|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
/*
|
|
Alain Reguera Delgado |
8f60cb |
* HTML Functions
|
|
Alain Reguera Delgado |
8f60cb |
*
|
|
Alain Reguera Delgado |
8f60cb |
*/
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
// Display header template
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_header()
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
require_once(ABSPATH . 'contents/header.php');
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
// Display content template
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_content()
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
require_once(ABSPATH . 'contents/content.php');
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
// Display sidebar template
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_sidebar()
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
require_once(ABSPATH . 'contents/sidebar.php');
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
// Display footer template
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_footer()
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
require_once(ABSPATH . 'contents/footer.php');
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
// Display Mainlinks (to Pages)
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_mainlinks()
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
$mainlinks = array ();
|
|
Alain Reguera Delgado |
8f60cb |
$mainlinks[1] = 'donaciones';
|
|
Alain Reguera Delgado |
8f60cb |
$mainlinks[2] = 'documentacion';
|
|
Alain Reguera Delgado |
8f60cb |
$mainlinks[3] = 'wiki';
|
|
Alain Reguera Delgado |
8f60cb |
$mainlinks[4] = 'foros';
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
$html = '
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
if (!isset($_GET['p']))
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . strtoupper(translate('home')) . '' . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
else
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . strtoupper(translate('home')) . '' . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
foreach ($mainlinks as $key => $value)
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
if (isset($_GET['p']) && $_GET['p'] == $key)
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . strtoupper($value). "" . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
else
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . strtoupper($value). "" . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
return $html;
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
// Display promotions
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_promo()
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
$promotion = array();
|
|
Alain Reguera Delgado |
8f60cb |
$promotion['CentOS-5 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
|
|
Alain Reguera Delgado |
8f60cb |
$promotion['CentOS-4 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
|
|
Alain Reguera Delgado |
8f60cb |
$promotion['CentOS-3 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
|
|
Alain Reguera Delgado |
8f60cb |
$promotion['CentOS-2 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...';
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
$counter = 0;
|
|
Alain Reguera Delgado |
8f60cb |
$last_promotion = count($promotion) -1;
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
echo '' . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
foreach ( $promotion as $key => $value )
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
// Set first promoblock
|
|
Alain Reguera Delgado |
8f60cb |
switch ($counter)
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
case 0:
|
|
Alain Reguera Delgado |
8f60cb |
$html = '';
|
|
Alain Reguera Delgado |
8f60cb |
break;
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
case $last_promotion:
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '';
|
|
Alain Reguera Delgado |
8f60cb |
break;
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
default:
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '';
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . $key . '' . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . $value . ' ' . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '';
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
$counter++;
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
return $html;
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_searchform()
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
$html = '';
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '<form action="" method="post">';
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '<input id="searchinput" type="text" name="search" value="" onfocus="searchChange(this)" onblur="searchBlur(this)">';
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '<input type="submit" value="'.ucfirst(translate('find')).'">';
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '</form>';
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '';
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
return $html;
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
// Build 404 page not found error
|
|
Alain Reguera Delgado |
8f60cb |
function get_html_err($err_id = '404', $err_msg = 'Page not found', $err_descrip = '')
|
|
Alain Reguera Delgado |
8f60cb |
{
|
|
Alain Reguera Delgado |
8f60cb |
$html = '' . $err_id . ': ' . ucfirst($err_msg) . '' . "\n";
|
|
Alain Reguera Delgado |
8f60cb |
$html .= '' . $err_descrip. ' ';
|
|
Alain Reguera Delgado |
8f60cb |
return $html;
|
|
Alain Reguera Delgado |
8f60cb |
}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
?>
|