/** * Method to display navigation bar * * @static * @access public * @param integer [$p] Actual page * @param integer [$max] Maximum of available pages * @param string [$link] Complement in the url */ public static function navigation($p, $max, $link) { if (Vsession::html5()) { if ($p < $max) { echo '<div id="prev">' . '<a href="' . PATH . '?' . $link . 'p=' . ($p + 1) . '">Previous Page</a>' . '</div>'; } if ($p > 1) { echo '<div id="next">' . '<a href="' . PATH . '?' . $link . 'p=' . ($p - 1) . '">Next Page</a>' . '</div>'; } } else { echo '<ul id="nav">'; if ($p < $max) { echo '<li>' . '<div id="prev">' . '<a href="' . PATH . '?' . $link . 'p=' . ($p + 1) . '">Previous Page</a>' . '</div>' . '</li>'; } if ($p > 1) { echo '<li>' . '<div id="next">' . '<a href="' . PATH . '?' . $link . 'p=' . ($p - 1) . '">Next Page</a>' . '</div>' . '</li>'; } echo '</ul>'; } }
/** * Display page content * * @access public */ public function display_content() { if (!empty($this->_content)) { Html::header_links(); if (!VSession::html5()) { echo '<ul id="links">'; } foreach ($this->_content as $link) { Html::related_link($link->_name, $link->_link, $link->_rss_link, $link->_notes, $link->_priority); } if (!Vsession::html5()) { echo '</ul>'; } } else { Html::header_links(); if (!VSession::html5()) { echo '<ul id="links">'; } Html::no_content('There\'s no link registered yet.'); if (!Vsession::html5()) { echo '</ul>'; } } }
/** * Method to build easily html5 or not tag * * @static * @access public * @param string [$tag] $tag can only contain "o" or "c" * @param string [$chevron] */ public static function html5($tag, $chevron = '>') { if ($tag == 'o') { if (Vsession::html5()) { echo '<section '; } else { echo '<div '; } echo $chevron; } elseif ($tag == 'c') { if (Vsession::html5()) { echo '</section>'; } else { echo '</div>'; } } }