/program/themes/cornelia/cornelia.class.php - the class that implements the theme
Located in /program/themes/cornelia/cornelia.class.php (line 27)
Theme | --ThemeCornelia
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
compute URL for a background image based on current time and index
this routine returns a URL to be used as a background image. The URL is 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 path in $this->config['header_banners_directory'] 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 directory is supposed to contain banner files of the correct dimensions, e.g. 980x170.
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().
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.
show footer text, maybe some quicklinks and 'powered by'
construct an output page in HTML
This constructs a full HTML-page, starting at the DTD and ending with the html closing tag.
The page is constructed using nested DIVs, the layout is taken care of in separate style sheets. All knowledge about the structure of the page is contained in this routine.
As a rule the layout is based on three columns. The left hand column contains free form HTML, the menu and more free form HTML. The right hand column contains free form HTML, the contents of 0, 1 or more html-pages and more free form HTML. The column in the middle holds the actual content.
The list of html-pages to show in the right hand column is configurable per main menu item. A '0' (zero) means: no page, a page number means that page, a section number means all html-pages in that section and a dash ('-') means: suppress the right hand side column completely. This also inserts an additional stylesheet to style the 2-column layout. There is also a speial print stylesheet. This is included after the user clicks the special print link. Note that the stylesheets are added only once, in the order 'style.css', 'style2.css' and finally 'print.css' (if applicable).
The contents of the various DIVs is constructed in various helper routines in order to make this routine easy to read (by humans that is). The various helper routines all are called with a string of space characters; this should improve the the readability of the page that is generated eventually.
The header background changes every N minutes (N=configurable between 0 and 60). Also, the choice of background image is linked to the currently selected item in the main navigation.
Note that the routine $this->get_div_messages() does in fact generate its own DIV tags. This is done in order to completely get rid of the message DIV, we do not even want to see an empty DIV if there are no messages.
The same logic applies to the breadcrumb trail.
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 list of quicklinks for top of page (if any) + (maybe) a print-button
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:08:49 +0200 by phpDocumentor 1.4.0