[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"*/),
14 #"dhcpClass" => array("dhcpSubClass"),
15 "dhcpSubClass" => array(),
16 "dhcpHost" => array(),
17 "dhcpGroup" => array("dhcpHost"),
18 "dhcpPool" => array(),
19 "dhcpSubnet" => array("dhcpPool", "dhcpGroup", "dhcpHost" /*, "dhcpClass"*/),
20 "dhcpSharedNetwork" => array("dhcpSubnet", "dhcpPool"));
24 function dhcpNewSectionDialog($type)
25 {
26 $this->types= array( "dhcpService" => _("Global options"),
27 /*"dhcpClass" => _("Class"),*/
28 "dhcpSubClass" => _("Subclass"),
29 "dhcpHost" => _("Host"),
30 "dhcpGroup" => _("Group"),
31 "dhcpPool" => _("Pool"),
32 "dhcpSubnet" => _("Subnet"),
33 "dhcpSharedNetwork" => _("Shared network"));
35 $this->classtype= $type;
36 }
38 function execute()
39 {
40 /* Fill templating stuff */
41 $smarty = get_smarty();
42 $display= "";
44 $sections= $this->sectionMap[$this->classtype];
45 $t_sections= array();
46 foreach ($sections as $section){
47 $t_sections[$section]= $this->types[$section];
48 }
49 asort($t_sections);
50 $ui = get_userinfo();
51 $smarty->assign("sections", $t_sections);
52 $display.= $smarty->fetch(get_template_path('dhcpNewSection.tpl', TRUE, dirname(__FILE__)));
53 return($display);
54 }
56 /* Get posts and set class name
57 */
58 function save_object()
59 {
60 }
62 /* Check given class name */
63 function check()
64 {
65 /* Call common method to give check the hook */
66 $message= "";
68 return ($message);
69 }
72 /* Return the class name */
73 function save()
74 {
75 }
77 }
79 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
80 ?>