94 if ($CURRENT_SYSTEM_VIEWTYPE !=
"") {
104 return $CONFIG->view;
119 if (!isset($CONFIG->view_types) || !is_array($CONFIG->view_types)) {
120 $CONFIG->view_types = array();
123 if (!in_array(
$viewtype, $CONFIG->view_types)) {
141 if (!isset($CONFIG->view_types) || !is_array($CONFIG->view_types)) {
145 return in_array(
$viewtype, $CONFIG->view_types);
234 if (!isset($CONFIG->allowed_ajax_views)) {
235 $CONFIG->allowed_ajax_views = array();
238 $CONFIG->allowed_ajax_views[
$view] =
true;
267 if (isset($CONFIG->allowed_ajax_views[
$view])) {
268 unset($CONFIG->allowed_ajax_views[
$view]);
442 array_shift(
$params[
'segments']);
476 $vars[
'page_shell'] = $page_shell;
502 'http-equiv' =>
'Content-Type',
503 'content' =>
'text/html; charset=utf-8',
507 'name' =>
'description',
512 $data[
'metas'][] = array(
513 'name' =>
'viewport',
514 'content' =>
'width=device-width',
516 $data[
'metas'][] = array(
517 'name' =>
'mobile-web-app-capable',
520 $data[
'metas'][] = array(
521 'name' =>
'apple-mobile-web-app-capable',
524 $data[
'links'][] = array(
525 'rel' =>
'apple-touch-icon',
536 'sizes' =>
'16x16 32x32 48x48 64x64 128x128',
537 'type' =>
'image/svg+xml',
543 'type' =>
'image/png',
549 'type' =>
'image/png',
555 'type' =>
'image/png',
560 'sizes' =>
'128x128',
561 'type' =>
'image/png',
567 if (isset($autofeed) && $autofeed ==
true) {
569 if (substr_count(
$url,
'?')) {
575 'rel' =>
'alternative',
576 'type' =>
'application/rss+xml',
622 array_shift(
$params[
'segments']);
626 elgg_deprecated_notice(
"The use of unlimited optional string arguments in elgg_view_layout() was deprecated in favor of an options array", 1.8);
628 $param_array = array();
629 while ($arg < func_num_args()) {
630 $param_array[
'area' . $arg] = func_get_arg($arg);
634 $param_array =
$vars;
636 $param_array[
'layout'] = $layout_name;
690 $vars[
'name'] = $menu_name;
694 if (isset($CONFIG->menus[$menu_name])) {
695 $menu = $CONFIG->menus[$menu_name];
727 if (!isset(
$vars[
'class'])) {
728 $vars[
'class'] =
'elgg-menu-content';
737 if ($item->
getHref() ===
false) {
741 if (preg_match(
'~<[a-z]~',
$text)) {
748 if (!isset(
$vars[
'rel']) && !isset(
$vars[
'is_trusted'])) {
749 $vars[
'is_trusted'] =
true;
756 unset(
$vars[
'confirm']);
793 if (!$entity || !($entity instanceof
ElggEntity)) {
804 if (is_array(
$vars)) {
809 'full_view' =>
$vars,
817 $view = $entity->view;
818 if (is_string(
$view)) {
822 $entity_type = $entity->
getType();
837 if (
$vars[
'full_view']) {
865 if (!$entity || !($entity instanceof
ElggEntity)) {
872 $entity_type = $entity->
getType();
926 $view = $annotation->view;
927 if (is_string(
$view)) {
931 $name = $annotation->name;
977 $list_type =
get_input(
'list_type',
'list');
983 if (is_array(
$vars)) {
986 'items' => $entities,
987 'list_class' =>
'elgg-list-entity',
989 'pagination' =>
true,
990 'list_type' => $list_type,
991 'list_type_toggle' =>
false,
1003 'items' => $entities,
1004 'count' => (
int)
$vars,
1009 'list_type' => $list_type,
1010 'list_type_toggle' => $list_type_toggle,
1011 'list_class' =>
'elgg-list-entity',
1017 $vars[
"pagination"] =
false;
1020 if (
$vars[
'list_type'] !=
'list') {
1049 'list_class' =>
'elgg-list-annotation elgg-annotation-list',
1050 'full_view' =>
true,
1051 'offset_key' =>
'annoff',
1058 $vars[
"pagination"] =
false;
1083 $entity_type = $entity->
getType();
1087 'entity' => $entity,
1106 if (!is_array(
$vars)) {
1127 return elgg_view(
'output/friendlytime', array(
'time' => $time));
1150 $vars[
'show_add_form'] = $add_comment;
1218 $view = $item->getView();
1223 $subject = $item->getSubjectEntity();
1224 $object = $item->getObjectEntity();
1284 'action' => $CONFIG->wwwroot .
"action/$action",
1288 $form_class =
'elgg-form-' . preg_replace(
'/[^a-z0-9]/i',
'-',
$action);
1328 return elgg_view(
"output/tagcloud", array(
1329 'value' => $tag_data,
1348 $type = $item->getType();
1349 if (in_array(
$type, $CONFIG->entity_types)) {
1351 }
else if (
$type ==
'annotation') {
1353 }
else if (
$type ==
'river') {
1394 $entities =
$user->getFriends(array(
'limit' => 0));
1396 $entities = array();
1401 $collections[
$key]->entities = $entities;
1405 return elgg_view(
'core/friends/collections', array(
'collections' => $collections));
1431 if (is_callable($function_name)) {
1432 $CONFIG->template_handler = $function_name;
1471 static $autoload_registered;
1472 if (!$autoload_registered) {
1475 $autoload_registered =
true;
1478 if (preg_match(
'~[\.-]min\.~',
$params[
'view'])) {
1483 if (
$type ==
'js') {
1487 } elseif (
$type ==
'css') {
1489 $cssmin =
new CSSMin();
1520 if (isset($autofeed) && $autofeed ==
true) {
1522 if (substr_count(
$url,
'?')) {
1523 $url .=
"&view=rss";
1525 $url .=
"?view=rss";
1544 header(
'X-Frame-Options: SAMEORIGIN');
1555 if ($location ===
"/var/www/views/") {
1578 elgg_register_js(
'require',
'/vendors/requirejs/require-2.1.10.min.js',
'head');
1579 elgg_register_js(
'jquery',
'/vendors/jquery/jquery-1.11.0.min.js',
'head');
1580 elgg_register_js(
'jquery-migrate',
'/vendors/jquery/jquery-migrate-1.2.1.min.js',
'head');
1581 elgg_register_js(
'jquery-ui',
'/vendors/jquery/jquery-ui-1.10.4.min.js',
'head');
1585 'src' =>
'/vendors/jquery/jquery.form.min.js',
1586 'deps' => array(
'jquery'),
1587 'exports' =>
'jQuery.fn.ajaxForm',
1621 $view_path = $CONFIG->viewpath;
1622 $viewtype_dirs = scandir($view_path);
1630 if (!isset($CONFIG->icon_sizes)) {
1632 'topbar' => array(
'w' => 16,
'h' => 16,
'square' =>
true,
'upscale' =>
true),
1633 'tiny' => array(
'w' => 25,
'h' => 25,
'square' =>
true,
'upscale' =>
true),
1634 'small' => array(
'w' => 40,
'h' => 40,
'square' =>
true,
'upscale' =>
true),
1635 'medium' => array(
'w' => 100,
'h' => 100,
'square' =>
true,
'upscale' =>
true),
1636 'large' => array(
'w' => 200,
'h' => 200,
'square' =>
false,
'upscale' =>
false),
1637 'master' => array(
'w' => 550,
'h' => 550,
'square' =>
false,
'upscale' =>
false),
elgg_get_class_loader()
Get Elgg's class loader.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
getSubtype()
Get the entity subtype.
elgg_view_entity_annotations(ElggEntity $entity, $full_view=true)
Display a plugin-specified rendered list of annotations for an entity.
elgg_is_registered_viewtype($viewtype)
Checks if $viewtype is registered.
elgg_view_icon($name, $class= '')
View one of the elgg sprite icons.
elgg_view_entity(ElggEntity $entity, $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered entity.
_elgg_is_valid_viewtype($viewtype)
Checks if $viewtype is a string suitable for use as a viewtype name.
elgg_view_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
$annotation
Elgg default annotation view.
if($guid==elgg_get_logged_in_user_guid()) $name
elgg_define_js($name, $config)
Defines a JS lib as an AMD module.
set_template_handler($function_name)
Registers a function to handle templates.
elgg_view_tagcloud(array $options=array())
Create a tagcloud for viewing.
elgg_view_entity_list($entities, $vars=array(), $offset=0, $limit=10, $full_view=true, $list_type_toggle=true, $pagination=true)
Returns a rendered list of entities with pagination.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
elgg_view_menu_item(ElggMenuItem $item, array $vars=array())
Render a menu item (usually as a link)
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
_elgg_views_amd($hook, $type, $content, $params)
Inserts module names into anonymous modules by handling the "simplecache:generate" hook...
elgg_view_annotation_list($annotations, array $vars=array())
Returns a rendered list of annotations, plus pagination.
elgg_register_viewtype_fallback($viewtype)
Register a viewtype to fall back to a default view if a view isn't found for that viewtype...
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Register a callback as a plugin hook handler.
elgg_get_view_location($view, $viewtype= '')
Returns the file location for a view.
if(isset($vars['id'])) $class
elgg_views_handle_deprecated_views()
Registers deprecated views to avoid making some pages from older plugins completely empty...
elgg_unregister_external_view($view)
Unregister a view for ajax calls.
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
autoregister_views($view_base, $folder, $base_location_path, $viewtype)
Auto-registers views from a location.
elgg_view_list_item($item, array $vars=array())
View an item in a list.
_elgg_views_minify($hook, $type, $content, $params)
Minifies simplecache CSS and JS views by handling the "simplecache:generate" hook.
elgg_view_menu($menu_name, array $vars=array())
Render a menu.
get_user_access_collections($owner_guid, $site_guid=0)
Returns an array of database row objects of the access collections owned by $owner_guid.
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
elgg_load_css($name)
Load a CSS file for this page.
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
elgg_set_viewtype($viewtype="")
Manually set the viewtype.
elgg_get_viewtype()
Return the current view type.
elgg_view_entity_icon(ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
elgg_views_add_rss_link()
Add the rss link to the extras when if needed.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_get_simplecache_url($type, $view)
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
get_user($guid)
Get a user object from a GUID.
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
elgg_unextend_view($view, $view_extension)
Unextends a view.
get_members_of_access_collection($collection, $idonly=false)
Get all of members of an access collection.
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
elgg_set_config($name, $value)
Set an Elgg configuration value.
global $CURRENT_SYSTEM_VIEWTYPE
Elgg's view system.
elgg_does_viewtype_fallback($viewtype)
Checks if a viewtype falls back to default.
_elgg_is_view_cacheable($view)
Check whether a view is registered as cacheable.
if(!file_exists($filename)) $icon_sizes
elgg_view_deprecated($view, array $vars, $suggestion, $version)
Display a view with a deprecation notice.
if(!$vars['title']&&$vars['title']!==false) if(isset($vars['filter_override'])) if(!isset($vars['filter'])&&elgg_is_logged_in()&&$context) $filter
elgg_extend_view($view, $view_extension, $priority=501, $viewtype= '')
Extends a view with another view.
elgg_get_root_path()
Get the root directory path for this installation.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.
elgg global
Pointer to the global context.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
system_messages($message=null, $register="success", $count=false)
Queues a message to be displayed.
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
_elgg_views_send_header_x_frame_options()
Sends X-Frame-Options header on page requests.
_elgg_views_prepare_head($title)
Prepare the variables for the html head.
elgg_load_js($name)
Load a JavaScript resource on this page.
elgg_view_title($title, $vars=array())
Renders a title.
getType()
Returns the entity type.
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
$content
Set robots.txt action.
elgg_view_comments($entity, $add_comment=true, array $vars=array())
Returns rendered comments and a comment form for an entity.
elgg_format_url($url)
Handles formatting of ampersands in urls.
elgg_view_access_collections($owner_guid)
Displays a user's access collections, using the core/friends/collections view.
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
clearfix elgg elgg elgg elgg page header
elgg_view_annotation(ElggAnnotation $annotation, array $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered annotation.
elgg_view_form($action, $form_vars=array(), $body_vars=array())
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades...
count_messages($register="")
Counts the number of messages, either globally or in a particular register.
if(file_exists($welcome)) $vars
elgg_view_river_item($item, array $vars=array())
Renders a human-readable representation of a river item.
elgg_register_viewtype($viewtype)
Register a viewtype.