Example #1
0
// to support decorations
echo '<div id="upperbody">' . "\n";
// wrap content
echo '<div id="container" class="mw960p center">' . "\n";
// the header panel comes before everything
echo '<header id="header_panel" class="line mod">' . "\n";
// the site name -- can be replaced, through CSS, by an image -- access key 1
if ($context['site_name']) {
    echo '<p id="header_title" class="left"><a href="' . $context['url_to_root'] . '" title="' . encode_field(i18n::s('Front page')) . '" accesskey="1"><span>' . $context['site_name'] . '</span></a></p>' . "\n";
}
// site slogan -- can be replaced, through CSS, by an image
if (isset($context['site_slogan'])) {
    echo '<p id="header_slogan" class="item"><span>' . $context['site_slogan'] . "</span><br /></p>\n";
}
// horizontal tabs with Home, and second level drop-down menu displayed as smartlist
Page::tabs(TRUE, FALSE, NULL, NULL, 'smartlist');
// end of the header panel
echo '</header>' . "\n";
// display bread crumbs if not at the front page; if not defined, only the 'Home' link will be displayed
if ($context['skin_variant'] != 'home') {
    Page::bread_crumbs(2);
}
// wrap the 3 colums
echo '<div class="row medium-col tiny-box">' . "\n";
// navigation information
echo '<nav id="side_panel" class="col w20 medium-w25 tiny-inbl mod item">' . "\n";
// display side content
Page::side();
// link to yacs if we are at the front page
if ($context['skin_variant'] == 'home' && is_callable(array('i18n', 's'))) {
    echo Skin::build_box(NULL, '<p>' . sprintf(i18n::s('Powered by %s'), Skin::build_link(i18n::s('http://www.yacs.fr/'), 'Yacs', 'external')) . '</p>', 'extra');
Example #2
0
File: page.php Project: rair/yacs
 /**
  * build a header panel with background
  *
  * This function builds a nice header panel that may include following elements:
  * - a background image (that can be selected randomly in a set)
  * - site name
  * - site slogan
  * - top-level tabs
  *
  * This function can prove handy to change background images randomly.
  * To put this in place add a couple of images to the sub-directory #"images## of the current skin.
  * Then list file in an array and pass this as first parameter of this function.
  * For example:
  * [php]
  * // three images to alternate, all placed in sub-directory images
  * $images = array('1.jpg', '2.jpg', '3.jpg');
  *
  * // draw the header panel
  * Page::header_panel($images);
  * [/php]
  *
  * When tabs are activated, which is the default behavior, it is useless to call Page::tabs() separately.
  *
  * @param mixed either an image, or an array of images
  * @param string image attributes
  * @param boolean TRUE to display site name, FALSE otherwise
  * @param boolean TRUE to display site slogan, FALSE otherwise
  * @param boolean TRUE to display tabs, FALSE otherwise
  */
 public static function header_panel($images = NULL, $attributes = 'top left repeat-x', $with_name = TRUE, $with_slogan = TRUE, $with_tabs = TRUE)
 {
     global $context;
     // change rendering according to skin
     $tag = SKIN_HTML5 ? 'header' : 'div';
     // put an image in panel background
     if ($images) {
         // select a random image
         if (is_array($images)) {
             $image = $images[array_rand($images)];
         } else {
             $image = $images;
         }
         // get a random index in table
         $index = array_rand($images);
         // the header panel comes before everything
         echo '<' . $tag . ' id="header_panel" style="background: transparent url(' . $context['url_to_root'] . $context['skin'] . '/images/' . $images[$index] . ') ' . $attributes . ';">' . "\n";
         // no image in the background
     } else {
         echo '<' . $tag . ' id="header_panel">' . "\n";
     }
     // the site name -- can be replaced, through CSS, by an image -- access key 1
     if ($context['site_name'] && $with_name) {
         echo '<p id="header_title"><a href="' . $context['url_to_root'] . '" title="' . encode_field(i18n::s('Front page')) . '" accesskey="1"><span>' . $context['site_name'] . '</span></a></p>' . "\n";
     }
     // site slogan -- can be replaced, through CSS, by an image
     if (isset($context['site_slogan']) && $with_slogan) {
         echo '<p id="header_slogan"><span>' . $context['site_slogan'] . "</span></p>\n";
     }
     // horizontal tabs
     if ($with_tabs) {
         Page::tabs();
     }
     // end of the header panel
     echo '</' . $tag . '>' . "\n";
 }
Example #3
0
} elseif ($context['site_name']) {
    $name = $context['site_name'];
}
$title = '';
if (is_callable(array('i18n', 's'))) {
    $title = i18n::s('Return to front page');
}
if ($name) {
    echo "\t" . '<p id="header_title"><a href="' . $context['url_to_root'] . '" title="' . encode_field($title) . '" accesskey="1">' . $name . '</a></p>' . "\n";
}
// site slogan
if ($context['site_slogan']) {
    echo "\t" . '<p id="header_slogan">' . $context['site_slogan'] . '</p>';
}
// horizontal tabs -- add a tab for the front page, and reverse order
Page::tabs(TRUE, FALSE);
// end of the header panel
echo '</div></td></tr>' . "\n";
// main content
echo '<tr id="columns">' . "\n";
switch ($context['flexible_columns']) {
    case '1_2_3':
        echo '<td id="side_panel">';
        Page::side();
        echo '</td>';
        echo '<td id="main_panel">';
        Page::bread_crumbs();
        Page::content();
        echo '</td>';
        echo '<td id="extra_panel">';
        Page::extra_panel(NULL, FALSE);