Exemplo n.º 1
0
//$content["MENU_ROWS"] = $menu->get("rows");
class HTML_menu_browser_topnav extends HTML_menu_browser
{
    function HTML_menu_browser_topnav($DSN = '', $table = '', $query = "")
    {
        $this->HTML_Menu_browser($DSN, $table, $query);
    }
    function makeURL($eintrag)
    {
        $url = $eintrag['url'];
        return $url;
    }
}
$browser = new HTML_menu_browser_topnav($cfg['database']['dsn']);
$browser->setQuery("SELECT * FROM rc_navigation");
$topMenuEntries = $browser->getMenu();
//  print_r($topMenuEntries);
$topMenu = new mms_template_menu($topMenuEntries, 'rows', "REQUEST_URI");
/**
  Replaces an URI with the HTML-Clickable equivalent
  @param    string  str The string to be parsed an replaced
  @return   string  str The tag-added string
  @see      make_link
*/
function replace_uri($str)
{
    $pattern = '#(^|[^\\"=]{1})(http://|ftp://|mailto:|news:)([^\\s<>]+)([\\s\\n<>]|$)#sm';
    return preg_replace($pattern, "\\1<a href=\"\\2\\3\">\\3</a>\\4", $str);
}
// end func replace_uri
/**
Exemplo n.º 2
0
 /** initializes the navigation
  */
 function initMenu()
 {
     $browser = new HTML_menu_browser_topnav($this->cfg['database']['dsn']);
     $browser->setQuery("SELECT * FROM rc_navigation");
     $topMenuEntries = $browser->getMenu();
     $this->topMenu = new mms_template_menu($topMenuEntries, 'rows', "REQUEST_URI");
     $this->content["MENU_ROWS"] = $this->topMenu->get('rows');
 }