Blame Scripts/Php/Webenv/admin/includes/functions/links.php

878a2b
878a2b
/***
878a2b
 * Mainlinks used in administratoristration interface
878a2b
 *
878a2b
 * @param show_mainlink();
878a2b
 * @param control link visibility/availability.
878a2b
 */
878a2b
878a2b
 function show_mainlinks()
878a2b
 {
878a2b
878a2b
 //--------------------/* Initialize Link Array */
878a2b
 
878a2b
    $link = array();
878a2b
878a2b
    // User should have writer access to see the following links.
878a2b
    if ( is_user('writer') || is_user('administrator')  )
878a2b
    {
878a2b
        $link['entries']                = ucfirst(translate('entries'));
878a2b
    }
878a2b
878a2b
    // User should have administrator rights to see the following links.
878a2b
    if ( is_user('administrator') )
878a2b
    {
878a2b
        $link['pages']                  = ucfirst(translate('pages'));
878a2b
        $link['categories']             = ucfirst(translate('categories'));
878a2b
        $link['comments']             = ucfirst(translate('comments'));
878a2b
        $link['links']                  = ucfirst(translate('links'));
878a2b
        $link['users']                  = ucfirst(translate('users'));
878a2b
    }
878a2b
878a2b
 //-----------/* Sanitize URL variables */
878a2b
878a2b
    if ( sanitize_url_var('page') )
878a2b
    {
878a2b
        $url['page'] = $_GET['page'];
878a2b
    }
878a2b
878a2b
 //--------------------/* Build html links */
878a2b
878a2b
    $html = '
    ';
878a2b
878a2b
    if ( isset($url['page'] ) )
878a2b
    {
878a2b
        $html .= '
  • '. strtoupper(translate('home')) . '
  • ';
    878a2b
        } 
    878a2b
        else 
    878a2b
        {
    878a2b
            $html .= '
  • '. strtoupper(translate('home')) . '
  • ';
    878a2b
        }
    878a2b
    878a2b
        foreach ($link as $key => $value) 
    878a2b
        {
    878a2b
            if ( isset($url['page']) && $url['page'] == $key) 
    878a2b
            {
    878a2b
                $value = translate(strtolower($key));
    878a2b
                $html .= '
  • ' . strtoupper($value). '
  • ';
    878a2b
            } 
    878a2b
            else
    878a2b
            {
    878a2b
                $value = translate(strtolower($key));
    878a2b
                $html .= '
  • ' . strtoupper($value). '
  • ';
    878a2b
            }
    878a2b
        }
    878a2b
    878a2b
        $html .= '';
    878a2b
    878a2b
        return $html;
    878a2b
     }
    878a2b
    878a2b
    /***
    878a2b
     * Sublinks used in the administratoristration interface
    878a2b
     *
    878a2b
     * @param show_sublink();
    878a2b
     * @param control link visibility/availability.
    878a2b
     */
    878a2b
    878a2b
    function show_sublinks()
    878a2b
    {
    878a2b
    878a2b
    //-----------/* Initialize Link Array */
    878a2b
     
    878a2b
        $link = array();
    878a2b
    878a2b
        $link['entries']                = ucfirst(translate('entries'));
    878a2b
        $link['pages']                  = ucfirst(translate('pages'));
    878a2b
        $link['categories']             = ucfirst(translate('categories'));
    878a2b
        $link['links']                  = ucfirst(translate('links'));
    878a2b
        $link['users']                  = ucfirst(translate('users'));
    878a2b
    878a2b
    //-----------/* Sanitize URL variables */
    878a2b
    878a2b
        if ( sanitize_url_var('page') )
    878a2b
        {
    878a2b
            $url['page'] = $_GET['page'];
    878a2b
        }
    878a2b
    878a2b
    //-----------/* Build html links */
    878a2b
    878a2b
        $html = '
    878a2b
        $html .= '
      ';
    878a2b
    878a2b
    if ( isset( $url['page'] ) )
    878a2b
    {
    878a2b
        switch ($url['page']) 
    878a2b
        {
    878a2b
    878a2b
            case 'entries':
    878a2b
                if ( is_user('writer') == 'true' || is_user('administrator') == 'true' )
    878a2b
                {
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('entries')) . '
  • ';
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('add'))) . ' ' . translate(strtolower('entry')) . '
  • ';
    878a2b
                }
    878a2b
                break;
    878a2b
    878a2b
            case 'pages':
    878a2b
                if ( is_user('administrator') == 'true' )
    878a2b
                {
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('pages')) . '
  • ';
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('add'))) . ' ' . translate(strtolower('page')) . '
  • ';
    878a2b
                }
    878a2b
                break;
    878a2b
    878a2b
            case 'categories':
    878a2b
                if ( is_user('administrator') == 'true' )
    878a2b
                {
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('categories')) . '
  • ';
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('add'))) . ' ' . translate(strtolower('category')) . '
  • ';
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('category tree'))) . '
  • ';
    878a2b
                }
    878a2b
                break;
    878a2b
    878a2b
            case 'comments':
    878a2b
                if ( is_user('administrator') == 'true' )
    878a2b
                {
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('comments')) . '
  • ';
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('add'))) . ' ' . translate(strtolower('comment')) . '
  • ';
    878a2b
                }
    878a2b
                break;
    878a2b
    878a2b
            case 'links':
    878a2b
                if ( is_user('administrator') == 'true' )
    878a2b
                {
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('links')) . '
  • ';
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('add'))) . ' ' . translate(strtolower('link')) . '
  • ';
    878a2b
                }
    878a2b
                break;
    878a2b
    878a2b
            case 'users':
    878a2b
                if ( is_user('administrator') == 'true' )
    878a2b
                {
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('users')) . '
  • ';
    878a2b
                    $html .= '
  • ' . ucfirst(translate(strtolower('add'))) . ' ' . translate(strtolower('user')) . '
  • ';
    878a2b
                }
    878a2b
                break;
    878a2b
        
    878a2b
            }
    878a2b
        }
    878a2b
    878a2b
        $html .= '';
    878a2b
        $html .= '';
    878a2b
    878a2b
        return $html;
    878a2b
     }
    878a2b
    ?>