Changed namespace properties (including core identifier) for external pages that load the Enano API to be a uniform "API" namespace and "SystemAPI:" prefix.
authorDan
Wed, 13 Aug 2008 08:55:26 -0400
changeset 692 78473351a6c9
parent 691 dab7850c098d
child 693 f21aa64d050a
Changed namespace properties (including core identifier) for external pages that load the Enano API to be a uniform "API" namespace and "SystemAPI:" prefix.
includes/constants.php
includes/pageprocess.php
includes/paths.php
includes/template.php
--- a/includes/constants.php	Wed Aug 13 08:48:03 2008 -0400
+++ b/includes/constants.php	Wed Aug 13 08:55:26 2008 -0400
@@ -14,7 +14,6 @@
  */
 
 // Ban types
-
 define('BAN_IP', 1);
 define('BAN_USER', 2);
 define('BAN_EMAIL', 3);
@@ -113,7 +112,6 @@
 define('USER_LEVEL_GUEST', 1);
 
 // Group status
-
 define('GROUP_CLOSED', 1);
 define('GROUP_REQUEST', 2);
 define('GROUP_HIDDEN', 3);
--- a/includes/pageprocess.php	Wed Aug 13 08:48:03 2008 -0400
+++ b/includes/pageprocess.php	Wed Aug 13 08:55:26 2008 -0400
@@ -313,7 +313,7 @@
       
       $this->footer();
     }
-    else if ( $this->namespace == 'Anonymous' )
+    else if ( $this->namespace == 'API' )
     {
       if ( $this->send_headers )
       {
@@ -566,7 +566,7 @@
     // It's not in there. Perform validation.
     
     // We can't create special, admin, or external pages.
-    if ( $this->namespace == 'Special' || $this->namespace == 'Admin' || $this->namespace == 'Anonymous' )
+    if ( $this->namespace == 'Special' || $this->namespace == 'Admin' || $this->namespace == 'API' )
     {
       $this->raise_error($lang->get('pagetools_create_err_nodb_namespace'));
       return false;
--- a/includes/paths.php	Wed Aug 13 08:48:03 2008 -0400
+++ b/includes/paths.php	Wed Aug 13 08:55:26 2008 -0400
@@ -19,7 +19,7 @@
  
 class pathManager
 {
-  public $pages, $custom_page, $cpage, $page, $fullpage, $page_exists, $page_id, $namespace, $nslist, $admin_tree, $wiki_mode, $page_protected, $template_cache, $anonymous_page;
+  public $pages, $custom_page, $cpage, $page, $fullpage, $page_exists, $page_id, $namespace, $nslist, $admin_tree, $wiki_mode, $page_protected, $template_cache, $external_api_page;
   
   /**
    * List of custom processing functions for namespaces. This is protected so trying to do anything with it will throw an error.
@@ -48,7 +48,7 @@
       'System'  =>'Enano:',
       'Template'=>'Template:',
       'Category'=>'Category:',
-      'Anonymous'=>'PhysicalRedirect:',
+      'API'=>'SystemAPI:',
       'Project' =>sanitize_page_id(getConfig('site_name')).':',
       );
     
@@ -237,13 +237,13 @@
         $title = basename($_SERVER['SCRIPT_NAME']);
       }
       $base_uri = str_replace( scriptPath . '/', '', $_SERVER['SCRIPT_NAME'] );
-      $this->page = $this->nslist['Anonymous'] . sanitize_page_id($base_uri);
-      $this->fullpage = $this->nslist['Anonymous'] . sanitize_page_id($base_uri);
-      $this->namespace = 'Anonymous';
+      $this->page = $this->nslist['API'] . sanitize_page_id($base_uri);
+      $this->fullpage = $this->nslist['API'] . sanitize_page_id($base_uri);
+      $this->namespace = 'API';
       $this->cpage = array(
           'name' => $title,
           'urlname' => sanitize_page_id($base_uri),
-          'namespace' => 'Anonymous',
+          'namespace' => 'API',
           'special' => 1,
           'visible' => 1,
           'comments_on' => 1,
@@ -251,8 +251,8 @@
           'delvotes' => 0,
           'delvote_ips' => ''
         );
-      $this->anonymous_page = true;
-      $code = $plugins->setHook('paths_anonymous_page');
+      $this->external_api_page = true;
+      $code = $plugins->setHook('paths_external_api_page');
       foreach ( $code as $cmd )
       {
         eval($cmd);
@@ -355,7 +355,7 @@
       {
         $this->cpage['protected'] = 1;
       }
-      if($this->namespace == 'Special' && !$this->anonymous_page)
+      if($this->namespace == 'Special' && !$this->external_api_page)
       {
         // Can't load nonexistent pages
         if( is_string(getConfig('main_page')) )
--- a/includes/template.php	Wed Aug 13 08:48:03 2008 -0400
+++ b/includes/template.php	Wed Aug 13 08:55:26 2008 -0400
@@ -561,7 +561,7 @@
       case "Category":
         $ns = $lang->get('onpage_lbl_page_category');
         break;
-      case "Anonymous":
+      case "API":
         $ns = $lang->get('onpage_lbl_page_external');
         break;
     }
@@ -662,7 +662,7 @@
       $tb .= $button->run();
     // View source button
     }
-    else if ( $session->check_acl_scope('view_source', $local_namespace) && $perms->get_permissions('view_source') && ( !$perms->get_permissions('edit_page') || !$perms->get_permissions('even_when_protected') && $paths->page_protected ) && $local_namespace != 'Anonymous') 
+    else if ( $session->check_acl_scope('view_source', $local_namespace) && $perms->get_permissions('view_source') && ( !$perms->get_permissions('edit_page') || !$perms->get_permissions('even_when_protected') && $paths->page_protected ) && $local_namespace != 'API') 
     {
       $button->assign_vars(array(
         'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxEditor()); return false; }" title="' . $lang->get('onpage_tip_viewsource') . '" accesskey="e"',
@@ -922,7 +922,7 @@
     }
     
     // Manage ACLs button
-    if ( !$paths->anonymous_page && $session->check_acl_scope('edit_acl', $local_namespace) && ( $perms->get_permissions('edit_acl') || ( defined('ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL') &&  $session->user_level >= USER_LEVEL_ADMIN ) ) )
+    if ( !$paths->external_api_page && $session->check_acl_scope('edit_acl', $local_namespace) && ( $perms->get_permissions('edit_acl') || ( defined('ACL_ALWAYS_ALLOW_ADMIN_EDIT_ACL') &&  $session->user_level >= USER_LEVEL_ADMIN ) ) )
     {
       $menubtn->assign_vars(array(
           'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { var s = ajaxOpenACLManager(); console.debug(s); return false; }" title="' . $lang->get('onpage_tip_aclmanager') . '" accesskey="m"',