plugins/Newsboy.php
changeset 18 8205e4ca237e
parent 17 f6edf51a9479
child 19 93c01ea4366b
equal deleted inserted replaced
17:f6edf51a9479 18:8205e4ca237e
    81   }
    81   }
    82   
    82   
    83   if ( $paths->namespace != 'NewsBoy' )
    83   if ( $paths->namespace != 'NewsBoy' )
    84     return;
    84     return;
    85   
    85   
    86   if ( $paths->cpage['urlname_nons'] == 'Portal' || preg_match('/^Archive(\/|$)/', $page->page_id) )
    86   if ( $page->page_id == 'Portal' || preg_match('/^Archive(\/|$)/', $page->page_id) )
    87   {
    87   {
    88     
    88     
    89     // Add admin opener Javascript function
    89     // Add admin opener Javascript function
    90     $template->add_header('<!-- NewsBoy: admin panel nav function -->
    90     $template->add_header('<!-- NewsBoy: admin panel nav function -->
    91     <enano:no-opt>
    91     <enano:no-opt>
   109         window.location = loc;
   109         window.location = loc;
   110       }
   110       }
   111     </script>
   111     </script>
   112     </enano:no-opt>');
   112     </enano:no-opt>');
   113     
   113     
   114     if ( !$page->perms->get_permissions('read') )
   114     $perms =& $page->perms;
       
   115     if ( !$perms )
       
   116       $perms = $session->fetch_page_acl($page->page_id, $page->namespace);
       
   117     
       
   118     if ( !$perms->get_permissions('read') )
   115     {
   119     {
   116       $page->err_access_denied();
   120       $page->err_access_denied();
   117       return false;
   121       return false;
   118     }
   122     }
   119     
   123     
   155           $template->set_page($page_id, $namespace);
   159           $template->set_page($page_id, $namespace);
   156         }
   160         }
   157       }
   161       }
   158       
   162       
   159       parent::__construct($page_id, $namespace, $revision);
   163       parent::__construct($page_id, $namespace, $revision);
   160       $this->perms = $session->fetch_page_acl($this->page_id, $this->namespace);
   164     }
   161       $this->build_cdata();
       
   162     }  
       
   163     
   165     
   164     function build_cdata()
   166     function build_cdata()
   165     {
   167     {
   166       if ( $this->page_id == 'Portal' || $this->page_id == 'Article' )
   168       if ( $this->page_id == 'Portal' || $this->page_id == 'Article' )
   167       {
   169       {