b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: admin ] [ index: admin ] [ all elements ]

Source for file _menutop.php

Documentation is available at _menutop.php

  1. <?php
  2. /**
  3.  * Displays first part of the page menu (before the page title)
  4.  *
  5.  * b2evolution - {@link http://b2evolution.net/}
  6.  * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  7.  * @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
  8.  *
  9.  * @package admin
  10.  */
  11. if!defined('DB_USER') ) die'Please, do not access this page directly.' );
  12. ?>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  14. <html xml:lang="<?php locale_lang(?>" lang="<?php locale_lang(?>">
  15. <head>
  16.     <meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset(?>" />
  17.     <title>b2evo :: <?php echo preg_replace'/:$/'''$admin_pagetitle )?></title>
  18.     <link href="variation.css" rel="stylesheet" type="text/css" title="Variation" />
  19.     <link href="desert.css" rel="alternate stylesheet" type="text/css" title="Desert" />
  20.     <link href="legacy.css" rel="alternate stylesheet" type="text/css" title="Legacy" />
  21.     <?php ifis_filedirname(__FILE__).'/custom.css' ) ) ?>
  22.     <link href="custom.css" rel="alternate stylesheet" type="text/css" title="Custom" />
  23.     <?php ?>
  24.     <script type="text/javascript" src="styleswitcher.js"></script>
  25.     <?php
  26.     if$mode == 'sidebar' )
  27.     // Include CSS overrides for sidebar: ?>
  28.         <link href="sidebar.css" rel="stylesheet" type="text/css" />
  29.     <?php
  30.     }
  31.  
  32.     if$admin_tab == 'files'    || ($admin_tab == 'blogs' && $tab == 'perm') )
  33.     // -- Inject javascript ----------------
  34.         // gets initialized in _footer.php
  35.         ?>
  36.         <script type="text/javascript">
  37.         <!--
  38.         <?php
  39.         
  40.         switch$admin_tab )
  41.         {
  42.             case 'blogs':
  43.             ?>
  44.             function toggleall( the_form, id, i )
  45.             {
  46.                 if( allchecked[i] )
  47.                     allchecked[i] = false;
  48.                 else
  49.                     allchecked[i] = true;
  50.                 
  51.                 the_form.elements['blog_ismember_'+String(id)].checked = allchecked[i];
  52.                 the_form.elements['blog_perm_published_'+String(id)].checked = allchecked[i];
  53.                 the_form.elements['blog_perm_protected_'+String(id)].checked = allchecked[i];
  54.                 the_form.elements['blog_perm_private_'+String(id)].checked = allchecked[i];
  55.                 the_form.elements['blog_perm_draft_'+String(id)].checked = allchecked[i];
  56.                 the_form.elements['blog_perm_deprecated_'+String(id)].checked = allchecked[i];
  57.                 the_form.elements['blog_perm_delpost_'+String(id)].checked = allchecked[i];
  58.                 the_form.elements['blog_perm_comments_'+String(id)].checked = allchecked[i];
  59.                 the_form.elements['blog_perm_cats_'+String(id)].checked = allchecked[i];
  60.                 the_form.elements['blog_perm_properties_'+String(id)].checked = allchecked[i];
  61.                 
  62.                 setcheckallspan( i );
  63.             }
  64.             <?php
  65.             break;
  66.                 
  67.             case 'files':
  68.             /**
  69.              * Toggles status of a bunch of checkboxes in a form
  70.              *
  71.              * @param string the form name
  72.              * @param string the checkbox(es) element(s) name
  73.              */    ?>
  74.             function toggleCheckboxes(the_form, the_elements)
  75.             {
  76.                 if( allchecked[0] ) allchecked[0] = false;
  77.                 else allchecked[0] = true;
  78.                 
  79.                 var elems = document.forms[the_form].elements[the_elements];
  80.                 var elems_cnt = (typeof(elems.length) != 'undefined') ? elems.length : 0;
  81.                 if (elems_cnt)
  82.                 {
  83.                     for (var i = 0; i < elems_cnt; i++)
  84.                     {
  85.                         elems[i].checked = allchecked[0];
  86.                     } // end for
  87.                 }
  88.                 else
  89.                 {
  90.                     elems.checked = allchecked[0];
  91.                 }
  92.                 setcheckallspan(0);
  93.             }
  94.             <?php
  95.             break;
  96.         }
  97.         
  98.         // --- general functions ----------------
  99.         /**
  100.          * replaces the text of the [nr]th checkall-html-ID
  101.          *
  102.          * @param integer number of the checkall "set"
  103.          * @param boolean force setting to true/false
  104.          */    ?>
  105.         function setcheckallspan( nr, set )
  106.         {
  107.             if( typeof allchecked[nr] == 'undefined' || typeof set != 'undefined' )
  108.             { // init
  109.                 allchecked[ nr ] = set;
  110.             }
  111.  
  112.             if( allchecked[nr] )
  113.                 var replace = document.createTextNode('<?php echo /* TRANS: Warning this is a javascript string */ T_('uncheck all'?>');
  114.             else
  115.                 var replace = document.createTextNode('<?php echo /* TRANS: Warning this is a javascript string */ T_('check all'?>');
  116.                         
  117.             if( document.getElementById( idprefix+'_'+String(nr) ) )
  118.                 document.getElementById( idprefix+'_'+String(nr) ).replaceChild(replace, document.getElementById( idprefix+'_'+String(nr) ).firstChild);
  119.             //else alert('no element with id '+idprefix+'_'+String(nr));
  120.         }
  121.         
  122.         <?php
  123.         /**
  124.          * inits the checkall functionality.
  125.          *
  126.          * @param string the prefix of the IDs where the '(un)check all' text should be set
  127.          * @param boolean initial state of the text (if there is no checkbox with ID htmlid + '_state_' + nr)
  128.          */ ?>
  129.         function initcheckall( htmlid, init )
  130.         {
  131.             // initialize array
  132.             allchecked = Array();
  133.             if( typeof htmlid == 'undefined' ) idprefix = 'checkallspan';
  134.             else idprefix = htmlid;
  135.             
  136.             var i = 0;
  137.             //alert(document.getElementById("checkallspan"+String(i)));
  138.             while( id = document.getElementById( idprefix+'_'+String(i)) )
  139.             {
  140.                 //alert( document.getElementById(idprefix+'_state_'+String(i)) );
  141.                 if( document.getElementById( idprefix+'_state_'+String(i)) )
  142.                     setcheckallspan( i, document.getElementById( idprefix+'_state_'+String(i)).checked );
  143.                 else setcheckallspan( i, init );
  144.             
  145.                 i++;
  146.             }
  147.             //if( i == 0 ) alert('no elements with ID prefix '+idprefix+' found!');
  148.         }
  149.         //-->
  150.         </script>
  151.         <?php
  152.     }
  153.     ?>
  154. </head>
  155. <body>
  156.  
  157. <?php
  158.  
  159. param'blog''integer'0true );    // We need this for the urls
  160.  
  161. ifempty($mode) )
  162. {    // We're not running in an special mode (bookmarklet, sidebar...)
  163. ?>
  164.  
  165. <div id="header">
  166.     <a href="http://b2evolution.net/" title="<?php echo T_("visit b2evolution's website"?>"><img id="evologo" src="../img/b2evolution_minilogo2.png" alt="b2evolution"  title="<?php echo T_("visit b2evolution's website"?>" width="185" height="40" /></a>
  167.  
  168.     <div id="headfunctions">
  169.         <?php echo T_('Style:'?>
  170.         <a href="#" onclick="setActiveStyleSheet('Variation'); return false;" title="Variation (Default)">V</a>&middot;<a href="#" onclick="setActiveStyleSheet('Desert'); return false;" title="Desert">D</a>&middot;<a href="#" onclick="setActiveStyleSheet('Legacy'); return false;" title="Legacy">L</a><?php ifis_filedirname(__FILE__).'/custom.css' ) ) ?>&middot;<a href="#" onclick="setActiveStyleSheet('Custom'); return false;" title="Custom">C</a><?php ?>
  171.         &bull;
  172.         <a href="<?php echo $htsrv_url ?>/login.php?action=logout"><?php echo T_('Logout'?></a>
  173.         &bull;
  174.         <a href="<?php echo $baseurl ?>"><?php echo T_('Exit to blogs'?> <img src="img/close.gif" width="14" height="14" class="top" alt="" title="<?php echo T_('Exit to blogs'?>" /></a><br />
  175.     </div>
  176.  
  177.     <?php    
  178.     if!$obhandler_debug )
  179.     // don't display changing time when we want to test obhandler
  180.     ?>
  181.     <div id="headinfo">
  182.         b2evo v <strong><?php echo $b2_version ?></strong>
  183.         &middot; <?php echo T_('Blog time:'?> <strong><?php echo date_i18nlocale_timefmt()$localtimenow ?></strong>
  184.         &middot; <?php echo T_('GMT:'?> <strong><?php echo gmdatelocale_timefmt()$servertimenow)?></strong>
  185.         &middot; <?php echo T_('Logged in as:')' <strong>'$user_login?></strong>
  186.     </div>
  187.     <?php ?>
  188.     
  189.     <ul class="tabs">
  190.     <?php
  191.         if$admin_tab == 'new' )
  192.             echo '<li class="current">';
  193.         else
  194.             echo '<li>';
  195.         echo '<a href="b2edit.php?blog='$blog'" style="font-weight: bold;">'T_('Write')'</a></li>';
  196.  
  197.         if$admin_tab == 'edit'  )
  198.             echo '<li class="current">';
  199.         else
  200.             echo '<li>';
  201.         echo '<a href="b2browse.php?blog='$blog'" style="font-weight: bold;">'T_('Edit')'</a></li>';
  202.  
  203.         if$admin_tab == 'cats' )
  204.             echo '<li class="current">';
  205.         else
  206.             echo '<li>';
  207.         echo '<a href="b2categories.php?blog='$blog'" >'T_('Categories')'</a></li>';
  208.  
  209.         if$admin_tab == 'blogs' )
  210.             echo '<li class="current">';
  211.         else
  212.             echo '<li>';
  213.         echo '<a href="b2blogs.php" >'T_('Blogs')'</a></li>';
  214.  
  215.         if$current_User->check_perm'stats''view' ) )
  216.         {
  217.             if$admin_tab == 'stats' )
  218.                 echo '<li class="current">';
  219.             else
  220.                 echo '<li>';
  221.             echo '<a href="b2stats.php" >'T_('Stats')'</a></li>';
  222.         }
  223.  
  224.         if$current_User->check_perm'spamblacklist''view' ) )
  225.         {
  226.             if$admin_tab == 'antispam' )
  227.                 echo '<li class="current">';
  228.             else
  229.                 echo '<li>';
  230.             echo '<a href="b2antispam.php" >'T_('Antispam')'</a></li>';
  231.         }
  232.  
  233.         if$current_User->check_perm'templates''any' ) )
  234.         {
  235.             if$admin_tab == 'templates' )
  236.                 echo '<li class="current">';
  237.             else
  238.                 echo '<li>';
  239.             echo '<a href="b2template.php">'T_('Templates')'</a></li>';
  240.         }
  241.  
  242.         if$admin_tab == 'users' )
  243.             echo '<li class="current">';
  244.         else
  245.             echo '<li>';
  246.         
  247.         if$current_User->check_perm'users''view' ) )
  248.         {
  249.             echo '<a href="b2users.php" >'T_('Users')'</a></li>';
  250.         }
  251.         else
  252.         {
  253.             echo '<a href="b2users.php" >'T_('User Profile')'</a></li>';
  254.         }
  255.  
  256.  
  257.         if$current_User->check_perm'options''view' ) )
  258.         {
  259.             if$admin_tab == 'options' )
  260.                 echo '<li class="current">';
  261.             else
  262.                 echo '<li>';
  263.             echo '<a href="b2options.php" >'T_('Settings')'</a></li>';
  264.         }
  265.  
  266.         if$admin_tab == 'tools' )
  267.             echo '<li class="current">';
  268.         else
  269.             echo '<li>';
  270.         echo '<a href="tools.php" >'T_('Tools')'</a></li>';
  271.  
  272.     ?>
  273.  
  274.     </ul>
  275. </div>
  276.  
  277. <?php
  278. }    // not in special mode
  279. ?>
  280.  
  281. <div id="TitleArea">
  282. <h1><strong>:: <?php echo $admin_pagetitle?></strong>

Documentation generated on Tue, 20 May 2008 01:55:36 +0200 by phpDocumentor 1.4.2