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']);
448 if ($system_messages->count()) {
449 $messages = $system_messages->dumpRegister();
481 $vars[
'page_shell'] = $page_shell;
506 $params[
'metas'][
'content-type'] = array(
507 'http-equiv' =>
'Content-Type',
508 'content' =>
'text/html; charset=utf-8',
511 $params[
'metas'][
'description'] = array(
512 'name' =>
'description',
517 $params[
'metas'][
'viewport'] = array(
518 'name' =>
'viewport',
519 'content' =>
'width=device-width',
521 $params[
'metas'][
'mobile-web-app-capable'] = array(
522 'name' =>
'mobile-web-app-capable',
525 $params[
'metas'][
'apple-mobile-web-app-capable'] = array(
526 'name' =>
'apple-mobile-web-app-capable',
529 $params[
'links'][
'apple-touch-icon'] = array(
530 'rel' =>
'apple-touch-icon',
535 $params[
'links'][
'icon-ico'] = array(
539 $params[
'links'][
'icon-vector'] = array(
541 'sizes' =>
'16x16 32x32 48x48 64x64 128x128',
542 'type' =>
'image/svg+xml',
545 $params[
'links'][
'icon-16'] = array(
548 'type' =>
'image/png',
551 $params[
'links'][
'icon-32'] = array(
554 'type' =>
'image/png',
557 $params[
'links'][
'icon-64'] = array(
560 'type' =>
'image/png',
563 $params[
'links'][
'icon-128'] = array(
565 'sizes' =>
'128x128',
566 'type' =>
'image/png',
572 if (isset($autofeed) && $autofeed ==
true) {
574 if (substr_count(
$url,
'?')) {
579 $params[
'links'][
'rss'] = array(
580 'rel' =>
'alternative',
581 'type' =>
'application/rss+xml',
627 array_shift(
$params[
'segments']);
631 elgg_deprecated_notice(
"The use of unlimited optional string arguments in elgg_view_layout() was deprecated in favor of an options array", 1.8);
633 $param_array = array();
634 while ($arg < func_num_args()) {
635 $param_array[
'area' . $arg] = func_get_arg($arg);
639 $param_array =
$vars;
641 $param_array[
'layout'] = $layout_name;
695 $vars[
'name'] = $menu_name;
701 if (isset($CONFIG->menus[$menu_name])) {
702 $menu = $CONFIG->menus[$menu_name];
734 if (!isset(
$vars[
'class'])) {
735 $vars[
'class'] =
'elgg-menu-content';
748 if (preg_match(
'~<[a-z]~',
$text)) {
755 if (!isset(
$vars[
'rel']) && !isset(
$vars[
'is_trusted'])) {
756 $vars[
'is_trusted'] =
true;
796 if (!$entity || !($entity instanceof \
ElggEntity)) {
807 if (is_array(
$vars)) {
812 'full_view' =>
$vars,
818 $entity_type = $entity->
getType();
820 if (empty($entity_subtype)) {
821 $entity_subtype =
'default';
824 $entity_views = array(
827 "$entity_type/$entity_subtype",
828 "$entity_type/default",
832 foreach ($entity_views as
$view) {
840 if (
$vars[
'full_view']) {
868 if (!$entity || !($entity instanceof \
ElggEntity)) {
875 $entity_type = $entity->
getType();
930 $view = $annotation->view;
931 if (is_string(
$view)) {
935 $name = $annotation->name;
940 $annotation_views = array(
943 "annotation/default",
947 foreach ($annotation_views as
$view) {
992 $list_type =
get_input(
'list_type',
'list');
998 if (is_array(
$vars)) {
1001 'items' => $entities,
1002 'list_class' =>
'elgg-list-entity',
1003 'full_view' =>
true,
1004 'pagination' =>
true,
1005 'list_type' => $list_type,
1006 'list_type_toggle' =>
false,
1022 'items' => $entities,
1023 'count' => (
int)
$vars,
1028 'list_type' => $list_type,
1029 'list_type_toggle' => $list_type_toggle,
1030 'list_class' =>
'elgg-list-entity',
1036 $vars[
"pagination"] =
false;
1039 if (
$vars[
'list_type'] !=
'list') {
1069 'list_class' =>
'elgg-list-annotation elgg-annotation-list',
1070 'full_view' =>
true,
1071 'offset_key' =>
'annoff',
1078 $vars[
"pagination"] =
false;
1103 $entity_type = $entity->
getType();
1107 'entity' => $entity,
1126 if (!is_array(
$vars)) {
1147 return elgg_view(
'output/friendlytime', array(
'time' => $time));
1170 $vars[
'show_add_form'] = $add_comment;
1238 $view = $item->getView();
1243 $subject = $item->getSubjectEntity();
1244 $object = $item->getObjectEntity();
1263 $river_views = array(
1269 foreach ($river_views as
$view) {
1317 'action' => $CONFIG->wwwroot .
"action/$action",
1321 $form_class =
'elgg-form-' . preg_replace(
'/[^a-z0-9]/i',
'-',
$action);
1361 return elgg_view(
"output/tagcloud", array(
1362 'value' => $tag_data,
1408 if (
$vars ===
true) {
1410 $vars = array(
'class' =>
'float');
1413 if (is_string(
$vars)) {
1417 if (!is_array(
$vars)) {
1418 throw new \InvalidArgumentException(
'$vars needs to be a string or an array');
1421 if (!array_key_exists(
'class',
$vars)) {
1422 $vars[
'class'] = array();
1425 if (!is_array(
$vars[
'class'])) {
1429 $vars[
'class'][] =
"elgg-icon-$name";
1447 $entities =
$user->getFriends(array(
'limit' => 0));
1449 $entities = array();
1454 $collections[
$key]->entities = $entities;
1458 return elgg_view(
'core/friends/collections', array(
'collections' => $collections));
1484 if (is_callable($function_name)) {
1485 $CONFIG->template_handler = $function_name;
1524 if (preg_match(
'~[\.-]min\.~',
$params[
'view'])) {
1529 if (
$type ==
'js') {
1533 } elseif (
$type ==
'css') {
1535 $cssmin =
new CSSmin();
1554 $filter = new \Elgg\Amd\ViewFilter();
1566 if (isset($autofeed) && $autofeed ==
true) {
1568 if (substr_count(
$url,
'?')) {
1569 $url .=
"&view=rss";
1571 $url .=
"?view=rss";
1590 header(
'X-Frame-Options: SAMEORIGIN');
1599 $removed_views = array(
1601 'core/settings/tools',
1606 foreach ($removed_views as
$version => $names) {
1607 foreach ($names as
$name) {
1608 if ($views_svc->viewExists($name)) {
1623 if ($location ===
"/var/www/views/") {
1644 elgg_register_js(
'require',
'/vendors/requirejs/require-2.1.10.min.js',
'head');
1645 elgg_register_js(
'jquery',
'/vendors/jquery/jquery-1.11.0.min.js',
'head');
1646 elgg_register_js(
'jquery-migrate',
'/vendors/jquery/jquery-migrate-1.2.1.min.js',
'head');
1647 elgg_register_js(
'jquery-ui',
'/vendors/jquery/jquery-ui-1.10.4.min.js',
'head');
1651 'src' =>
'/vendors/jquery/jquery.form.min.js',
1652 'deps' => array(
'jquery'),
1653 'exports' =>
'jQuery.fn.ajaxForm',
1656 'src' =>
'/vendors/jquery/jquery-ui-1.10.4.min.js',
1657 'deps' => array(
'jquery'),
1691 $view_path = $CONFIG->viewpath;
1692 $viewtype_dirs = scandir($view_path);
1700 if (!isset($CONFIG->icon_sizes)) {
1702 'topbar' => array(
'w' => 16,
'h' => 16,
'square' =>
true,
'upscale' =>
true),
1703 'tiny' => array(
'w' => 25,
'h' => 25,
'square' =>
true,
'upscale' =>
true),
1704 'small' => array(
'w' => 40,
'h' => 40,
'square' =>
true,
'upscale' =>
true),
1705 'medium' => array(
'w' => 100,
'h' => 100,
'square' =>
true,
'upscale' =>
true),
1706 'large' => array(
'w' => 200,
'h' => 200,
'square' =>
false,
'upscale' =>
false),
1707 'master' => array(
'w' => 550,
'h' => 550,
'square' =>
false,
'upscale' =>
false),
1714 $events->registerHandler(
'boot',
'system',
'elgg_views_boot');
1715 $events->registerHandler(
'init',
'system',
'elgg_views_handle_deprecated_views');
1716 $events->registerHandler(
'ready',
'system',
'_elgg_views_deprecate_removed_views');
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
getSubtype()
Get the entity subtype.
elgg_is_registered_viewtype($viewtype)
Checks if $viewtype is registered.
_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.
elgg_view_icon($name, $vars=array())
View one of the elgg sprite icons.
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_entity_annotations(\ElggEntity $entity, $full_view=true)
Display a plugin-specified rendered list of annotations for an entity.
elgg_view_tagcloud(array $options=array())
Create a tagcloud for viewing.
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
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)
elgg_get_view_location($view, $viewtype= '')
Returns the file location for a view.
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_views_deprecate_removed_views()
Checks for usage of core views that have been removed.
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_views_add_rss_link()
Add the rss link to the extras when if needed.
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered annotation.
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
The viewtype override.
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_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log 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.
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
_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_view_menu_item(\ElggMenuItem $item, array $vars=array())
Render a menu item (usually as a link)
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_view_entity(\ElggEntity $entity, $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered 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_entity_list($entities, $vars=array(), $offset=0, $limit=null, $full_view=true, $list_type_toggle=true, $pagination=true)
Returns a rendered list of entities with pagination.
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
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...
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.