Elgg  Version 2.3
content.php
Go to the documentation of this file.
1 <?php
2 
3 // don't show content for default widgets
4 if (elgg_in_context('default_widgets')) {
5  return;
6 }
7 
8 $widget = elgg_extract('entity', $vars);
9 if (!elgg_instanceof($widget, 'object', 'widget')) {
10  return;
11 }
12 
13 $handler = $widget->handler;
14 
15 if (elgg_view_exists("widgets/$handler/content")) {
16  echo elgg_view("widgets/$handler/content", $vars);
17 } else {
18  echo elgg_view_deprecated("widgets/$handler/view", $vars, "Widgets use content as the display view", '1.8');
19 }
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:293
if(elgg_in_context('default_widgets')) $widget
Definition: content.php:8
elgg_view_deprecated($view, array $vars, $suggestion, $version)
Display a view with a deprecation notice.
Definition: views.php:353
if(!elgg_instanceof($widget, 'object', 'widget')) $handler
Definition: content.php:13
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an and optionally for type and subtype.
Definition: entities.php:736
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:241
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375
$vars['title']
Definition: content.php:19