plugins/SpecialAdmin.php
changeset 1099 73abd46f5148
parent 1094 121cf3bbd16e
child 1118 e26e74d80c15
--- a/plugins/SpecialAdmin.php	Fri Aug 21 20:30:52 2009 -0400
+++ b/plugins/SpecialAdmin.php	Fri Aug 21 20:37:18 2009 -0400
@@ -2226,26 +2226,22 @@
         <td width="100%" valign="top">
           <div class="pad" id="ajaxPageContainer">
           <?php
-          if(isset($_GET['module'])) 
+          if ( isset($_GET['module']) ) 
           {
-            // Look for a namespace prefix in the urlname, and assign a different namespace, if necessary
-            $k = array_keys($paths->nslist);
-            for ( $i = 0; $i < sizeof($paths->nslist); $i++ )
+            list($module) = explode('/', $_GET['module']);
+            list($page_id, $namespace) = RenderMan::strToPageID($module);
+            if ( $namespace != 'Admin' )
             {
-              $ln = strlen( $paths->nslist[ $k[ $i ] ] );
-              if ( substr($_GET['module'], 0, $ln) == $paths->nslist[$k[$i]] )
-              {
-                $ns = $k[$i];
-                $nm = substr($_GET['module'], $ln, strlen($_GET['module']));
-              }
+              echo '<div class="error-box">Module must be in the Admin namespace</div>';
             }
-            $fname = 'page_'.$ns.'_'.$nm;
-            $s = strpos($fname, '?noheaders');
-            if($s) $fname = substr($fname, 0, $s);
-            $paths->cpage['module'] = $_GET['module'];
-            if ( function_exists($fname) && $_GET['module'] != $paths->nslist['Special'] . 'Administration' )
+            else
             {
-              call_user_func($fname);
+              $paths->fullpage = $_GET['module'];
+              $paths->cpage['module'] = $_GET['module'];
+              $page = new PageProcessor($page_id, $namespace);
+              $page->send_headers = false;
+              $page->send();
+              $paths->fullpage = $paths->page;
             }
           } 
           else