3.3.1 SP3 version.
This commit is contained in:
1433
php_classes/AastraCommon.php
Normal file
1433
php_classes/AastraCommon.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,28 +1,56 @@
|
||||
<?php
|
||||
|
||||
###################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhone
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# AastraIPPhone is the root class for all the Aastra XML objects.
|
||||
#
|
||||
# Public methods
|
||||
# setTitle(Title) to setup the title of an object (optional)
|
||||
# setTitle(Title,color) to setup the title of an object (optional)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setBackgroundColor(color) to change the XML object background color (optional 6739i only)
|
||||
# @color string, "red", "blue", ...
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (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)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setLockInCall() to set the Lock-in tag to 'call' (optional)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
|
||||
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
|
||||
# @timeout integer (seconds)
|
||||
# addSoftkey(index,label,uri,icon_index,color) to add custom soktkeys to the object (optional)
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon_index integer, icon number
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# generate() to return the object content
|
||||
# output() to display the object
|
||||
#
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
###################################################################################################
|
||||
|
||||
###################################################################################################
|
||||
# Includes
|
||||
###################################################################################################
|
||||
require_once('AastraIPPhone.php');
|
||||
require_once('AastraIPPhoneSoftkeyEntry.class.php');
|
||||
require_once('AastraIPPhoneIconEntry.class.php');
|
||||
|
||||
@ -32,17 +60,27 @@ class AastraIPPhone {
|
||||
var $_icons;
|
||||
var $_title='';
|
||||
var $_title_wrap='';
|
||||
var $_title_color='';
|
||||
var $_destroyOnExit='';
|
||||
var $_cancelAction='';
|
||||
var $_refreshTimeout=0;
|
||||
var $_refreshURL='';
|
||||
var $_beep='';
|
||||
var $_beep='';
|
||||
var $_lockin='';
|
||||
var $_timeout=0;
|
||||
var $_allowAnswer='';
|
||||
var $_allowDrop='';
|
||||
var $_allowXfer='';
|
||||
var $_allowConf='';
|
||||
var $_bcolor='';
|
||||
var $_toptitle='';
|
||||
var $_toptitle_icon='';
|
||||
var $_toptitle_color='';
|
||||
var $_encoding='ISO-8859-1';
|
||||
|
||||
function AastraIPPhone()
|
||||
{
|
||||
# Variables for the XML object
|
||||
$this->_entries = array();
|
||||
$this->_softkeys = array();
|
||||
$this->_icons = array();
|
||||
@ -52,18 +90,40 @@ class AastraIPPhone {
|
||||
$this->_refreshURL='';
|
||||
$this->_beep='';
|
||||
$this->_lockin='';
|
||||
$this->_lockin_uri='';
|
||||
$this->_timeout=0;
|
||||
$this->_allowAnswer='';
|
||||
$this->_allowDrop='';
|
||||
$this->_allowXfer='';
|
||||
$this->_allowConf='';
|
||||
}
|
||||
|
||||
function setTitle($title)
|
||||
function setEncodingUTF8()
|
||||
{
|
||||
$this->_encoding = 'UTF-8';
|
||||
}
|
||||
|
||||
function setBackgroundColor($color)
|
||||
{
|
||||
$this->_bcolor = $color;
|
||||
}
|
||||
|
||||
function setTitle($title,$color='')
|
||||
{
|
||||
$this->_title = $title;
|
||||
$this->_title_color = $color;
|
||||
}
|
||||
|
||||
function setTopTitle($title,$color='',$icon='')
|
||||
{
|
||||
$this->_toptitle = $title;
|
||||
$this->_toptitle_color = $color;
|
||||
$this->_toptitle_icon = $icon;
|
||||
}
|
||||
|
||||
function setTitleWrap()
|
||||
{
|
||||
$this->_title_wrap = "yes";
|
||||
$this->_title_wrap = 'yes';
|
||||
}
|
||||
|
||||
function setRefresh($timeout,$URL)
|
||||
@ -88,9 +148,15 @@ class AastraIPPhone {
|
||||
}
|
||||
|
||||
|
||||
function setLockIn()
|
||||
function setLockIn($uri='')
|
||||
{
|
||||
$this->_lockin='yes';
|
||||
$this->_lockin_uri=$uri;
|
||||
}
|
||||
|
||||
function setLockInCall()
|
||||
{
|
||||
$this->_lockin='call';
|
||||
}
|
||||
|
||||
function setTimeout($timeout)
|
||||
@ -103,39 +169,121 @@ class AastraIPPhone {
|
||||
$this->_allowAnswer='yes';
|
||||
}
|
||||
|
||||
function output()
|
||||
function setAllowDrop()
|
||||
{
|
||||
header("Content-type: text/xml");
|
||||
$this->_allowDrop='yes';
|
||||
}
|
||||
|
||||
function setAllowXfer()
|
||||
{
|
||||
$this->_allowXfer='yes';
|
||||
}
|
||||
|
||||
function setAllowConf()
|
||||
{
|
||||
$this->_allowConf='yes';
|
||||
}
|
||||
|
||||
function output($flush=False)
|
||||
{
|
||||
header("Content-Type: text/xml; charset=".$this->_encoding);
|
||||
if (($this->_refreshTimeout!=0) and ($this->_refreshURL!='')) header("Refresh: ".$this->_refreshTimeout."; url=".$this->_refreshURL);
|
||||
$output=$this->render();
|
||||
header("Content-Length: ".strlen($output));
|
||||
$output="<?xml version=\"1.0\" encoding=\"".$this->_encoding."\"?>\n";
|
||||
$output.=$this->render();
|
||||
header('Content-Length: '.strlen($output));
|
||||
echo($output);
|
||||
if($flush)
|
||||
{
|
||||
ob_flush();
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
function generate()
|
||||
{
|
||||
$output=$this->render();
|
||||
return($output);
|
||||
return($this->render());
|
||||
}
|
||||
|
||||
|
||||
function addSoftkey($index, $label, $uri, $icon=NULL)
|
||||
function addSoftkey($index, $label, $uri, $icon=NULL, $color='')
|
||||
{
|
||||
$this->_softkeys[] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon);
|
||||
if(!Aastra_is_icons_supported()) $icon=NULL;
|
||||
if(($index>=1) and ($index<=Aastra_number_softkeys_supported())) $this->_softkeys[$index] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon, $color);
|
||||
$this->_softkeys[$index] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon, $color);
|
||||
}
|
||||
|
||||
function addIcon($index, $icon)
|
||||
{
|
||||
$this->_icons[] = new AastraIPPhoneIconEntry($index, $icon);
|
||||
if(Aastra_is_icons_supported()) $this->_icons[$index] = new AastraIPPhoneIconEntry($index, $icon);
|
||||
}
|
||||
|
||||
function escape($string)
|
||||
{
|
||||
return(str_replace(
|
||||
array('<', '>', '&'),
|
||||
array('<', '>', '&'),
|
||||
$string
|
||||
));
|
||||
return(str_replace(
|
||||
array('&', '<', '>', '"', "'"),
|
||||
array('&', '<', '>', '"', '''),
|
||||
$string
|
||||
));
|
||||
}
|
||||
|
||||
function convert_high_ascii($s)
|
||||
{
|
||||
$HighASCII = array(
|
||||
"!\xc0!" => 'A', # A`
|
||||
"!\xe0!" => 'a', # a`
|
||||
"!\xc1!" => 'A', # A'
|
||||
"!\xe1!" => 'a', # a'
|
||||
"!\xc2!" => 'A', # A^
|
||||
"!\xe2!" => 'a', # a^
|
||||
"!\xc4!" => 'Ae', # A:
|
||||
"!\xe4!" => 'ae', # a:
|
||||
"!\xc3!" => 'A', # A~
|
||||
"!\xe3!" => 'a', # a~
|
||||
"!\xc8!" => 'E', # E`
|
||||
"!\xe8!" => 'e', # e`
|
||||
"!\xc9!" => 'E', # E'
|
||||
"!\xe9!" => 'e', # e'
|
||||
"!\xca!" => 'E', # E^
|
||||
"!\xea!" => 'e', # e^
|
||||
"!\xcb!" => 'Ee', # E:
|
||||
"!\xeb!" => 'ee', # e:
|
||||
"!\xcc!" => 'I', # I`
|
||||
"!\xec!" => 'i', # i`
|
||||
"!\xcd!" => 'I', # I'
|
||||
"!\xed!" => 'i', # i'
|
||||
"!\xce!" => 'I', # I^
|
||||
"!\xee!" => 'i', # i^
|
||||
"!\xcf!" => 'Ie', # I:
|
||||
"!\xef!" => 'ie', # i:
|
||||
"!\xd2!" => 'O', # O`
|
||||
"!\xf2!" => 'o', # o`
|
||||
"!\xd3!" => 'O', # O'
|
||||
"!\xf3!" => 'o', # o'
|
||||
"!\xd4!" => 'O', # O^
|
||||
"!\xf4!" => 'o', # o^
|
||||
"!\xd6!" => 'Oe', # O:
|
||||
"!\xf6!" => 'oe', # o:
|
||||
"!\xd5!" => 'O', # O~
|
||||
"!\xf5!" => 'o', # o~
|
||||
"!\xd8!" => 'Oe', # O/
|
||||
"!\xf8!" => 'oe', # o/
|
||||
"!\xd9!" => 'U', # U`
|
||||
"!\xf9!" => 'u', # u`
|
||||
"!\xda!" => 'U', # U'
|
||||
"!\xfa!" => 'u', # u'
|
||||
"!\xdb!" => 'U', # U^
|
||||
"!\xfb!" => 'u', # u^
|
||||
"!\xdc!" => 'Ue', # U:
|
||||
"!\xfc!" => 'ue', # u:
|
||||
"!\xc7!" => 'C', # ,C
|
||||
"!\xe7!" => 'c', # ,c
|
||||
"!\xd1!" => 'N', # N~
|
||||
"!\xf1!" => 'n', # n~
|
||||
"!\xdf!" => 'ss'
|
||||
);
|
||||
$find = array_keys($HighASCII);
|
||||
$replace = array_values($HighASCII);
|
||||
$s = preg_replace($find,$replace,$s);
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
1827
php_classes/AastraIPPhone.php
Normal file
1827
php_classes/AastraIPPhone.php
Normal file
File diff suppressed because it is too large
Load Diff
213
php_classes/AastraIPPhoneCallLog.class.php
Normal file
213
php_classes/AastraIPPhoneCallLog.class.php
Normal file
@ -0,0 +1,213 @@
|
||||
<?php
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneCallLog
|
||||
# Copyright Aastra Telecom 2005-2012
|
||||
#
|
||||
# AastraIPPhoneCallLog object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
|
||||
# setBeep() to enable a notification beep with the object (optional)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
|
||||
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
|
||||
# @timeout integer (seconds)
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# addEntry(name,number,date,time,selection,duration,type,terminal,count,line)
|
||||
# @name string (optional)
|
||||
# @number string
|
||||
# @date string MM-DD-YYYY
|
||||
# @time string HH:MM (military time)
|
||||
# @selection string (optional)
|
||||
# @duration integer call duration in seconds (optional)
|
||||
# @type string call type (incoming/outgoung/missed) (optional)
|
||||
# @terminal string terminal type (office/mobile/home) (optional)
|
||||
# @count integer number of calls (optional)
|
||||
# @line integer line used (1-9) (optional)
|
||||
# setScrollConstrain() to avoid the list to wrap
|
||||
# setScrollUp(uri) to set the URI to be called when the user presses the Up arrow (optional)
|
||||
# @uri string
|
||||
# setScrollDown(uri) to set the URI to be called when the user presses the Down arrow (optional)
|
||||
# @uri string
|
||||
# setDeleteUri(uri) to configure the uri called by the "Delete" button (optional)
|
||||
# @uri string
|
||||
# setDeleteAllUri(uri) to configure the uri called by the "Delete ALL" button (optional)
|
||||
# @uri string
|
||||
# setDialUri(uri) to configure the uri called by the "Dial" button (optional)
|
||||
# @uri string
|
||||
# setAddUri(uri) to configure the uri called by the "Add to directory" button(optional)
|
||||
# @uri string
|
||||
#
|
||||
# Example
|
||||
#
|
||||
########################################################################################################
|
||||
require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneCallLogEntry.class.php');
|
||||
|
||||
class AastraIPPhoneCallLog extends AastraIPPhone {
|
||||
var $_maxitems='50';
|
||||
var $_scrollConstrain='';
|
||||
var $_scrollUp='';
|
||||
var $_scrollDown='';
|
||||
var $_delete='';
|
||||
var $_deleteAll='';
|
||||
var $_dial='';
|
||||
var $_add='';
|
||||
|
||||
function addEntry($name, $number, $date, $time, $selection, $duration, $type, $terminal, $count='', $line='')
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneCallLogEntry($name, $number, $date, $time, $selection, $duration, $type, $terminal, $count, $line);
|
||||
}
|
||||
|
||||
|
||||
function setScrollConstrain()
|
||||
{
|
||||
$this->_scrollConstrain = 'yes';
|
||||
}
|
||||
|
||||
function setScrollUp($uri)
|
||||
{
|
||||
$this->_scrollUp = $uri;
|
||||
}
|
||||
|
||||
function setScrollDown($uri)
|
||||
{
|
||||
$this->_scrollDown = $uri;
|
||||
}
|
||||
|
||||
function setDeleteUri($uri)
|
||||
{
|
||||
$this->_delete = $uri;
|
||||
}
|
||||
|
||||
function setDeleteAllUri($uri)
|
||||
{
|
||||
$this->_deleteAll = $uri;
|
||||
}
|
||||
|
||||
function setDialUri($uri)
|
||||
{
|
||||
$this->_dial = $uri;
|
||||
}
|
||||
|
||||
function setAddUri($uri)
|
||||
{
|
||||
$this->_add = $uri;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneCallLog";
|
||||
|
||||
# DestroyOnExit
|
||||
if ($this->_destroyOnExit=='yes') $out .= " destroyOnExit=\"yes\"";
|
||||
|
||||
# CancelAction
|
||||
if($this->_cancelAction != "") {
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
|
||||
# Beep
|
||||
if ($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
|
||||
# Lockin
|
||||
if($this->_lockin!='') {
|
||||
$out .= " LockIn=\"{$this->_lockin}\"";
|
||||
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
|
||||
}
|
||||
|
||||
# AllowAnswer
|
||||
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# AllowDrop
|
||||
if ($this->_allowDrop == 'yes') $out .= " allowDrop=\"yes\"";
|
||||
|
||||
# AllowXfer
|
||||
if ($this->_allowXfer == 'yes') $out .= " allowXfer=\"yes\"";
|
||||
|
||||
# AllowConf
|
||||
if ($this->_allowConf == 'yes') $out .= " allowConf=\"yes\"";
|
||||
|
||||
# Timeout
|
||||
if ($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
|
||||
# Prevent list wrap
|
||||
if ($this->_scrollConstrain == 'yes') $out .= " scrollConstrain=\"yes\"";
|
||||
|
||||
# Scrolls up/down
|
||||
if($this->_scrollUp!='') $out .= " scrollUp=\"".$this->escape($this->_scrollUp)."\"";
|
||||
if($this->_scrollDown!='') $out .= " scrollDown=\"".$this->escape($this->_scrollDown)."\"";
|
||||
|
||||
# Misc uris
|
||||
if($this->_delete!='') $out .= " deleteUri=\"".$this->escape($this->_delete)."\"";
|
||||
if($this->_deleteAll!='') $out .= " deleteAllUri=\"".$this->escape($this->_deleteAll)."\"";
|
||||
if($this->_dial!='') $out .= " dialUri=\"".$this->escape($this->_dial)."\"";
|
||||
if($this->_add!='') $out .= " addUri=\"".$this->escape($this->_add)."\"";
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
|
||||
# Top Title
|
||||
if ($this->_toptitle!='') {
|
||||
$toptitle = $this->escape($this->_toptitle);
|
||||
$out .= "<TopTitle";
|
||||
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
|
||||
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
|
||||
$out .= ">".$toptitle."</TopTitle>\n";
|
||||
}
|
||||
|
||||
# Menu items
|
||||
if (isset($this->_entries) && is_array($this->_entries)) {
|
||||
$index=0;
|
||||
foreach ($this->_entries as $entry) {
|
||||
if($index<$this->_maxitems) $out .= $entry->render($this->_style,$length,$is_softkeys);
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons)) {
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon) {
|
||||
if(!$IconList) {
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End Tag
|
||||
$out .= "</AastraIPPhoneCallLog>\n";
|
||||
|
||||
# Return XML object
|
||||
return($out);
|
||||
}
|
||||
}
|
||||
?>
|
83
php_classes/AastraIPPhoneCallLogEntry.class.php
Normal file
83
php_classes/AastraIPPhoneCallLogEntry.class.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneCallLogEntry
|
||||
# Copyright Aastra Telecom 2005-2012
|
||||
#
|
||||
# Internal class for AastraIPPhoneCallLog object.
|
||||
################################################################################
|
||||
|
||||
class AastraIPPhoneCallLogEntry extends AastraIPPhone {
|
||||
var $_name;
|
||||
var $_number;
|
||||
var $_date;
|
||||
var $_time;
|
||||
var $_selection;
|
||||
var $_duration;
|
||||
var $_type;
|
||||
var $_terminal;
|
||||
var $_count;
|
||||
var $_line;
|
||||
|
||||
function AastraIPPhoneCallLogEntry($name, $number, $date, $time, $selection, $duration, $type, $terminal, $count, $line)
|
||||
{
|
||||
$this->_name=$name;
|
||||
$this->_number=$number;
|
||||
$this->_date=$date;
|
||||
$this->_time=$time;
|
||||
$this->_selection=$selection;
|
||||
$this->_duration=$duration;
|
||||
$this->_type=$type;
|
||||
$this->_terminal=$terminal;
|
||||
$this->_count=$count;
|
||||
$this->_line=$line;
|
||||
}
|
||||
|
||||
|
||||
function render()
|
||||
{
|
||||
# Opening
|
||||
$xml = '<LogItem';
|
||||
if($this->_duration!='') {
|
||||
$temp = $this->escape($this->_duration);
|
||||
$xml .= " duration=\"".$temp."\"";
|
||||
}
|
||||
if($this->_type!='') {
|
||||
$temp = $this->escape($this->_type);
|
||||
$xml .= " type=\"".$temp."\"";
|
||||
}
|
||||
if($this->_terminal!='') {
|
||||
$temp = $this->escape($this->_terminal);
|
||||
$xml .= " callingTerminal=\"".$temp."\"";
|
||||
}
|
||||
if($this->_count!='') {
|
||||
$temp = $this->escape($this->_count);
|
||||
$xml .= " count=\"".$temp."\"";
|
||||
}
|
||||
if($this->_line!='') {
|
||||
$temp = $this->escape($this->_line);
|
||||
$xml .= " line=\"".$temp."\"";
|
||||
}
|
||||
$xml .= ">\n";
|
||||
|
||||
# Fiedls
|
||||
$temp = $this->escape($this->_name);
|
||||
$xml .= "<Name>{$temp}</Name>\n";
|
||||
$temp = $this->escape($this->_number);
|
||||
$xml .= "<Number>{$temp}</Number>\n";
|
||||
$temp = $this->escape($this->_date);
|
||||
$xml .= "<Date>{$temp}</Date>\n";
|
||||
$temp = $this->escape($this->_time);
|
||||
$xml .= "<Time>{$temp}</Time>\n";
|
||||
if($this->_selection!='') {
|
||||
$temp = $this->escape($this->_selection);
|
||||
$xml .= "<Selection>{$temp}</Selection>\n";
|
||||
}
|
||||
|
||||
# Close
|
||||
$xml .= "</LogItem>\n";
|
||||
|
||||
# Return generated vaue
|
||||
return($xml);
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,20 +1,26 @@
|
||||
<?php
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneConfiguration
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2007-2010
|
||||
#
|
||||
# AastraIPPhoneConfiguration object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# output() to display the object
|
||||
# generate() to return the object content
|
||||
# setBeep() to enable a notification beep with the object (optional)
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# addEntry(parameter,value) to add a configuration change.
|
||||
# setType(type) to set the type of configuration object (optional)
|
||||
# @type string, configuration change type
|
||||
# addEntry(parameter,value,type) to add a configuration change
|
||||
# @parameter string, parameter name
|
||||
# @value string, parameter value
|
||||
# @type string, conmfiguration change type (optional)
|
||||
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to
|
||||
# "yes" (optional)
|
||||
#
|
||||
@ -33,10 +39,12 @@ require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneConfigurationEntry.class.php');
|
||||
|
||||
class AastraIPPhoneConfiguration extends AastraIPPhone {
|
||||
var $_type='';
|
||||
var $_triggerDestroyOnExit='';
|
||||
|
||||
function addEntry($parameter, $value)
|
||||
function addEntry($parameter, $value, $type='')
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneConfigurationEntry($parameter, $value);
|
||||
$this->_entries[] = new AastraIPPhoneConfigurationEntry($parameter, $value, $type);
|
||||
}
|
||||
|
||||
function setTriggerDestroyOnExit()
|
||||
@ -44,15 +52,39 @@ class AastraIPPhoneConfiguration extends AastraIPPhone {
|
||||
$this->_triggerDestroyOnExit="yes";
|
||||
}
|
||||
|
||||
function setType($type)
|
||||
{
|
||||
$this->_type=$type;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneConfiguration";
|
||||
|
||||
# Beep
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
|
||||
# TriggerDestroyOnExit
|
||||
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
|
||||
|
||||
# Type
|
||||
if($this->_type!='') $out .= " setType=\"{$this->_type}\"";
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
|
||||
# Configuration Items
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
}
|
||||
|
||||
# End tag
|
||||
$out .= "</AastraIPPhoneConfiguration>\n";
|
||||
|
||||
# Return XML object
|
||||
return($out);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneConfigurationEntry
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2007-2010
|
||||
#
|
||||
# Internal class for AastraIPPhoneConfiguration object.
|
||||
################################################################################
|
||||
@ -11,11 +10,13 @@
|
||||
class AastraIPPhoneConfigurationEntry extends AastraIPPhone {
|
||||
var $_parameter;
|
||||
var $_value;
|
||||
var $_type;
|
||||
|
||||
function AastraIPPhoneConfigurationEntry($parameter, $value)
|
||||
function AastraIPPhoneConfigurationEntry($parameter, $value, $type)
|
||||
{
|
||||
$this->setParameter($parameter);
|
||||
$this->setValue($value);
|
||||
$this->setType($type);
|
||||
}
|
||||
|
||||
function setParameter($parameter)
|
||||
@ -28,15 +29,24 @@ class AastraIPPhoneConfigurationEntry extends AastraIPPhone {
|
||||
$this->_value = $value;
|
||||
}
|
||||
|
||||
function setType($type)
|
||||
{
|
||||
$this->_type = $type;
|
||||
}
|
||||
|
||||
|
||||
function render()
|
||||
{
|
||||
$parameter = $this->escape($this->_parameter);
|
||||
$value = $this->escape($this->_value);
|
||||
$xml = "<ConfigurationItem>\n";
|
||||
$type = $this->escape($this->_type);
|
||||
$xml = "<ConfigurationItem";
|
||||
if($type!='') $xml.=" setType=\"".$type."\"";
|
||||
$xml .=">\n";
|
||||
$xml .= "<Parameter>".$parameter."</Parameter>\n";
|
||||
$xml .= "<Value>".$value."</Value>\n";
|
||||
$xml .= "</ConfigurationItem>\n";
|
||||
return($xml);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@ -1,124 +0,0 @@
|
||||
<?
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneDirectory
|
||||
# Copyright Aastra Telecom 2007
|
||||
#
|
||||
# AastraIPPhoneDirectory object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setTitle(Title) to setup the title of an object (optional)
|
||||
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
|
||||
# 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)
|
||||
# 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
|
||||
# setNext(next) to set URI of the next page (optional)
|
||||
# setPrevious(previous) to set URI of the previous page (optional)
|
||||
# addEntry(name,phone) to add an element in the list to be displayed, at least one is needed.
|
||||
# natsortbyname() to order the list
|
||||
#
|
||||
# Example
|
||||
# require_once('AastraIPPhoneDirectory.class.php');
|
||||
# $directory = new AastraIPPhoneDirectory();
|
||||
# $directory->setTitle('Title');
|
||||
# $directory->setNext('http://myserver.com/script.php?page=2');
|
||||
# $directory->setPrevious('http://myserver.com/script.php?page=0');
|
||||
# $directory->setDestroyOnExit();
|
||||
# $directory->addEntry('John Doe', '200');
|
||||
# $directory->addEntry('Jane Doe', '201');
|
||||
# $directory->natsortByName();
|
||||
# $directory->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
|
||||
# $directory->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
# $directory->output();
|
||||
#
|
||||
########################################################################################################
|
||||
|
||||
require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneDirectoryEntry.class.php');
|
||||
|
||||
class AastraIPPhoneDirectory extends AastraIPPhone {
|
||||
var $_next="";
|
||||
var $_previous="";
|
||||
|
||||
function setNext($next)
|
||||
{
|
||||
$this->_next = $next;
|
||||
}
|
||||
|
||||
function setPrevious($previous)
|
||||
{
|
||||
$this->_previous = $previous;
|
||||
}
|
||||
|
||||
function addEntry($name, $telephone)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneDirectoryEntry($name, $telephone);
|
||||
}
|
||||
|
||||
function natsortByName()
|
||||
{
|
||||
$tmpary = array();
|
||||
foreach ($this->_entries as $id => $entry) {
|
||||
$tmpary[$id] = $entry->getName();
|
||||
}
|
||||
natsort($tmpary);
|
||||
foreach ($tmpary as $id => $name) {
|
||||
$newele[] = $this->_entries[$id];
|
||||
}
|
||||
$this->_entries = $newele;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$out = '';
|
||||
$out .= "<AastraIPPhoneDirectory";
|
||||
if($this->_previous!="")
|
||||
{
|
||||
$previous = $this->escape($this->_previous);
|
||||
|
||||
$out .= " previous=\"$previous\"";
|
||||
}
|
||||
if($this->_next!="")
|
||||
{
|
||||
$next = $this->escape($this->_next);
|
||||
$out .= " next=\"$next\"";
|
||||
}
|
||||
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->_lockin=='yes') $out .= " LockIn=\"yes\"";
|
||||
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
$out .= ">\n";
|
||||
if ($this->_title!='')
|
||||
{
|
||||
$title = $this->escape($this->_title);
|
||||
$out .= "<Title";
|
||||
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
|
||||
$out .= ">".$title."</Title>\n";
|
||||
}
|
||||
$index=0;
|
||||
foreach ($this->_entries as $entry) {
|
||||
if($index<15) $out .= $entry->render();
|
||||
$index++;
|
||||
}
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
$out .= "</AastraIPPhoneDirectory>\n";
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneDirectoryEntry
|
||||
# Copyright Aastra Telecom 2007
|
||||
#
|
||||
# Internal class for AastraIPPhoneDirectory object.
|
||||
########################################################################################################
|
||||
|
||||
class AastraIPPhoneDirectoryEntry extends AastraIPPhone {
|
||||
var $_name;
|
||||
var $_telephone;
|
||||
|
||||
function AastraIPPhoneDirectoryEntry($name, $telephone)
|
||||
{
|
||||
$this->_name=$name;
|
||||
$this->_telephone=$telephone;
|
||||
}
|
||||
|
||||
function getName()
|
||||
{
|
||||
return($this->_name);
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$name = $this->escape($this->_name);
|
||||
$telephone = $this->escape($this->_telephone);
|
||||
return("<MenuItem>\n<Prompt>{$name}</Prompt>\n<URI>{$telephone}</URI>\n</MenuItem>\n");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,21 +1,24 @@
|
||||
<?php
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneExecute
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2006-2010
|
||||
#
|
||||
# AastraIPPhoneExecute object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# output() to display the object
|
||||
# generate() to return the object content
|
||||
# setBeep() to enable a notification beep with the object (optional)
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to "yes" (optional)
|
||||
# addEntry(url,interruptCall) to add an action to be executed.
|
||||
# @url string
|
||||
# @interruptCall string, optional, "yes" or "no"
|
||||
#
|
||||
# Example
|
||||
# require_once('AastraIPPhoneExecute.class.php');
|
||||
@ -30,8 +33,8 @@ require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneExecuteEntry.class.php');
|
||||
|
||||
class AastraIPPhoneExecute extends AastraIPPhone {
|
||||
var $_defaultIndex="";
|
||||
var $_triggerDestroyOnExit="";
|
||||
var $_defaultIndex='';
|
||||
var $_triggerDestroyOnExit='';
|
||||
|
||||
function addEntry($url,$interruptCall=NULL)
|
||||
{
|
||||
@ -40,19 +43,34 @@ class AastraIPPhoneExecute extends AastraIPPhone {
|
||||
|
||||
function setTriggerDestroyOnExit()
|
||||
{
|
||||
$this->_triggerDestroyOnExit="yes";
|
||||
$this->_triggerDestroyOnExit='yes';
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$title = $this->escape($this->_title);
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneExecute";
|
||||
|
||||
# Beep
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
|
||||
# TriggerDestroyOnExit
|
||||
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
|
||||
# Execute Items
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
}
|
||||
|
||||
# End tag
|
||||
$out .= "</AastraIPPhoneExecute>\n";
|
||||
|
||||
# Return XML object
|
||||
return($out);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneExecuteEntry
|
||||
# Firmware 1.4.1 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# Internal class for AastraIPPhoneExecute object.
|
||||
################################################################################
|
||||
@ -22,7 +21,7 @@ class AastraIPPhoneExecuteEntry extends AastraIPPhone {
|
||||
{
|
||||
$url = $this->escape($this->_url);
|
||||
$xml = "<ExecuteItem URI=\"".$url."\"";
|
||||
if ($this->_interruptCall=='no') $xml .= " interuptCall=\"no\"";
|
||||
if ($this->_interruptCall=='no') $xml .= " interruptCall=\"no\"";
|
||||
$xml .= "/>\n";
|
||||
return($xml);
|
||||
}
|
||||
|
@ -1,31 +1,71 @@
|
||||
<?
|
||||
|
||||
<?php
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPFormattedPhoneTextScreen
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2008-2010
|
||||
#
|
||||
# AastraIPPhoneFormattedTextScreen object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (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)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setLockInCall() to set the Lock-in tag to 'call' (optional)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
|
||||
# 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)
|
||||
# @timeout integer (seconds)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon_index integer, icon number
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# generate() to return the object content
|
||||
# output() to display the object
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# addLine(text,size,align) to add a formatted line
|
||||
# addLine(text,size,align,color) to add a formatted line
|
||||
# @text string
|
||||
# @size string, optional, "small", "double" or "large"
|
||||
# @align string, optional, "left", "right" or "center"
|
||||
# @color string, optional, "red", "black", ...
|
||||
# addText(text,size,align,$color) to add a formatted text as formatted lines
|
||||
# @text string, can include carriage returns
|
||||
# @size string, optional, "double"
|
||||
# @align string, optional, "left", "right" or "center"
|
||||
# @color string, optional, "red", "black", ...
|
||||
# setScrollStart(height) to define the beginning of the scrolling section and its height
|
||||
# @height integer
|
||||
# setScrollEnd() to define the end of the scrolling section
|
||||
# setAllowDTMF() to allow DTMF passthrough on the object
|
||||
# setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
|
||||
# @uri string
|
||||
# setScrollUp(uri) to set the URI to be called when the user presses the Up arrow (optional)
|
||||
# @uri string
|
||||
# setScrollDown(uri) to set the URI to be called when the user presses the Down arrow (optional)
|
||||
# @uri string
|
||||
# setScrollLeft(uri) to set the URI to be called when the user presses the Left arrow (optional)
|
||||
# @uri string
|
||||
# setScrollRight(uri) to set the URI to be called when the user presses the Right arrow (optional)
|
||||
# @uri string
|
||||
#
|
||||
# Example
|
||||
# require_once('AastraIPPhoneFormattedTextScreen.class.php');
|
||||
@ -51,21 +91,32 @@ require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneFormattedTextScreenEntry.class.php');
|
||||
|
||||
class AastraIPPhoneFormattedTextScreen extends AastraIPPhone {
|
||||
var $_doneAction="";
|
||||
var $_doneAction='';
|
||||
var $_allowDTMF='';
|
||||
var $_scrollUp='';
|
||||
var $_scrollDown='';
|
||||
var $_scrollLeft='';
|
||||
var $_scrollRight='';
|
||||
|
||||
function addLine($text, $size=NULL, $align=NULL)
|
||||
function addLine($text, $size=NULL, $align=NULL, $color=NULL)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, 'normal');
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $color, 'normal');
|
||||
}
|
||||
|
||||
function addText($text, $size=NULL, $align=NULL, $color=NULL)
|
||||
{
|
||||
$pieces=explode("\n",wordwrap($text,$this->_display_size,"\n",True));
|
||||
foreach($pieces as $value) $this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($value, $size, $align, $color, 'normal');
|
||||
}
|
||||
|
||||
function setScrollStart($height)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, $height, NULL, 'scrollstart');
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, $height, NULL, NULL, 'scrollstart');
|
||||
}
|
||||
|
||||
function setScrollEnd()
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, NULL, NULL, 'scrollend');
|
||||
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, NULL, NULL, NULL, 'scrollend');
|
||||
}
|
||||
|
||||
function setDoneAction($uri)
|
||||
@ -73,41 +124,134 @@ class AastraIPPhoneFormattedTextScreen extends AastraIPPhone {
|
||||
$this->_doneAction = $uri;
|
||||
}
|
||||
|
||||
function setAllowDTMF()
|
||||
{
|
||||
$this->_allowDTMF = 'yes';
|
||||
}
|
||||
|
||||
function setScrollUp($uri)
|
||||
{
|
||||
$this->_scrollUp = $uri;
|
||||
}
|
||||
|
||||
function setScrollDown($uri)
|
||||
{
|
||||
$this->_scrollDown = $uri;
|
||||
}
|
||||
|
||||
function setScrollLeft($uri)
|
||||
{
|
||||
$this->_scrollLeft = $uri;
|
||||
}
|
||||
|
||||
function setScrollRight($uri)
|
||||
{
|
||||
$this->_scrollRight = $uri;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$out = '';
|
||||
$out .= "<AastraIPPhoneFormattedTextScreen";
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneFormattedTextScreen";
|
||||
|
||||
# DestroyOnExit
|
||||
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
|
||||
if($this->_cancelAction != "")
|
||||
|
||||
# CancelAction
|
||||
if($this->_cancelAction != '')
|
||||
{
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
if($this->_doneAction != "")
|
||||
|
||||
# DoneAction
|
||||
if($this->_doneAction != '')
|
||||
{
|
||||
$doneAction = $this->escape($this->_doneAction);
|
||||
$out .= " doneAction=\"{$doneAction}\"";
|
||||
}
|
||||
|
||||
# Beep
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
|
||||
|
||||
# Lockin
|
||||
if($this->_lockin!='') {
|
||||
$out .= " LockIn=\"{$this->_lockin}\"";
|
||||
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
|
||||
}
|
||||
|
||||
# AllowAnswer
|
||||
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# AllowDrop
|
||||
if($this->_allowDrop == 'yes') $out .= " allowDrop=\"yes\"";
|
||||
|
||||
# AllowXfer
|
||||
if($this->_allowXfer == 'yes') $out .= " allowXfer=\"yes\"";
|
||||
|
||||
# AllowConf
|
||||
if($this->_allowConf == 'yes') $out .= " allowConf=\"yes\"";
|
||||
|
||||
# TimeOut
|
||||
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
|
||||
# AllowDTMF
|
||||
if($this->_allowDTMF=='yes') $out .= " allowDTMF=\"yes\"";
|
||||
|
||||
# Scrolls up/down/left/right
|
||||
if($this->_scrollUp!='') $out .= " scrollUp=\"".$this->escape($this->_scrollUp)."\"";
|
||||
if($this->_scrollDown!='') $out .= " scrollDown=\"".$this->escape($this->_scrollDown)."\"";
|
||||
if($this->_scrollLeft!='') $out .= " scrollLeft=\"".$this->escape($this->_scrollLeft)."\"";
|
||||
if($this->_scrollRight!='') $out .= " scrollRight=\"".$this->escape($this->_scrollRight)."\"";
|
||||
|
||||
# End of Root tag
|
||||
$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)
|
||||
|
||||
# Top Title
|
||||
if ($this->_toptitle!='')
|
||||
{
|
||||
if($IconList==0)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=1;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
$toptitle = $this->escape($this->_toptitle);
|
||||
$out .= "<TopTitle";
|
||||
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
|
||||
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
|
||||
$out .= ">".$toptitle."</TopTitle>\n";
|
||||
}
|
||||
if($IconList!=0) $out .= "</IconList>\n";
|
||||
|
||||
# Lines
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
}
|
||||
|
||||
# Softkeys
|
||||
if (isset($this->_softkeys) && is_array($this->_softkeys))
|
||||
{
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons))
|
||||
{
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon)
|
||||
{
|
||||
if(!$IconList)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End tag
|
||||
$out .= "</AastraIPPhoneFormattedTextScreen>\n";
|
||||
|
||||
# Return XML object
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneFormattedTextScreenEntry
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2008-2010
|
||||
#
|
||||
# Internal class for AastraIPPhoneFormattedTextScreen object.
|
||||
################################################################################
|
||||
@ -12,13 +11,16 @@ class AastraIPPhoneFormattedTextScreenEntry extends AastraIPPhone {
|
||||
var $_text;
|
||||
var $_size;
|
||||
var $_align;
|
||||
var $_color;
|
||||
var $_type;
|
||||
|
||||
function AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $type)
|
||||
function AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $color, $type)
|
||||
{
|
||||
$this->_text=$text;
|
||||
if($size=='double')$this->_text=$this->convert_high_ascii($text);
|
||||
else $this->_text=$text;
|
||||
$this->_size=$size;
|
||||
$this->_align=$align;
|
||||
$this->_color=$color;
|
||||
$this->_type=$type;
|
||||
}
|
||||
|
||||
@ -30,11 +32,13 @@ class AastraIPPhoneFormattedTextScreenEntry extends AastraIPPhone {
|
||||
$xml = "<Line";
|
||||
if($this->_size!=NULL) $xml .= " Size=\"{$this->_size}\"";
|
||||
if($this->_align!=NULL) $xml .= " Align=\"{$this->_align}\"";
|
||||
if($this->_color!=NULL) $xml .= " Color=\"{$this->_color}\"";
|
||||
$xml .= ">";
|
||||
$xml .= $this->escape($this->_text)."</Line>\n";
|
||||
break;
|
||||
case "scrollstart":
|
||||
$xml = "<Scroll Height=\"{$this->_size}\">\n";
|
||||
if($this->_size!='') $xml = "<Scroll Height=\"{$this->_size}\">\n";
|
||||
else $xml = "<Scroll>\n";
|
||||
break;
|
||||
case "scrollend":
|
||||
$xml = "</Scroll>\n";
|
||||
|
184
php_classes/AastraIPPhoneGDImage.class.php
Normal file
184
php_classes/AastraIPPhoneGDImage.class.php
Normal file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
#########################################################################################################
|
||||
# Aastra XML API Classes - Aastra XML API Classes - AastraIPPhoneGDImage
|
||||
# Copyright Aastra Telecom 2007-2010
|
||||
#
|
||||
# Firmware 2.0 or better
|
||||
#
|
||||
# AastraIPPhoneGDImage for AastraIPPhoneImageScreen and AastraIPPhoneImageScreen.
|
||||
#
|
||||
# php engine needs GD extensions
|
||||
# ------------------------------
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# drawttftext(fontsize,angle,x,y,text,colorIndex,fontfile)
|
||||
# Writes text to the image using TrueType fonts
|
||||
# fontsize The font size. Depending on your version of GD, this should be specified as the pixel
|
||||
# size (GD1) or point size (GD2)
|
||||
# angle The angle in degrees, with 0 degrees being left-to-right reading text. Higher values
|
||||
# represent a counter-clockwise rotation. For example, a value of 90 would result in
|
||||
# bottom-to-top reading text.
|
||||
# x,y The coordinates given by x and y will define the basepoint of the first character
|
||||
# (roughly the lower-left corner of the character).
|
||||
# colorIndex 0=White 1=Black
|
||||
# fontfile Location and name of the ttf file to use
|
||||
# see php imagettftext() for more details
|
||||
#
|
||||
# drawtext(fontsize,x,y,text,colorIndex)
|
||||
# Writes text to the image using built-in font
|
||||
# fontsize The font size. From 1 to 5
|
||||
# x,y The coordinates given by x and y will define the basepoint of the first character
|
||||
# (roughly the lower-left corner of the character).
|
||||
# colorIndex 0=White 1=Black
|
||||
# see php imagestring() for more details
|
||||
#
|
||||
# rectangle(x1,y1,x2,y2,colorIndex,filled)
|
||||
# Creates a rectangle starting at the specified coordinates.
|
||||
# x1,y1 Upper left x,y coordinate. 0,0 is the top left corner of the image.
|
||||
# x2,y2 Bottom right x,y coordinate
|
||||
# colorIndex 0=White 1=Black
|
||||
# filled Boolean, optional (default if False)
|
||||
# see php imagerectangle() and imagefilledrectangle() for more details
|
||||
#
|
||||
# ellipse(cx,cy,width,height,colorIndex,filled)
|
||||
# Draws an ellipse centered at the specified coordinates.
|
||||
# cx,cy x-coordinate and y-coordinate of the center
|
||||
# width the ellipse width
|
||||
# height the ellipse height
|
||||
# colorIndex 0=White 1=Black
|
||||
# filled Boolean, optional (default if False)
|
||||
# see php imageellipse() and imagefilledellipse() for more details
|
||||
#
|
||||
# line(x1,y1,x2,y2,colorIndex)
|
||||
# Draws a line
|
||||
# x1,y1 x,y coordinates for the first point
|
||||
# x2,y2 x,y coordinates for the second point
|
||||
# colorIndex 0=White 1=Black
|
||||
# see php imageline() for more details
|
||||
#
|
||||
# setGDImage(image)
|
||||
# Imports an externally generated GD image
|
||||
# image GD image to import
|
||||
#
|
||||
# getGDImage()
|
||||
# Exports the current GD image
|
||||
#
|
||||
# setFontPath(fontpath)
|
||||
# Set directory path for the fonts to use
|
||||
# fontpath Directory for the ttf fonts
|
||||
# Default value
|
||||
# Windows based platform C:\Windows\Fonts
|
||||
# Linux based platform ../fonts
|
||||
#
|
||||
# Example 1
|
||||
# require_once('AastraIPPhoneGDImage.class.php');
|
||||
# $PhoneImageGD = new AastraIPPhoneGDImage();
|
||||
# $time = strftime("%H:%M");
|
||||
# $PhoneImageGD->drawttftext(30, 0, 10, 39, $time, 1,'Ni7seg.ttf');
|
||||
#
|
||||
# Example 2
|
||||
# require_once('AastraIPPhoneGDImage.class.php');
|
||||
# $PhoneImageGD = new AastraIPPhoneGDImage();
|
||||
# $utf8text = "东丝丞丟丸";
|
||||
# $PhoneImageGD->drawttftext(20, 0, 5, 35, $utf8text, 1,'arialuni.ttf');
|
||||
#
|
||||
########################################################################################################
|
||||
|
||||
########################################################################################################
|
||||
class AastraIPPhoneGDImage
|
||||
{
|
||||
var $_img;
|
||||
var $_white;
|
||||
var $_black;
|
||||
var $_blackNoAntiAliasing;
|
||||
var $_font;
|
||||
var $_fontpath;
|
||||
|
||||
function AastraIPPhoneGDImage()
|
||||
{
|
||||
# create the actual image
|
||||
$this->_img=imagecreate(144, 40);
|
||||
|
||||
# define black and white
|
||||
$this->_white = imagecolorallocate($this->_img, 255, 255, 255);
|
||||
$this->_black = imagecolorallocate($this->_img, 0, 0, 0);
|
||||
|
||||
# Black and White only so disable anti-aliasing
|
||||
$this->_black = $this->_black * -1;
|
||||
$this->_white = $this->_white * -1;
|
||||
|
||||
# define a default font path
|
||||
$os = strtolower(PHP_OS);
|
||||
if(strpos($os, "win") === false) $this->_fontpath='../fonts';
|
||||
else $this->_fontpath='C:\Windows\Fonts';
|
||||
putenv('GDFONTPATH='.$this->_fontpath);
|
||||
}
|
||||
|
||||
function importFromPng($file,$x,$y)
|
||||
{
|
||||
$image=@imagecreatefrompng($file);
|
||||
imagecopy($this->_img,$image,$x,$y,0,0,imagesx($image),imagesy($image));
|
||||
}
|
||||
|
||||
function exportToPng($file,$file)
|
||||
{
|
||||
imagepng($this->_img);
|
||||
}
|
||||
|
||||
function setFontPath($fontpath)
|
||||
{
|
||||
$this->_fontpath=$fontpath;
|
||||
putenv('GDFONTPATH='.$this->_fontpath);
|
||||
}
|
||||
|
||||
|
||||
function drawttftext($size, $angle, $x, $y, $text, $colorIndex, $font)
|
||||
{
|
||||
imagettftext($this->_img, $size, $angle, $x, $y, $this->getColor($colorIndex), $font, $text);
|
||||
}
|
||||
|
||||
function drawtext($size, $x, $y, $text, $colorIndex)
|
||||
{
|
||||
imagestring($this->_img, $size, $x, $y, $text, $this->getColor($colorIndex));
|
||||
}
|
||||
|
||||
function setGDImage($image)
|
||||
{
|
||||
$this->_img=$image;
|
||||
}
|
||||
|
||||
function getGDImage()
|
||||
{
|
||||
return $this->_img;
|
||||
}
|
||||
|
||||
function rectangle($x1, $y1, $x2, $y2, $colorIndex, $filled=False)
|
||||
{
|
||||
if($filled) imagefilledrectangle($this->_img, $x1, $y1, $x2, $y2, $this->getColor($colorIndex));
|
||||
else imagerectangle($this->_img, $x1, $y1, $x2, $y2, $this->getColor($colorIndex));
|
||||
}
|
||||
|
||||
function ellipse($cx, $cy, $width, $height, $colorIndex, $filled=False)
|
||||
{
|
||||
if($filled) imagefilledellipse($this->_img, $cx, $cy, $width, $height, $this->getColor($colorIndex));
|
||||
else imageellipse($this->_img, $cx, $cy, $width, $height, $this->getColor($colorIndex));
|
||||
}
|
||||
|
||||
function line($x1, $y1, $x2, $y2, $colorIndex, $dashed=False)
|
||||
{
|
||||
if(!$dashed) imageline($this->_img, $x1, $y1, $x2, $y2, $this->getColor($colorIndex));
|
||||
else
|
||||
{
|
||||
$style = array($this->_black, $this->_white);
|
||||
imagesetstyle($this->_img, $style);
|
||||
imageline($this->_img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
|
||||
}
|
||||
}
|
||||
|
||||
function getColor($index)
|
||||
{
|
||||
if ($index == 0) return $this->_white; else return $this->_black;
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPIconEntry
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2007-2010
|
||||
#
|
||||
# Internal class for AastraIPPhone object.
|
||||
################################################################################
|
||||
|
@ -1,29 +1,68 @@
|
||||
<?php
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneImageMenu
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2007-2012
|
||||
#
|
||||
# AastraIPPhoneImageMenu object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
|
||||
# setBeep() to enable a notification beep with the object (optional)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setLockInCall() to set the Lock-in tag to 'call' (optional)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional, only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional, only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional, only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional, only for non softkey phones)
|
||||
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
|
||||
# setLockIn() to set the Lock-in tag to 'yes' (optional)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
|
||||
# @timeout integer (seconds)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon_index integer, icon number
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# generate() to return the object content
|
||||
# output() to display the object
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# setImage(image)to define the image to be displayed
|
||||
# @image string
|
||||
# setGDImage(GDImage) to use a GDImage for display, the size is forced to 40x144
|
||||
# @GDImage GDImage
|
||||
# setAlignment(vertical,horizontal) to define image alignment
|
||||
# @vertical string, "top", "middle", "bottom"
|
||||
# @horizontal string, "left", "middle", "right"
|
||||
# setSize(height,width) to define image size
|
||||
# @height integer (pixels)
|
||||
# @width integer (pixels)
|
||||
# setURIBase(uriBase) to define the base URI for the selections
|
||||
# @uriBase string
|
||||
# addURI(key,uri) to add a selection key with its URI
|
||||
# @key string (1-9, * and #)
|
||||
# @uri string
|
||||
# setMode(mode) to define the image mode to be displayed (normal,extended,fullscreen) (optional, 6739i only)
|
||||
# @mode string enum normal,extended,fullscreen
|
||||
# setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
|
||||
# @uri string
|
||||
# setImageAction(uri) to set the imageAction parameter with the URI to be called when user presses on the displayed image (optional, 6739i only)
|
||||
# @uri string
|
||||
#
|
||||
# Example
|
||||
# require_once('AastraIPPhoneImageMenu.class.php');
|
||||
@ -51,6 +90,9 @@ class AastraIPPhoneImageMenu extends AastraIPPhone {
|
||||
var $_height=NULL;
|
||||
var $_width=NULL;
|
||||
var $_uriBase=NULL;
|
||||
var $_mode=NULL;
|
||||
var $_imageAction='';
|
||||
var $_doneAction='';
|
||||
|
||||
function setImage($image)
|
||||
{
|
||||
@ -78,46 +120,176 @@ class AastraIPPhoneImageMenu extends AastraIPPhone {
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneImageMenuEntry($key, $uri);
|
||||
}
|
||||
|
||||
|
||||
function setGDImage($GDImage)
|
||||
{
|
||||
$img = $GDImage->getGDImage();
|
||||
$byte = 0;
|
||||
$i = 0;
|
||||
$imageHexString = "";
|
||||
for ($x=0; $x < 144; $x++)
|
||||
{
|
||||
for ($y=0; $y < 40; $y++)
|
||||
{
|
||||
$rgb = imagecolorat($img, $x, $y);
|
||||
if ($rgb > 0) $byte = $byte + pow(2,(7-($i%8)));
|
||||
if ($i%8 == 7)
|
||||
{
|
||||
$byteHex = dechex($byte);
|
||||
if (strlen($byteHex) == 1) $byteHex = "0".$byteHex;
|
||||
$imageHexString = $imageHexString . $byteHex;
|
||||
$byte=0;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$this->setImage($imageHexString);
|
||||
$this->setSize(40,144);
|
||||
}
|
||||
|
||||
function setImageAction($action)
|
||||
{
|
||||
$this->_imageAction = $action;
|
||||
}
|
||||
|
||||
function setDoneAction($uri)
|
||||
{
|
||||
$this->_doneAction = $uri;
|
||||
}
|
||||
|
||||
function setMode($mode)
|
||||
{
|
||||
$this->_mode = $mode;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$title = $this->escape($this->_title);
|
||||
# Beginning of roor tag
|
||||
$out = "<AastraIPPhoneImageMenu";
|
||||
|
||||
# DestroyOnExit
|
||||
if ($this->_destroyOnExit=='yes') $out .= " destroyOnExit=\"yes\"";
|
||||
|
||||
# CancelAction
|
||||
if($this->_cancelAction != "")
|
||||
{
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
|
||||
# DoneAction
|
||||
if($this->_doneAction != "")
|
||||
{
|
||||
$doneAction = $this->escape($this->_doneAction);
|
||||
$out .= " doneAction=\"{$doneAction}\"";
|
||||
}
|
||||
|
||||
# Beep
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
|
||||
|
||||
# Lockin
|
||||
if($this->_lockin!='') {
|
||||
$out .= " LockIn=\"{$this->_lockin}\"";
|
||||
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
|
||||
}
|
||||
|
||||
# AllowAnswer
|
||||
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# AllowDrop
|
||||
if ($this->_allowDrop == 'yes') $out .= " allowDrop=\"yes\"";
|
||||
|
||||
# AllowXfer
|
||||
if ($this->_allowXfer == 'yes') $out .= " allowXfer=\"yes\"";
|
||||
|
||||
# AllowConf
|
||||
if ($this->_allowConf == 'yes') $out .= " allowConf=\"yes\"";
|
||||
|
||||
# Timeout
|
||||
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
|
||||
# ImageAction
|
||||
if($this->_imageAction != '')
|
||||
{
|
||||
$imageAction = $this->escape($this->_imageAction);
|
||||
$out .= " imageAction=\"{$imageAction}\"";
|
||||
}
|
||||
|
||||
# Mode
|
||||
if($this->_mode != '')
|
||||
{
|
||||
$mode = $this->escape($this->_mode);
|
||||
$out .= " mode=\"{$mode}\"";
|
||||
}
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
|
||||
# Top Title
|
||||
if ($this->_toptitle!='')
|
||||
{
|
||||
$toptitle = $this->escape($this->_toptitle);
|
||||
$out .= "<TopTitle";
|
||||
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
|
||||
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
|
||||
$out .= ">".$toptitle."</TopTitle>\n";
|
||||
}
|
||||
|
||||
# Image tag
|
||||
$out .= "<Image";
|
||||
|
||||
# VerticalAlign
|
||||
if($this->_verticalAlign!=NULL) $out .= " verticalAlign=\"{$this->_verticalAlign}\"";
|
||||
|
||||
# HorizontalAlign
|
||||
if($this->_horizontalAlign!=NULL) $out .= " horizontalAlign=\"{$this->_horizontalAlign}\"";
|
||||
|
||||
# Height
|
||||
if($this->_height!=NULL) $out .= " height=\"{$this->_height}\"";
|
||||
|
||||
# Width
|
||||
if($this->_width!=NULL) $out .= " width=\"{$this->_width}\"";
|
||||
|
||||
# Image
|
||||
$out .= ">{$this->_image}</Image>\n";
|
||||
|
||||
# URI List
|
||||
$out .= "<URIList";
|
||||
$uriBase = $this->escape($this->_uriBase);
|
||||
if($uriBase!=NULL) $out .= " base=\"{$uriBase}\"";
|
||||
$out .= ">\n";
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
$out .= "</URIList>\n";
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
$IconList=0;
|
||||
foreach ($this->_icons as $icon)
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
if($IconList==0)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=1;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
}
|
||||
if($IconList!=0) $out .= "</IconList>\n";
|
||||
$out .= "</URIList>\n";
|
||||
|
||||
# Softkeys
|
||||
if (isset($this->_softkeys) && is_array($this->_softkeys))
|
||||
{
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons))
|
||||
{
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon)
|
||||
{
|
||||
if(!$IconList)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End of root tag
|
||||
$out .= "</AastraIPPhoneImageMenu>\n";
|
||||
|
||||
# Return XML object
|
||||
return($out);
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneImageMenuEntry
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2007-2010
|
||||
#
|
||||
# Internal class for AastraIPPhoneImageMenu object.
|
||||
################################################################################
|
||||
|
@ -1,30 +1,79 @@
|
||||
<?
|
||||
|
||||
<?php
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneImageScreen
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2008-2012
|
||||
#
|
||||
# AastraIPPhoneImageScreen object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
|
||||
# setBeep() to enable a notification beep with the object (optional)
|
||||
# setLockIn() to set the Lock-in tag to 'yes' (optional)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setLockInCall() to set the Lock-in tag to 'call' (optional)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional, only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional, only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional, only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional, only for non softkey phones)
|
||||
# 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)
|
||||
# @timeout integer (seconds)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon_index integer, icon number
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# generate() to return the object content
|
||||
# output() to display the object
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# setImage(image)to define the image to be displayed
|
||||
# setImage(image) to define the image to be displayed
|
||||
# @image string
|
||||
# setGDImage(GDImage) to use a GDImage for display, the size is forced to 40x144
|
||||
# @GDImage GDImage
|
||||
# setSPImage(SPImage) to use a SPImage for display, the size is forced to 40x144
|
||||
# @SPImage SPImage
|
||||
# setAlignment(vertical,horizontal) to define image alignment
|
||||
# @vertical string, "top", "middle", "bottom"
|
||||
# @horizontal string, "left", "middle", "right"
|
||||
# setSize(height,width) to define image size
|
||||
# @height integer (pixels)
|
||||
# @width integer (pixels)
|
||||
# setAllowDTMF() to allow DTMF passthrough on the object
|
||||
# setScrollUp(uri) to set the URI to be called when the user presses the Up arrow (optional)
|
||||
# @uri string
|
||||
# setScrollDown(uri) to set the URI to be called when the user presses the Down arrow (optional)
|
||||
# @uri string
|
||||
# setScrollLeft(uri) to set the URI to be called when the user presses the Left arrow (optional)
|
||||
# @uri string
|
||||
# setScrollRight(uri) to set the URI to be called when the user presses the Right arrow (optional)
|
||||
# @uri string
|
||||
# setMode(mode) to define the image mode to be displayed (normal,extended,fullscreen) (optional, 6739i only)
|
||||
# @mode string enum normal,extended,fullscreen
|
||||
# setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
|
||||
# @uri string
|
||||
# setImageAction(uri) to set the imageAction parameter with the URI to be called when user presses on the displayed image (optional, 6739i only)
|
||||
# @uri string
|
||||
#
|
||||
# Example
|
||||
#
|
||||
# Using a Pixel image
|
||||
#
|
||||
# require_once('AastraIPPhoneImageScreen.class.php');
|
||||
# $images = new AastraIPPhoneImageScreen();
|
||||
# $images->setDestroyOnExit();
|
||||
@ -35,6 +84,32 @@
|
||||
# $images->addIcon('1', 'Icon:Envelope');
|
||||
# $images->output();
|
||||
#
|
||||
# Using a GD image
|
||||
#
|
||||
# require_once('AastraIPPhoneGDImage.class.php');
|
||||
# require_once('AastraIPPhoneImageScreen.class.php');
|
||||
# $PhoneImageGD = new AastraIPPhoneGDImage();
|
||||
# $object = new AastraIPPhoneImageScreen();
|
||||
# $time = strftime("%H:%M");
|
||||
# $PhoneImageGD->drawttftext(30, 0, 10, 39, $time, 1,'Ni7seg.ttf');
|
||||
# $object->setGDImage($PhoneImageGD);
|
||||
# $object->output();
|
||||
#
|
||||
# Using a SP image
|
||||
#
|
||||
# require_once('AastraIPPhoneImageScreen.class.php');
|
||||
# $object = new AastraIPPhoneImageScreen();
|
||||
# require_once('AastraIPPhoneSPImage.class.php');
|
||||
# $SPimage=new AastraIPPhoneSPImage();
|
||||
# $SPimage->addIcon('1','286CEE6C2800');
|
||||
# $SPimage->setBitmap('answered',3,1);
|
||||
# $SPimage->setText('Jean Valjean',1,'left',3);
|
||||
# $SPimage->setText('9057604454',2,'left',3);
|
||||
# $SPimage->setText('Sep 9 10:14am',4,'left',3);
|
||||
# $SPimage->setText('Use #1# to browse',5,'center');
|
||||
# $object->setSPImage($SPimage);
|
||||
# $object->output();
|
||||
#
|
||||
########################################################################################################
|
||||
|
||||
require_once('AastraIPPhone.class.php');
|
||||
@ -45,6 +120,14 @@ class AastraIPPhoneImageScreen extends AastraIPPhone {
|
||||
var $_horizontalAlign=NULL;
|
||||
var $_height=NULL;
|
||||
var $_width=NULL;
|
||||
var $_allowDTMF='';
|
||||
var $_scrollUp='';
|
||||
var $_scrollDown='';
|
||||
var $_scrollLeft='';
|
||||
var $_scrollRight='';
|
||||
var $_mode=NULL;
|
||||
var $_imageAction='';
|
||||
var $_doneAction='';
|
||||
|
||||
function setImage($image)
|
||||
{
|
||||
@ -63,37 +146,204 @@ class AastraIPPhoneImageScreen extends AastraIPPhone {
|
||||
$this->_width = $width;
|
||||
}
|
||||
|
||||
function setScrollUp($uri)
|
||||
{
|
||||
$this->_scrollUp = $uri;
|
||||
}
|
||||
|
||||
function setScrollDown($uri)
|
||||
{
|
||||
$this->_scrollDown = $uri;
|
||||
}
|
||||
|
||||
function setScrollLeft($uri)
|
||||
{
|
||||
$this->_scrollLeft = $uri;
|
||||
}
|
||||
|
||||
function setScrollRight($uri)
|
||||
{
|
||||
$this->_scrollRight = $uri;
|
||||
}
|
||||
|
||||
function setImageAction($action)
|
||||
{
|
||||
$this->_imageAction = $action;
|
||||
}
|
||||
|
||||
function setDoneAction($uri)
|
||||
{
|
||||
$this->_doneAction = $uri;
|
||||
}
|
||||
|
||||
function setMode($mode)
|
||||
{
|
||||
$this->_mode = $mode;
|
||||
}
|
||||
|
||||
function setGDImage($GDImage)
|
||||
{
|
||||
$img = $GDImage->getGDImage();
|
||||
$byte = 0;
|
||||
$i = 0;
|
||||
$imageHexString = "";
|
||||
for ($x=0; $x < 144; $x++)
|
||||
{
|
||||
for ($y=0; $y < 40; $y++)
|
||||
{
|
||||
$rgb = imagecolorat($img, $x, $y);
|
||||
if ($rgb > 0) $byte = $byte + pow(2,(7-($i%8)));
|
||||
if ($i%8 == 7)
|
||||
{
|
||||
$byteHex = dechex($byte);
|
||||
if (strlen($byteHex) == 1) $byteHex = "0".$byteHex;
|
||||
$imageHexString = $imageHexString . $byteHex;
|
||||
$byte=0;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$this->setImage($imageHexString);
|
||||
$this->setSize(40,144);
|
||||
}
|
||||
|
||||
function setSPImage($SPImage)
|
||||
{
|
||||
$this->setImage($SPImage->getSPImage());
|
||||
$this->setSize(40,144);
|
||||
}
|
||||
|
||||
function setAllowDTMF()
|
||||
{
|
||||
$this->_allowDTMF = 'yes';
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneImageScreen";
|
||||
|
||||
# DestroyOnExit
|
||||
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
|
||||
|
||||
# CancelAction
|
||||
if($this->_cancelAction != "")
|
||||
{
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
if($this->_beep=='yes') $out .= " Beep=\"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();
|
||||
|
||||
# DoneAction
|
||||
if($this->_doneAction != "")
|
||||
{
|
||||
$doneAction = $this->escape($this->_doneAction);
|
||||
$out .= " doneAction=\"{$doneAction}\"";
|
||||
}
|
||||
if($IconList!=0) $out .= "</IconList>\n";
|
||||
|
||||
# Beep
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
|
||||
# Lockin
|
||||
if($this->_lockin!='') {
|
||||
$out .= " LockIn=\"{$this->_lockin}\"";
|
||||
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
|
||||
}
|
||||
|
||||
# Timeout
|
||||
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
|
||||
# AllowAnswer
|
||||
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# AllowDrop
|
||||
if ($this->_allowDrop == 'yes') $out .= " allowDrop=\"yes\"";
|
||||
|
||||
# AllowXfer
|
||||
if ($this->_allowXfer == 'yes') $out .= " allowXfer=\"yes\"";
|
||||
|
||||
# AllowConf
|
||||
if ($this->_allowConf == 'yes') $out .= " allowConf=\"yes\"";
|
||||
|
||||
# AllowDTMF
|
||||
if($this->_allowDTMF=='yes') $out .= " allowDTMF=\"yes\"";
|
||||
|
||||
# Scrolls up/down/left/right
|
||||
if($this->_scrollUp!='') $out .= " scrollUp=\"".$this->escape($this->_scrollUp)."\"";
|
||||
if($this->_scrollDown!='') $out .= " scrollDown=\"".$this->escape($this->_scrollDown)."\"";
|
||||
if($this->_scrollLeft!='') $out .= " scrollLeft=\"".$this->escape($this->_scrollLeft)."\"";
|
||||
if($this->_scrollRight!='') $out .= " scrollRight=\"".$this->escape($this->_scrollRight)."\"";
|
||||
|
||||
# ImageAction
|
||||
if($this->_imageAction != '')
|
||||
{
|
||||
$imageAction = $this->escape($this->_imageAction);
|
||||
$out .= " imageAction=\"{$imageAction}\"";
|
||||
}
|
||||
|
||||
# Mode
|
||||
if($this->_mode != '')
|
||||
{
|
||||
$mode = $this->escape($this->_mode);
|
||||
$out .= " mode=\"{$mode}\"";
|
||||
}
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
|
||||
# Top Title
|
||||
if ($this->_toptitle!='')
|
||||
{
|
||||
$toptitle = $this->escape($this->_toptitle);
|
||||
$out .= "<TopTitle";
|
||||
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
|
||||
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
|
||||
$out .= ">".$toptitle."</TopTitle>\n";
|
||||
}
|
||||
|
||||
# Beginning of Image tag
|
||||
$out .= "<Image";
|
||||
|
||||
# VerticalAlign
|
||||
if($this->_verticalAlign!=NULL) $out .= " verticalAlign=\"{$this->_verticalAlign}\"";
|
||||
|
||||
# HorizontalAlign
|
||||
if($this->_horizontalAlign!=NULL) $out .= " horizontalAlign=\"{$this->_horizontalAlign}\"";
|
||||
|
||||
# Height
|
||||
if($this->_height!=NULL) $out .= " height=\"{$this->_height}\"";
|
||||
|
||||
# Width
|
||||
if($this->_width!=NULL) $out .= " width=\"{$this->_width}\"";
|
||||
|
||||
# Image and end of image tag
|
||||
$out .= ">{$this->_image}</Image>\n";
|
||||
|
||||
# Softkeys
|
||||
if (isset($this->_softkeys) && is_array($this->_softkeys))
|
||||
{
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons))
|
||||
{
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon)
|
||||
{
|
||||
if(!$IconList)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End tag
|
||||
$out .= "</AastraIPPhoneImageScreen>\n";
|
||||
|
||||
# Return XML object
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
<?
|
||||
|
||||
<?php
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneInputScreen
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2005-2011
|
||||
#
|
||||
# AastraIPPhoneInputScreen object.
|
||||
#
|
||||
@ -10,48 +9,110 @@
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setTitle(Title) to setup the title of an object (optional)
|
||||
# @title string
|
||||
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (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)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setLockInCall() to set the Lock-in tag to 'call' (optional)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
|
||||
# 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)
|
||||
# @timeout integer (seconds)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon_index integer, icon number
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# generate() to return the object content
|
||||
# output() to display the object
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object - Single Input
|
||||
# setURL(url) to set the URL to called after the input
|
||||
# setType(type) to set type of input ('IP', 'string'or 'number'), 'string' by default
|
||||
# @url string
|
||||
# setType(type) to set type of input, 'string' by default
|
||||
# @type enum ('IP', 'string', 'number', 'dateUS'...)
|
||||
# setDefault(default) to set default value for the input (optional)
|
||||
# setParameter(param) to set the parameter name to be parsed after the input
|
||||
# @default string
|
||||
# setParameter(param,color,bcolor) to set the parameter name to be parsed after the input
|
||||
# @param string
|
||||
# @color string, field color "red", "blue" ... (optional)
|
||||
# @bcolor string, background color "red", "blue" ... (optional)
|
||||
# setInputLanguage(language) to set the language of the input (optional)
|
||||
# @language enum ("English", "French"....)
|
||||
# setPassword() to set the Password parameter to 'yes', 'no' by default (optional)
|
||||
# setNotEditable() to set the editable parameter to 'no', 'yes' by default (optional)
|
||||
# setEditable() is now replaced by setNotEditable but kept for compatibility reasons (optional)
|
||||
# setPrompt(prompt) to set the prompt to be displayed for the input.
|
||||
# setPrompt(prompt,color) to set the prompt to be displayed for the input.
|
||||
# @prompt string
|
||||
# @color string, prompt color "red", "blue" ... (optional)
|
||||
# setDefaultFocus() to set the default focus to 'yes'
|
||||
#
|
||||
# Specific to the object - Multiple Inputs
|
||||
# setURL(url) to set the URL to called after the input
|
||||
# setType(type) to set the default type of input ('IP', 'string'or 'number'), 'string' by default
|
||||
# @url string
|
||||
# setType(type) to set the default type of input 'string' by default
|
||||
# @type enum ('IP', 'string', 'number', 'dateUS'...)
|
||||
# setDefault(default) to set default default value for the input (optional)
|
||||
# setParameter(param) to set the default parameter name to be parsed after the input
|
||||
# @default string
|
||||
# setParameter(param,color) to set the default parameter name to be parsed after the input
|
||||
# @param string
|
||||
# @color string, field color "red", "blue" ... (optional)
|
||||
# setPassword() to set the default Password parameter to 'yes', 'no' by default (optional)
|
||||
# setNotEditable() to set the default editable parameter to 'no', 'yes' by default (optional)
|
||||
# setEditable() is now replaced by setNotEditable but kept for compatibility reasons (optional)
|
||||
# setPrompt(prompt) to set the default prompt to be displayed for the input.
|
||||
# setDefaultIndex(index) to define the field index the object will use to start (optional) default is 1
|
||||
# setDisplayMode(display) to define the aspect of the display, normal/condensed (optional) default is normal.
|
||||
# setPrompt(prompt,color) to set the default prompt to be displayed for the input.
|
||||
# @prompt string
|
||||
# @color string, prompt color "red", "blue" ... (optional)
|
||||
# setDefaultIndex(index) to define the field index the object will use to start (optional)
|
||||
# @index integer, optional, default is 1
|
||||
# setDisplayMode(display) to define the aspect of the display, normal/condensed (optional)
|
||||
# @display enum ("normal, "condensed"), default is "normal".
|
||||
# setInputLanguage(language) to set the language of the input (optional)
|
||||
# addField(type) to add an input field and setting its type (IP, string, number, dateUS, timeUS,dateInt, timeInt or empty) if the type is an empty string then the type is inherited from the main object.
|
||||
# setFieldPassword(password) to set the password mode for the input field ('yes', no'), overrides the value set by setPassword for the field
|
||||
# @language enum ("English", "French"....)
|
||||
# addField(type,choiceURL) to add an input field and setting its type
|
||||
# @type (IP, string, number, dateUS, timeUS,dateInt, timeInt, empty or choice) if the type is an empty string then the type is inherited from the main object.
|
||||
# @choiceURL escape URL for choice input
|
||||
# setFieldType(type,choiceURL) to set input field type
|
||||
# @type (IP, string, number, dateUS, timeUS,dateInt, timeInt, empty or choice) if the type is an empty string then the type is inherited from the main object.
|
||||
# @choiceURL escape URL for choice input
|
||||
# setFieldPassword(password) to set the password mode for the input field, overrides the value set by setPassword for the field
|
||||
# @password enum ("yes", "no")
|
||||
# setFieldEditable(editable) to set the input field editable mode ('yes', no'), overrides the value set by setEditable or setNotEditable for the field
|
||||
# setFieldParameter(parameter) to set the parameter name to be parsed after the global input, overrides the value set by setParameter for the field
|
||||
# setFieldPrompt(prompt)to set the prompt to be displayed for the input field, overrides the value set by setPrompt for the field
|
||||
# @editable enum ("yes", "no")
|
||||
# setDefaultFocus() to set the default focus to 'yes'
|
||||
# setFieldParameter(parameter,color) to set the parameter name to be parsed after the global input, overrides the value set by setParameter for the field
|
||||
# @parameter string
|
||||
# @color string, field color "red", "blue" ... (optional)
|
||||
# setFieldPrompt(prompt,color)to set the prompt to be displayed for the input field, overrides the value set by setPrompt for the field
|
||||
# @prompt string
|
||||
# @color string, prompt color "red", "blue" ... (optional)
|
||||
# setFieldSelection(selection) to set the Selection tag for the field
|
||||
# @selection string
|
||||
# setFieldDefault(default) to set default value for the input field, overrides the value set by setDefault for the field
|
||||
# @default string
|
||||
# addFieldSoftkey(index,label,uri,icon) to add custom softkeys to the input field, overrides the softkeys set by addSoftkey.
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon integer, icon number
|
||||
#
|
||||
# Example 1 - Single Input
|
||||
# require_once('AastraIPPhoneInputScreen.class.php');
|
||||
@ -97,10 +158,13 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
|
||||
var $_prompt;
|
||||
var $_editable='';
|
||||
var $_default='';
|
||||
var $_defaultfocus='';
|
||||
var $_password='';
|
||||
var $_defaultindex='';
|
||||
var $_displaymode='';
|
||||
var $_inputlanguage='';
|
||||
var $_fieldcolor='';
|
||||
var $_promptcolor='';
|
||||
|
||||
function setURL($url)
|
||||
{
|
||||
@ -126,9 +190,15 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
|
||||
$this->_default=$default;
|
||||
}
|
||||
|
||||
function setParameter($parameter)
|
||||
function setDefaultFocus()
|
||||
{
|
||||
$this->_defaultfocus='yes';
|
||||
}
|
||||
|
||||
function setParameter($parameter,$color='')
|
||||
{
|
||||
$this->_parameter=$parameter;
|
||||
$this->_fieldcolor=$color;
|
||||
}
|
||||
|
||||
function setPassword()
|
||||
@ -136,9 +206,10 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
|
||||
$this->_password='yes';
|
||||
}
|
||||
|
||||
function setPrompt($prompt)
|
||||
function setPrompt($prompt,$color='')
|
||||
{
|
||||
$this->_prompt=$prompt;
|
||||
$this->_promptcolor=$color;
|
||||
}
|
||||
|
||||
function setDefaultIndex($index)
|
||||
@ -156,16 +227,17 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
|
||||
$this->_inputlanguage=$input;
|
||||
}
|
||||
|
||||
|
||||
function addField($type='')
|
||||
function addField($type='',$choiceURL='')
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneInputScreenEntry($type);
|
||||
end($this->_entries);
|
||||
if($type=='choice') $this->_entries[key($this->_entries)]->_choiceURL=$choiceURL;
|
||||
}
|
||||
|
||||
function setFieldType($type)
|
||||
|
||||
function setFieldType($type,$choiceURL='')
|
||||
{
|
||||
$this->_entries[key($this->_entries)]->_type=$type;
|
||||
if($type=='choice') $this->_entries[key($this->_entries)]->_choiceURL=$choiceURL;
|
||||
}
|
||||
|
||||
function setFieldPassword($password='yes')
|
||||
@ -178,14 +250,16 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
|
||||
$this->_entries[key($this->_entries)]->_editable=$editable;
|
||||
}
|
||||
|
||||
function setFieldParameter($parameter)
|
||||
function setFieldParameter($parameter,$color='')
|
||||
{
|
||||
$this->_entries[key($this->_entries)]->_parameter=$parameter;
|
||||
$this->_entries[key($this->_entries)]->_fieldcolor=$color;
|
||||
}
|
||||
|
||||
function setFieldPrompt($prompt)
|
||||
function setFieldPrompt($prompt,$color='')
|
||||
{
|
||||
$this->_entries[key($this->_entries)]->_prompt=$this->escape($prompt);
|
||||
$this->_entries[key($this->_entries)]->_promptcolor=$color;
|
||||
}
|
||||
|
||||
function setFieldDefault($default)
|
||||
@ -193,58 +267,150 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
|
||||
$this->_entries[key($this->_entries)]->_default=$default;
|
||||
}
|
||||
|
||||
function setFieldSelection($selection)
|
||||
{
|
||||
$this->_entries[key($this->_entries)]->_selection=$selection;
|
||||
}
|
||||
|
||||
function addFieldSoftkey($index, $label, $uri, $icon=NULL)
|
||||
{
|
||||
$this->_entries[key($this->_entries)]->_softkeys[] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon);
|
||||
}
|
||||
|
||||
|
||||
function render()
|
||||
{
|
||||
$prompt = $this->escape($this->_prompt);
|
||||
$url = $this->escape($this->_url);
|
||||
$out = '';
|
||||
$out .= "<AastraIPPhoneInputScreen type=\"$this->_type\"";
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneInputScreen type=\"$this->_type\"";
|
||||
|
||||
# Password
|
||||
if($this->_password == 'yes') $out .= " password=\"yes\"";
|
||||
|
||||
# DestroyOnExit
|
||||
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
|
||||
|
||||
# CancelAction
|
||||
if($this->_cancelAction != "")
|
||||
{
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
|
||||
# Editable
|
||||
if($this->_editable=='no') $out .= " editable=\"no\"";
|
||||
|
||||
# Beep
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
|
||||
# DefaultIndex
|
||||
if($this->_defaultindex!='') $out .= " defaultIndex=\"".$this->_defaultindex."\"";
|
||||
|
||||
# DefaultFocus
|
||||
if($this->_defaultfocus!='') $out .= " defaultFocus=\"yes\"";
|
||||
|
||||
# InputLanguage
|
||||
if($this->_inputlanguage!='') $out .= " inputLanguage=\"".$this->_inputlanguage."\"";
|
||||
|
||||
# Display Mode
|
||||
if($this->_displaymode!='') $out .= " displayMode=\"".$this->_displaymode."\"";
|
||||
if($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
|
||||
|
||||
# Lockin
|
||||
if($this->_lockin!='') {
|
||||
$out .= " LockIn=\"{$this->_lockin}\"";
|
||||
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
|
||||
}
|
||||
|
||||
# AllowAnswer
|
||||
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# AllowDrop
|
||||
if($this->_allowDrop == 'yes') $out .= " allowDrop=\"yes\"";
|
||||
|
||||
# AllowXfer
|
||||
if($this->_allowXfer == 'yes') $out .= " allowXfer=\"yes\"";
|
||||
|
||||
# AllowConf
|
||||
if($this->_allowConf == 'yes') $out .= " allowConf=\"yes\"";
|
||||
|
||||
# TimeOut
|
||||
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
|
||||
# End of the root tag
|
||||
$out .= ">\n";
|
||||
|
||||
# Title
|
||||
if ($this->_title!='')
|
||||
{
|
||||
$title = $this->escape($this->_title);
|
||||
$out .= "<Title";
|
||||
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
|
||||
if ($this->_title_color!='') $out .= " Color=\"{$this->_title_color}\"";
|
||||
$out .= ">".$title."</Title>\n";
|
||||
}
|
||||
if($this->_prompt != '') $out .= "<Prompt>{$prompt}</Prompt>\n";
|
||||
$out .= "<URL>{$url}</URL>\n";
|
||||
if($this->_parameter != '') $out .= "<Parameter>{$this->_parameter}</Parameter>\n";
|
||||
$out .= "<Default>{$this->_default}</Default>\n";
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
$IconList=0;
|
||||
foreach ($this->_icons as $icon)
|
||||
|
||||
# Top Title
|
||||
if ($this->_toptitle!='')
|
||||
{
|
||||
if($IconList==0)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=1;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
$toptitle = $this->escape($this->_toptitle);
|
||||
$out .= "<TopTitle";
|
||||
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
|
||||
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
|
||||
$out .= ">".$toptitle."</TopTitle>\n";
|
||||
}
|
||||
if($IconList!=0) $out .= "</IconList>\n";
|
||||
|
||||
# Prompt
|
||||
if($this->_prompt != '')
|
||||
{
|
||||
$prompt = $this->escape($this->_prompt);
|
||||
$out .= "<Prompt";
|
||||
if($this->_promptcolor != '') $out .= " Color=\"{$this->_promptcolor}\"";
|
||||
$out .= ">{$prompt}</Prompt>\n";
|
||||
}
|
||||
|
||||
# URL
|
||||
$url = $this->escape($this->_url);
|
||||
$out .= "<URL>{$url}</URL>\n";
|
||||
|
||||
# Parameter
|
||||
if($this->_parameter != '')
|
||||
{
|
||||
$out .= "<Parameter";
|
||||
if($this->_fieldcolor != '') $out .= " Color=\"{$this->_fieldcolor}\"";
|
||||
if($this->_fieldbcolor != '') $out .= " Bcolor=\"{$this->_fieldbcolor}\"";
|
||||
$out .= ">{$this->_parameter}</Parameter>\n";
|
||||
}
|
||||
|
||||
# Default
|
||||
$out .= "<Default>{$this->_default}</Default>\n";
|
||||
|
||||
# Multiple input fields
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
}
|
||||
|
||||
# Softkeys
|
||||
if (isset($this->_softkeys) && is_array($this->_softkeys))
|
||||
{
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons))
|
||||
{
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon)
|
||||
{
|
||||
if(!$IconList)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End tag
|
||||
$out .= "</AastraIPPhoneInputScreen>\n";
|
||||
return $out;
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneInputScreenEntry
|
||||
# Firmware 2.0.2 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# Internal class for AastraIPPhoneInputScreen object.
|
||||
################################################################################
|
||||
@ -15,7 +14,12 @@ class AastraIPPhoneInputScreenEntry {
|
||||
var $_parameter='';
|
||||
var $_prompt='';
|
||||
var $_default='';
|
||||
var $_selection='';
|
||||
var $_softkeys;
|
||||
var $_inputlanguage='';
|
||||
var $_fieldcolor='';
|
||||
var $_promptcolor='';
|
||||
var $_choiceURL='';
|
||||
|
||||
function AastraIPPhoneInputScreenEntry($type)
|
||||
{
|
||||
@ -30,9 +34,22 @@ class AastraIPPhoneInputScreenEntry {
|
||||
if($this->_password != '') $xml .= " password=\"".$this->_password."\"";
|
||||
if($this->_editable != '') $xml .= " editable=\"".$this->_editable."\"";
|
||||
$xml .= ">\n";
|
||||
if($this->_prompt != '') $xml .= "<Prompt>".$this->_prompt."</Prompt>\n";
|
||||
if($this->_parameter != '') $xml .= "<Parameter>".$this->_parameter."</Parameter>\n";
|
||||
if($this->_prompt != '')
|
||||
{
|
||||
$xml .= "<Prompt";
|
||||
if($this->_promptcolor != '') $xml .= " Color=\"{$this->_promptcolor}\"";
|
||||
$xml .= ">".$this->_prompt."</Prompt>\n";
|
||||
}
|
||||
if($this->_parameter != '')
|
||||
{
|
||||
$xml .= "<Parameter";
|
||||
if($this->_fieldcolor != '') $xml .= " Color=\"{$this->_fieldcolor}\"";
|
||||
if($this->_fieldbcolor != '') $xml .= " Bcolor=\"{$this->_fieldbcolor}\"";
|
||||
$xml .= ">".$this->_parameter."</Parameter>\n";
|
||||
}
|
||||
if($this->_selection != '') $xml .= "<Selection>".$this->_selection."</Selection>\n";
|
||||
if($this->_default != '') $xml .= "<Default>".$this->_default."</Default>\n";
|
||||
if($this->_choiceURL != '') $xml .= "<choiceURL>".$this->_choiceURL."</choiceURL>\n";
|
||||
foreach ($this->_softkeys as $softkey) $xml .= $softkey->render();
|
||||
$xml .= "</InputField>\n";
|
||||
return($xml);
|
||||
|
69
php_classes/AastraIPPhoneScrollHandler.php
Normal file
69
php_classes/AastraIPPhoneScrollHandler.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
#############################################################################
|
||||
# AastraIPPhoneScrollHandler
|
||||
#
|
||||
# Copyright 2009 Aastra Telecom Ltd
|
||||
#
|
||||
# Note
|
||||
# This script is a helper script of the AastraIPPhoneScrollableTextMenu
|
||||
# and AastraIPPhoneScrollableDirectory class. It should only be called
|
||||
# by those classes.
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
#############################################################################
|
||||
# PHP customization for includes and warnings
|
||||
#############################################################################
|
||||
$os = strtolower(PHP_OS);
|
||||
if(strpos($os, "win") === false) ini_set('include_path',ini_get('include_path').':include:../include');
|
||||
else ini_set('include_path',ini_get('include_path').';include;..\include');
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
|
||||
#############################################################################
|
||||
# Includes
|
||||
#############################################################################
|
||||
require_once('AastraCommon.php');
|
||||
require_once('AastraIPPhoneTextScreen.class.php');
|
||||
require_once('AastraIPPhoneScrollableTextMenu.class.php');
|
||||
require_once('AastraIPPhoneScrollableDirectory.class.php');
|
||||
|
||||
$cookie = Aastra_getvar_safe('listCookie');
|
||||
$page = Aastra_getvar_safe('listPage');
|
||||
$zoomIndex = Aastra_getvar_safe('zoomIndex');
|
||||
$recentSelection = Aastra_getvar_safe('recentSelection');
|
||||
$recentPage = Aastra_getvar_safe('recentPage');
|
||||
|
||||
Aastra_trace_call('LDAP directory',$_SERVER['REQUEST_URI']);
|
||||
|
||||
# Get Language and HTTP header
|
||||
$language = Aastra_get_language();
|
||||
$header = Aastra_decode_HTTP_header();
|
||||
|
||||
# Load user context
|
||||
$menu = Aastra_get_user_context($header['mac'],'scrollableTextMenuData');
|
||||
|
||||
if (!is_object($menu)) {
|
||||
# If not an object: Something went wrong when fetching the user context. Display error and exit.
|
||||
$object = new AastraIPPhoneTextScreen();
|
||||
$object->setTitle(Aastra_get_label('Server error',$language));
|
||||
$object->setText(Aastra_get_label('Context not found. Check cache directory settings.',$language));
|
||||
$object->output();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$menu->verifyCookie($cookie)) {
|
||||
# If cookie does not match: Display error and exit.
|
||||
$object = new AastraIPPhoneTextScreen();
|
||||
$object->setTitle(Aastra_get_label('Server error',$language));
|
||||
$object->setText(Aastra_get_label('Session not found. Please try again.',$language));
|
||||
$object->output();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($recentSelection != "") $menu->setDefaultIndex($recentSelection);
|
||||
|
||||
if ($zoomIndex != "") $menu->zoom($zoomIndex,$recentPage,$recentSelection); # This means $object is of type AastraIPPhoneScrollableDirectory
|
||||
else $menu->output($page);
|
||||
exit;
|
||||
|
||||
?>
|
369
php_classes/AastraIPPhoneScrollableDirectory.class.php
Normal file
369
php_classes/AastraIPPhoneScrollableDirectory.class.php
Normal file
@ -0,0 +1,369 @@
|
||||
<?php
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneScrollableDirectory
|
||||
#
|
||||
# Aastra SIP Phones 1.4.2 or better
|
||||
#
|
||||
# Copyright 2009-2011 Aastra Telecom Ltd
|
||||
#
|
||||
# Supported Aastra Phones
|
||||
# All IP phones except Aastra9112i and Aastra9133i
|
||||
#
|
||||
# AastraIPPhoneScrollableDirectory object.
|
||||
#
|
||||
# Public methods
|
||||
# setDialKeyPosition(position) Set position of Dial Softkey in list view. Default is 2.
|
||||
# setNameDisplayFormat(format) Set name display format. 0="Firstname Lastname", 1="Lastname, Firstname"
|
||||
# natsortByLastname() Sort by lastname (same as natsortByName in case firstname is not provided)
|
||||
# natsortByFirstname() Sort by firstname (same as natsortByName in case firstname is not provided)
|
||||
#
|
||||
# Overwritten methods from AastraIPPhoneScrollableTextMenu
|
||||
# setEntries(records) Set directory entries by 2 dim array. Inner array fields: See addEntry(record)
|
||||
# addEntry(record) Add directory entry
|
||||
# Array fields: (name is mandatory, rest optional)
|
||||
# name: Lastname or name
|
||||
# firstname: Firstname (optional)
|
||||
# title: Title
|
||||
# department: Department
|
||||
# company: Company
|
||||
# icon: Icon
|
||||
# office: Office number display format
|
||||
# officeDigits: Office number digits / extension to be dialed. Optional
|
||||
# mobile: Cell number display format
|
||||
# mobileDigits: Cell number digits / extension to be dialed. Optional
|
||||
# home: Home number display format
|
||||
# homeDigits: Home number digits / extension to be dialed. Optional
|
||||
# office2: Alternative / 2nd office number display format
|
||||
# office2Digits: 2nd office number digits / extension to be dialed. Optional
|
||||
# speedURL: If this field is present, a "+Speed" Softkey will be shown in zoom mode. Selected number will be passed in $selection variable.
|
||||
# Ex: speedURL=http://xmlserver/xml/speed/speed.php?action=add&name=Peter
|
||||
#
|
||||
# Inherited from AastraIPPhoneScrollableTextMenu
|
||||
# setEntries(entries) Set entries of the list by an 2 dim array. Inner array field names: 'name', 'url', 'selection', 'icon', 'dial'
|
||||
# verifyCookie(cookie) Verifies if the cookie of the HTTP requests matches the cookie of the saved context.
|
||||
# setBackURI(URI) Set the cancel parameter with the URI to be called on Cancel or Back Softkey (optional)
|
||||
# setBackKeyPosition(position) Set position of Back Softkey. Default is 3.
|
||||
# setNextKeyPosition(position) Set position of Back Softkey. Default is 4.
|
||||
# setPreviousKeyPosition(position) Set position of Back Softkey. Default is 5.
|
||||
# setExitKeyPosition(position) Set position of Back Softkey. Default is 6.
|
||||
# setSelectKeyPosition(position) Set position of Back Softkey. Default is 1.
|
||||
# setNextKeyIcon(icon) Set icon of Next Softkey. Default is Icon:TailArrowDown. Set NULL to disable icon.
|
||||
# setPreviousKeyIcon(icon) Set icon of Previous Softkey. Default is Icon:TailArrowUp. Set NULL to disable icon.
|
||||
# disableExitKey() Disable the Exit Softkey
|
||||
# setSelectKeyLabel(label) Set the label of the Select Softkey. Default is 'Select'. Make sure the string is in language.ini.
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel or Back Softkey (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# output() to display the object
|
||||
# addEntry(name,url,selection,icon,dial) to add an element in the list to be displayed
|
||||
# natsortbyname() to order the list
|
||||
#
|
||||
# Example:
|
||||
# $records[0]['name'] = "Smith";
|
||||
# $records[0]['firstname'] = "Lisa";
|
||||
# $records[0]['office'] = "+1 (0) 555-123-4321";
|
||||
# $records[0]['officeDigits'] = "4321";
|
||||
# $records[0]['mobile'] = "079 555 12 34";
|
||||
# # ... add as many entries you want
|
||||
# $records[99]['name'] = "Miller";
|
||||
# $records[99]['firstname'] = "Bob";
|
||||
# $records[99]['office'] = "+1 (0) 555-123-1234";
|
||||
# $records[99]['officeDigits'] = "1234";
|
||||
# $records[99]['home'] = "044 555 22 33";
|
||||
# $records[99]['company'] = "Aastra Telecom Inc.";
|
||||
# $directory = new AastraIPPhoneScrollableDirectory();
|
||||
# $directory->setTitle('Directory');
|
||||
# $directory->setBackURI($XML_SERVER."?action=start");
|
||||
# $directory->setEntries($records):
|
||||
# $directory->output(); # Page scrolling and record zooming will be handled by AastraIPPhoneScrollableTextMenu
|
||||
########################################################################################################
|
||||
|
||||
require_once('AastraIPPhoneScrollableTextMenu.class.php');
|
||||
|
||||
class AastraIPPhoneScrollableDirectory extends AastraIPPhoneScrollableTextMenu
|
||||
{
|
||||
# Variables
|
||||
var $_dialKeyPosition = 2;
|
||||
var $_selectKeyLabel = 'Details';
|
||||
var $_index = 0;
|
||||
var $_nameDisplayFormat = 0; # 0="Firstname Lastname", 1="Lastname, Firstname"
|
||||
|
||||
# Constructor
|
||||
function AastraIPPhoneScrollableDirectory()
|
||||
{
|
||||
# Set default style to "none"
|
||||
$this->setStyle('none');
|
||||
|
||||
# Set default title
|
||||
$this->setTitle(Aastra_get_label('Directory',$this->_language));
|
||||
|
||||
# Call parent constructor
|
||||
parent::AastraIPPhoneScrollableTextMenu();
|
||||
}
|
||||
|
||||
function addEntry($record)
|
||||
{
|
||||
# If no name or fistname provided, skip record
|
||||
if (empty($record['name']) && empty($record['firstname'])) return;
|
||||
|
||||
# Save lastname (needed if we want to sort by lastname)
|
||||
$record['lastname'] = $record['name'];
|
||||
|
||||
# Set display name
|
||||
if ($this->_nameDisplayFormat==0) $record['name'] = trim((isset($record['firstname'])) ? $record['firstname'] . ' ' . $record['name'] : $record['name']);
|
||||
else $record['name'] = trim((isset($record['firstname'])) ? $record['name'] . ', ' . $record['firstname'] : $record['name']);
|
||||
|
||||
# If actual digits are not provided, use display format number.
|
||||
if (empty($record['officeDigits'])) $record['officeDigits'] = $record['office'];
|
||||
if (empty($record['mobileDigits'])) $record['mobileDigits'] = $record['mobile'];
|
||||
if (empty($record['homeDigits'])) $record['homeDigits'] = $record['home'];
|
||||
if (empty($record['office2Digits'])) $record['office2Digits'] = $record['office2'];
|
||||
|
||||
# Remove non-numeric digits
|
||||
$record['officeDigits'] = preg_replace('/[^0-9]/','',$record['officeDigits']);
|
||||
$record['mobileDigits'] = preg_replace('/[^0-9]/','',$record['mobileDigits']);
|
||||
$record['homeDigits'] = preg_replace('/[^0-9]/','',$record['homeDigits']);
|
||||
$record['office2Digits'] = preg_replace('/[^0-9]/','',$record['office2Digits']);
|
||||
|
||||
# Set instant dial number (to be dialed when hook is lifted in list view / when dial key is pressed in list view)
|
||||
if (!empty($record['officeDigits'])) $record['dial'] = $record['officeDigits'];
|
||||
else if (!empty($record['office2Digits'])) $record['dial'] = $record['office2Digits'];
|
||||
else if (!empty($record['mobileDigits'])) $record['dial'] = $record['mobileDigits'];
|
||||
else if (!empty($record['homeDigits'])) $record['dial'] = $record['homeDigits'];
|
||||
$record['url'] = $this->_scrollHandlerReference.'&zoomIndex='.$this->_index;
|
||||
|
||||
# We need to save the index as a field as the order of $this->_list can change after sorting
|
||||
$record['index'] = $this->_index;
|
||||
|
||||
# Add record to text menu list entries
|
||||
$this->_list[$this->_index] = $record;
|
||||
$this->_index++;
|
||||
}
|
||||
|
||||
function setEntries($records)
|
||||
{
|
||||
# Empty list?
|
||||
if (empty($records)) return;
|
||||
|
||||
# Clear list
|
||||
$this->_list = array();
|
||||
foreach ($records as $record) $this->addEntry($record);
|
||||
}
|
||||
|
||||
function zoom($index, $recentPage, $recentSelection)
|
||||
{
|
||||
# Find record matching the given index
|
||||
foreach ($this->_list as $record)
|
||||
{
|
||||
if ($record['index']==$index)
|
||||
{
|
||||
$myrecord = $record;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Textmenu for the zoom
|
||||
$menu = new AastraIPPhoneTextMenu();
|
||||
$menu->setDestroyOnExit();
|
||||
if (Aastra_is_style_textmenu_supported()) $menu->setStyle('none');
|
||||
if (Aastra_is_wrap_title_supported())$menu->setTitleWrap();
|
||||
if (Aastra_is_textmenu_wrapitem_supported()) $menu->setWrapList();
|
||||
if (Aastra_is_top_title_supported())
|
||||
{
|
||||
$menu->setTopTitle($myrecord['name']);
|
||||
$menu->setTitle(' ');
|
||||
}
|
||||
else $menu->setTitle($myrecord['name']);
|
||||
|
||||
# Default Index
|
||||
$defaultIndex = 1;
|
||||
if(!empty($myrecord['title']))
|
||||
{
|
||||
$menu->addEntry($myrecord['title'], NULL, NULL);
|
||||
$defaultIndex++;
|
||||
}
|
||||
if(!empty($myrecord['department']))
|
||||
{
|
||||
$menu->addEntry($myrecord['department'], NULL, NULL);
|
||||
$defaultIndex++;
|
||||
}
|
||||
if(!empty($myrecord['company']))
|
||||
{
|
||||
$menu->addEntry($myrecord['company'], NULL, NULL);
|
||||
$defaultIndex++;
|
||||
}
|
||||
$menu->setDefaultIndex($defaultIndex);
|
||||
|
||||
# If Dial2 softkey is supported, add 'Dial:' Prefix to URL (so number can be dialed by pressing right navigation key)
|
||||
if (!Aastra_test_phone_version('2.0.1.',1)) $URLprefix = 'Dial:'; else $URLprefix = '';
|
||||
|
||||
# Office Number
|
||||
if(!empty($myrecord['office']))
|
||||
{
|
||||
if (Aastra_is_icons_supported())
|
||||
{
|
||||
$iconIndex = 10;
|
||||
$prompt='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$iconIndex = NULL;
|
||||
$prompt=Aastra_get_label('(W)',$this->_language).' ';
|
||||
}
|
||||
if (!Aastra_test_phone_version('2.0.1.',1)) $menu->addEntry($prompt.$myrecord['office'], $URLprefix.$myrecord['officeDigits'], $myrecord['officeDigits'], $iconIndex, $myrecord['officeDigits']);
|
||||
else $menu->addEntry($prompt.$myrecord['office'], $URLprefix.$myrecord['officeDigits'], $myrecord['officeDigits']);
|
||||
}
|
||||
|
||||
# Office 2 number
|
||||
if(!empty($myrecord['office2']))
|
||||
{
|
||||
if (Aastra_is_icons_supported())
|
||||
{
|
||||
$iconIndex = 10;
|
||||
$prompt='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$iconIndex = NULL;
|
||||
$prompt=Aastra_get_label('(W)',$this->_language).' ';
|
||||
}
|
||||
if (!Aastra_test_phone_version('2.0.1.',1)) $menu->addEntry($prompt.$myrecord['office2'], $URLprefix.$myrecord['office2Digits'], $myrecord['officeDigits'], $iconIndex, $myrecord['office2Digits']);
|
||||
else $menu->addEntry($prompt.$myrecord['office2'], $URLprefix.$myrecord['office2Digits'], $myrecord['officeDigits']);
|
||||
}
|
||||
|
||||
# Mobile number
|
||||
if(!empty($myrecord['mobile']))
|
||||
{
|
||||
if (Aastra_is_icons_supported())
|
||||
{
|
||||
$iconIndex = 11;
|
||||
$prompt='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$iconIndex = NULL;
|
||||
$prompt=Aastra_get_label('(C)',$this->_language).' ';
|
||||
}
|
||||
if (!Aastra_test_phone_version('2.0.1.',1)) $menu->addEntry($prompt.$myrecord['mobile'], $URLprefix.$myrecord['mobileDigits'], $myrecord['officeDigits'], $iconIndex, $myrecord['mobileDigits']);
|
||||
else $menu->addEntry($prompt.$myrecord['mobile'], $URLprefix.$myrecord['mobileDigits'], $myrecord['officeDigits']);
|
||||
}
|
||||
|
||||
# Home number
|
||||
if(!empty($myrecord['home']))
|
||||
{
|
||||
if (Aastra_is_icons_supported())
|
||||
{
|
||||
$iconIndex = 12;
|
||||
$prompt='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$iconIndex = NULL;
|
||||
$prompt=Aastra_get_label('(H)',$this->_language).' ';
|
||||
}
|
||||
if (!Aastra_test_phone_version('2.0.1.',1)) $menu->addEntry($prompt.$myrecord['home'], $URLprefix.$myrecord['homeDigits'], $myrecord['officeDigits'], $iconIndex, $myrecord['homeDigits']);
|
||||
else $menu->addEntry($prompt.$myrecord['home'], $URLprefix.$myrecord['homeDigits'], $myrecord['officeDigits']);
|
||||
}
|
||||
|
||||
# Softkeys
|
||||
$nb_softkeys=Aastra_number_physical_softkeys_supported();
|
||||
if ($nb_softkeys)
|
||||
{
|
||||
if ($nb_softkeys==4)
|
||||
{
|
||||
# 6867i
|
||||
if (!Aastra_test_phone_version('2.0.1.',1)) $dialKeyType = 'SoftKey:Dial2';
|
||||
else $dialKeyType = 'SoftKey:Dial';
|
||||
$menu->addSoftkey(1, Aastra_get_label('Dial',$this->_language), $dialKeyType);
|
||||
$menu->addSoftkey(3, Aastra_get_label('Back',$this->_language), $this->_scrollHandlerReference.'&listPage='.$recentPage.'&recentSelection='.$recentSelection);
|
||||
$menu->addSoftkey(4, Aastra_get_label('Exit',$this->_language), 'SoftKey:Exit');
|
||||
|
||||
# Check if speed dial URL is set
|
||||
if (isset($myrecord['speedURL'])) $menu->addSoftkey(2, Aastra_get_label('Add to Speed Dial',$this->_language), $myrecord['speedURL']);
|
||||
}
|
||||
else if ($nb_softkeys==6)
|
||||
{
|
||||
# Regular phone with 6 softkeys
|
||||
if (!Aastra_test_phone_version('2.0.1.',1)) $dialKeyType = 'SoftKey:Dial2';
|
||||
else $dialKeyType = 'SoftKey:Dial';
|
||||
$menu->addSoftkey(1, Aastra_get_label('Dial',$this->_language), $dialKeyType);
|
||||
$menu->addSoftkey(3, Aastra_get_label('Back',$this->_language), $this->_scrollHandlerReference.'&listPage='.$recentPage.'&recentSelection='.$recentSelection);
|
||||
$menu->addSoftkey(6, Aastra_get_label('Exit',$this->_language), 'SoftKey:Exit');
|
||||
|
||||
# Check if speed dial URL is set
|
||||
if (isset($myrecord['speedURL'])) $menu->addSoftkey(4, Aastra_get_label('Add to Speed Dial',$this->_language), $myrecord['speedURL']);
|
||||
}
|
||||
else
|
||||
{
|
||||
# 6739i
|
||||
$menu->addSoftkey(9, Aastra_get_label('Back',$this->_language), $this->_scrollHandlerReference.'&listPage='.$recentPage.'&recentSelection='.$recentSelection,8);
|
||||
$menu->addSoftkey(10, Aastra_get_label('Exit',$this->_language), 'SoftKey:Exit',9);
|
||||
|
||||
# Check if speed dial URL is set
|
||||
if (isset($myrecord['speedURL'])) $menu->addSoftkey(6, Aastra_get_label('+Speed',$this->_language), $myrecord['speedURL']);
|
||||
}
|
||||
}
|
||||
|
||||
# Icons
|
||||
if(Aastra_is_icons_supported())
|
||||
{
|
||||
if(Aastra_phone_type()!=5)
|
||||
{
|
||||
$menu->addIcon(10,Aastra_get_custom_icon('Office'));
|
||||
$menu->addIcon(11,Aastra_get_custom_icon('Cellphone'));
|
||||
$menu->addIcon(12,Aastra_get_custom_icon('Home'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu->addIcon(8,'Icon:ArrowLeft');
|
||||
$menu->addIcon(9,'Icon:CircleRed');
|
||||
$menu->addIcon(10,'Icon:Office');
|
||||
$menu->addIcon(11,'Icon:CellPhone');
|
||||
$menu->addIcon(12,'Icon:Home');
|
||||
}
|
||||
}
|
||||
|
||||
# Cancel action
|
||||
$menu->setCancelAction($this->_scrollHandlerReference.'&listPage='.$recentPage.'&recentSelection='.$recentSelection);
|
||||
|
||||
# Display XML object
|
||||
$menu->output();
|
||||
}
|
||||
|
||||
function _setupSoftKeys()
|
||||
{
|
||||
# Check if softkeys and the Dial2 softkey is supported. Don't put dial key on 6739i
|
||||
if (Aastra_is_softkeys_supported() && !Aastra_test_phone_version('2.0.1.',1) && Aastra_phone_type()!=5) $this->addSoftkey($this->_dialKeyPosition, Aastra_get_label('Dial',$this->_language), 'SoftKey:Dial2');
|
||||
parent::_setupSoftKeys();
|
||||
}
|
||||
|
||||
function setDialKeyPosition($position)
|
||||
{
|
||||
$this->_dialKeyPosition = $position;
|
||||
}
|
||||
|
||||
function setNameDisplayFormat($format)
|
||||
{
|
||||
$this->_nameDisplayFormat = $format;
|
||||
}
|
||||
|
||||
function natsortByLastname()
|
||||
{
|
||||
if (empty($this->_list)) return;
|
||||
$tmpary = array();
|
||||
foreach ($this->_list as $id => $entry) $tmpary[$id] = $entry['lastname'];
|
||||
natsort($tmpary);
|
||||
foreach ($tmpary as $key => $valude) $new[] = $this->_list[$key];
|
||||
$this->_list = $new;
|
||||
}
|
||||
|
||||
function natsortByFirstname()
|
||||
{
|
||||
if (empty($this->_list)) return;
|
||||
$tmpary = array();
|
||||
foreach ($this->_list as $id => $entry) $tmpary[$id] = $entry['firstname'];
|
||||
natsort($tmpary);
|
||||
foreach ($tmpary as $key => $valude) $new[] = $this->_list[$key];
|
||||
$this->_list = $new;
|
||||
}
|
||||
}
|
||||
?>
|
383
php_classes/AastraIPPhoneScrollableTextMenu.class.php
Normal file
383
php_classes/AastraIPPhoneScrollableTextMenu.class.php
Normal file
@ -0,0 +1,383 @@
|
||||
<?php
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneScrollableTextMenu
|
||||
#
|
||||
# Aastra SIP Phones 1.4.2 or better
|
||||
#
|
||||
# Copyright 2009-2011 Aastra Telecom Ltd
|
||||
#
|
||||
# Supported Aastra Phones
|
||||
# All IP phones except Aastra9112i and Aastra9133i
|
||||
#
|
||||
# AastraIPPhoneScrollableTextMenu object.
|
||||
#
|
||||
# Public methods
|
||||
# setEntries(entries) Set entries of the list by 2 dim array. Inner array field names: 'name', 'url', 'selection', 'icon', 'dial'
|
||||
# verifyCookie(cookie) Verifies if the cookie of the HTTP requests matches the cookie of the saved context.
|
||||
# setBackURI(URI) Set the cancel parameter with the URI to be called on Cancel or Back Softkey (optional)
|
||||
# setBackKeyPosition(position) Set position of Back Softkey. Default is 3.
|
||||
# setNextKeyPosition(position) Set position of Next Softkey. Default is 4.
|
||||
# setPreviousKeyPosition(position) Set position of Previous Softkey. Default is 5.
|
||||
# setExitKeyPosition(position) Set position of Back Softkey. Default is 6.
|
||||
# setSelectKeyPosition(position) Set position of Back Softkey. Default is 1.
|
||||
# setNextKeyIcon(icon) Set icon of Next Softkey. Default is Icon:TailArrowDown. Set NULL to disable icon.
|
||||
# setPreviousKeyIcon(icon) Set icon of Previous Softkey. Default is Icon:TailArrowUp. Set NULL to disable icon.
|
||||
# disableExitKey() Disable the Exit Softkey
|
||||
# setSelectKeyLabel(label) Set the label of the Select Softkey. Default is 'Select'. Make sure the string is in language.ini.
|
||||
#
|
||||
# Overwritten methods from AastraIPPhoneTextMenu
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel or Back Softkey (optional)
|
||||
# output() to display the object
|
||||
# addEntry(name,url,selection,icon,dial) to add an element in the list to be displayed
|
||||
# natsortbyname() to order the list
|
||||
#
|
||||
# Inherited from AastraIPPhoneTextMenu
|
||||
# setTitle(Title) to setup the title of an object (optional)
|
||||
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# setDestroyOnExit() to set DestroyOnExit parameter to "yes" (optional)
|
||||
# setBeep() to enable a notification beep with the object (optional)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI (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,icon_index) to add custom softkeys to the object (optional)
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# generate() to return the object content
|
||||
# setDefaultIndex(index) to set the default selection in the list (optional)
|
||||
# setStyle(style) to set the style of the list numbered/none/radio (optional)
|
||||
# setWrapList() to allow 2 lines items (optional)
|
||||
#
|
||||
# Example 1:
|
||||
# $menu = new AastraIPPhoneScrollableTextMenu();
|
||||
# $menu->setTitle('My Menu');
|
||||
# $menu->addEntry('Choice 1', $XML_SERVER."?choice=1", '1');
|
||||
# # ... add as many entries you want
|
||||
# $menu->addEntry('Choice 100', $XML_SERVER."?choice=100", '100');
|
||||
# $menu->output(); # Page scrolling will be handled by AastraIPPhoneScrollableTextMenu
|
||||
#
|
||||
# Example 2:
|
||||
# $entries[0]['name'] = "Choice 1";
|
||||
# $entries[0]['url'] = $XML_SERVER."?choice=1";
|
||||
# $entries[0]['selection'] = "1";
|
||||
# # ... add as many entries you want
|
||||
# $entries[99]['name'] = "Choice 100";
|
||||
# $entries[99]['url'] = $XML_SERVER."?choice=100";
|
||||
# $entries[99]['selection'] = "100";
|
||||
# $menu = new AastraIPPhoneScrollableTextMenu();
|
||||
# $menu->setTitle('My Menu');
|
||||
# $menu->setEntries($entries):
|
||||
# $menu->output(); # Page scrolling will be handled by AastraIPPhoneScrollableTextMenu
|
||||
#
|
||||
########################################################################################################
|
||||
require_once('AastraCommon.php');
|
||||
require_once('AastraIPPhoneTextMenu.class.php');
|
||||
|
||||
class AastraIPPhoneScrollableTextMenu extends AastraIPPhoneTextMenu {
|
||||
|
||||
var $_language;
|
||||
var $_list = array(); # All entries of the list
|
||||
var $_count = 0; # Total number of entries
|
||||
var $_cookie; # Cookie - unique per AastraIPPhoneScrollableTextMenu instance
|
||||
var $_header;
|
||||
var $_scrollHandlerReference;
|
||||
var $_backCancelURL;
|
||||
var $_maxLines;
|
||||
var $_exitKeyDisabled;
|
||||
var $_selectKeyLabel = 'Select';
|
||||
var $_backKeyPosition = 3;
|
||||
var $_exitKeyPosition = 6;
|
||||
var $_selectKeyPosition = 1;
|
||||
var $_nextKeyPosition = 4;
|
||||
var $_previousKeyPosition = 5;
|
||||
var $_backKeyIconIndex = 8;
|
||||
var $_selectKeyIconIndex = 9;
|
||||
var $_exitKeyIconIndex = 10;
|
||||
var $_nextKeyIconIndex = 11;
|
||||
var $_previousKeyIconIndex = 12;
|
||||
var $_nextKeyIcon = 'Icon:TailArrowDown';
|
||||
var $_previousKeyIcon = 'Icon:TailArrowUp';
|
||||
|
||||
# Constructor
|
||||
function AastraIPPhoneScrollableTextMenu()
|
||||
{
|
||||
# Get Language
|
||||
$this->_language = Aastra_get_language();
|
||||
|
||||
# Decode HTTP header
|
||||
$this->_header = Aastra_decode_HTTP_header();
|
||||
|
||||
# Generate new cookie
|
||||
$this->_cookie = $this->_generateCookie();
|
||||
|
||||
# Generate Scroll Handler reference
|
||||
global $XML_HTTP, $AA_XML_SERVER, $AA_XMLDIRECTORY;
|
||||
$this->_scrollHandlerReference = $XML_HTTP.$AA_XML_SERVER."/".$AA_XMLDIRECTORY."/include/AastraIPPhoneScrollHandler.php?listCookie=".$this->_cookie;
|
||||
|
||||
# Calculate max linex
|
||||
$this->_calculateMaxLines();
|
||||
|
||||
# Modify some values for 6739i
|
||||
if(Aastra_number_softkeys_supported()==10)
|
||||
{
|
||||
$this->_exitKeyPosition = 10;
|
||||
$this->_nextKeyPosition = 8;
|
||||
$this->_previousKeyPosition = 7;
|
||||
$this->_selectKeyPosition = 3;
|
||||
}
|
||||
}
|
||||
|
||||
function addEntry($name, $url, $selection=NULL, $icon=NULL, $dial=NULL)
|
||||
{
|
||||
$entry['name'] = $name;
|
||||
$entry['url'] = $url;
|
||||
$entry['selection'] = $selection;
|
||||
$entry['icon'] = $icon;
|
||||
$entry['dial'] = $dial;
|
||||
$this->_list[] = $entry;
|
||||
}
|
||||
|
||||
function setEntries($entries)
|
||||
{
|
||||
$this->_list = $entries;
|
||||
}
|
||||
|
||||
function output($page=NULL)
|
||||
{
|
||||
# Test phone firmware / model
|
||||
Aastra_test_phone_version('1.4.2.',0);
|
||||
Aastra_test_phone_model(array('Aastra9112i','Aastra9133i'),False,0);
|
||||
|
||||
# Force destroyOnExit
|
||||
$this->_destroyOnExit = 'yes';
|
||||
|
||||
# Initial call?
|
||||
if (!isset($page))
|
||||
{
|
||||
# Count number of entries in list
|
||||
$this->_count = count($this->_list);
|
||||
|
||||
# Setup icons
|
||||
$this->_setupIcons();
|
||||
|
||||
# Setup Softkeys
|
||||
$this->_setupSoftKeys();
|
||||
|
||||
# Set Cancel URI
|
||||
if (!empty($this->_backCancelURL)) parent::setCancelAction($this->_backCancelURL);
|
||||
|
||||
# Do some security / compliancy checks
|
||||
# Protect against wrap list bug in FW < R2.4.0
|
||||
if (Aastra_test_phone_version('2.4.0.',1)) $this->_wraplist = 'no';
|
||||
if (!Aastra_is_wrap_title_supported())$this->_wraplist = 'no';
|
||||
if (!Aastra_is_textmenu_wrapitem_supported()) $this->_title_wrap = 'no';
|
||||
if (!Aastra_is_style_textmenu_supported()) $this->_style = '';
|
||||
if (!Aastra_is_lockin_supported()) $this->_lockin = 'no';
|
||||
|
||||
# Save object in user context (context = mac address)
|
||||
Aastra_save_user_context($this->_header['mac'],'scrollableTextMenuData',$this);
|
||||
}
|
||||
else
|
||||
{
|
||||
# If beep is set, only beep during initial call
|
||||
$this->_beep='no';
|
||||
}
|
||||
|
||||
# Generate the actual items of the menu for the given page
|
||||
$this->_generatePage($page);
|
||||
parent::output();
|
||||
}
|
||||
|
||||
function _generatePage($page)
|
||||
{
|
||||
# Empty List protection (to avoid 'cannot display')
|
||||
if ($this->_count==0)
|
||||
{
|
||||
$tmpEntry['name'] = '[NO ENTRIES]';
|
||||
$this->_list[] = $tmpEntry;
|
||||
$this->_count++;
|
||||
}
|
||||
|
||||
# Calculate total number of pages
|
||||
$last = ceil($this->_count / $this->_maxLines);
|
||||
|
||||
# Invalid page protection
|
||||
if (empty($page) or $page < 1) $page = 1;
|
||||
if ($page > $last) $page = $last;
|
||||
|
||||
# On phones without softkeys: Add dummy entry that allows to jump to previous page
|
||||
if (!Aastra_is_softkeys_supported() && ($page > 1 && $last > 1)) $this->_entries[] = new AastraIPPhoneTextMenuEntry('['.Aastra_get_label('Previous Page',$this->_language).']', $this->_scrollHandlerReference.'&listPage='.($page-1), NULL, NULL, NULL, NULL,NULL);
|
||||
|
||||
# Populate list for current page
|
||||
for ($i = 0; ($i < $this->_maxLines and ($i + (($page - 1) * $this->_maxLines)) < $this->_count); $i++)
|
||||
{
|
||||
# Get entry from list
|
||||
$tmpEntry = $this->_list[$i + (($page - 1) * $this->_maxLines)];
|
||||
|
||||
# Add 'recentSelection' and 'recentPage' attribute to URL of the entry.
|
||||
# Allows to jump back to same page / selection
|
||||
$tmpURI = $tmpEntry['url'];
|
||||
|
||||
# Check if URI is an HTTP(S) URL (could also be an URI like Dial:1234)
|
||||
if (preg_match('/^http/i',$tmpURI))
|
||||
{
|
||||
# Check if URL already contains parameters
|
||||
if (preg_match('/\?/',$tmpURI)) $tmpEntry['url'] = $tmpEntry['url'].'&recentSelection='.($i+1).'&recentPage='.$page;
|
||||
else $tmpEntry['url'] = $tmpEntry['url'].'?recentSelection='.($i+1).'&recentPage='.$page;
|
||||
}
|
||||
|
||||
# Make sure we don't add menu items the phone firmware cannot handle
|
||||
if (!Aastra_is_icons_supported()) $tmpEntry['icon'] = NULL;
|
||||
if (Aastra_test_phone_version('2.0.1.',1)) $tmpEntry['dial'] = NULL;
|
||||
$this->_entries[] = new AastraIPPhoneTextMenuEntry($tmpEntry['name'], $tmpEntry['url'], $tmpEntry['selection'], $tmpEntry['icon'], $tmpEntry['dial'], NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
# On phones without softkeys: Add dummy entry that allows to jump to next page
|
||||
if (!Aastra_is_softkeys_supported() && ($page < $last)) $this->_entries[] = new AastraIPPhoneTextMenuEntry('['.Aastra_get_label('Next Page',$this->_language).']', $this->_scrollHandlerReference.'&listPage='.($page+1), NULL, NULL, NULL, NULL,NULL);
|
||||
|
||||
# On phones with softkeys:Add Next/Previous Softkeys
|
||||
if(Aastra_is_softkeys_supported())
|
||||
{
|
||||
if ($page < $last)
|
||||
{
|
||||
# Add Next key
|
||||
if (Aastra_is_icons_supported() && !empty($this->_nextKeyIcon)) $this->addSoftkey($this->_nextKeyPosition, Aastra_get_label('Next',$this->_language), $this->_scrollHandlerReference.'&listPage='.($page+1), $this->_nextKeyIconIndex);
|
||||
else $this->addSoftkey($this->_nextKeyPosition, Aastra_get_label('Next',$this->_language), $this->_scrollHandlerReference.'&listPage='.($page+1));
|
||||
}
|
||||
if ($page > 1 && $last > 1)
|
||||
{
|
||||
# Add Previous key
|
||||
if (Aastra_is_icons_supported() && !empty($this->_previousKeyIcon)) $this->addSoftkey($this->_previousKeyPosition, Aastra_get_label('Previous',$this->_language), $this->_scrollHandlerReference.'&listPage='.($page-1), $this->_previousKeyIconIndex);
|
||||
else $this->addSoftkey($this->_previousKeyPosition, Aastra_get_label('Previous',$this->_language), $this->_scrollHandlerReference.'&listPage='.($page-1));
|
||||
}
|
||||
}
|
||||
|
||||
# Add page info to title
|
||||
if ($last > 1)
|
||||
{
|
||||
# For phones with big screen
|
||||
if (Aastra_is_softkeys_supported()) $this->_title = $this->_title.' ('.Aastra_get_label('Pg.',$this->_language).' '.$page.'/'.$last.')';
|
||||
# For 3 line phones
|
||||
else $this->_title = $this->_title.' ('.$page.'/'.$last.')';
|
||||
}
|
||||
}
|
||||
|
||||
function _calculateMaxLines()
|
||||
{
|
||||
$this->_maxLines = Aastra_max_items_textmenu();
|
||||
if(!Aastra_is_softkeys_supported()) $this->_maxLines = $this->_maxLines - 2;
|
||||
}
|
||||
|
||||
function _setupIcons()
|
||||
{
|
||||
if (Aastra_is_icons_supported())
|
||||
{
|
||||
$this->addIcon($this->_nextKeyIconIndex, $this->_nextKeyIcon);
|
||||
$this->addIcon($this->_previousKeyIconIndex, $this->_previousKeyIcon);
|
||||
if(Aastra_phone_type()==5)
|
||||
{
|
||||
# 6739i
|
||||
$this->addIcon($this->_backKeyIconIndex,'Icon:ArrowLeft');
|
||||
$this->addIcon($this->_selectKeyIconIndex,'Icon:Information');
|
||||
$this->addIcon($this->_exitKeyIconIndex,'Icon:CircleRed');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _setupSoftKeys()
|
||||
{
|
||||
if (Aastra_is_softkeys_supported())
|
||||
{
|
||||
if(Aastra_phone_type()!=5)
|
||||
{
|
||||
# non 6739i
|
||||
$this->addSoftkey($this->_selectKeyPosition, Aastra_get_label($this->_selectKeyLabel,$this->_language), 'SoftKey:Select');
|
||||
if (!$this->_exitKeyDisabled) $this->addSoftkey($this->_exitKeyPosition, Aastra_get_label('Exit',$this->_language), 'SoftKey:Exit');
|
||||
if (!empty($this->_backCancelURL)) $this->addSoftkey($this->_backKeyPosition, Aastra_get_label('Back',$this->_language), $this->_backCancelURL);
|
||||
}
|
||||
else
|
||||
{
|
||||
# 6739i SoftKey:Select not yet supported
|
||||
#$this->addSoftkey($this->_selectKeyPosition, Aastra_get_label($this->_selectKeyLabel,$this->_language), 'SoftKey:Select',$this->_selectKeyIconIndex);
|
||||
if (!$this->_exitKeyDisabled) $this->addSoftkey($this->_exitKeyPosition, Aastra_get_label('Exit',$this->_language), 'SoftKey:Exit',$this->_exitKeyIconIndex);
|
||||
if (!empty($this->_backCancelURL)) $this->addSoftkey($this->_backKeyPosition, Aastra_get_label('Back',$this->_language), $this->_backCancelURL,$this->_backKeyIconIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _generateCookie()
|
||||
{
|
||||
return md5(time().rand());
|
||||
}
|
||||
|
||||
function verifyCookie($cookie)
|
||||
{
|
||||
return ($this->_cookie == $cookie);
|
||||
}
|
||||
|
||||
function setBackURI($URI)
|
||||
{
|
||||
$this->_backCancelURL = $URI;
|
||||
}
|
||||
|
||||
function setBackKeyPosition($position)
|
||||
{
|
||||
$this->_backKeyPosition = $position;
|
||||
}
|
||||
|
||||
function setNextKeyPosition($position)
|
||||
{
|
||||
$this->_nextKeyPosition = $position;
|
||||
}
|
||||
|
||||
function setPreviousKeyPosition($position)
|
||||
{
|
||||
$this->_previousKeyPosition = $position;
|
||||
}
|
||||
|
||||
function setExitKeyPosition($position)
|
||||
{
|
||||
$this->_exitKeyPosition = $position;
|
||||
}
|
||||
|
||||
function setSelectKeyPosition($position)
|
||||
{
|
||||
$this->_selectKeyPosition = $position;
|
||||
}
|
||||
|
||||
function setNextKeyIcon($icon=NULL)
|
||||
{
|
||||
$this->_nextKeyIcon = $icon;
|
||||
}
|
||||
|
||||
function setPreviousKeyIcon($icon=NULL)
|
||||
{
|
||||
$this->_previousKeyIcon = $icon;
|
||||
}
|
||||
|
||||
function disableExitKey()
|
||||
{
|
||||
$this->_exitKeyDisabled = 1;
|
||||
}
|
||||
|
||||
function setSelectKeyLabel($label)
|
||||
{
|
||||
$this->_selectKeyLabel = $label;
|
||||
}
|
||||
|
||||
function setCancelAction($cancelAction)
|
||||
{
|
||||
$this->_backCancelURL = $cancelAction;
|
||||
}
|
||||
|
||||
function natsortByName()
|
||||
{
|
||||
if (empty($this->_list)) return;
|
||||
$tmpary = array();
|
||||
foreach ($this->_list as $id => $entry) $tmpary[$id] = $entry['name'];
|
||||
natsort($tmpary);
|
||||
foreach ($tmpary as $key => $value) $new[] = $this->_list[$key];
|
||||
$this->_list = $new;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneSoftkeyEntry
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# Internal class for AastraIPPhone object.
|
||||
################################################################################
|
||||
@ -13,21 +12,26 @@ class AastraIPPhoneSoftkeyEntry {
|
||||
var $_label;
|
||||
var $_uri;
|
||||
var $_icon;
|
||||
var $_color;
|
||||
|
||||
function AastraIPPhoneSoftkeyEntry($index, $label, $uri, $icon)
|
||||
function AastraIPPhoneSoftkeyEntry($index, $label, $uri, $icon, $color)
|
||||
{
|
||||
$this->_index = $index;
|
||||
$this->_label = $label;
|
||||
$this->_uri = $uri;
|
||||
$this->_icon = $icon;
|
||||
$this->_color = $color;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$xml = "<SoftKey index=\"".$this->_index."\"";
|
||||
$index=$this->_index;
|
||||
$xml = "<SoftKey index=\"".$index."\"";
|
||||
if($this->_icon!=NULL) $xml.= " icon=\"".$this->_icon."\"";
|
||||
$xml .= ">\n";
|
||||
$xml .= "<Label>".$this->_label."</Label>\n";
|
||||
$xml .= "<Label";
|
||||
if($this->_color!='') $xml.= " Color=\"".$this->_color."\"";
|
||||
$xml .=">".$this->_label."</Label>\n";
|
||||
$xml .= "<URI>".$this->_uri."</URI>\n";
|
||||
$xml .= "</SoftKey>\n";
|
||||
return($xml);
|
||||
|
@ -1,24 +1,31 @@
|
||||
<?php
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneStatus
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2006-2010
|
||||
#
|
||||
# AastraIPPhoneStatus object.
|
||||
#
|
||||
# Public methods
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# output() to display the object
|
||||
# generate() to return the object content
|
||||
# setBeep() to enable a notification beep with the object (optional)
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# setSession(session) to setup the session ID
|
||||
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to
|
||||
# "yes" (optional)
|
||||
# addEntry(index,message,type,timeout) to add a message to be displayed
|
||||
# on the idle screen.
|
||||
# @session string
|
||||
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to "yes" (optional)
|
||||
# addEntry(index,message,type,timeout,uri,icon,color) to add a message to be displayed on the idle screen.
|
||||
# @index integer
|
||||
# @message string
|
||||
# @type enum ("alert","icon") optional
|
||||
# @timeout integer (seconds) optional
|
||||
# @uri uri to call when message/alert pressed optional, only for 6739i
|
||||
# @icon icon index 6739i only, optional
|
||||
# @color label color, 6739i only, optional
|
||||
#
|
||||
# Example
|
||||
# require_once('AastraIPPhoneStatus.class.php');
|
||||
@ -48,21 +55,55 @@ class AastraIPPhoneStatus extends AastraIPPhone {
|
||||
$this->_triggerDestroyOnExit="yes";
|
||||
}
|
||||
|
||||
function addEntry($index, $message, $type='', $timeout=NULL)
|
||||
function addEntry($index, $message, $type='', $timeout=NULL, $uri='', $icon=0, $color='')
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneStatusEntry($index, $message, $type, $timeout);
|
||||
$this->_entries[] = new AastraIPPhoneStatusEntry($index, $message, $type, $timeout, $uri, $icon, $color);
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$session = $this->escape($this->_session);
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneStatus";
|
||||
|
||||
# Beep
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
|
||||
# TriggerDestroyOnExit
|
||||
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
|
||||
# Session
|
||||
$session = $this->escape($this->_session);
|
||||
$out .= "<Session>".$session."</Session>\n";
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
|
||||
# Status Items
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons))
|
||||
{
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon)
|
||||
{
|
||||
if(!$IconList)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End tag
|
||||
$out .= "</AastraIPPhoneStatus>\n";
|
||||
|
||||
# Return XML object
|
||||
return($out);
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneStatusEntry
|
||||
# Firmware 1.4.1 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2007-2010
|
||||
#
|
||||
# Internal class for AastraIPPhoneStatus object.
|
||||
################################################################################
|
||||
@ -11,53 +9,41 @@
|
||||
class AastraIPPhoneStatusEntry extends AastraIPPhone {
|
||||
var $_index;
|
||||
var $_message;
|
||||
var $_type='';
|
||||
var $_timeout=0;
|
||||
var $_type='';
|
||||
var $_timeout=0;
|
||||
var $_uri='';
|
||||
var $_color='';
|
||||
var $_icon=0;
|
||||
|
||||
function AastraIPPhoneStatusEntry($index, $message, $type='', $timeout=NULL)
|
||||
{
|
||||
$this->setIndex($index);
|
||||
$this->setMessage($message);
|
||||
$this->setType($type);
|
||||
$this->setTimeout($timeout);
|
||||
|
||||
}
|
||||
|
||||
function setIndex($index)
|
||||
function AastraIPPhoneStatusEntry($index, $message, $type='', $timeout=NULL, $uri='', $icon=0, $color)
|
||||
{
|
||||
$this->_index = $index;
|
||||
}
|
||||
|
||||
function setMessage($message)
|
||||
{
|
||||
$this->_message = $message;
|
||||
}
|
||||
|
||||
function setType($type)
|
||||
{
|
||||
$this->_message = $this->convert_high_ascii($message);
|
||||
$this->_type = $type;
|
||||
}
|
||||
|
||||
function setTimeout($timeout)
|
||||
{
|
||||
$this->_timeout = $timeout;
|
||||
$this->_uri = $uri;
|
||||
$this->_icon = $icon;
|
||||
$this->_color = $color;
|
||||
}
|
||||
|
||||
|
||||
function render()
|
||||
{
|
||||
$index = $this->escape($this->_index);
|
||||
$message = $this->escape($this->_message);
|
||||
$type = $this->escape($this->_type);
|
||||
$timeout = $this->_timeout;
|
||||
$uri = $this->escape($this->_uri);
|
||||
$xml = "<Message index=\"{$index}\"";
|
||||
if ($this->_color!='') $xml .= " Color=\"{$this->_color}\"";
|
||||
if ($type!='')
|
||||
{
|
||||
$xml .= " type=\"{$type}\"";
|
||||
if ($timeout!=NULL) $xml .= " Timeout=\"{$timeout}\"";
|
||||
}
|
||||
if ($uri!='') $xml .= " URI=\"{$uri}\"";
|
||||
if($this->_icon!=0) $xml .= " icon=\"{$this->_icon}\"";
|
||||
$xml .= ">{$message}</Message>\n";
|
||||
return($xml);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneTextMenu
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# AastraIPPhoneTextMenu object.
|
||||
#
|
||||
@ -10,25 +9,67 @@
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setTitle(Title) to setup the title of an object (optional)
|
||||
# @title string
|
||||
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
|
||||
# setDestroyOnExit() to set DestroyOnExit parameter to "yes" (optional)
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (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)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setLockInCall() to set the Lock-in tag to 'call' (optional)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
|
||||
# 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)
|
||||
# @timeout integer (seconds)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon_index integer, icon number
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# generate() to return the object content
|
||||
# output() to display the object
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# setDefaultIndex(index) to set the default selection in the list (optional)
|
||||
# setStyle(style) to set the style of the list numbered/none/radio (optional)
|
||||
# addEntry(name,url,selection,icon,dial) to add an element in the list to be displayed, at
|
||||
# least one is needed.
|
||||
# natsortbyname() to order the list
|
||||
# @index index (1-30)
|
||||
# setStyle(style) to set the style of the list (optional)
|
||||
# @style enum (numbered/none/radio)
|
||||
# setWrapList() to allow 2 lines items (optional)
|
||||
# setScrollConstrain() to avoid the list to wrap
|
||||
# setNumberLaunch() to allow number selection
|
||||
# setBase(base) to configure the menuItem base URI
|
||||
# @base string
|
||||
# resetBase() to reset the menuItem base URI
|
||||
# addEntry(name,url,selection,icon,dial,line,color,split) to add an element in the list to be displayed
|
||||
# @name string or array(0=>Line1,1=>Line2,2=>Offset,3=>Char,4=>Mode)
|
||||
# @url string
|
||||
# @selection string (optional)
|
||||
# @icon integer (optional)
|
||||
# @dial string, phone number to dial (optional)
|
||||
# @line integer, SIP line to use (optional)
|
||||
# @color string, "red", "black", ... (optional)
|
||||
# @split integer, position of the split between line 1 and line 2 (optional)
|
||||
# setScrollUp(uri) to set the URI to be called when the user presses the Up arrow (optional)
|
||||
# @uri string
|
||||
# setScrollDown(uri) to set the URI to be called when the user presses the Down arrow (optional)
|
||||
# @uri string
|
||||
# setUnitScroll() to set the unitScroll tag to yes which changes the scrolling behavior on the 6739i (optional and 6739i only)
|
||||
# natsortbyname() to order the list, must not be use in conjunction with setBase or resetBase
|
||||
#
|
||||
# Example 1
|
||||
# require_once('AastraIPPhoneTextMenu.class.php');
|
||||
@ -62,13 +103,19 @@
|
||||
# $menu->output();
|
||||
#
|
||||
########################################################################################################
|
||||
|
||||
require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneTextMenuEntry.class.php');
|
||||
|
||||
class AastraIPPhoneTextMenu extends AastraIPPhone {
|
||||
var $_defaultIndex="";
|
||||
var $_style="";
|
||||
var $_defaultIndex='';
|
||||
var $_style='';
|
||||
var $_wraplist='';
|
||||
var $_maxitems='30';
|
||||
var $_scrollConstrain='';
|
||||
var $_numberLaunch='';
|
||||
var $_scrollUp='';
|
||||
var $_scrollDown='';
|
||||
var $_unitScroll='';
|
||||
|
||||
function setDefaultIndex($defaultIndex)
|
||||
{
|
||||
@ -80,65 +127,197 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
|
||||
$this->_style = $style;
|
||||
}
|
||||
|
||||
function addEntry($name, $url, $selection=NULL, $icon=NULL, $dial=NULL)
|
||||
function addEntry($name, $url, $selection=NULL, $icon=NULL, $dial=NULL, $line=NULL, $color='', $split=NULL)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial);
|
||||
if(!Aastra_is_icons_supported()) $icon=NULL;
|
||||
$this->_entries[] = new AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial, $line, $color, $split, NULL);
|
||||
}
|
||||
|
||||
function setBase($base)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneTextMenuEntry(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $base);
|
||||
}
|
||||
|
||||
function resetBase()
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneTextMenuEntry(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'AASTRA_RESETBASE');
|
||||
}
|
||||
|
||||
function setWrapList()
|
||||
{
|
||||
$this->_wraplist = 'yes';
|
||||
}
|
||||
|
||||
function setScrollConstrain()
|
||||
{
|
||||
$this->_scrollConstrain = 'yes';
|
||||
}
|
||||
|
||||
function setUnitScroll()
|
||||
{
|
||||
$this->_unitScroll = 'yes';
|
||||
}
|
||||
|
||||
function setNumberLaunch()
|
||||
{
|
||||
$this->_numberLaunch = 'yes';
|
||||
}
|
||||
|
||||
function setScrollUp($uri)
|
||||
{
|
||||
$this->_scrollUp = $uri;
|
||||
}
|
||||
|
||||
function setScrollDown($uri)
|
||||
{
|
||||
$this->_scrollDown = $uri;
|
||||
}
|
||||
|
||||
function natsortByName()
|
||||
{
|
||||
$tmpary = array();
|
||||
foreach ($this->_entries as $id => $entry) {
|
||||
$tmpary[$id] = $entry->getName();
|
||||
}
|
||||
foreach ($this->_entries as $id => $entry) $tmpary[$id] = $entry->getName();
|
||||
natsort($tmpary);
|
||||
foreach ($tmpary as $id => $name) {
|
||||
$newele[] = $this->_entries[$id];
|
||||
}
|
||||
foreach ($tmpary as $id => $name) $newele[] = $this->_entries[$id];
|
||||
$this->_entries = $newele;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneTextMenu";
|
||||
|
||||
# DestroyOnExit
|
||||
if ($this->_destroyOnExit=='yes') $out .= " destroyOnExit=\"yes\"";
|
||||
|
||||
# CancelAction
|
||||
if($this->_cancelAction != "")
|
||||
{
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
|
||||
# DefaultIndex
|
||||
if ($this->_defaultIndex!="") $out .= " defaultIndex=\"{$this->_defaultIndex}\"";
|
||||
|
||||
# Style
|
||||
if ($this->_style!='') $out .= " style=\"{$this->_style}\"";
|
||||
|
||||
# Beep
|
||||
if ($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
if ($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
|
||||
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# Lockin
|
||||
if($this->_lockin!='') {
|
||||
$out .= " LockIn=\"{$this->_lockin}\"";
|
||||
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
|
||||
}
|
||||
|
||||
# WrapList
|
||||
if ($this->_wraplist=='yes') $out .= " wrapList=\"yes\"";
|
||||
|
||||
# AllowAnswer
|
||||
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# AllowDrop
|
||||
if ($this->_allowDrop == 'yes') $out .= " allowDrop=\"yes\"";
|
||||
|
||||
# AllowXfer
|
||||
if ($this->_allowXfer == 'yes') $out .= " allowXfer=\"yes\"";
|
||||
|
||||
# AllowConf
|
||||
if ($this->_allowConf == 'yes') $out .= " allowConf=\"yes\"";
|
||||
|
||||
# Timeout
|
||||
if ($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
|
||||
# Prevent list wrap
|
||||
if ($this->_scrollConstrain == 'yes') $out .= " scrollConstrain=\"yes\"";
|
||||
|
||||
# Number selection
|
||||
if ($this->_numberLaunch == 'yes') $out .= " numberLaunch=\"yes\"";
|
||||
|
||||
# Scrolls up/down
|
||||
if($this->_scrollUp!='') $out .= " scrollUp=\"".$this->escape($this->_scrollUp)."\"";
|
||||
if($this->_scrollDown!='') $out .= " scrollDown=\"".$this->escape($this->_scrollDown)."\"";
|
||||
|
||||
# Unit scroll (6739i)
|
||||
if ($this->_unitScroll == 'yes') $out .= " unitScroll=\"yes\"";
|
||||
|
||||
# Background color(6739i)
|
||||
if ($this->_bcolor != '') $out .= " Bcolor=\"{$this->_bcolor}\"";
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
|
||||
# Title
|
||||
if ($this->_title!='')
|
||||
{
|
||||
$title = $this->escape($this->_title);
|
||||
$out .= "<Title";
|
||||
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
|
||||
if ($this->_title_color!='') $out .= " Color=\"{$this->_title_color}\"";
|
||||
$out .= ">".$title."</Title>\n";
|
||||
}
|
||||
$index=0;
|
||||
foreach ($this->_entries as $entry) {
|
||||
if($index<15) $out .= $entry->render();
|
||||
$index++;
|
||||
}
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
$IconList=0;
|
||||
foreach ($this->_icons as $icon)
|
||||
|
||||
# Top Title
|
||||
if ($this->_toptitle!='')
|
||||
{
|
||||
if($IconList==0)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=1;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
$toptitle = $this->escape($this->_toptitle);
|
||||
$out .= "<TopTitle";
|
||||
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
|
||||
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
|
||||
$out .= ">".$toptitle."</TopTitle>\n";
|
||||
}
|
||||
if($IconList!=0) $out .= "</IconList>\n";
|
||||
|
||||
# Menu items
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
$index=0;
|
||||
$base=NULL;
|
||||
$length=Aastra_size_display_line();
|
||||
$is_softkeys=Aastra_is_softkeys_supported();
|
||||
foreach ($this->_entries as $entry)
|
||||
{
|
||||
if($entry->getBase()!=NULL) $base=$entry->getBase();
|
||||
else
|
||||
{
|
||||
if($base!=NULL)
|
||||
{
|
||||
if($index<$this->_maxitems) $out .= $entry->render($this->_style,$length,$is_softkeys,$base);
|
||||
$base=NULL;
|
||||
}
|
||||
else if($index<$this->_maxitems) $out .= $entry->render($this->_style,$length,$is_softkeys);
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Softkeys
|
||||
if (isset($this->_softkeys) && is_array($this->_softkeys))
|
||||
{
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons))
|
||||
{
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon)
|
||||
{
|
||||
if(!$IconList)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End Tag
|
||||
$out .= "</AastraIPPhoneTextMenu>\n";
|
||||
|
||||
# Return XML object
|
||||
return($out);
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneTextMenuEntry
|
||||
# Firmware 2.0 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# Internal class for AastraIPPhoneTextMenu object.
|
||||
################################################################################
|
||||
@ -14,14 +12,22 @@ class AastraIPPhoneTextMenuEntry extends AastraIPPhone {
|
||||
var $_selection;
|
||||
var $_icon;
|
||||
var $_dial;
|
||||
var $_line;
|
||||
var $_base;
|
||||
var $_split;
|
||||
var $_color;
|
||||
|
||||
function AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial)
|
||||
function AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial, $line, $color, $split, $base)
|
||||
{
|
||||
$this->_name=$name;
|
||||
$this->_url=$url;
|
||||
$this->_selection=$selection;
|
||||
$this->_icon=$icon;
|
||||
$this->_dial=$dial;
|
||||
$this->_line=$line;
|
||||
$this->_split=$split;
|
||||
$this->_color=$color;
|
||||
$this->_base=$base;
|
||||
}
|
||||
|
||||
function getName()
|
||||
@ -29,18 +35,122 @@ class AastraIPPhoneTextMenuEntry extends AastraIPPhone {
|
||||
return($this->_name);
|
||||
}
|
||||
|
||||
function render()
|
||||
function getBase()
|
||||
{
|
||||
$name = $this->escape($this->_name);
|
||||
return($this->_base);
|
||||
}
|
||||
|
||||
function format_line($array_name,$style,$length,$is_softkeys)
|
||||
{
|
||||
# Retrieve parameters
|
||||
$line1=$array_name[0];
|
||||
$line2=$array_name[1];
|
||||
$offset=$array_name[2];
|
||||
$char=$array_name[3];
|
||||
if($char==' ') $char=chr(0xa0);
|
||||
$mode=$array_name[4];
|
||||
if($mode=='') $mode='left';
|
||||
|
||||
# Adjust with the style if softkey phone
|
||||
if($is_softkeys)
|
||||
{
|
||||
switch($style)
|
||||
{
|
||||
case 'none':
|
||||
case 'radio':
|
||||
$length--;
|
||||
break;
|
||||
default:
|
||||
$length-=4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Unbreakable space
|
||||
$nbsp=chr(0xa0);
|
||||
|
||||
# Pad the the first line with regular spaces
|
||||
switch($mode)
|
||||
{
|
||||
case 'center':
|
||||
$line=str_pad($line1,$length-1-$offset,$char,STR_PAD_BOTH);
|
||||
break;
|
||||
case 'right':
|
||||
$line=str_pad($line1,$length-1-$offset,$char,STR_PAD_LEFT);
|
||||
break;
|
||||
default:
|
||||
$line=str_pad($line1,$length-1-$offset,$char,STR_PAD_RIGHT);
|
||||
break;
|
||||
}
|
||||
|
||||
# Crop the line to the correct length (-1 for wrap-space)
|
||||
$line=substr($line,0,($length-1-$offset));
|
||||
|
||||
# Append a space so it can wrap to line two, and two non-break spaces to pad below the icon
|
||||
if($line2!='')
|
||||
{
|
||||
$line.=' '.str_repeat($nbsp,$offset);
|
||||
switch($mode)
|
||||
{
|
||||
case 'center':
|
||||
if($char==chr(0xa0)) $line.=str_repeat($char,($length-$offset-strlen($line2))/2).$line2;
|
||||
else $line.=str_pad($line2,$length-$offset-1,$char,STR_PAD_BOTH);
|
||||
break;
|
||||
case 'right':
|
||||
$line.=str_repeat($char,$length-$offset-strlen($line2)+1).$line2;
|
||||
break;
|
||||
default:
|
||||
$line.=$line2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# Return formatted prompt
|
||||
return($line);
|
||||
}
|
||||
|
||||
|
||||
function render($style,$length,$is_softkeys,$base=NULL)
|
||||
{
|
||||
# Opening
|
||||
$base = $this->escape($base);
|
||||
$xml = '<MenuItem';
|
||||
if($base!=NULL)
|
||||
{
|
||||
if($base!='AASTRA_RESETBASE') $xml .= " base=\"{$base}\"";
|
||||
else $xml .= " base=\"\"";
|
||||
}
|
||||
if($this->_icon!=NULL) $xml .= " icon=\"{$this->_icon}\"";
|
||||
$xml .= ">\n";
|
||||
|
||||
# Prompt
|
||||
if(is_array($this->_name)) $name = $this->format_line($this->_name,$style,$length,$is_softkeys);
|
||||
else $name = $this->_name;
|
||||
$name = $this->escape($name);
|
||||
$xml .= "<Prompt";
|
||||
if($this->_split!=NULL) $xml .= " split=\"{$this->_split}\"";
|
||||
if($this->_color!='') $xml .= " Color=\"{$this->_color}\"";
|
||||
$xml .= ">{$name}</Prompt>\n";
|
||||
|
||||
# URI
|
||||
$url = $this->escape($this->_url);
|
||||
$xml .= "<URI>{$url}</URI>\n";
|
||||
|
||||
# Selection
|
||||
$selection = $this->escape($this->_selection);
|
||||
$icon=$this->_icon;
|
||||
$xml = "<MenuItem";
|
||||
if($icon!=NULL) $xml .= " icon=\"{$icon}\"";
|
||||
$xml .= ">\n<Prompt>{$name}</Prompt>\n<URI>{$url}</URI>\n";
|
||||
if($selection!=NULL) $xml .= "<Selection>{$selection}</Selection>\n";
|
||||
if($this->_dial!=NULL) $xml .= "<Dial>{$this->_dial}</Dial>\n";
|
||||
$xml .= "</MenuItem>\n";
|
||||
|
||||
# Dial
|
||||
if($this->_dial!=NULL)
|
||||
{
|
||||
if($this->_line!=NULL) $xml .= "<Dial line=\"{$this->_line}\">{$this->_dial}</Dial>\n";
|
||||
else $xml .= "<Dial>{$this->_dial}</Dial>\n";
|
||||
}
|
||||
|
||||
# Close
|
||||
$xml .= '</MenuItem>'."\n";
|
||||
|
||||
# Return generated vaue
|
||||
return($xml);
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
<?
|
||||
|
||||
<?php
|
||||
########################################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneTextScreen
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# AastraIPPhoneTextScreen object.
|
||||
#
|
||||
@ -10,22 +9,56 @@
|
||||
#
|
||||
# Inherited from AastraIPPhone
|
||||
# setTitle(Title) to setup the title of an object (optional)
|
||||
# @title string
|
||||
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
|
||||
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
|
||||
# @title string
|
||||
# @color string, "red", "blue", ... (optional)
|
||||
# @icon_index integer, icon number
|
||||
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
|
||||
# @uri string
|
||||
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (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)
|
||||
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
|
||||
# @uri string, GoodByeLockInURI
|
||||
# setLockInCall() to set the Lock-in tag to 'call' (optional)
|
||||
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
|
||||
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
|
||||
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
|
||||
# addSoftkey(index,label,uri,iconindex) to add custom softkeys to the object (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# @timeout integer (seconds)
|
||||
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
|
||||
# @index integer, softkey number
|
||||
# @label string
|
||||
# @uri string
|
||||
# @icon_index integer, icon number
|
||||
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
|
||||
# generate() to return the object content
|
||||
# output() to display the object
|
||||
# @timeout integer (seconds)
|
||||
# @URL string
|
||||
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
|
||||
# addIcon(index,icon) to add custom icons to the object (optional)
|
||||
# @index integer, icon index
|
||||
# @icon string, icon name or definition
|
||||
# generate() to return the generated XML for the object
|
||||
# output(flush) to display the object
|
||||
# @flush boolean optional, output buffer to be flushed out or not.
|
||||
#
|
||||
# Specific to the object
|
||||
# setText(text) to set the text to be displayed.
|
||||
# setText(text,color) to set the text to be displayed.
|
||||
# @text string
|
||||
# @color string, "red", "blue"... (optional)
|
||||
# setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
|
||||
# @uri string
|
||||
# setAllowDTMF() to allow DTMF passthrough on the object
|
||||
# setScrollUp(uri) to set the URI to be called when the user presses the Up arrow (optional)
|
||||
# @uri string
|
||||
# setScrollDown(uri) to set the URI to be called when the user presses the Down arrow (optional)
|
||||
# @uri string
|
||||
# setScrollLeft(uri) to set the URI to be called when the user presses the Left arrow (optional)
|
||||
# @uri string
|
||||
# setScrollRight(uri) to set the URI to be called when the user presses the Right arrow (optional)
|
||||
# @uri string
|
||||
#
|
||||
# Example
|
||||
# require_once('AastraIPPhoneTextScreen.class.php');
|
||||
@ -41,64 +74,170 @@
|
||||
########################################################################################################
|
||||
|
||||
require_once('AastraIPPhone.class.php');
|
||||
require_once('AastraIPPhoneTextScreenEntry.class.php');
|
||||
|
||||
class AastraIPPhoneTextScreen extends AastraIPPhone {
|
||||
var $_text;
|
||||
var $_doneAction="";
|
||||
|
||||
function setText($text)
|
||||
{
|
||||
$this->_text = $text;
|
||||
}
|
||||
var $_doneAction='';
|
||||
var $_allowDTMF='';
|
||||
var $_scrollUp='';
|
||||
var $_scrollDown='';
|
||||
var $_scrollLeft='';
|
||||
var $_scrollRight='';
|
||||
|
||||
function setDoneAction($uri)
|
||||
{
|
||||
$this->_doneAction = $uri;
|
||||
}
|
||||
|
||||
function setScrollUp($uri)
|
||||
{
|
||||
$this->_scrollUp = $uri;
|
||||
}
|
||||
|
||||
function setScrollDown($uri)
|
||||
{
|
||||
$this->_scrollDown = $uri;
|
||||
}
|
||||
|
||||
function setScrollLeft($uri)
|
||||
{
|
||||
$this->_scrollLeft = $uri;
|
||||
}
|
||||
|
||||
function setScrollRight($uri)
|
||||
{
|
||||
$this->_scrollRight = $uri;
|
||||
}
|
||||
|
||||
function setAllowDTMF()
|
||||
{
|
||||
$this->_allowDTMF = 'yes';
|
||||
}
|
||||
|
||||
function addEntry($text, $color='')
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneTextScreenEntry($text, $color);
|
||||
}
|
||||
|
||||
function setText($text,$color='')
|
||||
{
|
||||
$pieces=explode("\n",$text);
|
||||
foreach($pieces as $key=>$value)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneTextScreenEntry($value, $color);
|
||||
}
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$title = $this->escape($this->_title);
|
||||
$text = $this->escape($this->_text);
|
||||
$out = '';
|
||||
$out .= "<AastraIPPhoneTextScreen";
|
||||
# Beginning of root tag
|
||||
$out = "<AastraIPPhoneTextScreen";
|
||||
|
||||
# DestroyOnExut
|
||||
if($this->_destroyOnExit == 'yes') $out .= " destroyOnExit=\"yes\"";
|
||||
|
||||
# CancelAction
|
||||
if($this->_cancelAction != "")
|
||||
{
|
||||
$cancelAction = $this->escape($this->_cancelAction);
|
||||
$out .= " cancelAction=\"{$cancelAction}\"";
|
||||
}
|
||||
|
||||
# DoneAction
|
||||
if($this->_doneAction != "")
|
||||
{
|
||||
$doneAction = $this->escape($this->_doneAction);
|
||||
$out .= " doneAction=\"{$doneAction}\"";
|
||||
}
|
||||
|
||||
# Beep
|
||||
if ($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
|
||||
# TimeOut
|
||||
if ($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
|
||||
if ($this->_lockin=='yes') $out .= " LockIn=\"yes\"";
|
||||
|
||||
# Lockin
|
||||
if($this->_lockin!='') {
|
||||
$out .= " LockIn=\"{$this->_lockin}\"";
|
||||
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
|
||||
}
|
||||
|
||||
# AllowAnswer
|
||||
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
|
||||
|
||||
# AllowDrop
|
||||
if ($this->_allowDrop == 'yes') $out .= " allowDrop=\"yes\"";
|
||||
|
||||
# AllowXfer
|
||||
if ($this->_allowXfer == 'yes') $out .= " allowXfer=\"yes\"";
|
||||
|
||||
# AllowConf
|
||||
if ($this->_allowConf == 'yes') $out .= " allowConf=\"yes\"";
|
||||
|
||||
# AllowDTMF
|
||||
if ($this->_allowDTMF=='yes') $out .= " allowDTMF=\"yes\"";
|
||||
|
||||
# Scrolls up/down/left/right
|
||||
if($this->_scrollUp!='') $out .= " scrollUp=\"".$this->escape($this->_scrollUp)."\"";
|
||||
if($this->_scrollDown!='') $out .= " scrollDown=\"".$this->escape($this->_scrollDown)."\"";
|
||||
if($this->_scrollLeft!='') $out .= " scrollLeft=\"".$this->escape($this->_scrollLeft)."\"";
|
||||
if($this->_scrollRight!='') $out .= " scrollRight=\"".$this->escape($this->_scrollRight)."\"";
|
||||
|
||||
# End of root tag
|
||||
$out .= ">\n";
|
||||
|
||||
# Title
|
||||
if ($this->_title!='')
|
||||
{
|
||||
$title = $this->escape($this->_title);
|
||||
$out .= "<Title";
|
||||
if ($this->_title_wrap=='yes') $out .= " wrap=\"yes\"";
|
||||
if ($this->_title_color!='') $out .= " Color=\"{$this->_title_color}\"";
|
||||
$out .= ">".$title."</Title>\n";
|
||||
}
|
||||
$out .= "<Text>{$text}</Text>\n";
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
$IconList=0;
|
||||
foreach ($this->_icons as $icon)
|
||||
|
||||
# Top Title
|
||||
if ($this->_toptitle!='')
|
||||
{
|
||||
if($IconList==0)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=1;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
$toptitle = $this->escape($this->_toptitle);
|
||||
$out .= "<TopTitle";
|
||||
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
|
||||
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
|
||||
$out .= ">".$toptitle."</TopTitle>\n";
|
||||
}
|
||||
if($IconList!=0) $out .= "</IconList>\n";
|
||||
|
||||
# Text Items
|
||||
if (isset($this->_entries) && is_array($this->_entries))
|
||||
{
|
||||
foreach ($this->_entries as $entry) $out .= $entry->render();
|
||||
}
|
||||
|
||||
# Softkeys
|
||||
if (isset($this->_softkeys) && is_array($this->_softkeys))
|
||||
{
|
||||
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
|
||||
}
|
||||
|
||||
# Icons
|
||||
if (isset($this->_icons) && is_array($this->_icons))
|
||||
{
|
||||
$IconList=False;
|
||||
foreach ($this->_icons as $icon)
|
||||
{
|
||||
if(!$IconList)
|
||||
{
|
||||
$out .= "<IconList>\n";
|
||||
$IconList=True;
|
||||
}
|
||||
$out .= $icon->render();
|
||||
}
|
||||
if($IconList) $out .= "</IconList>\n";
|
||||
}
|
||||
|
||||
# End tag
|
||||
$out .= "</AastraIPPhoneTextScreen>\n";
|
||||
|
||||
# Return XML object
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
28
php_classes/AastraIPPhoneTextScreenEntry.class.php
Normal file
28
php_classes/AastraIPPhoneTextScreenEntry.class.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
################################################################################
|
||||
# Aastra XML API Classes - AastraIPPhoneTextScreenEntry
|
||||
# Copyright Aastra Telecom 2007-2011
|
||||
#
|
||||
# Internal class for AastraIPPhoneTextScreen object.
|
||||
################################################################################
|
||||
|
||||
class AastraIPPhoneTextScreenEntry extends AastraIPPhone {
|
||||
var $_text;
|
||||
var $_color='';
|
||||
|
||||
function AastraIPPhoneTextScreenEntry($text,$color)
|
||||
{
|
||||
$this->_text = $text;
|
||||
$this->_color = $color;
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
$text = $this->escape($this->_text);
|
||||
$xml = "<Text";
|
||||
if ($this->_color!='') $xml .= " Color=\"{$this->_color}\"";
|
||||
$xml .= ">{$text}</Text>\n";
|
||||
return($xml);
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2007 Aastra Telecom US, Inc.
|
||||
Copyright (c) 2008 Aastra Telecom US, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,67 +1,24 @@
|
||||
<?php
|
||||
|
||||
##########################################################
|
||||
###########################################################################
|
||||
# Sample php applications using the Aastra XML API Classes
|
||||
# Aastra SIP Phones Firmware 2.1.1 or better
|
||||
# Copyright Aastra Telecom 2007
|
||||
# Aastra 6739i Firmware 3.0.1 or better
|
||||
# Copyright Aastra Telecom 2005-2010
|
||||
#
|
||||
# @param type, type of XML object to display
|
||||
# type=textmenu1 AastraIPPhoneTextMenu
|
||||
# type=textmenu2 AastraIPPhoneTextMenu
|
||||
# type=textmenu3 AastraIPPhoneTextMenu
|
||||
# type=textscreen AastraIPPhoneTextScreen
|
||||
# type=directory AastraIPPhoneDirectory
|
||||
# type=inputscreen1 AastraIPPhoneInputScreen
|
||||
# type=inputscreen2 AastraIPPhoneInputScreen
|
||||
# type=inputscreen3 AastraIPPhoneInputScreen
|
||||
# type=inputscreen4 AastraIPPhoneInputScreen
|
||||
# type=status AastraIPPhoneStatus
|
||||
# type=execute AastraIPPhoneExecute
|
||||
# type=configuration AastraIPPhoneConfiguration
|
||||
# type=imagescreen AastraIPPhoneImageScreen
|
||||
# type=imagemenu AastraIPPhoneImageMenu
|
||||
# type=formattedtextscreen AastraIPPhoneFormattedTextScreen
|
||||
#
|
||||
# If type is not set, the list of all the XML objects is displayed
|
||||
#
|
||||
##########################################################
|
||||
###########################################################################
|
||||
|
||||
##########################################################
|
||||
# Aastra_decode_HTTP_header
|
||||
#
|
||||
# Returns an array
|
||||
# 'model' Phone Type
|
||||
# 'mac' Phone MAC Address
|
||||
# 'firmware' Phone firmware version
|
||||
# 'ip' Phone Remote IP address
|
||||
# 'language' Phone Language
|
||||
# 'module'[x] Expension Modules
|
||||
#
|
||||
###########################################################################
|
||||
# Includes
|
||||
###########################################################################
|
||||
require_once('AastraIPPhone.php');
|
||||
|
||||
function Aastra_decode_HTTP_header()
|
||||
{
|
||||
# User Agent
|
||||
$user_agent=$_SERVER["HTTP_USER_AGENT"];
|
||||
if(stristr($user_agent,"Aastra"))
|
||||
{
|
||||
$value=preg_split("/ MAC:/",$user_agent);
|
||||
$fin=preg_split("/ /",$value[1]);
|
||||
$value[1]=preg_replace("/\-/","",$fin[0]);
|
||||
$value[2]=preg_replace("/V:/","",$fin[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$value[0]="MSIE";
|
||||
$value[1]="NA";
|
||||
$value[2]="NA";
|
||||
}
|
||||
###########################################################################
|
||||
# Main Code
|
||||
###########################################################################
|
||||
|
||||
# Create array
|
||||
$array=array('model'=>$value[0],'mac'=>$value[1],'firmware'=>$value[2]);
|
||||
return($array);
|
||||
}
|
||||
# Test firmware version
|
||||
#Aastra_test_phone_version('3.0.1',0);
|
||||
|
||||
##########################################################
|
||||
# Retrieve type parameter
|
||||
$type=$_GET['type'];
|
||||
|
||||
@ -85,19 +42,11 @@ switch($type)
|
||||
$menu->addEntry('TextScreen', $XML_SERVER.'?type=textscreen');
|
||||
$menu->addEntry('InputScreen1', $XML_SERVER.'?type=inputscreen1');
|
||||
$menu->addEntry('InputScreen2', $XML_SERVER.'?type=inputscreen2');
|
||||
$menu->addEntry('Status', $XML_SERVER.'?type=status');
|
||||
$menu->addEntry('InputScreen3', $XML_SERVER.'?type=inputscreen3');
|
||||
$menu->addEntry('Execute', $XML_SERVER.'?type=execute');
|
||||
if(($header['model']!="Aastra51i") and ($header['model']!="Aastra53i"))
|
||||
{
|
||||
$menu->addEntry('ImageScreen', $XML_SERVER.'?type=imagescreen');
|
||||
$menu->addEntry('ImageMenu', $XML_SERVER.'?type=imagemenu');
|
||||
$menu->addEntry('InputScreen3', $XML_SERVER.'?type=inputscreen3');
|
||||
$menu->addEntry('InputScreen4', $XML_SERVER.'?type=inputscreen4');
|
||||
$menu->addEntry('InputScreen5', $XML_SERVER.'?type=inputscreen5');
|
||||
$menu->addEntry('Directory', $XML_SERVER.'?type=directory');
|
||||
}
|
||||
$menu->addEntry('FTextScreen1', $XML_SERVER.'?type=formattedtextscreen1');
|
||||
$menu->addEntry('FTextScreen2', $XML_SERVER.'?type=formattedtextscreen2');
|
||||
$menu->addEntry('FormattedTextScreen', $XML_SERVER.'?type=formattedtextscreen');
|
||||
$menu->addEntry('Status1', $XML_SERVER.'?type=status1');
|
||||
$menu->addEntry('Status2', $XML_SERVER.'?type=status2');
|
||||
$menu->natsortByName();
|
||||
$menu->output();
|
||||
break;
|
||||
@ -105,11 +54,10 @@ switch($type)
|
||||
case 'textmenu1':
|
||||
require_once('AastraIPPhoneTextMenu.class.php');
|
||||
$menu = new AastraIPPhoneTextMenu();
|
||||
$menu->setTitle('Title this is a pretty long title');
|
||||
$menu->setTitle('Title, which is a pretty long title');
|
||||
$menu->setTitleWrap();
|
||||
$menu->setDestroyOnExit();
|
||||
$menu->setDeFaultIndex('3');
|
||||
$menu->setStyle('radio');
|
||||
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','','12345');
|
||||
$menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1');
|
||||
$menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3');
|
||||
@ -119,9 +67,7 @@ switch($type)
|
||||
$menu->addEntry('Choice 7', 'http://myserver.com/script.php?choice=7', 'Value=7');
|
||||
$menu->natsortByName();
|
||||
$menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
|
||||
$menu->addSoftkey('2', 'My Dial', 'SoftKey:Dial2');
|
||||
$menu->addSoftkey('4', 'Back', $XML_SERVER);
|
||||
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$menu->addSoftkey('10', 'Done', 'SoftKey:Exit');
|
||||
$menu->output();
|
||||
break;
|
||||
|
||||
@ -130,33 +76,14 @@ switch($type)
|
||||
$menu = new AastraIPPhoneTextMenu();
|
||||
$menu->setTitle('Title');
|
||||
$menu->setDestroyOnExit();
|
||||
$menu->setDeFaultIndex('2');
|
||||
$menu->setDefaultIndex('2');
|
||||
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','1');
|
||||
$menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1','2');
|
||||
$menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3','3');
|
||||
$menu->natsortByName();
|
||||
$menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
|
||||
$menu->addSoftkey('4', 'Back', $XML_SERVER);
|
||||
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$menu->addIcon('1', 'Icon:PhoneOnHook');
|
||||
$menu->addIcon('2', 'Icon:PhoneOffHook');
|
||||
$menu->addIcon('3', 'Icon:PhoneRinging');
|
||||
$menu->output();
|
||||
break;
|
||||
|
||||
case 'textmenu3':
|
||||
require_once('AastraIPPhoneTextMenu.class.php');
|
||||
$menu = new AastraIPPhoneTextMenu();
|
||||
$menu->setTitle('Title');
|
||||
$menu->setDestroyOnExit();
|
||||
$menu->addEntry('Choice 1', 'Dial:12345', 'Value=1', '', '6789');
|
||||
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','','12345');
|
||||
$menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3');
|
||||
$menu->addSoftkey('1', 'Select', 'SoftKey:Select');
|
||||
$menu->addSoftkey('2', 'Dial', 'SoftKey:Dial');
|
||||
$menu->addSoftkey('3', 'Dial2', 'SoftKey:Dial2');
|
||||
$menu->addSoftkey('4', 'Back', $XML_SERVER);
|
||||
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$menu->addSoftkey('9', 'Back', $XML_SERVER);
|
||||
$menu->addSoftkey('10', 'Exit', 'SoftKey:Exit');
|
||||
$menu->output();
|
||||
break;
|
||||
|
||||
@ -166,10 +93,8 @@ switch($type)
|
||||
$text->setTitle('Title');
|
||||
$text->setText('The screen object can be implemented similar to the firmware info screen.');
|
||||
$text->setDestroyOnExit();
|
||||
$text->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1','1');
|
||||
$text->addSoftkey('4', 'Back', $XML_SERVER);
|
||||
$text->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1');
|
||||
$text->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$text->addIcon('1', 'Icon:Envelope');
|
||||
$text->output();
|
||||
break;
|
||||
|
||||
@ -177,7 +102,7 @@ switch($type)
|
||||
require_once('AastraIPPhoneInputScreen.class.php');
|
||||
$input = new AastraIPPhoneInputScreen();
|
||||
$input->setTitle('Title');
|
||||
$input->setPrompt('Enter date');
|
||||
$input->setPrompt('Enter your password');
|
||||
$input->setParameter('param');
|
||||
$input->setType('string');
|
||||
$input->setURL('http://myserver.com/script.php?test=1');
|
||||
@ -202,94 +127,31 @@ switch($type)
|
||||
break;
|
||||
|
||||
case 'inputscreen3':
|
||||
require_once('AastraIPPhoneInputScreen.class.php');
|
||||
$input = new AastraIPPhoneInputScreen();
|
||||
$input->setTitle('Title');
|
||||
$input->setPrompt('Enter email address');
|
||||
$input->setParameter('email');
|
||||
$input->setType('string');
|
||||
$input->setURL('http://myserver.com/script.php');
|
||||
$input->addSoftkey('1', 'Backspace', 'SoftKey:BackSpace');
|
||||
$input->addSoftkey('2', 'Symbols', 'SoftKey:SymbolList="@."');
|
||||
$input->addSoftkey('5', 'Done', 'SoftKey:Submit');
|
||||
$input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$input->setDestroyOnExit();
|
||||
$input->output();
|
||||
break;
|
||||
|
||||
case 'inputscreen4':
|
||||
require_once('AastraIPPhoneInputScreen.class.php');
|
||||
$input = new AastraIPPhoneInputScreen();
|
||||
$input->setTitle('Restricted application');
|
||||
$input->setDisplayMode('condensed');
|
||||
$input->setURL($XML_SERVER);
|
||||
$input->setDestroyOnExit();
|
||||
$input->addSoftkey('5', 'Done', 'SoftKey:Submit');
|
||||
$input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$input->addField();
|
||||
$input->setFieldType('empty');
|
||||
$input->addField('empty');
|
||||
$input->addField('string');
|
||||
$input->setFieldType('string');
|
||||
$input->setFieldSelection('1');
|
||||
$input->setFieldPrompt('Username:');
|
||||
$input->setFieldParameter('user');
|
||||
$input->addFieldSoftkey('3', 'ABC', 'SoftKey:ChangeMode');
|
||||
$input->setFieldSelection('1');
|
||||
$input->addField('number');
|
||||
$input->setFieldPassword('yes');
|
||||
$input->setFieldPrompt('Password:');
|
||||
$input->setFieldParameter('password');
|
||||
$input->setFieldSelection('2');
|
||||
$input->addSoftkey('10', 'Exit', 'SoftKey:Exit');
|
||||
$input->output();
|
||||
break;
|
||||
|
||||
case 'inputscreen5':
|
||||
require_once('AastraIPPhoneInputScreen.class.php');
|
||||
$input = new AastraIPPhoneInputScreen();
|
||||
$input->setTitle('Date and Time');
|
||||
$input->setURL('http://myserver.com/script.php');
|
||||
$input->setDestroyOnExit();
|
||||
$input->addSoftkey('5', 'Done', 'SoftKey:Submit');
|
||||
$input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$input->addField('dateUS');
|
||||
$input->setFieldPrompt('Enter Date');
|
||||
$input->setFieldParameter('date');
|
||||
$input->addField('timeUS');
|
||||
$input->setFieldPrompt('Enter Time');
|
||||
$input->setFieldParameter('time');
|
||||
$input->output();
|
||||
break;
|
||||
|
||||
case 'directory':
|
||||
require_once('AastraIPPhoneDirectory.class.php');
|
||||
$directory = new AastraIPPhoneDirectory();
|
||||
$directory->setTitle('Title');
|
||||
$directory->setNext('http://myserver.com/script.php?page=2');
|
||||
$directory->setPrevious('http://myserver.com/script.php?page=0');
|
||||
$directory->setDestroyOnExit();
|
||||
$directory->addEntry('John Doe', '200');
|
||||
$directory->addEntry('Jane Doe', '201');
|
||||
$directory->natsortByName();
|
||||
$directory->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
|
||||
$directory->addSoftkey('4', 'Back', $XML_SERVER);
|
||||
$directory->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$directory->output();
|
||||
break;
|
||||
|
||||
case 'status':
|
||||
require_once('AastraIPPhoneStatus.class.php');
|
||||
$status = new AastraIPPhoneStatus();
|
||||
$status->setSession('Session');
|
||||
$status->setBeep();
|
||||
$status->addEntry('1','Message 1',"alert",5);
|
||||
$status->addEntry('2','Message 2');
|
||||
$status->output();
|
||||
break;
|
||||
|
||||
case 'execute':
|
||||
require_once('AastraIPPhoneExecute.class.php');
|
||||
$execute = new AastraIPPhoneExecute();
|
||||
$execute->setTriggerDestroyOnExit();
|
||||
$execute->addEntry('http://myserver.com/script.php?choice=2');
|
||||
$execute->addEntry('Command: Reset');
|
||||
$execute->addEntry('Command: FastReboot');
|
||||
$execute->addEntry('Led: softkey1=on');
|
||||
$execute->addEntry('Dial:7001','no');
|
||||
$execute->output();
|
||||
@ -301,76 +163,44 @@ switch($type)
|
||||
$configuration->addEntry('softkey1 label','Test');
|
||||
$configuration->addEntry('softkey1 type','xml');
|
||||
$configuration->setTriggerDestroyOnExit();
|
||||
$configuration->setBeep();
|
||||
$configuration->output();
|
||||
break;
|
||||
|
||||
case 'formattedtextscreen1':
|
||||
case 'formattedtextscreen':
|
||||
require_once('AastraIPPhoneFormattedTextScreen.class.php');
|
||||
$ftext = new AastraIPPhoneFormattedTextScreen();
|
||||
$ftext->setDestroyOnExit();
|
||||
if($header['model']!="Aastra53i") $ftext->addLine('Formatted Screen','double','center');
|
||||
$ftext->setScrollStart('2');
|
||||
$ftext->addLine('Formatted Screen','double','center','red');
|
||||
$ftext->setScrollStart();
|
||||
$ftext->addLine('Scrolled text1');
|
||||
$ftext->addLine('Scrolled text2');
|
||||
$ftext->addLine('Scrolled text3','double');
|
||||
$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('4', 'Back', $XML_SERVER);
|
||||
$ftext->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$ftext->addIcon('1', 'Icon:Envelope');
|
||||
$ftext->output();
|
||||
break;
|
||||
|
||||
case 'formattedtextscreen2':
|
||||
require_once('AastraIPPhoneFormattedTextScreen.class.php');
|
||||
$ftext = new AastraIPPhoneFormattedTextScreen();
|
||||
$ftext->setDestroyOnExit();
|
||||
$ftext->addLine('Line 1');
|
||||
$ftext->addLine('Line 2');
|
||||
$ftext->addLine('Line 3');
|
||||
$ftext->addLine('Line 4');
|
||||
$ftext->addLine('Line 5');
|
||||
$ftext->addLine('Line 6');
|
||||
$ftext->addSoftkey('1', 'Softkey 1', 'SoftKey:Exit');
|
||||
$ftext->addSoftkey('2', 'Softkey 2', 'SoftKey:Exit');
|
||||
$ftext->addSoftkey('3', 'Softkey 3', 'SoftKey:Exit');
|
||||
$ftext->addSoftkey('4', 'Softkey 4', 'SoftKey:Exit');
|
||||
$ftext->addSoftkey('5', 'Softkey 5', 'SoftKey:Exit');
|
||||
$ftext->addSoftkey('6', 'Softkey 6', 'SoftKey:Exit');
|
||||
$ftext->output();
|
||||
break;
|
||||
|
||||
case 'imagescreen':
|
||||
require_once('AastraIPPhoneImageScreen.class.php');
|
||||
$images = new AastraIPPhoneImageScreen();
|
||||
$images->setDestroyOnExit();
|
||||
$images->setSize(40,144);
|
||||
$images->setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020931400020ac5c91088b0f2b08c21c07d0c2006009fdfe81f80efe0107fe0fb1c3ffff8ffc3fffef8f7febffbfcf87ffbff64');
|
||||
$images->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1','1');
|
||||
$images->addSoftkey('4', 'Back', $XML_SERVER);
|
||||
$images->addSoftkey('6', 'Exit', 'SoftKey:Exit',2);
|
||||
$images->addIcon('1', 'Icon:Envelope');
|
||||
$images->output();
|
||||
$ftext->addSoftkey('10', 'Exit', 'SoftKey:Exit');
|
||||
$ftext->output();
|
||||
break;
|
||||
|
||||
case 'imagemenu':
|
||||
require_once('AastraIPPhoneImageMenu.class.php');
|
||||
$imagem = new AastraIPPhoneImageMenu();
|
||||
$imagem->setDestroyOnExit();
|
||||
$imagem->setSize(40,144);
|
||||
$imagem->setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020131400020a05c91088b002b08c21c0000c200000001fe800000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020041000004008300000ff08500000000c900000000710000000000000001401400000140140000014014000001401400000140140000000000000007c0ff00000c30880000081088000008108800000c30700000062000000000003f000001e02000000330200000021000000003301e000001e0330000000021000003f033000002001e0000020000000000001e000c03fc33003c013021007c02101201f00330ff03f001e000039000003e039001e00103f003300101f8021003007c03303f003c01e000000c00001e001c03f033007802002100f002002103e000001203c401702003cc0290ff039c02902101fc02b000007c03f01a003c020039018c0ff02d03c402102703c400001203ec01e000026402b0000264029000026c029000027c01a0000338000000033800000003100000000300000000030003f00003fc03000003fc02000003fc020000030001f0000300000000030001e000030002b000030002900003fc02900003fc01a00003f00000000310030000031c01e000031f003000033f81e00003f383000001e081e000008c003000003c01e00000fc03000001f000000003d001a0000390039000039002d00003f002700000f8012000007c000000001c0000000004000000000000000000000000000');
|
||||
$imagem->addURI('1','http://myserver.com?choice=1');
|
||||
$imagem->addURI('2','http://myserver.com?Choice=2');
|
||||
$imagem->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1','1');
|
||||
$imagem->addSoftkey('4', 'Back', $XML_SERVER);
|
||||
$imagem->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$imagem->addIcon('1', 'Icon:Envelope');
|
||||
$imagem->addIcon('2', 'FFFF0000FFFF0000');
|
||||
$imagem->output();
|
||||
break;
|
||||
case 'status1':
|
||||
require_once('AastraIPPhoneStatus.class.php');
|
||||
$status = new AastraIPPhoneStatus();
|
||||
$status->setTriggerDestroyOnExit();
|
||||
$status->setSession('Session');
|
||||
$status->addEntry('1','Message 1');
|
||||
$status->addEntry('2','Message 2');
|
||||
$status->output();
|
||||
break;
|
||||
|
||||
case 'status2':
|
||||
require_once('AastraIPPhoneStatus.class.php');
|
||||
$status = new AastraIPPhoneStatus();
|
||||
$status->setSession('Session');
|
||||
$status->setTriggerDestroyOnExit();
|
||||
$status->addEntry('1','');
|
||||
$status->addEntry('2','');
|
||||
$status->output();
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user