2.1.0 version.
This commit is contained in:
113
php_classes/AastraIPPhoneFormattedTextScreen.class.php
Normal file
113
php_classes/AastraIPPhoneFormattedTextScreen.class.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPFormattedPhoneTextScreen
|
||||
# Copyright Aastra Telecom 2007
|
||||
#
|
||||
# AastraIPPhoneFormattedTextScreen object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
|
||||
# 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)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional)
|
||||
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
|
||||
# addSoftkey(index, label, uri) 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
|
||||
# addLine(text,size,align) to add a formatted line
|
||||
# setScrollStart(height) to define the beginning of the scrolling section and its height
|
||||
# setScrollEnd() to define the end of the scrolling section
|
||||
# setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
|
||||
#
|
||||
# Example
|
||||
# require_once('AastraIPPhoneFormattedTextScreen.class.php');
|
||||
# $ftext = new AastraIPPhoneFormattedTextScreen();
|
||||
# $ftext->setDestroyOnExit();
|
||||
# $ftext->addLine('Formatted Screen','double','center');
|
||||
# $ftext->setScrollStart('2');
|
||||
# $ftext->addLine('Scrolled text1');
|
||||
# $ftext->addLine('Scrolled text2');
|
||||
# $ftext->addLine('Scrolled text3');
|
||||
# $ftext->addLine('Scrolled text4');
|
||||
# $ftext->addLine('Scrolled text5');
|
||||
# $ftext->setScrollEnd();
|
||||
# $ftext->addLine('Footer',NULL,'center');
|
||||
# $ftext->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1','1');
|
||||
# $ftext->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
# $ftext->addIcon('1', 'Icon:Envelope');
|
||||
# $ftext->output();
|
||||
#
|
||||
########################################################################################################
|
||||
|
||||
require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneFormattedTextScreenEntry.class.php');
|
||||
|
||||
class AastraIPPhoneFormattedTextScreen extends AastraIPPhone {
|
||||
var $_doneAction="";
|
||||
|
||||
function addLine($text, $size=NULL, $align=NULL)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, 'normal');
|
||||
}
|
||||
|
||||
function setScrollStart($height)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, $height, NULL, 'scrollstart');
|
||||
}
|
||||
|
||||
function setScrollEnd()
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, NULL, NULL, 'scrollend');
|
||||
}
|
||||
|
||||
function setDoneAction($uri)
|
||||
{
|
||||
$this->_doneAction = $uri;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$out = '';
|
||||
$out .= "<AastraIPPhoneFormattedTextScreen";
|
||||
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
|
||||
if($this->_cancelAction != "")
|
||||
{
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
if($this->_doneAction != "")
|
||||
{
|
||||
$doneAction = $this->escape($this->_doneAction);
|
||||
$out .= " doneAction=\"{$doneAction}\"";
|
||||
}
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
|
||||
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
$out .= ">\n";
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
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 .= "</AastraIPPhoneFormattedTextScreen>\n";
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user