Files
aastra-xml-php/php_classes/AastraIPPhoneConfiguration.class.php
2018-02-15 22:59:05 +01:00

59 lines
1.8 KiB
PHP

<?php
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneConfiguration
# Copyright Aastra Telecom 2007
#
# 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)
#
# Specific to the object
# addEntry(parameter,value) to add a configuration change.
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to
# "yes" (optional)
#
# Example
# require_once('AastraIPPhoneConfiguration.class.php');
# $configuration = new AastraIPPhoneConfiguration();
# $configuration->addEntry('softkey1 label','Test');
# $configuration->addEntry('softkey1 type','xml');
# $configuration->setTriggerDestroyOnExit();
# $configuration->setBeep();
# $configuration->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneConfigurationEntry.class.php');
class AastraIPPhoneConfiguration extends AastraIPPhone {
function addEntry($parameter, $value)
{
$this->_entries[] = new AastraIPPhoneConfigurationEntry($parameter, $value);
}
function setTriggerDestroyOnExit()
{
$this->_triggerDestroyOnExit="yes";
}
function render()
{
$out = "<AastraIPPhoneConfiguration";
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
$out .= ">\n";
foreach ($this->_entries as $entry) $out .= $entry->render();
$out .= "</AastraIPPhoneConfiguration>\n";
return($out);
}
}
?>