includes/template.php
changeset 349 fdaf9070566c
parent 345 4ccdfeee9a11
child 355 d15e4411ef65
equal deleted inserted replaced
348:87e08a6e4fec 349:fdaf9070566c
   304         ));
   304         ));
   305       
   305       
   306       $tb .= $button->run();
   306       $tb .= $button->run();
   307     }
   307     }
   308     // Edit button
   308     // Edit button
   309     if($session->get_permissions('read') && ($paths->namespace != 'Special' && $paths->namespace != 'Admin') && ( $session->get_permissions('edit_page') && ( ( $paths->page_protected && $session->get_permissions('even_when_protected') ) || !$paths->page_protected ) ) )
   309     if($session->get_permissions('read') && ($paths->namespace != 'Special' && $paths->namespace != 'Admin' && $paths->namespace != 'Anonymous') && ( $session->get_permissions('edit_page') && ( ( $paths->page_protected && $session->get_permissions('even_when_protected') ) || !$paths->page_protected ) ) )
   310     {
   310     {
   311       $button->assign_vars(array(
   311       $button->assign_vars(array(
   312         'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxEditor()); return false; }" title="' . $lang->get('onpage_tip_edit') . '" accesskey="e"',
   312         'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxEditor()); return false; }" title="' . $lang->get('onpage_tip_edit') . '" accesskey="e"',
   313         'PARENTFLAGS' => 'id="mdgToolbar_edit"',
   313         'PARENTFLAGS' => 'id="mdgToolbar_edit"',
   314         'HREF' => makeUrl($paths->page, 'do=edit', true),
   314         'HREF' => makeUrl($paths->page, 'do=edit', true),
   315         'TEXT' => $lang->get('onpage_btn_edit')
   315         'TEXT' => $lang->get('onpage_btn_edit')
   316         ));
   316         ));
   317       $tb .= $button->run();
   317       $tb .= $button->run();
   318     // View source button
   318     // View source button
   319     }
   319     }
   320     else if($session->get_permissions('view_source') && ( !$session->get_permissions('edit_page') || !$session->get_permissions('even_when_protected') && $paths->page_protected ) && $paths->namespace != 'Special' && $paths->namespace != 'Admin') 
   320     else if($session->get_permissions('view_source') && ( !$session->get_permissions('edit_page') || !$session->get_permissions('even_when_protected') && $paths->page_protected ) && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $paths->namespace != 'Anonymous') 
   321     {
   321     {
   322       $button->assign_vars(array(
   322       $button->assign_vars(array(
   323         'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxEditor()); return false; }" title="' . $lang->get('onpage_tip_viewsource') . '" accesskey="e"',
   323         'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxEditor()); return false; }" title="' . $lang->get('onpage_tip_viewsource') . '" accesskey="e"',
   324         'PARENTFLAGS' => 'id="mdgToolbar_edit"',
   324         'PARENTFLAGS' => 'id="mdgToolbar_edit"',
   325         'HREF' => makeUrl($paths->page, 'do=viewsource', true),
   325         'HREF' => makeUrl($paths->page, 'do=viewsource', true),
  1940     
  1940     
  1941     // The rewritten template engine will process all required vars during the load_template stage instead of (cough) re-processing everything each time around.
  1941     // The rewritten template engine will process all required vars during the load_template stage instead of (cough) re-processing everything each time around.
  1942     $tpl_strings = Array(
  1942     $tpl_strings = Array(
  1943       'PAGE_NAME'=>$this_page,
  1943       'PAGE_NAME'=>$this_page,
  1944       'PAGE_URLNAME'=>'Null',
  1944       'PAGE_URLNAME'=>'Null',
  1945       'SITE_NAME'=>$lang->get('meta_site_name'),
  1945       'SITE_NAME'=> ( defined('IN_ENANO_INSTALL') ) ? $lang->get('meta_site_name') : 'Critical error',
  1946       'USERNAME'=>'admin',
  1946       'USERNAME'=>'admin',
  1947       'SITE_DESC'=>$lang->get('meta_site_desc'),
  1947       'SITE_DESC'=>( defined('IN_ENANO_INSTALL') ) ? $lang->get('meta_site_desc') : 'This site is experiencing a problem and cannot load.',
  1948       'TOOLBAR'=>$tb,
  1948       'TOOLBAR'=>$tb,
  1949       'SCRIPTPATH'=>scriptPath,
  1949       'SCRIPTPATH'=>scriptPath,
  1950       'CONTENTPATH'=>contentPath,
  1950       'CONTENTPATH'=>contentPath,
  1951       'ADMIN_SID_QUES'=>$asq,
  1951       'ADMIN_SID_QUES'=>$asq,
  1952       'ADMIN_SID_AMP'=>$asa,
  1952       'ADMIN_SID_AMP'=>$asa,
  1953       'ADMIN_SID_AMP_HTML'=>'',
  1953       'ADMIN_SID_AMP_HTML'=>'',
  1954       'ADDITIONAL_HEADERS'=>$this->additional_headers,
  1954       'ADDITIONAL_HEADERS'=>$this->additional_headers,
  1955       'SIDEBAR_EXTRA'=>'',
  1955       'SIDEBAR_EXTRA'=>'',
  1956       'COPYRIGHT'=>$lang->get('meta_enano_copyright'),
  1956       'COPYRIGHT'=>( defined('IN_ENANO_INSTALL') ) ? $lang->get('meta_enano_copyright') : ( defined('ENANO_CONFIG_FETCHED') ? getConfig('copyright_notice') : '' ),
  1957       'TOOLBAR_EXTRAS'=>'',
  1957       'TOOLBAR_EXTRAS'=>'',
  1958       'REQUEST_URI'=>( isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '' ).$_SERVER['REQUEST_URI'],
  1958       'REQUEST_URI'=>( isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '' ).$_SERVER['REQUEST_URI'],
  1959       'STYLE_LINK'=>$slink,
  1959       'STYLE_LINK'=>$slink,
  1960       'LOGOUT_LINK'=>'',
  1960       'LOGOUT_LINK'=>'',
  1961       'THEME_LINK'=>'',
  1961       'THEME_LINK'=>'',