180 if (func_num_args() == 5) {
181 elgg_log(__FUNCTION__ .
' now has only 3 arguments. Update your usage.',
'ERROR');
269 if (is_array(
$body)) {
277 if (!
$timer->hasEnded([
'build page'])) {
278 $timer->end([
'build page']);
280 $timer->begin([__FUNCTION__]);
285 array_shift(
$params[
'segments']);
292 if ($system_messages->count()) {
293 $messages = $system_messages->dumpRegister();
309 $vars[
'page_shell'] = $page_shell;
321 $timer->end([__FUNCTION__]);
336 $view =
"resources/$name";
382 if (!
$timer->hasEnded([
'build page'])) {
383 $timer->end([
'build page']);
385 $timer->begin([__FUNCTION__]);
389 array_shift(
$vars[
'segments']);
393 $vars[
'layout'] = $layout_name;
396 "page/layouts/$layout_name",
397 "page/layouts/default",
401 foreach ($layout_views as $layout_view) {
408 $timer->end([__FUNCTION__]);
471 unset(
$vars[
'menu_view']);
473 if (is_string(
$menu)) {
488 "navigation/menu/$name",
489 'navigation/menu/default',
532 $entity_type = $entity->
getType();
537 "$entity_type/$entity_subtype",
538 "$entity_type/default",
542 foreach ($entity_views as
$view) {
572 $entity_type = $entity->
getType();
614 $name = $annotation->name;
619 $annotation_views = [
622 "annotation/default",
626 foreach ($annotation_views as
$view) {
665 $list_type =
get_input(
'list_type',
'list');
668 'items' => $entities,
669 'list_class' =>
'elgg-list-entity',
671 'pagination' =>
true,
672 'list_type' => $list_type,
681 $vars[
"pagination"] =
false;
684 $view =
"page/components/{$vars['list_type']}";
686 $view =
'page/components/list';
712 $list_type =
get_input(
'list_type',
'list');
715 'items' => $annotations,
718 'list_class' =>
'elgg-list-annotation',
720 'list_type' => $list_type,
721 'offset_key' =>
'annoff',
728 $vars[
"pagination"] =
false;
731 $view =
"page/components/{$vars['list_type']}";
733 $view =
'page/components/list';
759 $list_type =
get_input(
'list_type',
'list');
762 'items' => $relationships,
765 'list_class' =>
'elgg-list-relationship',
766 'full_view' =>
false,
767 'list_type' => $list_type,
768 'offset_key' =>
'reloff',
775 $vars[
'pagination'] =
false;
778 $view =
"page/components/{$vars['list_type']}";
780 $view =
'page/components/list';
810 $name = $relationship->relationship;
815 $relationship_views = [
817 "relationship/$name",
818 "relationship/default",
822 foreach ($relationship_views as
$view) {
860 $view =
'output/friendlytime';
889 if (!
$entity->hasCapability(
'commentable')) {
894 $vars[
'show_add_form'] = $add_comment;
897 $default_id =
'comments';
899 $default_id .=
"-{$entity->guid}";
1017 "river/{$type}/{$subtype}/{$action}",
1018 "river/{$type}/{$subtype}/default",
1019 "river/{$type}/{$action}",
1020 "river/{$type}/default",
1021 'river/elements/layout',
1025 foreach ($river_views as
$view) {
1108 if (!isset($prefixes)) {
1113 $default_section =
'';
1116 foreach ($prefixes as $prefix) {
1151 if (!empty(
$params[
'#html'])) {
1155 if (empty(
$params[
'#type'])) {
1156 _elgg_services()->logger->error(__FUNCTION__ .
'(): $params["#type"] is required.');
1165 $hidden_types = [
'hidden',
'securitytoken'];
1173 $id =
"elgg-field-" . base_convert(mt_rand(), 10, 36);
1177 $make_special_checkbox_label =
false;
1190 $make_special_checkbox_label =
true;
1210 $element_vars = array_merge($split_params[
''], $split_params[
'#']);
1219 $element_vars[
'label'] =
elgg_view(
'elements/forms/label', $element_vars);
1220 $element_vars[
'help'] =
elgg_view(
'elements/forms/help', $element_vars);
1222 if ($make_special_checkbox_label) {
1225 unset($element_vars[
'label']);
1229 return elgg_view(
'elements/forms/field', $element_vars);
1256 'value' => $tag_data,
1308 if (is_string(
$vars)) {
1312 if (!is_array(
$vars)) {
1394 'deps' => [
'jquery-ui/widgets/autocomplete'],
1399 'deps' => [
'elgg/touch_punch'],
1416 if ($message_delay < 1) {
1424 'elgg.config.message_delay' => $message_delay * 1000,
1427 'elgg.security.interval' => (int)
_elgg_services()->csrf->getActionTokenTimeout() * 333,
1428 'elgg.config.language' =>
_elgg_services()->config->language ?:
'en',
1440 if (!is_array(
$data)) {
1441 elgg_log(
'"elgg.data" plugin hook handlers must return an array. Returned ' . gettype(
$data) .
'.',
'ERROR');
1462 '_data' => (object)
$data,
1472 $user_object =
$user->toObject();
1473 $user_object->admin =
$user->isAdmin();
1474 $elgg[
'session'][
'user'] = $user_object;
1476 $elgg[
'user'] = (array) $user_object;
1494 $current_view_type = null;
1502 if (isset($current_view_type)) {
elgg_get_current_language()
Get the current system/user language or "en".
if(!elgg_view_exists("plugins/{$plugin_id}/settings")) $form_vars
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades...
getSubtype()
Get the entity subtype.
elgg_get_release()
Get the current Elgg release.
elgg_get_view_extensions($view)
Get the views (and priorities) that extend a view.
if(empty($plugins)) $errors
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
elgg_require_css(string $view)
Register a CSS view name to be included in the HTML head.
$params
Saves global plugin settings.
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
elgg_view_entity_list($entities, array $vars=[])
Returns a rendered list of entities with pagination.
elgg_view_resource($name, array $vars=[])
Render a resource view.
if(!$user||!$user->canDelete()) $name
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
elgg_view_relationship_list($relationships, array $vars=[])
Returns a rendered list of relationships, plus pagination.
$relationship
Elgg default relationship view.
if(!$annotation instanceof ElggAnnotation) $time
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
if($vars['name']&&$vars['default']!==false) $input_vars
elgg_view_tagcloud(array $options=[])
Create a tagcloud for viewing.
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_register_external_file(string $type, string $name, string $url, string $location= '')
Core registration function for external files.
_elgg_get_js_site_data()
Get the site data to be merged into "elgg" in elgg.js.
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=[])
View the icon of an entity.
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
elgg_get_viewtype()
Return the current view type.
elgg_view_image_block($image, $body, $vars=[])
Wrapper function for the image block display pattern.
_elgg_has_rss_link()
Should the RSS view of this URL be linked to?
elgg_view_menu($menu, array $vars=[])
Render a menu.
_elgg_get_js_page_data()
Get the initial contents of "elgg" client side.
Thrown when page is not accessible.
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
elgg_view_list_item($item, array $vars=[])
View an item in a list.
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
elgg_view_river_item($item, array $vars=[])
Renders a human-readable representation of a river item.
if(!empty($avatar)&&!$avatar->isValid()) elseif(empty($avatar)) if(!$owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
elgg_view_form($action, $form_vars=[], $body_vars=[])
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
elgg_view_relationship(\ElggRelationship $relationship, array $vars=[])
Returns a string of a rendered relationship.
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_load_external_file(string $type, string $name)
Load an external resource for use on this page.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
const ELGG_ENTITIES_ANY_VALUE
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
elgg_extend_view($view, $view_extension, $priority=501)
Extends a view with another view.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
elgg_view_friendly_time($time, $time_updated=null)
Displays a UNIX timestamp in a friendly way.
elgg_view_annotation_list($annotations, array $vars=[])
Returns a rendered list of annotations, plus pagination.
if($email instanceof\Elgg\Email) $object
$ts
CSRF security token view for use with secure forms.
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
elgg_view_layout($layout_name, $vars=[])
Displays a layout with optional parameters.
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof ElggRelationship) elseif(is_callable([$item, 'getType']))
elgg_is_simplecache_enabled()
Is simple cache enabled.
getType()
Returns the entity type.
elgg_view_icon($name, $vars=[])
View an icon glyph.
_elgg_services()
Get the global service provider.
elgg_set_viewtype($viewtype= '')
Manually set the viewtype.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=[])
Returns a string of a rendered annotation.
elgg_unregister_rss_link()
Remove the RSS icon link and link element from the head.
_elgg_view_under_viewtype($view, $vars, $viewtype)
Render a view while the global viewtype is temporarily changed.
elgg_is_xhr()
Checks whether the request was requested via ajax.
$id
Generic annotation delete action.
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
_elgg_split_vars(array $vars=[], array $prefixes=null)
Split array of vars into subarrays based on property prefixes.
if(!empty($title)&&!empty($icon_name)) if(!empty($title)) if(!empty($menu)) if(!empty($header)) if(!empty($body)) $contents
getURL()
Gets the URL for this entity.
elgg_define_js($name, $config)
Helper functions for external files like css/js.
elgg_view_title($title, array $vars=[])
Renders a title.
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
getDisplayName()
Get the entity's display name.
elgg_get_config($name, $default=null)
Get an Elgg configuration value.
elgg_view_comments($entity, $add_comment=true, array $vars=[])
Returns rendered comments and a comment form for an entity.
elgg_get_form_footer()
Returns currently set footer, or false if not in the form rendering stack.
elgg_register_rss_link()
Include the RSS icon link and link element in the head.
elgg_unextend_view($view, $view_extension)
Unextends a view.