From: hickert Date: Mon, 20 Aug 2007 09:21:56 +0000 (+0000) Subject: Updated dhcp stuff to be compatible with PHP4. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a94ec5e2e3ef053c5884c51fa5cc6be348391797;p=gosa.git Updated dhcp stuff to be compatible with PHP4. No static variables in classes and no static variable calls. Class names will always be returned as lowercase. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7072 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_dhcpNewSectionDialog.inc b/plugins/admin/systems/class_dhcpNewSectionDialog.inc index 32291f83e..e2235d372 100644 --- a/plugins/admin/systems/class_dhcpNewSectionDialog.inc +++ b/plugins/admin/systems/class_dhcpNewSectionDialog.inc @@ -10,7 +10,7 @@ class dhcpNewSectionDialog extends plugin /* Mapping array */ var $types= array(); var $classtype= ""; - static $sectionMap= array( "dhcpService" => array("dhcpSharedNetwork", "dhcpSubnet", "dhcpGroup", "dhcpHost" /*, "dhcpClass"*/), + var $sectionMap= array( "dhcpService" => array("dhcpSharedNetwork", "dhcpSubnet", "dhcpGroup", "dhcpHost" /*, "dhcpClass"*/), #"dhcpClass" => array("dhcpSubClass"), "dhcpSubClass" => array(), "dhcpHost" => array(), @@ -41,7 +41,7 @@ class dhcpNewSectionDialog extends plugin $smarty = get_smarty(); $display= ""; - $sections= dhcpNewSectionDialog::$sectionMap[$this->classtype]; + $sections= $this->sectionMap[$this->classtype]; $t_sections= array(); foreach ($sections as $section){ $t_sections[$section]= $this->types[$section]; diff --git a/plugins/admin/systems/class_servDHCP.inc b/plugins/admin/systems/class_servDHCP.inc index d9c571f1d..742ae5539 100644 --- a/plugins/admin/systems/class_servDHCP.inc +++ b/plugins/admin/systems/class_servDHCP.inc @@ -28,6 +28,12 @@ class servdhcp extends plugin "dhcpFailOverPeer" => _("Failover peer"), "dhcpSharedNetwork" => _("Shared network")); + + /* Backport: PHP4 compatibility */ + foreach($this->types as $type => $translation){ + $this->types[strtolower($type)] = $translation; + } + /* Load information about available services */ $this->reload(); if (!count($this->dhcpSections)){ @@ -48,7 +54,8 @@ class servdhcp extends plugin /* Section Creation? */ if (isset($_POST['create_section']) && isset($_POST['section'])){ $section= $_POST['section']; - if (isset(dhcpNewSectionDialog::$sectionMap[$section])){ + $tmp = new dhcpNewSectionDialog(NULL); + if (isset($tmp->sectionMap[$section])){ $this->dialog= new $section($this->current_object); $this->current_object= ""; } else { @@ -237,8 +244,11 @@ class servdhcp extends plugin ""; $editImg = "". ""; + + $tmp = new dhcpNewSectionDialog(NULL); foreach($this->dhcpSections as $section => $values ){ - if (count(dhcpNewSectionDialog::$sectionMap[$this->objectType($section)])){ + + if (count($tmp->sectionMap[$this->objectType($section)])){ if ($this->objectType($section) == "dhcpService"){ $DhcpList->AddEntry(array( array("string" => $values),