plugins/SpecialAdmin.php
changeset 1099 73abd46f5148
parent 1094 121cf3bbd16e
child 1118 e26e74d80c15
equal deleted inserted replaced
1098:be6cfe79128c 1099:73abd46f5148
  2224           </div>
  2224           </div>
  2225         </td>
  2225         </td>
  2226         <td width="100%" valign="top">
  2226         <td width="100%" valign="top">
  2227           <div class="pad" id="ajaxPageContainer">
  2227           <div class="pad" id="ajaxPageContainer">
  2228           <?php
  2228           <?php
  2229           if(isset($_GET['module'])) 
  2229           if ( isset($_GET['module']) ) 
  2230           {
  2230           {
  2231             // Look for a namespace prefix in the urlname, and assign a different namespace, if necessary
  2231             list($module) = explode('/', $_GET['module']);
  2232             $k = array_keys($paths->nslist);
  2232             list($page_id, $namespace) = RenderMan::strToPageID($module);
  2233             for ( $i = 0; $i < sizeof($paths->nslist); $i++ )
  2233             if ( $namespace != 'Admin' )
  2234             {
  2234             {
  2235               $ln = strlen( $paths->nslist[ $k[ $i ] ] );
  2235               echo '<div class="error-box">Module must be in the Admin namespace</div>';
  2236               if ( substr($_GET['module'], 0, $ln) == $paths->nslist[$k[$i]] )
       
  2237               {
       
  2238                 $ns = $k[$i];
       
  2239                 $nm = substr($_GET['module'], $ln, strlen($_GET['module']));
       
  2240               }
       
  2241             }
  2236             }
  2242             $fname = 'page_'.$ns.'_'.$nm;
  2237             else
  2243             $s = strpos($fname, '?noheaders');
       
  2244             if($s) $fname = substr($fname, 0, $s);
       
  2245             $paths->cpage['module'] = $_GET['module'];
       
  2246             if ( function_exists($fname) && $_GET['module'] != $paths->nslist['Special'] . 'Administration' )
       
  2247             {
  2238             {
  2248               call_user_func($fname);
  2239               $paths->fullpage = $_GET['module'];
       
  2240               $paths->cpage['module'] = $_GET['module'];
       
  2241               $page = new PageProcessor($page_id, $namespace);
       
  2242               $page->send_headers = false;
       
  2243               $page->send();
       
  2244               $paths->fullpage = $paths->page;
  2249             }
  2245             }
  2250           } 
  2246           } 
  2251           else 
  2247           else 
  2252           {
  2248           {
  2253             echo '<script type="text/javascript">document.write(\'<div class="wait-box">Please wait while the administration panel loads. You need to be using a recent browser with AJAX support in order to use Runt.</div>\');</script><noscript><div class="error-box">It looks like Javascript isn\'t enabled in your browser. Please enable Javascript or use a different browser to continue.</div></noscript>';
  2249             echo '<script type="text/javascript">document.write(\'<div class="wait-box">Please wait while the administration panel loads. You need to be using a recent browser with AJAX support in order to use Runt.</div>\');</script><noscript><div class="error-box">It looks like Javascript isn\'t enabled in your browser. Please enable Javascript or use a different browser to continue.</div></noscript>';