/program/themes/ruta/ruta.class.php - the class that implements the theme
Located in /program/themes/ruta/ruta.class.php (line 27)
Theme | --ThemeRuta
Inherited from Theme
Theme::$area_id
Theme::$area_record
Theme::$breadcrumb_addendum
Theme::$breadcrumb_separator
Theme::$config
Theme::$content
Theme::$domain
Theme::$dtd
Theme::$html_head
Theme::$http_headers
Theme::$jumps
Theme::$messages_bottom
Theme::$messages_inline
Theme::$messages_top
Theme::$node_id
Theme::$node_record
Theme::$preview_mode
Theme::$quickbottom_separator
Theme::$quicktop_separator
Theme::$silent_mode
Theme::$text_only
Theme::$theme_id
Theme::$theme_record
Theme::$title
Theme::$tree
construct a ThemeRuta object
workhorse for constructing alternative recursive menu (walk the tree)
construct nested (sub)menus for a depth of at most $max_level, unless we hit the breadcrumb trail in which case we carry on nesting. The (sub)menus are constructed in the form of nested UL's with LI's.
The level of recursion of the list items (LI) is indicated via class='levelNNN'. The type of item is indicated via class='page' or class='section'. Also, the item has an addional class='current' when it is part of the breadcrumb trail. Finally a current item also has the additional class 'activepage' or 'activesection' which makes the CSS easier.
The actual A-tag of the link only indicates being part of the breadcrumb trail via class='current'.
It is up to the style sheet to visualise these items taking all variants into account. Note that we only process visible pages and sections.
Note: this routine looks very much like {@see show_tree_walk()}. The difference is the limit $max_level.
create alternative navigation in case Javascript is not available
This creates separated DIVs, one for each item in the main navigation bar, each containing the corresponding submenu. This whole alternative navigation DIV is set to display: none using Javascript. If there is no Javascript, it remains visible. The submenus are displayed for up to 2 levels deep, unless the current breadcrumb trail leads deeper into the tree. This way most of the important nodes are reachable.
insert special rotating background banner in bazaar style style in header
the background style is precomputed onceand stored in $this->ruta_header_background. This extends the original routine in such a way that the calculated background is inserted _before_ the used-defined BSSS. This means that the user can overrule the background image information if she wants to.
show footer text, maybe some quicklinks and 'powered by'
construct the submenu starting at $menu_id OR the first breadcrumb in the top level menu
this constructs an 'infinitely' nested set of submenus, starting at $menu_id or at the first breadcrumb in the top level menu (if any). If there are no suitable nodes, an empty string is returned.
this is largely the same routine as parent::get_menu(). Difference is that here we may add a menu title to the menu IF the first item in the breadcrumb trail is a visible section
construct a top level menu (navigation bar)
walk through the top level of the menu tree and create a link for each node. This variant of the top level navigation is to be displayed under the submenu in the left hand margin in case the screen is small (<650). In that case the main navigation bar is limited to 'MENU' and 'HOME' and the rest of the main navigation has to be available elsewhere. Different entries here are all members of the class 'menunavsub'.
construct a top level menu (navigation bar) with an additional menu button
start with a menu-button (that can be made invisible via CSS) and subsequently walk through the top level of the menu tree and create a link for each node. the first real link gets a different class so we can keep the first real link visible while hiding the others via CSS. This is used to create a navbar with two links 'MENU' and 'HOME' on the small (<650px) screen.
Note that this MENU-button uses a tiny snippet of Javascript to toggle the menu.
compute background image(s) based on current time and index
this routine returns a snippet of ready-to-use code to set a background image for #header. The images are different depending on the time of day and the $index parameter. The latter is thought to be the position of the current item in the main navigation (starting at 1) or 0 in case no item in the main navigation is current.
Configuration is done via two parameters: the paths in $this->config['header_banners_directories'] (one per line) and the interval in $this->config['header_banners_interval'].
The interval is expressed in minutes. It means that a particular page has the same background image for the duration of the interval and another one in the next interval. The banners directories are supposed to contain banner files of the correct dimensions, e.g. 650x71 (small), 980x170 (medium) or 1440x240 (large).
If the specified directory starts with a '/' it is assumed to start in the data root, e.g. something like /areas/exemplum/banners. This will eventually lead to a URL of the form /file.php/areas/exemplum/banners/mentha-banner.jpg using was_file_url()
If the specified directory does NOT start with a '/' it is assumed to be a directory relative to the directory where index.php and friends live, unless it starts with 'program/' in which case it is a static dir somewhere in the program hierarchy. This is done via was_url().
Note: if files are found in a directory, the names are sort()ed so there is a chance that the three files are the same ones independent of the physical order in the file system directory.
retrieve data for sidebar
this retrieves the content of the various sidebar blocks (if any) currently only the htmlpage module is supported.
retrieve page data for htmlpage module on a node
this retrieves data from the page $node_id (requires knowledge of internals of htmlpage module/table) in order to show that in a box in the 3rd column. The content is wrapped in a div which has a unique ID of the form sidebar_blockN where N counts from 1 upward and a common class sidebar_htmlpage. This allows for connecting style information to a particular sidebar block in a flexible way.
calculate the index of the current main navigation item
this routine determines which main menu item is the current one, starting at 1. if no menu item is current, the function returns 0.
This index is used for two purposes:
compute the list of sidebar blocks for a main menu item
this constructs an ordered array of node_id's corresponding to the current main menu item. If the current main menu_item indicates no sidebar then FALSE is returned.
The basis for the node_ids to return is the contents of the parameter 'sidebar_nodelist'. This is a comma-delimited string containing node_ids, zeros or dashes.
Example: suppose sidebar_nodelist contains "5,0,0,0,-". If the first item of the main menu is current (ie. is part of the breadcrumb trail), the node with node_id = 5 is examined. If it is a page and the module is supported, this page's node_id is returned. If, however, this is a section, all supported pages within that section are returned. For main menu items 2, 3 and 4 a '0' is specified. This means that no pages will be displayed (an empty array is returned). For main menu item 5 a dash ('-') is specified. This yields a return value of FALSE which must be interpreted as 'suppress the complete 3rd column of the page, including rightmargin_top and rightmargin_bottom. This effectively reduces the 3-column layout to a 2-column layout.
Note that the node_ids in the sidebar_nodelist themselves must not be under embargo but a hidden section (with visible pages) is OK.
Note that when there are more main menu items than entries in the sidebar_nodelist, the value '0' is assumed.
Finally, if no main menu item is current (eg. the visitor arrived on a page via quicktop entries) then the value of '0' is assumed, too.
insert code for toggling the menu/free HTML in the left hand margin
Inherited From Theme
Theme::Theme()
Theme::add_content()
Theme::add_html_header()
Theme::add_http_header()
Theme::add_message()
Theme::add_meta()
Theme::add_meta_http_equiv()
Theme::add_popup_bottom()
Theme::add_popup_top()
Theme::add_stylesheet()
Theme::calc_breadcrumb_trail()
Theme::construct_tree()
Theme::dump_subtree()
Theme::get_address()
Theme::get_bazaar_style_style()
Theme::get_bottomline()
Theme::get_content()
Theme::get_div_breadcrumbs()
Theme::get_div_messages()
Theme::get_html()
Theme::get_html_head()
Theme::get_jumpmenu()
Theme::get_lines()
Theme::get_logo()
Theme::get_menu()
Theme::get_navigation()
Theme::get_popups()
Theme::get_properties()
Theme::get_quickbottom()
Theme::get_quicklinks()
Theme::get_quicktop()
Theme::node2anchor()
Theme::queue_alert()
Theme::send_headers()
Theme::send_output()
Theme::set_preview_mode()
Theme::show_tree_walk()
Documentation generated on Tue, 28 Jun 2016 19:11:30 +0200 by phpDocumentor 1.4.0