Code

Replaced in_array calls with in_array_strict
[gosa.git] / gosa-plugins / dhcp / admin / systems / services / dhcp / class_dhcpNewSectionDialog.inc
1 <?php
3 class dhcpNewSectionDialog extends plugin
4 {
5     /* attribute list for save action */
6     var $ignore_account     = TRUE;
7     var $attributes         = array();
8     var $objectclasses      = array("whatever");
10     /* Mapping array */
11     var $types= array();
12     var $classtype= "";
13     var $sectionMap= array(  "dhcpService" => array("dhcpSharedNetwork", "dhcpSubnet", "dhcpGroup", "dhcpHost", "dhcpClass", "dhcpTSigKey", "dhcpDnsZone"),
14             "dhcpClass" => array("dhcpSubClass"),
15             "dhcpSubClass" => array(),
16             "dhcpHost" => array(),
17             "dhcpGroup" => array("dhcpHost"),
18             "dhcpPool" => array(),
19             "dhcpSubnet" => array("dhcpPool", "dhcpGroup", "dhcpHost", "dhcpClass", "dhcpTSigKey", "dhcpDnsZone"),
20             "dhcpSharedNetwork" => array("dhcpSubnet", "dhcpPool", "dhcpTsigKey", "dhcpDnsZone"),
21             "dhcpTSigKey"=> array(),
22             "dhcpDnsZone" => array());
26     function dhcpNewSectionDialog($type)
27     {
28         $this->initTime = microtime(TRUE);
29         stats::log('plugin', $class = get_class($this), $category = array($this->acl_category),  $action = 'open',
30                 $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
32         $this->types= array(  "dhcpService" => _("Global options"),
33                 "dhcpClass" => _("Class"),
34                 "dhcpSubClass" => _("Subclass"),
35                 "dhcpHost" => _("Host"),
36                 "dhcpGroup" => _("Group"),
37                 "dhcpPool" => _("Pool"),
38                 "dhcpSubnet" => _("Subnet"),
39                 "dhcpSharedNetwork" => _("Shared network"),
40                 "dhcpTSigKey" => _("DNS update key"),
41                 "dhcpDnsZone" => _("DNS update zone") );
43         $this->classtype= $type;
44     }
46     function execute()
47     {
48         plugin::execute();
50         /* Fill templating stuff */
51         $smarty = get_smarty();
52         $display= "";
54         $sections= $this->sectionMap[$this->classtype];
55         $t_sections= array();
56         foreach ($sections as $section){
57             $t_sections[$section]= $this->types[$section]; 
58         }
59         asort($t_sections);
60         $ui = get_userinfo();
61         $smarty->assign("sections", set_post($t_sections));
62         $display.= $smarty->fetch(get_template_path('dhcpNewSection.tpl', TRUE, dirname(__FILE__)));
63         return($display);
64     }
66     /* Get posts and set class name 
67      */ 
68     function save_object()
69     {
70     }
72     /* Check given class name */
73     function check()
74     {
75         /* Call common method to give check the hook */
76         $message= "";
78         return ($message);
79     }
82     /* Return the class name */
83     function save()
84     {
85     }
87 }
89 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
90 ?>