Elgg
Version 2.3
|
Go to the source code of this file.
Namespaces | |
Elgg\Core | |
Activate a plugin or plugins. | |
Functions | |
elgg_set_viewtype ($viewtype="") | |
Manually set the viewtype. More... | |
elgg_get_viewtype () | |
Return the current view type. More... | |
_elgg_get_initial_viewtype () | |
Get the initial viewtype. More... | |
elgg_register_viewtype ($viewtype) | |
Register a viewtype. More... | |
elgg_is_registered_viewtype ($viewtype) | |
Checks if $viewtype is registered. More... | |
_elgg_is_valid_viewtype ($viewtype) | |
Checks if $viewtype is a string suitable for use as a viewtype name. More... | |
elgg_register_viewtype_fallback ($viewtype) | |
Register a viewtype to fall back to a default view if a view isn't found for that viewtype. More... | |
elgg_does_viewtype_fallback ($viewtype) | |
Checks if a viewtype falls back to default. More... | |
elgg_register_ajax_view ($view) | |
Register a view to be available for ajax calls. More... | |
elgg_unregister_ajax_view ($view) | |
Unregister a view for ajax calls. More... | |
elgg_register_external_view ($view, $cacheable=false) | |
Registers a view as being available externally (i.e. More... | |
elgg_unregister_external_view ($view) | |
Unregister a view for ajax calls. More... | |
elgg_set_view_location ($view, $location, $viewtype= '') | |
Set an alternative base location for a view. More... | |
elgg_view_exists ($view, $viewtype= '', $recurse=true) | |
Returns whether the specified view exists. More... | |
elgg_list_views ($viewtype= 'default') | |
List all views in a viewtype. More... | |
elgg_view ($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '') | |
Return a parsed view. More... | |
elgg_view_deprecated ($view, array $vars, $suggestion, $version) | |
Display a view with a deprecation notice. More... | |
elgg_extend_view ($view, $view_extension, $priority=501) | |
Extends a view with another view. More... | |
elgg_unextend_view ($view, $view_extension) | |
Unextends a view. More... | |
elgg_get_view_extensions ($view) | |
Get the views (and priorities) that extend a view. More... | |
elgg_prepend_css_urls ($css, $path) | |
In CSS content, prepend a path to relative URLs. More... | |
elgg_view_page ($title, $body, $page_shell= 'default', $vars=array()) | |
Assembles and outputs a full page. More... | |
elgg_view_resource ($name, array $vars=[]) | |
Render a resource view. More... | |
_elgg_views_prepare_head ($title) | |
Prepare the variables for the html head. More... | |
_elgg_views_prepare_favicon_links ($hook, $type, $head_params, $params) | |
Add favicon link tags to HTML head. More... | |
elgg_view_layout ($layout_name, $vars=array()) | |
Displays a layout with optional parameters. More... | |
elgg_view_menu ($menu, array $vars=array()) | |
Render a menu. More... | |
elgg_view_menu_item (\ElggMenuItem $item, array $vars=array()) | |
Render a menu item (usually as a link) More... | |
elgg_view_entity (\ElggEntity $entity, array $vars=array(), $bypass=false, $debug=false) | |
Returns a string of a rendered entity. More... | |
elgg_view_entity_icon (\ElggEntity $entity, $size= 'medium', $vars=array()) | |
View the icon of an entity. More... | |
elgg_view_annotation (\ElggAnnotation $annotation, array $vars=array(), $bypass=false, $debug=false) | |
Returns a string of a rendered annotation. More... | |
elgg_view_entity_list ($entities, array $vars=array()) | |
Returns a rendered list of entities with pagination. More... | |
elgg_view_annotation_list ($annotations, array $vars=array()) | |
Returns a rendered list of annotations, plus pagination. More... | |
elgg_view_entity_annotations (\ElggEntity $entity, $full_view=true) | |
Display a plugin-specified rendered list of annotations for an entity. More... | |
elgg_view_title ($title, array $vars=array()) | |
Renders a title. More... | |
elgg_view_friendly_time ($time) | |
Displays a UNIX timestamp in a friendly way. More... | |
elgg_view_comments ($entity, $add_comment=true, array $vars=array()) | |
Returns rendered comments and a comment form for an entity. More... | |
elgg_view_image_block ($image, $body, $vars=array()) | |
Wrapper function for the image block display pattern. More... | |
elgg_view_module ($type, $title, $body, array $vars=array()) | |
Wrapper function for the module display pattern. More... | |
elgg_view_river_item ($item, array $vars=array()) | |
Renders a human-readable representation of a river item. More... | |
elgg_view_form ($action, $form_vars=array(), $body_vars=array()) | |
elgg_set_form_footer ($footer= '') | |
Sets form footer and defers its rendering until the form view and extensions have been rendered. More... | |
elgg_get_form_footer () | |
Returns currently set footer, or false if not in the form rendering stack. More... | |
elgg_view_input ($input_type, array $vars=array()) | |
Renders a form field. More... | |
elgg_view_field (array $params=[]) | |
Renders a form field, usually with a wrapper element, a label, help text, etc. More... | |
elgg_view_tagcloud (array $options=array()) | |
Create a tagcloud for viewing. More... | |
elgg_view_list_item ($item, array $vars=array()) | |
View an item in a list. More... | |
elgg_view_icon ($name, $vars=array()) | |
View one of the icons. More... | |
elgg_register_rss_link () | |
Include the RSS icon link and link element in the head. More... | |
elgg_unregister_rss_link () | |
Remove the RSS icon link and link element from the head. More... | |
_elgg_has_rss_link () | |
Should the RSS view of this URL be linked to? More... | |
elgg_view_access_collections ($owner_guid) | |
Displays a user's access collections, using the core/friends/collections view. More... | |
autoregister_views ($view_base, $folder, $ignored, $viewtype) | |
Auto-registers views from a location. More... | |
_elgg_views_minify ($hook, $type, $content, $params) | |
Minifies simplecache CSS and JS views by handling the "simplecache:generate" hook. More... | |
_elgg_views_amd ($hook, $type, $content, $params) | |
Inserts module names into anonymous modules by handling the "simplecache:generate" hook. More... | |
elgg_views_add_rss_link () | |
Add the RSS link to the extras when if needed. More... | |
_elgg_views_send_header_x_frame_options () | |
Sends X-Frame-Options header on page requests. More... | |
_elgg_view_may_be_altered ($view, $path) | |
Is there a chance a plugin is altering this view? More... | |
elgg_views_boot () | |
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades. More... | |
_elgg_manage_pagesetup ($hook, $view, $value, $params) | |
Handle triggering the pagesetup event at the right time. More... | |
_elgg_get_js_site_data () | |
Get the site data to be merged into "elgg" in elgg.js. More... | |
_elgg_get_js_page_data () | |
Get the initial contents of "elgg" client side. More... | |
_elgg_view_under_viewtype ($view, $vars, $viewtype) | |
Render a view while the global viewtype is temporarily changed. More... | |
Variables | |
global | $CURRENT_SYSTEM_VIEWTYPE = "" |
The viewtype override. More... | |
return | function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
_elgg_get_initial_viewtype | ( | ) |
Get the initial viewtype.
_elgg_get_js_page_data | ( | ) |
Get the initial contents of "elgg" client side.
Will be extended by elgg.js.
_elgg_get_js_site_data | ( | ) |
Get the site data to be merged into "elgg" in elgg.js.
Unlike _elgg_get_js_page_data(), the keys returned are literal expressions.
_elgg_has_rss_link | ( | ) |
Should the RSS view of this URL be linked to?
_elgg_is_valid_viewtype | ( | $viewtype | ) |
Checks if $viewtype is a string suitable for use as a viewtype name.
string | $viewtype | Potential viewtype name. Alphanumeric chars plus _ allowed. |
_elgg_manage_pagesetup | ( | $hook, | |
$view, | |||
$value, | |||
$params | |||
) |
Handle triggering the pagesetup event at the right time.
Trigger the system "pagesetup" event just before the 1st view rendering, or the 2nd if the 1st view starts with "resources/".
We delay the pagesetup event if the first view is a resource view in order to allow plugins to move all page-specific logic like context setting into a resource view with more confidence that that state will be available in their pagesetup event handlers. See the commit message for more BG info.
string | $hook | "view_vars" |
string | $view | View name |
array | $value | View arguments |
array | $params | Hook params |
_elgg_view_may_be_altered | ( | $view, | |
$path | |||
) |
Is there a chance a plugin is altering this view?
// check a view in core if (_elgg_view_may_be_altered('foo/bar', 'foo/bar.php')) { // use the view for BC }
// check a view in a bundled plugin $dir = DIR . "/views/" . elgg_get_viewtype(); if (_elgg_view_may_be_altered('foo.css', "$dir/foo.css.php")) { // use the view for BC }
string | $view | View name. E.g. "elgg/init.js" |
string | $path | Absolute file path, or path relative to the viewtype directory. E.g. "elgg/init.js.php" |
_elgg_view_under_viewtype | ( | $view, | |
$vars, | |||
$viewtype | |||
) |
Render a view while the global viewtype is temporarily changed.
This makes sure that nested views use the same viewtype.
string | $view | View name |
array | $vars | View vars |
string | $viewtype | Temporary viewtype ('' to leave current) |
_elgg_views_amd | ( | $hook, | |
$type, | |||
$content, | |||
$params | |||
) |
Inserts module names into anonymous modules by handling the "simplecache:generate" hook.
string | $hook | The name of the hook |
string | $type | View type (css, js, or unknown) |
string | $content | Content of the view |
array | $params | Array of parameters |
_elgg_views_minify | ( | $hook, | |
$type, | |||
$content, | |||
$params | |||
) |
Minifies simplecache CSS and JS views by handling the "simplecache:generate" hook.
string | $hook | The name of the hook |
string | $type | View type (css, js, or unknown) |
string | $content | Content of the view |
array | $params | Array of parameters |
_elgg_views_prepare_favicon_links | ( | $hook, | |
$type, | |||
$head_params, | |||
$params | |||
) |
Add favicon link tags to HTML head.
string | $hook | "head" |
string | $type | "page" |
array | $head_params | Head params [ 'title' => '', 'metas' => [], 'links' => [], ] |
array | $params | Hook params |
_elgg_views_prepare_head | ( | $title | ) |
Prepare the variables for the html head.
string | $title | Page title for <head> |
_elgg_views_send_header_x_frame_options | ( | ) |
autoregister_views | ( | $view_base, | |
$folder, | |||
$ignored, | |||
$viewtype | |||
) |
Auto-registers views from a location.
string | $view_base | Optional The base of the view name without the view type. |
string | $folder | Required The folder to begin looking in |
string | $ignored | This argument is ignored |
string | $viewtype | The type of view we're looking at (default, rss, etc) |
elgg_does_viewtype_fallback | ( | $viewtype | ) |
Checks if a viewtype falls back to default.
string | $viewtype | Viewtype |
elgg_extend_view | ( | $view, | |
$view_extension, | |||
$priority = 501 |
|||
) |
Extends a view with another view.
The output of any view can be prepended or appended to any other view.
The default action is to append a view. If the priority is less than 500, the output of the extended view will be appended to the original view.
Views can be extended multiple times, and extensions are not checked for uniqueness. Use elgg_unextend_view() to help manage duplicates.
Priority can be specified and affects the order in which extensions are appended or prepended.
string | $view | The view to extend. |
string | $view_extension | This view is added to $view |
int | $priority | The priority, from 0 to 1000, to add at (lowest numbers displayed first) |
elgg_get_form_footer | ( | ) |
Returns currently set footer, or false if not in the form rendering stack.
elgg_get_view_extensions | ( | $view | ) |
Get the views (and priorities) that extend a view.
string | $view | View name |
elgg_get_viewtype | ( | ) |
Return the current view type.
Viewtypes are automatically detected and can be set with $_REQUEST['view'] or elgg_set_viewtype().
elgg_is_registered_viewtype | ( | $viewtype | ) |
Checks if $viewtype is registered.
string | $viewtype | The viewtype name |
elgg_list_views | ( | $viewtype = 'default' | ) |
List all views in a viewtype.
string | $viewtype | Viewtype |
elgg_prepend_css_urls | ( | $css, | |
$path | |||
) |
In CSS content, prepend a path to relative URLs.
This is useful to process a CSS view being used as an extension.
string | $css | CSS |
string | $path | Path to prepend. E.g. "foo/bar/" or "../" |
elgg_register_ajax_view | ( | $view | ) |
Register a view to be available for ajax calls.
string | $view | The view name |
elgg_register_external_view | ( | $view, | |
$cacheable = false |
|||
) |
Registers a view as being available externally (i.e.
via URL).
string | $view | The name of the view. |
boolean | $cacheable | Whether this view can be cached. |
elgg_register_rss_link | ( | ) |
Include the RSS icon link and link element in the head.
elgg_register_viewtype | ( | $viewtype | ) |
Register a viewtype.
string | $viewtype | The view type to register |
elgg_register_viewtype_fallback | ( | $viewtype | ) |
Register a viewtype to fall back to a default view if a view isn't found for that viewtype.
This is useful for alternate html viewtypes (such as for mobile devices).
string | $viewtype | The viewtype to register |
elgg_set_form_footer | ( | $footer = '' | ) |
Sets form footer and defers its rendering until the form view and extensions have been rendered.
Deferring footer rendering allows plugins to extend the form view while maintaining logical DOM structure. Footer will be rendered using 'elements/forms/footer' view after form body has finished rendering
string | $footer | Footer |
elgg_set_view_location | ( | $view, | |
$location, | |||
$viewtype = '' |
|||
) |
Set an alternative base location for a view.
Views are expected to be in plugin_name/views/. This function can be used to change that location.
This is useful to optionally register views in a plugin.
string | $view | The name of the view |
string | $location | The full path to the view |
string | $viewtype | The view type |
elgg_set_viewtype | ( | $viewtype = "" | ) |
Manually set the viewtype.
View types are detected automatically. This function allows you to force subsequent views to use a different viewtype.
Call elgg_set_viewtype() with no parameter to reset.
string | $viewtype | The view type, e.g. 'rss', or 'default'. |
elgg_unextend_view | ( | $view, | |
$view_extension | |||
) |
Unextends a view.
string | $view | The view that was extended. |
string | $view_extension | This view that was added to $view |
elgg_unregister_ajax_view | ( | $view | ) |
Unregister a view for ajax calls.
string | $view | The view name |
elgg_unregister_external_view | ( | $view | ) |
Unregister a view for ajax calls.
string | $view | The view name |
elgg_unregister_rss_link | ( | ) |
Remove the RSS icon link and link element from the head.
elgg_view | ( | $view, | |
$vars = array() , |
|||
$ignore1 = false , |
|||
$ignore2 = false , |
|||
$viewtype = '' |
|||
) |
Return a parsed view.
Views are rendered by a template handler and returned as strings.
Views are called with a special $vars variable set, which includes any variables passed as the second parameter.
The input of views can be intercepted by registering for the view_vars, $view_name plugin hook.
If the input contains the key "__view_output", the view will output this value as a string. No extensions are used, and the "view" hook is not triggered).
The output of views can be intercepted by registering for the view, $view_name plugin hook.
string | $view | The name and location of the view to use |
array | $vars | Variables to pass to the view. |
boolean | $ignore1 | This argument is ignored and will be removed eventually |
boolean | $ignore2 | This argument is ignored and will be removed eventually |
string | $viewtype | If set, forces the viewtype for the elgg_view call to be this value (default: standard detection) |
elgg_view_access_collections | ( | $owner_guid | ) |
Displays a user's access collections, using the core/friends/collections view.
int | $owner_guid | The GUID of the owning user |
elgg_view_annotation | ( | \ElggAnnotation | $annotation, |
array | $vars = array() , |
||
$bypass = false , |
|||
$debug = false |
|||
) |
Returns a string of a rendered annotation.
Annotation views are expected to be in annotation/$annotation_name. If a view is not found for $annotation_name, the default annotation/default will be used.
The annotation view is called with the following in $vars:
\ElggAnnotation | $annotation | The annotation to display |
array | $vars | Variable array for view. 'item_view' Alternative view used to render an annotation |
bool | $bypass | Ignored and will be removed eventually |
bool | $debug | Complain if views are missing |
elgg_view_annotation_list | ( | $annotations, | |
array | $vars = array() |
||
) |
Returns a rendered list of annotations, plus pagination.
This function should be called by wrapper functions.
array | $annotations | Array of annotations |
array | $vars | Display variables 'count' The total number of annotations across all pages 'offset' The current indexing offset 'limit' The number of annotations to display per page 'full_view' Display the full view of the annotation? 'list_class' CSS Class applied to the list 'item_view' Alternative view to render list items 'offset_key' The url parameter key used for offset 'no_results' Message to display if no results (string|Closure) |
elgg_view_comments | ( | $entity, | |
$add_comment = true , |
|||
array | $vars = array() |
||
) |
Returns rendered comments and a comment form for an entity.
Plugins can override the output by registering a handler for the comments, $entity_type hook. The handler is responsible for formatting the comments and the add comment form.
\ElggEntity | $entity | The entity to view comments of |
bool | $add_comment | Include a form to add comments? |
array | $vars | Variables to pass to comment view |
elgg_view_deprecated | ( | $view, | |
array | $vars, | ||
$suggestion, | |||
$version | |||
) |
Display a view with a deprecation notice.
No missing view NOTICE is logged
string | $view | The name and location of the view to use |
array | $vars | Variables to pass to the view |
string | $suggestion | Suggestion with the deprecation message |
string | $version | Human-readable release version: 1.7, 1.8, ... |
elgg_view_entity | ( | \ElggEntity | $entity, |
array | $vars = array() , |
||
$bypass = false , |
|||
$debug = false |
|||
) |
Returns a string of a rendered entity.
Entity views are either determined by setting the view property on the entity or by having a view named after the entity $type/$subtype. Entities that have neither a view property nor a defined $type/$subtype view will fall back to using the $type/default view.
The entity view is called with the following in $vars:
This function can automatically appends annotations to entities if in full view and a handler is registered for the entity:annotate. See https://github.com/Elgg/Elgg/issues/964 and elgg_view_entity_annotations().
\ElggEntity | $entity | The entity to display |
array | $vars | Array of variables to pass to the entity view. 'full_view' Whether to show a full or condensed view. (Default: true) 'item_view' Alternative view used to render this entity |
boolean | $bypass | Ignored and will be removed eventually |
boolean | $debug | Complain if views are missing |
elgg_view_entity_annotations | ( | \ElggEntity | $entity, |
$full_view = true |
|||
) |
Display a plugin-specified rendered list of annotations for an entity.
This displays the output of functions registered to the entity:annotation, $entity_type plugin hook.
This is called automatically by the framework from elgg_view_entity()
\ElggEntity | $entity | Entity |
bool | $full_view | Display full view? |
elgg_view_entity_icon | ( | \ElggEntity | $entity, |
$size = 'medium' , |
|||
$vars = array() |
|||
) |
View the icon of an entity.
Entity views are determined by having a view named after the entity $type/$subtype. Entities that do not have a defined icon/$type/$subtype view will fall back to using the icon/$type/default view.
\ElggEntity | $entity | The entity to display |
string | $size | The size: tiny, small, medium, large |
array | $vars | An array of variables to pass to the view. Some possible variables are img_class and link_class. See the specific icon view for more parameters. |
elgg_view_entity_list | ( | $entities, | |
array | $vars = array() |
||
) |
Returns a rendered list of entities with pagination.
This function should be called by wrapper functions.
array | $entities | Array of entities |
array | $vars | Display variables 'count' The total number of entities across all pages 'offset' The current indexing offset 'limit' The number of entities to display per page (default from settings) 'full_view' Display the full view of the entities? 'list_class' CSS class applied to the list 'item_class' CSS class applied to the list items 'item_view' Alternative view to render list items 'pagination' Display pagination? 'base_url' Base URL of list (optional) 'url_fragment' URL fragment to add to links if not present in base_url (optional) 'position' Position of the pagination: before, after, or both 'list_type' List type: 'list' (default), 'gallery' 'list_type_toggle' Display the list type toggle? 'no_results' Message to display if no results (string|Closure) |
elgg_view_exists | ( | $view, | |
$viewtype = '' , |
|||
$recurse = true |
|||
) |
Returns whether the specified view exists.
string | $view | The view name |
string | $viewtype | If set, forces the viewtype |
bool | $recurse | If false, do not check extensions |
elgg_view_field | ( | array | $params = [] | ) |
Renders a form field, usually with a wrapper element, a label, help text, etc.
array | $params | Field parameters and variables for the input view. Keys not prefixed with hash (#) are passed to the input view as $vars. Keys prefixed with a hash specify the field wrapper (.elgg-view-field) output.
|
elgg_view_form | ( | $action, | |
$form_vars = array() , |
|||
$body_vars = array() |
|||
) |
elgg_view_friendly_time | ( | $time | ) |
Displays a UNIX timestamp in a friendly way.
int | $time | A UNIX epoch timestamp |
elgg_view_icon | ( | $name, | |
$vars = array() |
|||
) |
View one of the icons.
Shorthand for
string | $name | The specific icon to display |
mixed | $vars | The additional classname as a string ('float', 'float-alt' or a custom class) or an array of variables (array('class' => 'float')) to pass to the icon view. |
InvalidArgumentException |
elgg_view_image_block | ( | $image, | |
$body, | |||
$vars = array() |
|||
) |
Wrapper function for the image block display pattern.
Fixed width media on the side (image, icon, flash, etc.). Descriptive content filling the rest of the column.
This is a shortcut for { page/components/image_block}.
string | $image | The icon and other information |
string | $body | Description content |
array | $vars | Additional parameters for the view |
elgg_view_input | ( | $input_type, | |
array | $vars = array() |
||
) |
Renders a form field.
string | $input_type | Input type, used to generate an input view ("input/$input_type") |
array | $vars | Fields and input vars. Field vars contain both field and input params. 'label', 'help', and 'field_class' params will not be passed on to the input view. Others, including 'required' and 'id', will be available to the input view. Both 'label' and 'help' params accept HTML, and will be printed unescaped within their wrapper element. |
elgg_view_layout | ( | $layout_name, | |
$vars = array() |
|||
) |
Displays a layout with optional parameters.
Layouts provide consistent organization of pages and other blocks of content. There are a few default layouts in core:
The layout views take the form page/layouts/$layout_name See the individual layouts for what options are supported. The three most common layouts have these parameters: one_column content => string one_sidebar content => string sidebar => string (optional) content content => string sidebar => string (optional) buttons => string (override the default add button) title => string (override the default title) filter_context => string (selected content filter) See the content layout view for more parameters
string | $layout_name | The name of the view in page/layouts/. |
array | $vars | Associative array of parameters for the layout view |
elgg_view_list_item | ( | $item, | |
array | $vars = array() |
||
) |
View an item in a list.
\ElggEntity | \ElggAnnotation | $item | |
array | $vars | Additional parameters for the rendering 'item_view' Alternative view used to render list items |
elgg_view_menu | ( | $menu, | |
array | $vars = array() |
||
) |
Render a menu.
This function triggers a 'register', 'menu:<menu name>="">' plugin hook that enables plugins to add menu items just before a menu is rendered. This is used by dynamic menus (menus that change based on some input such as the user hover menu). Using elgg_register_menu_item() in response to the hook can cause incorrect links to show up. See the blog plugin's blog_owner_block_menu() for an example of using this plugin hook.
An additional hook is the 'prepare', 'menu:<menu name>="">' which enables plugins to modify the structure of the menu (sort it, remove items, set variables on the menu items).
Preset (unprepared) menu items passed to the this function with the $vars argument, will be merged with the registered items (registered with elgg_register_menu_item()). The combined set of menu items will be passed to 'register', 'menu:<menu_name>' hook.
Plugins that pass preset menu items to this function and do not wish to be affected by plugin hooks (e.g. if you are displaying multiple menus with the same name on the page) should instead choose a unqie menu name and define a menu_view argument to render menus consistently. For example, if you have multiple 'filter' menus on the page: elgg_view_menu("filter:$uid", [ 'items' => $items, 'menu_view' => 'navigation/menu/filter', ]);
elgg_view_menu() uses views in navigation/menu
string | Menu | UnpreparedMenu | $menu | Menu name (or object) |
array | $vars | An associative array of display options for the menu. Options include: items => an array of unprepared menu items as ElggMenuItem or menu item factory options sort_by => string or php callback string options: 'name', 'priority', 'title' (default), 'register' (registration order) or a php callback (a compare function for usort) handler: string the page handler to build action URLs entity: \ElggEntity to use to build action URLs class: string the class for the entire menu. menu_view: name of the view to be used to render the menu show_section_headers: bool show headers before menu sections. |
elgg_view_menu_item | ( | \ElggMenuItem | $item, |
array | $vars = array() |
||
) |
Render a menu item (usually as a link)
\ElggMenuItem | $item | The menu item |
array | $vars | Options to pass to output/url if a link |
elgg_view_module | ( | $type, | |
$title, | |||
$body, | |||
array | $vars = array() |
||
) |
Wrapper function for the module display pattern.
Box with header, body, footer
This is a shortcut for { page/components/module}.
string | $type | The type of module (main, info, popup, aside, etc.) |
string | $title | A title to put in the header |
string | $body | Content of the module |
array | $vars | Additional parameters for the module |
elgg_view_page | ( | $title, | |
$body, | |||
$page_shell = 'default' , |
|||
$vars = array() |
|||
) |
Assembles and outputs a full page.
A "page" in Elgg is determined by the current view type and can be HTML for a browser, RSS for a feed reader, or Javascript, PHP and a number of other formats.
For HTML pages, use the 'head', 'page' plugin hook for setting meta elements and links.
string | $title | Title |
string | $body | Body |
string | $page_shell | Optional page shell to use. See page/shells view directory |
array | $vars | Optional vars array to pass to the page shell. Automatically adds title, body, head, and sysmessages |
elgg_view_resource | ( | $name, | |
array | $vars = [] |
||
) |
Render a resource view.
Use this in your page handler to hand off page rendering to a view in "resources/". If not found in the current viewtype, we try the "default" viewtype.
string | $name | The view name without the leading "resources/" |
array | $vars | Arguments passed to the view |
SecurityException |
elgg_view_river_item | ( | $item, | |
array | $vars = array() |
||
) |
Renders a human-readable representation of a river item.
\ElggRiverItem | $item | A river item object |
array | $vars | An array of variables for the view 'item_view' Alternative view to render the item |
elgg_view_tagcloud | ( | array | $options = array() | ) |
Create a tagcloud for viewing.
array | $options | Any elgg_get_tags() options except: type => must be single entity type subtype => must be single entity subtype |
elgg_view_title | ( | $title, | |
array | $vars = array() |
||
) |
Renders a title.
This is a shortcut for { page/elements/title}.
string | $title | The page title |
array | $vars | View variables (was submenu be displayed? (deprecated)) |
elgg_views_add_rss_link | ( | ) |
Add the RSS link to the extras when if needed.
elgg_views_boot | ( | ) |
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades.
See #2252
$CURRENT_SYSTEM_VIEWTYPE = "" |
The viewtype override.
string $CURRENT_SYSTEM_VIEWTYPE
return function(\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |