1.4.2 version.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
###################################################################################################
|
||||
# Copyright (c) 2006 Aastra Telecom US, Inc.
|
||||
# Copyright (c) 2007 Aastra Telecom US, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -43,6 +43,7 @@
|
||||
#
|
||||
# Specific to the object
|
||||
# setDestroyOnExit() to set DestroyOnExit parameter to "yes", optional
|
||||
# setStyle(style) to set the style of the list numbered/none/radio (optional)
|
||||
# addEntry(name,url,selection) to add an element in the list to be displayed, at
|
||||
# least one is needed.
|
||||
# natsortbyname() to order the list
|
||||
@ -68,12 +69,18 @@ require_once('AastraIPPhoneTextMenuEntry.class.php');
|
||||
|
||||
class AastraIPPhoneTextMenu extends AastraIPPhone {
|
||||
var $_defaultIndex="";
|
||||
var $_style="";
|
||||
|
||||
function setDefaultIndex($defaultIndex)
|
||||
{
|
||||
$this->_defaultIndex = $defaultIndex;
|
||||
}
|
||||
|
||||
function setStyle($style)
|
||||
{
|
||||
$this->_style = $style;
|
||||
}
|
||||
|
||||
function addEntry($name, $url, $selection=NULL)
|
||||
{
|
||||
$this->_entries[] = new AastraIPPhoneTextMenuEntry($name, $url, $selection);
|
||||
@ -98,6 +105,7 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
|
||||
$out = "<AastraIPPhoneTextMenu ";
|
||||
if ($this->_destroyOnExit=='yes') $out .= "destroyOnExit=\"yes\" ";
|
||||
if ($this->_defaultIndex!="") $out .= "defaultIndex=\"{$this->_defaultIndex}\"";
|
||||
if ($this->_style!='') $out .= " style=\"{$this->_style}\"";
|
||||
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
|
||||
$out .= ">\n";
|
||||
$out .= "<Title>".$title."</Title>\n";
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
###################################################################################################
|
||||
# Copyright (c) 2006 Aastra Telecom US, Inc.
|
||||
# Copyright (c) 2007 Aastra Telecom US, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -28,7 +28,7 @@
|
||||
#
|
||||
###################################################################################################
|
||||
# Sample php applications using the Aastra XML API Classes
|
||||
# Aastra SIP Phones Firmware 1.4.1 or better
|
||||
# Aastra SIP Phones Firmware 1.4.2 or better
|
||||
#
|
||||
# @param type, type of XML object to display
|
||||
# type=textmenu AastraIPPhoneTextMenu
|
||||
@ -43,36 +43,58 @@
|
||||
##########################################################
|
||||
# Retrieve type parameter
|
||||
$type=$_GET['type'];
|
||||
$type='inputscreen';
|
||||
|
||||
# Global parameters
|
||||
$XML_SERVER = "http://$SERVER_ADDR".$_SERVER['SCRIPT_NAME'];
|
||||
|
||||
# Display the object
|
||||
switch($type)
|
||||
{
|
||||
case 'textmenu':
|
||||
case '':
|
||||
require_once('AastraIPPhoneTextMenu.class.php');
|
||||
$menu = new AastraIPPhoneTextMenu();
|
||||
$menu->setTitle('Sample Applications');
|
||||
$menu->setDestroyOnExit();
|
||||
$menu->addEntry('TextMenu1', $XML_SERVER.'?type=textmenu1');
|
||||
$menu->addEntry('TextMenu2', $XML_SERVER.'?type=textmenu2');
|
||||
$menu->addEntry('TextScreen', $XML_SERVER.'?type=textscreen');
|
||||
$menu->addEntry('Directory', $XML_SERVER.'?type=directory');
|
||||
$menu->addEntry('InputScreen', $XML_SERVER.'?type=inputscreen');
|
||||
$menu->addEntry('Status', $XML_SERVER.'?type=status');
|
||||
$menu->addEntry('Execute', $XML_SERVER.'?type=execute');
|
||||
$menu->natsortByName();
|
||||
$menu->output();
|
||||
break;
|
||||
|
||||
case 'textmenu1':
|
||||
require_once('AastraIPPhoneTextMenu.class.php');
|
||||
$menu = new AastraIPPhoneTextMenu();
|
||||
$menu->setTitle('Title');
|
||||
# $menu->setDestroyOnExit();
|
||||
$menu->setDestroyOnExit();
|
||||
$menu->setDeFaultIndex('3');
|
||||
$menu->addEntry('Choice 2', 'http://65.205.71.13/php_classes/php_classes_1.4.1/sample.php', 'Value=2');
|
||||
$menu->addEntry('Choice 1', 'http://65.205.71.13/php_classes/php_classes_1.4.1/sample.php', 'Value=1');
|
||||
$menu->addEntry('Choice 3', 'http://65.205.71.13/php_classes/php_classes_1.4.1/sample.php', 'Value=3');
|
||||
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2');
|
||||
$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');
|
||||
$menu->natsortByName();
|
||||
$menu->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
|
||||
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$menu->output();
|
||||
break;
|
||||
|
||||
|
||||
# $menu = new AastraIPPhoneTextMenu();
|
||||
# $menu->setTitle('Title');
|
||||
# $menu->setDestroyOnExit();
|
||||
# $menu->setDeFaultIndex('3');
|
||||
# $menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2');
|
||||
# $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');
|
||||
# $menu->natsortByName();
|
||||
# $menu->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
|
||||
# $menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
# $menu->output();
|
||||
|
||||
|
||||
case 'textmenu2':
|
||||
require_once('AastraIPPhoneTextMenu.class.php');
|
||||
$menu = new AastraIPPhoneTextMenu();
|
||||
$menu->setTitle('Title');
|
||||
$menu->setDestroyOnExit();
|
||||
$menu->setDeFaultIndex('3');
|
||||
$menu->setStyle('none');
|
||||
$menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2');
|
||||
$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');
|
||||
$menu->natsortByName();
|
||||
$menu->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
|
||||
$menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$menu->output();
|
||||
break;
|
||||
|
||||
case 'textscreen':
|
||||
@ -89,27 +111,17 @@ switch($type)
|
||||
case 'inputscreen':
|
||||
require_once('AastraIPPhoneInputScreen.class.php');
|
||||
$input = new AastraIPPhoneInputScreen();
|
||||
$input->setTitle('Test Input');
|
||||
$input->setPrompt('Pin code');
|
||||
$input->setParameter('password');
|
||||
$input->setType('number');
|
||||
$input->setURL('http://192.168.0.49/VoIPer/Default.aspx?type=T001&user=TEST&number=');
|
||||
$input->setTitle('Title');
|
||||
$input->setPrompt('Enter your password');
|
||||
$input->setParameter('param');
|
||||
$input->setType('string');
|
||||
$input->setURL('http://myserver.com/script.php');
|
||||
$input->setPassword();
|
||||
$input->setDestroyOnExit();
|
||||
$input->setDefault('Default');
|
||||
$input->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
|
||||
$input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
$input->output();
|
||||
|
||||
# $input = new AastraIPPhoneInputScreen();
|
||||
# $input->setTitle('Title');
|
||||
# $input->setPrompt('Enter your password');
|
||||
# $input->setParameter('param');
|
||||
# $input->setType('string');
|
||||
# $input->setURL('http://myserver.com/script.php');
|
||||
# $input->setPassword();
|
||||
# $input->setDestroyOnExit();
|
||||
# $input->setDefault('Default');
|
||||
# $input->addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1');
|
||||
# $input->addSoftkey('6', 'Exit', 'SoftKey:Exit');
|
||||
# $input->output();
|
||||
break;
|
||||
|
||||
case 'directory':
|
||||
|
Reference in New Issue
Block a user