Blame Scripts/Php/Webenv/admin/content.php

878a2b
878a2b
/***
878a2b
 * Content Template
878a2b
 *
878a2b
 */
878a2b
878a2b
//-----------/* Show error if called directly */
878a2b
878a2b
    if ( basename( $_SERVER['PHP_SELF'] ) <> 'index.php')
878a2b
    {
878a2b
        echo '

Sorry, this page can\'t be served directly. ';

878a2b
        echo 'Try this instead.';
878a2b
        exit;
878a2b
    }
878a2b
878a2b
//-----------/* Sanitize URL variables */
878a2b
878a2b
    foreach ( $_GET as $key => $value )
878a2b
    {
878a2b
        if ( sanitize_url_var($key) )
878a2b
        {
878a2b
            $url[$key] = $value;
878a2b
        }
878a2b
    }
878a2b
878a2b
//----------/* Page Selector */
878a2b
878a2b
    if ( isset( $url['page'] ) ) 
878a2b
    {
878a2b
        switch ( $url['page'] )
878a2b
        {
878a2b
            case 'entries':
878a2b
                /* Build relation between "Entries" sublinks and its pages */
878a2b
                if ( isset($url['action'] ) ) 
878a2b
                {
878a2b
                    switch ( $url['action'] ) 
878a2b
                    {
878a2b
                        case "add":
878a2b
                            $page = 'p_entries_add.php';
878a2b
                            break;
878a2b
    
878a2b
                        case "update":
878a2b
                            $page = 'p_entries_update.php';
878a2b
                            break;
878a2b
                    }
878a2b
                }
878a2b
                else
878a2b
                {
878a2b
                    $page = 'p_entries.php';
878a2b
                }
878a2b
                break;
878a2b
        
878a2b
                case 'pages':
878a2b
                    // Just if user has admin rights.
878a2b
                    if ( is_user('administrator') )
878a2b
                    {
878a2b
                        /* Build relation between "Pages" sublinks and its pages */
878a2b
                        if ( isset($url['action'] ) ) 
878a2b
                        {
878a2b
                            switch ( $url['action'] ) 
878a2b
                            {
878a2b
                                case 'add':
878a2b
                                    $page = 'p_pages_add.php';
878a2b
                                        break;
878a2b
                                    
878a2b
                                case 'update':
878a2b
                                    $page = 'p_pages_update.php';
878a2b
                                    break;
878a2b
                            }
878a2b
                        }
878a2b
                        else
878a2b
                        {
878a2b
                            $page = 'p_pages.php';
878a2b
                        }
878a2b
                    }
878a2b
                    break;
878a2b
        
878a2b
                case 'categories':
878a2b
                    // Just if user has admin rights.
878a2b
                    if ( is_user('administrator') )
878a2b
                    {
878a2b
                        /* Build relation between "Categories" sublinks and its pages */
878a2b
                        if ( isset($url['action'] ) ) 
878a2b
                        {
878a2b
                            switch ( $url['action'] )
878a2b
                            {
878a2b
                                case 'add':
878a2b
                                    $page = 'p_categories_add.php';
878a2b
                                    break;
878a2b
                                case 'update':
878a2b
                                    $page = 'p_categories_update.php';
878a2b
                                    break;
878a2b
                                case 'tree':
878a2b
                                    $page = 'p_categories_tree.php';
878a2b
                                    break;
878a2b
                            }
878a2b
                        }
878a2b
                        else
878a2b
                        {
878a2b
                           $page = 'p_categories.php'; 
878a2b
                        }
878a2b
                    }
878a2b
                    break;
878a2b
878a2b
                case 'comments':
878a2b
                    // Just if user has admin rights.
878a2b
                    if ( is_user('administrator') )
878a2b
                    {
878a2b
                        /* Build relation between "Links" sublinks and its pages */
878a2b
                        if ( isset($url['action'] ) ) 
878a2b
                        {
878a2b
                            switch ( $url['action'] )
878a2b
                            {
878a2b
                                case 'add':
878a2b
                                    $page = 'p_comments_add.php';
878a2b
                                    break;
878a2b
                                case 'update':
878a2b
                                    $page = 'p_comments_update.php';
878a2b
                                    break;
878a2b
                            }
878a2b
                        }
878a2b
                        else
878a2b
                        {
878a2b
                            $page = 'p_comments.php'; 
878a2b
                        }
878a2b
                    }
878a2b
                    break;
878a2b
                
878a2b
                case 'links':
878a2b
                    // Just if user has admin rights.
878a2b
                    if ( is_user('administrator') )
878a2b
                    {
878a2b
                        /* Build relation between "Links" sublinks and its pages */
878a2b
                        if ( isset($url['action'] ) ) 
878a2b
                        {
878a2b
                            switch ( $url['action'] )
878a2b
                            {
878a2b
                                case 'add':
878a2b
                                    $page = 'p_links_add.php';
878a2b
                                    break;
878a2b
                            }
878a2b
                        }
878a2b
                        else
878a2b
                        {
878a2b
                            $page = 'p_links.php'; 
878a2b
                        }
878a2b
                    }
878a2b
                    break;
878a2b
        
878a2b
                case 'users':
878a2b
                    // Just if user has admin rights.
878a2b
                    if ( is_user('administrator') )
878a2b
                    {
878a2b
                        /* Build relation between "Links" sublinks and its pages */
878a2b
                        if ( isset($url['action'] ) ) 
878a2b
                        {
878a2b
                            switch ( $url['action'] )
878a2b
                            {
878a2b
                                case 'add':
878a2b
                                    $page = 'p_users_add.php';
878a2b
                                    break;
878a2b
                            }
878a2b
                        }
878a2b
                        else
878a2b
                        {
878a2b
                            $page = 'p_users.php';
878a2b
                        }
878a2b
                    }
878a2b
                    break;
878a2b
    
878a2b
                default:
878a2b
                    $page = 'p_index.php';
878a2b
                    break;
878a2b
            }
878a2b
        }
878a2b
        else
878a2b
        {
878a2b
            $page = 'p_index.php'; 
878a2b
        }
878a2b
878a2b
//--------/* Verify file before include it
878a2b
878a2b
    if ( file_exists( ABSPATH . 'admin/' . $page ) )
878a2b
    {
878a2b
        include (ABSPATH . 'admin/' . $page );
878a2b
    }
878a2b
?>