Blame Scripts/centos-web/includes/functions/html.php

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

    ' . $key . '

    ' . "\n";
    1f953a
        $html .= '

    ' . $value . '

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

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

    ' . "\n";
    1f953a
        $html .= '

    ' . $err_descrip. '

    ';
    1f953a
        return $html;
    1f953a
    }
    1f953a
    1f953a
    ?>