Blame Scripts/Php/Webenv/includes/functions/html.php

878a2b
878a2b
878a2b
/*
878a2b
 * HTML Functions
878a2b
 *
878a2b
 */
878a2b
878a2b
// Display header template
878a2b
function get_html_header()
878a2b
{
878a2b
    require_once(ABSPATH . 'contents/header.php');
878a2b
}
878a2b
// Display content template
878a2b
function get_html_content()
878a2b
{
878a2b
    require_once(ABSPATH . 'contents/content.php');
878a2b
}
878a2b
// Display sidebar template
878a2b
function get_html_sidebar()
878a2b
{
878a2b
    require_once(ABSPATH . 'contents/sidebar.php');
878a2b
}
878a2b
// Display footer template
878a2b
function get_html_footer()
878a2b
{
878a2b
    require_once(ABSPATH . 'contents/footer.php');
878a2b
}
878a2b
878a2b
// Display Mainlinks (to Pages)
878a2b
function get_html_mainlinks()
878a2b
{
878a2b
878a2b
    $mainlinks = array ();
878a2b
    $mainlinks[1] = 'donaciones';
878a2b
    $mainlinks[2] = 'documentacion';
878a2b
    $mainlinks[3] = 'wiki';
878a2b
    $mainlinks[4] = 'foros';
878a2b
878a2b
    $html = '
    ' . "\n";
878a2b
878a2b
    if (!isset($_GET['p']))
878a2b
    { 
878a2b
878a2b
        $html .= '
  • ' . strtoupper(translate('home')) . '
  • ' . "\n";
    878a2b
    878a2b
        } 
    878a2b
        else 
    878a2b
        {
    878a2b
            $html .= '
  • ' . strtoupper(translate('home')) . '
  • ' . "\n";
    878a2b
        }
    878a2b
    878a2b
        foreach ($mainlinks as $key => $value) 
    878a2b
        {
    878a2b
            if (isset($_GET['p']) && $_GET['p'] == $key) 
    878a2b
            {
    878a2b
                $html .= '
  • ' . strtoupper($value). "
  • " . "\n";
    878a2b
            } 
    878a2b
            else 
    878a2b
            {
    878a2b
                $html .= '
  • ' . strtoupper($value). "
  • " . "\n";
    878a2b
            }
    878a2b
        }
    878a2b
    878a2b
    $html .= '' . "\n";
    878a2b
    return $html;
    878a2b
    878a2b
    }
    878a2b
    878a2b
     // Display promotions
    878a2b
    function get_html_promo()
    878a2b
    {
    878a2b
        $promotion = array();
    878a2b
        $promotion['CentOS-5 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
    878a2b
        $promotion['CentOS-4 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
    878a2b
        $promotion['CentOS-3 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
    878a2b
        $promotion['CentOS-2 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
    878a2b
    878a2b
        $counter = 0;
    878a2b
        $last_promotion = count($promotion) -1;
    878a2b
    878a2b
        echo '
    ' . "\n";
    878a2b
    878a2b
        foreach ( $promotion as $key => $value )
    878a2b
        {
    878a2b
    878a2b
        // Set first promoblock
    878a2b
        switch ($counter) 
    878a2b
        {
    878a2b
            case 0:
    878a2b
            $html = '
    ';
    878a2b
                break;
    878a2b
        
    878a2b
            case $last_promotion:
    878a2b
            $html .= '
    ';
    878a2b
            break;
    878a2b
        
    878a2b
            default:
    878a2b
            $html .= '
    ';
    878a2b
        } 
    878a2b
    878a2b
        $html .= '

    ' . $key . '

    ' . "\n";
    878a2b
        $html .= '

    ' . $value . '

    ' . "\n";
    878a2b
        $html .= '';
    878a2b
    878a2b
        $counter++;
    878a2b
        }
    878a2b
    878a2b
    return $html; 
    878a2b
    878a2b
    }
    878a2b
    878a2b
    function get_html_searchform()
    878a2b
    {
    878a2b
        $html = '
    ';
    878a2b
        $html .= '<form action="" method="post">';
    878a2b
        $html .= '<input id="searchinput" type="text" name="search" value="" onfocus="searchChange(this)" onblur="searchBlur(this)">';
    878a2b
        $html .= '<input type="submit" value="'.ucfirst(translate('find')).'">';
    878a2b
        $html .= '</form>';
    878a2b
        $html .= '';
    878a2b
    878a2b
        return $html;
    878a2b
    }
    878a2b
    878a2b
    // Build 404 page not found error
    878a2b
    function get_html_err($err_id = '404', $err_msg = 'Page not found', $err_descrip = '')
    878a2b
    {
    878a2b
        $html = '

    ' . $err_id . ': ' . ucfirst($err_msg) . '

    ' . "\n";
    878a2b
        $html .= '

    ' . $err_descrip. '

    ';
    878a2b
        return $html;
    878a2b
    }
    878a2b
    878a2b
    ?>