summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 55902e5)
raw | patch | inline | side by side (parent: 55902e5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 May 2011 11:28:11 +0000 (11:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 May 2011 11:28:11 +0000 (11:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20844 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc
index 253532be6c69beccbfcdf291c9dc7c3b34288505..4e981fb1d8a79f51dfc1a18aeb5ad8566d8ab95f 100644 (file)
public $initialized = FALSE;
+
/*! \brief Initialize the plugin and its widgets.
- * Finally call init() to load values from the backend.
*/
function __construct(&$config, $dn, $parent)
{
plugin::plugin($config, $dn);
+ // Get the account information from the generic class.
$this->is_account = $this->initially_was_account = FALSE;
-
$this->_device = &$parent;
$this->deviceUUID = $parent->deviceUUID;
$this->parameterList->setAcl('rwcdm');
}
+
function check()
{
}
-
+
+ /*! \brief Generates the HTML output for the plugin
+ */
function execute()
{
}
}
-
// Log account access
if($this->is_account && !$this->view_logged){
$this->view_logged = TRUE;
}
}
+ /***************
+ Create the HTML content with its lists
+ ***************/
+
// Fill list of assignable elements
$rpc = $this->config->getRpcHandle();
$res = $rpc->listAssignableElements('squeeze/1.0');
$this->assignableElements = $res;
$data = $lData = array();;
foreach($this->assignableElements as $name => $element){
+
+ // skip already assigned elements
if(in_array($name, $this->usedElements)) continue;
+
+ // Create the list elements.
$data[$name] = $element;
$desc = (isset($element['description'])) ? $element['description'] : '';
$lData[$name] = array('data' => array($name, $desc));
// Build list of assigned Elements
$data = $lData = array();;
foreach($this->usedElements as $name){
+
+ // check if the assgined element is still available, if not mark it in red.
if(isset($this->assignableElements[$name])){
$element = $this->assignableElements[$name];
$data[$name] = $element;
$element = NULL;
$data[$name] = $element;
$desc = "<font color='red'>"._("Unknown config item")."</font>";
-
}
$lData[$name] = array('data' => array($name, $desc));
}
$data = $lData = array();;
foreach($this->usedElements as $name){
+ // Skip parameters for not existent items.
if(!isset($this->assignableElements[$name]['parameter'])) continue;
+ // Build up the parameter list using the 'TemplateWidget_string' class.
$parameter = $this->assignableElements[$name]['parameter'];
foreach($parameter as $param => $desc){
$data[$param] = NULL;
$value = (isset($this->parameterValues[$param])) ? $this->parameterValues[$param] : "";
+ // Create template widget on demand.
if(!isset($this->parameterWidgets[$param])){
$this->parameterWidgets[$param] = new TemplateWidget_string($this->config, $param, $value,
$desc, '', FALSE, 'string', $param);
}
$w = $this->parameterWidgets[$param];
- $lData[$param] = array('data' => array($w->getDisplayName(), $w->render()));
+ $lData[$param] = array('data' => array($w->getDisplayName(),$desc, $w->render()));
}
}
$this->parameterList->setListData($data, $lData);
+ // Build up smarty template.
$smarty = get_smarty();
$smarty->assign("error", FALSE);
$smarty->assign("assignableElementsList", $this->assignableElementsList->render());
}
+ /*! \brief Act on posted values.
+ * And keep track of posted values.
+ */
function save_object()
{
-
// Get posted parameter values
foreach($this->parameterWidgets as $name => $w){
$w->save_object();
}
+ /*! \brief Save changes back to the GOsa-ng server.
+ */
function save()
{
-
// Collect paramter list.
$params = array();
foreach($this->usedElements as $name){
}
+ /*! \brief Removes the account from the device.
+ */
function remove_from_parent()
{
// Save changes back to server.
static function plInfo()
{
return (array(
- "plShortName" => _("Device"),
- "plDescription" => _("Registered device"),
+ "plShortName" => _("Device config"),
+ "plDescription" => _("Device config"),
"plSelfModify" => FALSE,
"plDepends" => array(),
"plPriority" => 1,