Inheritance diagram for Theme:
Collaboration diagram for Theme:Public Member Functions | |
| __construct ($themedata) | |
| info () | |
| add_template_vars () | |
| display_fallback ($template_list, $display_function= 'display') | |
| template_exists ($template_name) | |
| act_display ($paramarray=array( 'user_filters'=> array())) | |
| act_display_home ($user_filters=array()) | |
| act_display_entries ($user_filters=array()) | |
| act_display_post ($user_filters=array()) | |
| act_display_tag ($user_filters=array()) | |
| act_display_date ($user_filters=array()) | |
| act_search ($user_filters=array()) | |
| act_display_404 ($user_filters=array()) | |
| display ($template_name) | |
| fetch ($template_name, $unstack=false) | |
| fetch_unassigned ($template_name) | |
| assign ($key, $value) | |
| theme_header ($theme) | |
| theme_footer ($theme) | |
| theme_content ($theme, $object, $context=null) | |
| theme_has_context ($theme, $context) | |
| theme_feed_alternate ($theme) | |
| theme_comment_form_action ($theme, $post) | |
| theme_prev_page_link ($theme, $text=null) | |
| theme_next_page_link ($theme, $text=null) | |
| theme_comments_link ($theme, $post, $zero= '', $one= '', $many= '', $fragment= 'comments') | |
| theme_comments_count ($theme, $post, $zero= '', $one= '', $many= '') | |
| theme_query_count () | |
| theme_query_time () | |
| theme_comment_author_link ($theme, $comment) | |
| __isset ($key) | |
| __set ($key, $value) | |
| __get ($key) | |
| __unset ($key) | |
| start_buffer () | |
| end_buffer () | |
| __call ($function, $params) | |
| get_blocks ($area, $scope, $theme) | |
| check_scope_criteria ($criteria) | |
| get_scopes ($area) | |
| sort_scopes ($scope1, $scope2) | |
| theme_area ($theme, $area, $context=null, $scope=null) | |
| theme_body_class ($theme, $args=array()) | |
| add_script ($where= 'header', $value, $name=null, $requires=null) | |
| add_style ($where= 'header', $value, $name=null, $requires=null) | |
| get_version () | |
Static Public Member Functions | |
| static | theme_page_selector ($theme, $rr_name=null, $settings=array()) |
Public Attributes | |
| $name = null | |
| $version = null | |
| $template_engine = null | |
| $theme_dir = null | |
| $config_vars = array() | |
| $context = array() | |
| $valid_filters | |
Protected Member Functions | |
| play_var_stack () | |
The Theme class is the behind-the-scenes representation of of a set of UI files that compose the visual theme of the blog
Definition at line 14 of file theme.php.
| Theme::__construct | ( | $ | themedata | ) |
Constructor for theme
If no parameter is supplied, then the constructor Loads the active theme from the database.
If no theme option is set, a fatal error is thrown
| name | ( optional ) override the default theme lookup | |
| template_engine | ( optional ) specify a template engine | |
| theme_dir | ( optional ) specify a theme directory |
| Theme::__call | ( | $ | function, | |
| $ | params | |||
| ) |
Handle methods called on this class or its descendants that are not defined by this class. Allow plugins to provide additional theme actions, like a custom act_display_*()
| string | $function The method that was called. | |
| array | $params An array of parameters passed to the method |
| Theme::__get | ( | $ | key | ) |
| Theme::__isset | ( | $ | key | ) |
| Theme::__set | ( | $ | key, | |
| $ | value | |||
| ) |
| Theme::__unset | ( | $ | key | ) |
| Theme::act_display | ( | $ | paramarray = array( 'user_filters'=> array() ) |
) |
Grabs post data and inserts that data into the internal handler_vars array, which eventually gets extracted into the theme's ( and thereby the template_engine's ) local symbol table for use in the theme's templates
This is the default, generic function to grab posts. To "filter" the posts retrieved, simply pass any filters to the handler_vars variables associated with the post retrieval. For instance, to filter by tag, ensure that handler_vars['tag'] contains the tag to filter by. Simple as that.
| Theme::act_display_404 | ( | $ | user_filters = array() |
) |
| Theme::act_display_date | ( | $ | user_filters = array() |
) |
| Theme::act_display_entries | ( | $ | user_filters = array() |
) |
| Theme::act_display_home | ( | $ | user_filters = array() |
) |
| Theme::act_display_post | ( | $ | user_filters = array() |
) |
| Theme::act_display_tag | ( | $ | user_filters = array() |
) |
| Theme::act_search | ( | $ | user_filters = array() |
) |
| Theme::add_script | ( | $ | where = 'header', |
|
| $ | value, | |||
| $ | name = null, |
|||
| $ | requires = null | |||
| ) |
Add javascript to the stack to be output in the theme.
| string | $where Where should it be output? Options are header and footer. | |
| string | $value Either a URL or raw JS to be output inline. | |
| string | $name A name to reference this script by. Used for removing or using in $requires by other scripts. | |
| string|array | $requires Either a string or an array of strings of $name's for scripts this script requires. |
| Theme::add_style | ( | $ | where = 'header', |
|
| $ | value, | |||
| $ | name = null, |
|||
| $ | requires = null | |||
| ) |
Add a stylesheet to the stack to be output in the theme.
| string | $where Where should it be output? Options are header and footer. | |
| string | $value Either a URL or raw CSS to be output inline. | |
| string | $name A name to reference this script by. Used for removing or using in $after by other scripts. | |
| string|array | $requires Either a string or an array of strings of $name's for scripts this script requires. |
| Theme::add_template_vars | ( | ) |
| Theme::assign | ( | $ | key, | |
| $ | value | |||
| ) |
Helper function: Avoids having to call $theme->template_engine->key= 'value';
Definition at line 575 of file theme.php.
Referenced by act_display(), Mzingi::add_template_vars(), Charcoal::add_template_vars(), add_template_vars(), and display_fallback().
| Theme::check_scope_criteria | ( | $ | criteria | ) |
| Theme::display | ( | $ | template_name | ) |
| Theme::display_fallback | ( | $ | template_list, | |
| $ | display_function = 'display' | |||
| ) |
| Theme::end_buffer | ( | ) |
| Theme::fetch | ( | $ | template_name, | |
| $ | unstack = false | |||
| ) |
Helper function: Avoids having to call $theme->template_engine->fetch( 'template_name' );
| string | $template_name The name of the template to display | |
| boolean | $unstack If true, end the current template variable buffer upon returning |
| Theme::fetch_unassigned | ( | $ | template_name | ) |
| Theme::get_blocks | ( | $ | area, | |
| $ | scope, | |||
| $ | theme | |||
| ) |
Retrieve the block objects for the current scope and specified area Incomplete!
| string | $area The area to which blocks will be output | |
| string | $scope The scope to which blocks will be output | |
| Theme | $theme The theme that is outputting these blocks |
Definition at line 1072 of file theme.php.
Referenced by K2::action_theme_activated(), and Charcoal::action_theme_activated().
| Theme::get_scopes | ( | $ | area | ) |
| Theme::get_version | ( | ) |
| Theme::info | ( | ) |
| Theme::play_var_stack | ( | ) | [protected] |
| Theme::sort_scopes | ( | $ | scope1, | |
| $ | scope2 | |||
| ) |
| Theme::start_buffer | ( | ) |
| Theme::template_exists | ( | $ | template_name | ) |
Determine if a template exists in the current theme
| string | $template_name The name of the template to detect |
Definition at line 151 of file theme.php.
Referenced by act_display(), and display_fallback().
| Theme::theme_area | ( | $ | theme, | |
| $ | area, | |||
| $ | context = null, |
|||
| $ | scope = null | |||
| ) |
Displays blocks associated to the specified area and current scope.
| Theme | $theme The theme with which this area will be output | |
| string | $area The area to which blocks will be output | |
| string | $context The area of context within the theme that could adjust the template used | |
| string | $scope Used to force a specific scope |
| Theme::theme_body_class | ( | $ | theme, | |
| $ | args = array() | |||
| ) |
| Theme::theme_comment_author_link | ( | $ | theme, | |
| $ | comment | |||
| ) |
Returns a humane commenter's link for a comment if a URL is supplied, or just display the comment author's name
| Theme::theme_comment_form_action | ( | $ | theme, | |
| $ | post | |||
| ) |
| Theme::theme_comments_count | ( | $ | theme, | |
| $ | post, | |||
| $ | zero = '', |
|||
| $ | one = '', |
|||
| $ | many = '' | |||
| ) |
Returns a full qualified URL of the specified post based on the comments count.
Passed strings are localized prior to parsing therefore to localize "%d Comments" in french, it would be "%d Commentaires".
Since we use sprintf() in the final concatenation, you must format passed strings accordingly.
| Theme | $theme The current theme object | |
| Post | $post Post object used to build the comments link | |
| string | $zero String to return when there are no comments | |
| string | $one String to return when there is one comment | |
| string | $many String to return when there are more than one comment |
| Theme::theme_comments_link | ( | $ | theme, | |
| $ | post, | |||
| $ | zero = '', |
|||
| $ | one = '', |
|||
| $ | many = '', |
|||
| $ | fragment = 'comments' | |||
| ) |
Returns a full qualified URL of the specified post based on the comments count, and links to the post.
Passed strings are localized prior to parsing therefore to localize "%d Comments" in french, it would be "%d Commentaires".
Since we use sprintf() in the final concatenation, you must format passed strings accordingly.
| Theme | $theme The current theme object | |
| Post | $post Post object used to build the comments link | |
| string | $zero String to return when there are no comments | |
| string | $one String to return when there is one comment | |
| string | $many String to return when there are more than one comment | |
| string | $fragment Fragment (bookmark) portion of the URL to append to the link | |
| string | $title Fragment (bookmark) portion of the URL to append to the link |
| Theme::theme_content | ( | $ | theme, | |
| $ | object, | |||
| $ | context = null | |||
| ) |
Display an object using a template designed for the type of object it is The $object is assigned into the theme using the $content template variable
| Theme | $theme The theme used to display the object | |
| object | $object An object to display | |
| string | $context The context in which the object will be displayed |
| Theme::theme_feed_alternate | ( | $ | theme | ) |
| Theme::theme_footer | ( | $ | theme | ) |
| Theme::theme_has_context | ( | $ | theme, | |
| $ | context | |||
| ) |
| Theme::theme_header | ( | $ | theme | ) |
| Theme::theme_next_page_link | ( | $ | theme, | |
| $ | text = null | |||
| ) |
| static Theme::theme_page_selector | ( | $ | theme, | |
| $ | rr_name = null, |
|||
| $ | settings = array() | |||
| ) | [static] |
Build a collection of paginated URLs to be used for pagination.
| string | The RewriteRule name used to build the links. | |
| array | Various settings used by the method and the RewriteRule. |
| Theme::theme_prev_page_link | ( | $ | theme, | |
| $ | text = null | |||
| ) |
| Theme::theme_query_count | ( | ) |
| Theme::theme_query_time | ( | ) |
| Theme::$valid_filters |
array(
'content_type',
'not:content_type',
'slug',
'not:slug',
'user_id',
'vocabulary',
'status',
'page',
'tag',
'not:tag',
'month',
'year',
'day',
'criteria',
'limit',
'nolimit',
'offset',
'fetch_fn',
'id',
'info',
'has:info',
'all:info',
'any:info',
'not:info',
'not:all:info',
'not:any:info',
)
We build the Post filters by analyzing the handler_var data which is assigned to the handler ( by the Controller and also, optionally, by the Theme )
1.7.1