102 lines
3.8 KiB
PHP
102 lines
3.8 KiB
PHP
<?
|
|
|
|
########################################################################################################
|
|
# Aastra XML API Classes - AastraIPPhoneImageScreen
|
|
# Copyright Aastra Telecom 2007
|
|
#
|
|
# AastraIPPhoneImageScreen object.
|
|
#
|
|
# Public methods
|
|
#
|
|
# Inherited from AastraIPPhone
|
|
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
|
# setBeep() to enable a notification beep with the object (optional)
|
|
# setLockIn() to set the Lock-in tag to 'yes' (optional)
|
|
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
|
|
# addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
|
|
# addIcon(index,icon) to add custom icons to the object (optional)
|
|
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
|
# generate() to return the object content
|
|
# output() to display the object
|
|
#
|
|
# Specific to the object
|
|
# setImage(image)to define the image to be displayed
|
|
# setAlignment(vertical,horizontal) to define image alignment
|
|
# setSize(height,width) to define image size
|
|
#
|
|
# Example
|
|
# require_once('AastraIPPhoneImageScreen.class.php');
|
|
# $images = new AastraIPPhoneImageScreen();
|
|
# $images->setDestroyOnExit();
|
|
# $images->setSize(40,40);
|
|
# $images->setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020931400020ac5c91088b0f2b08c21c07d0c2006009fdfe81f80efe0107fe0fb1c3ffff8ffc3fffef8f7febffbfcf87ffbff64');
|
|
# $images->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1','1');
|
|
# $images->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
|
# $images->addIcon('1', 'Icon:Envelope');
|
|
# $images->output();
|
|
#
|
|
########################################################################################################
|
|
|
|
require_once('AastraIPPhone.class.php');
|
|
|
|
class AastraIPPhoneImageScreen extends AastraIPPhone {
|
|
var $_image;
|
|
var $_verticalAlign=NULL;
|
|
var $_horizontalAlign=NULL;
|
|
var $_height=NULL;
|
|
var $_width=NULL;
|
|
|
|
function setImage($image)
|
|
{
|
|
$this->_image = $image;
|
|
}
|
|
|
|
function setAlignment($vertical=NULL,$horizontal=NULL)
|
|
{
|
|
$this->_verticalAlign = $vertical;
|
|
$this->_horizontalAlign = $horizontal;
|
|
}
|
|
|
|
function setSize($height,$width)
|
|
{
|
|
$this->_height = $height;
|
|
$this->_width = $width;
|
|
}
|
|
|
|
function render()
|
|
{
|
|
$out = "<AastraIPPhoneImageScreen";
|
|
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
|
|
if($this->_cancelAction != "")
|
|
{
|
|
$cancelAction = $this->escape($this->_cancelAction);
|
|
$out .= " cancelAction=\"{$cancelAction}\"";
|
|
}
|
|
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
|
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
|
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
|
$out .= ">\n";
|
|
$out .= "<Image";
|
|
if($this->_verticalAlign!=NULL) $out .= " verticalAlign=\"{$this->_verticalAlign}\"";
|
|
if($this->_horizontalAlign!=NULL) $out .= " horizontalAlign=\"{$this->_horizontalAlign}\"";
|
|
if($this->_height!=NULL) $out .= " height=\"{$this->_height}\"";
|
|
if($this->_width!=NULL) $out .= " width=\"{$this->_width}\"";
|
|
$out .= ">{$this->_image}</Image>\n";
|
|
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
|
$IconList=0;
|
|
foreach ($this->_icons as $icon)
|
|
{
|
|
if($IconList==0)
|
|
{
|
|
$out .= "<IconList>\n";
|
|
$IconList=1;
|
|
}
|
|
$out .= $icon->render();
|
|
}
|
|
if($IconList!=0) $out .= "</IconList>\n";
|
|
$out .= "</AastraIPPhoneImageScreen>\n";
|
|
return $out;
|
|
}
|
|
}
|
|
?>
|