Blame Scripts/CentOS-Web/includes/functions/html.php

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

    ' . $key . '

    ' . "\n";
    61a2f1
        $html .= '

    ' . $value . '

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

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

    ' . "\n";
    61a2f1
        $html .= '

    ' . $err_descrip. '

    ';
    61a2f1
        return $html;
    61a2f1
    }
    61a2f1
    61a2f1
    ?>