]> git.mjollnir.org Git - moodle.git/commitdiff
More PHP4 compatibility issues fixed.
authorvinkmar <vinkmar>
Sun, 20 Aug 2006 03:56:25 +0000 (03:56 +0000)
committervinkmar <vinkmar>
Sun, 20 Aug 2006 03:56:25 +0000 (03:56 +0000)
admin/adminlib.php
blocks/admin_2/block_admin_2.php

index 60de9aae75964b48bc42123610ca13507b8df4f3..85b7423ebc58ea108dc7b8efa2c13faf2f54f3d8 100644 (file)
@@ -98,7 +98,12 @@ class admin_category extends parentable_part_of_admin_tree {
                        return true;
                }
                
-               foreach($this->children as $child) {
+               unset($entries);
+        
+        $entries = array_keys($this->children);
+               
+               foreach($entries as $entry) {
+                   $child =& $this->children[$entry];
                        if (is_a($child, 'parentable_part_of_admin_tree')) {
                            if ($child->add($destinationname, $something, $precedence)) {
                                    return true;
@@ -534,7 +539,7 @@ class admin_setting_special_frontpage extends admin_setting_configselect {
                for ($i = 0; $i < count($this->choices) - 1; $i++) {
                $return .='<select name="s_' . $this->name .'[]">';             
             foreach ($this->choices as $key => $value) {
-                   $return .= '<option value="' . $key . '"' . ($key == $currentsetting[$i] ? ' selected="selected"' : '') . '>' . $value . '</option>';
+                $return .= '<option value="' . $key . '"' . ($key == $currentsetting[$i] ? ' selected="selected"' : '') . '>' . $value . '</option>';
                }
                $return .= '</select>';
                        if ($i !== count($this->choices) - 2) {
index 489c3af0304ca7ba709fc78b1ac42f3178e11a67..fb230b5d42f73fc1d49dc9268bf36336a67bdd3f 100644 (file)
@@ -70,9 +70,13 @@ class block_admin_2 extends block_base {
                        }
 
                            $this->open_folder($content->visiblename);
-
-                   foreach ($content->children as &$child) {
-                               $this->build_tree($child);
+                
+                unset($entries);
+                
+                $entries = array_keys($content->children);
+                
+                   foreach ($entries as $entry) {
+                               $this->build_tree($content->children[$entry]);
                        }
 
                                $this->close_folder();
@@ -100,9 +104,15 @@ class block_admin_2 extends block_base {
 
         // we need to do this instead of $this->build_tree($ADMIN) because the top-level folder
                // is redundant (and ideally ignored). (the top-level folder is "administration".)
-               ksort($ADMIN->children);                            
-           foreach ($ADMIN->children as &$child) {
-            $this->build_tree($child);
+               
+               unset($entries);
+               
+               $entries = array_keys($ADMIN->children);
+        
+        asort($entries);                           
+        
+           foreach ($entries as $entry) {
+            $this->build_tree($ADMIN->children[$entry]);
         }
        
         if ($this->tempcontent !== '') {