]> git.mjollnir.org Git - moodle.git/commitdiff
Bring Sticky Blocks into the admin fold
authormoodler <moodler>
Mon, 2 Oct 2006 06:58:46 +0000 (06:58 +0000)
committermoodler <moodler>
Mon, 2 Oct 2006 06:58:46 +0000 (06:58 +0000)
admin/stickyblocks.php

index 713b35e804318fb53460f371a1f107c64240bcd1..d4867b75e15a062de17dd1044d85f93c658505ac 100644 (file)
     $strtitle = get_string('stickyblocks','admin');
     $strheading = get_string('adminhelpstickyblocks');
     
-    print_header($strtitle,$strtitle,'<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.
-                 get_string('administration').'</a> -> '.$strtitle);
-
-    echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
-    echo '<tr valign="top">';
     
 
     if (!empty($pt)) {
+
+        print_header($strtitle,$strtitle,'<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.
+                     get_string('administration').'</a> -> '.$strtitle);
+    
+        echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
+        echo '<tr valign="top">';
+
         require_once($CFG->dirroot.$pagetypes[$pt]['lib']);
         
         define('ADMIN_STICKYBLOCKS',$pt);
         echo '<td valign="top" style="width: '.$blocks_preferred_width.'px;" id="left-column">';
         
         blocks_print_group($PAGE, $blocks, BLOCK_POS_LEFT);
+        echo '</td>';
+        echo '<td valign="top" id="middle-column">';
+
     } else {
-        echo '<td valign="top" id="left-column">';
+        require_once($CFG->libdir.'/adminlib.php');
+        $adminroot = admin_get_root();
+        admin_externalpage_setup('stickyblocks', $adminroot);
+        admin_externalpage_print_header($adminroot);
     }
-    echo '</td>';
 
 
-    echo '<td valign="top" id="middle-column">';
     print_simple_box_start('center');
     print_heading($strheading);
     echo '<form method="post" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/stickyblocks.php">'
     echo '</p></form>';
     echo get_string('stickyblocksduplicatenotice','admin');
     print_simple_box_end();
-    echo '</td>';
 
 
     if (!empty($pt)) {
+        echo '</td>';
         echo '<td valign="top" style="width: '.$blocks_preferred_width.'px;" id="left-column">';
         blocks_print_group($PAGE, $blocks, BLOCK_POS_RIGHT);
+        echo '</td>';
+        echo '</tr></table>';
+        print_footer();
+    } else {
+        admin_externalpage_print_footer($adminroot);
     }
-    echo '<td valign="top" id="left-column">';
-    echo '</td>';
-  
-    echo '</tr></table>';
-
-    print_footer();
-    
 
 ?>