Convenience function for generating a form from a view in a standard location.This function assumes that the body of the form is located at "forms/$action" and sets the action by default to "action/$action". Automatically wraps the forms/$action view with a <form> tag and inserts the anti-csrf security tokens.
@tip This automatically appends elgg-form-action-name to the form's class. It replaces any slashes with dashes (blog/save becomes elgg-form-blog-save)
This would assume a "login" form body to be at "forms/login" and would set the action of the form to "http://yoursite.com/action/login".
If elgg_view('forms/login') is: <input type="text" name="username" > <input type="password" name="password" >
Then elgg_view_form('login') generates: <form action="http://yoursite.com/action/login" method="post"> ...security tokens... <input type="text" name="username" > <input type="password" name="password" > </form>
<?php
return true;
}
}
}
}
return 'default';
}
}
}
return true;
}
return false;
}
}
return false;
}
return false;
}
return true;
}
}
}
}
}
if (!isset(
$CONFIG->allowed_ajax_views)) {
$CONFIG->allowed_ajax_views = array();
}
if ($cacheable) {
}
}
}
}
}
}
}
}
}
}
}
}
if ($system_messages->count()) {
$messages = $system_messages->dumpRegister();
$errors = array(
);
}
}
} else {
}
$vars[
'page_shell'] = $page_shell;
}
'links' => array(),
'metas' => array(),
);
} else {
}
$params[
'metas'][
'content-type'] = array(
'http-equiv' => 'Content-Type',
'content' => 'text/html; charset=utf-8',
);
$params[
'metas'][
'description'] = array(
'name' => 'description',
);
$params[
'metas'][
'viewport'] = array(
'name' => 'viewport',
'content' => 'width=device-width',
);
$params[
'metas'][
'mobile-web-app-capable'] = array(
'name' => 'mobile-web-app-capable',
'content' => 'yes',
);
$params[
'metas'][
'apple-mobile-web-app-capable'] = array(
'name' => 'apple-mobile-web-app-capable',
'content' => 'yes',
);
$params[
'links'][
'apple-touch-icon'] = array(
'rel' => 'apple-touch-icon',
);
$params[
'links'][
'icon-ico'] = array(
'rel' => 'icon',
);
$params[
'links'][
'icon-vector'] = array(
'rel' => 'icon',
'sizes' => '16x16 32x32 48x48 64x64 128x128',
'type' => 'image/svg+xml',
);
$params[
'links'][
'icon-16'] = array(
'rel' => 'icon',
'sizes' => '16x16',
'type' => 'image/png',
);
$params[
'links'][
'icon-32'] = array(
'rel' => 'icon',
'sizes' => '32x32',
'type' => 'image/png',
);
$params[
'links'][
'icon-64'] = array(
'rel' => 'icon',
'sizes' => '64x64',
'type' => 'image/png',
);
$params[
'links'][
'icon-128'] = array(
'rel' => 'icon',
'sizes' => '128x128',
'type' => 'image/png',
);
global $autofeed;
if (isset($autofeed) && $autofeed == true) {
if (substr_count(
$url,
'?')) {
} else {
}
'rel' => 'alternative',
'type' => 'application/rss+xml',
'title' => 'RSS',
);
}
}
elgg_deprecated_notice(
"The use of unlimited optional string arguments in elgg_view_layout() was deprecated in favor of an options array", 1.8);
$arg = 1;
$param_array = array();
while ($arg < func_num_args()) {
$param_array['area' . $arg] = func_get_arg($arg);
$arg++;
}
} else {
}
$param_array['layout'] = $layout_name;
} else {
}
}
$vars[
'name'] = $menu_name;
if (isset(
$CONFIG->menus[$menu_name])) {
} else {
}
} else {
}
}
if (!isset(
$vars[
'class'])) {
$vars[
'class'] =
'elgg-menu-content';
}
if (
$item->getLinkClass()) {
}
if (
$item->getHref() ===
false ||
$item->getHref() ===
null) {
if (preg_match(
'~<[a-z]~',
$text)) {
} else {
}
}
if (!isset(
$vars[
'rel']) && !isset(
$vars[
'is_trusted'])) {
$vars[
'is_trusted'] =
true;
}
if (
$item->getConfirmText()) {
}
}
return false;
}
global $autofeed;
$autofeed = true;
'full_view' => true,
);
} else {
);
}
$entity_subtype =
$entity->getSubtype();
if (empty($entity_subtype)) {
$entity_subtype = 'default';
}
$entity_views = array(
"$entity_type/$entity_subtype",
"$entity_type/default",
);
foreach ($entity_views as
$view) {
break;
}
}
if (
$vars[
'full_view']) {
}
}
}
return false;
}
}
}
}
}
}
global $autofeed;
$autofeed = true;
'full_view' => true,
);
}
return false;
}
$annotation_views = array(
"annotation/$name",
"annotation/default",
);
foreach ($annotation_views as
$view) {
break;
}
}
}
}
}
'items' => $entities,
'list_class' => 'elgg-list-entity',
'full_view' => true,
'pagination' => true,
'list_type' => $list_type,
'list_type_toggle' => false,
'limit' => null,
);
} else {
}
'items' => $entities,
'list_type' => $list_type,
'list_type_toggle' => $list_type_toggle,
'list_class' => 'elgg-list-entity',
);
}
$vars[
"pagination"] =
false;
}
if (
$vars[
'list_type'] !=
'list') {
} else {
}
}
'offset' => null,
'limit' => null,
'list_class' => 'elgg-list-annotation elgg-annotation-list',
'full_view' => true,
'offset_key' => 'annoff',
);
$vars[
"pagination"] =
false;
}
}
return false;
}
array(
)
);
}
}
}
return elgg_view(
'output/friendlytime', array(
'time' => $time));
}
return false;
}
$vars[
'show_add_form'] = $add_comment;
} else {
}
}
}
}
return '';
}
return '';
}
return '';
}
$river_views = array(
"river/item",
);
foreach ($river_views as
$view) {
break;
}
}
}
'action' =>
$CONFIG->wwwroot .
"action/$action",
);
$form_class =
'elgg-form-' . preg_replace(
'/[^a-z0-9]/i',
'-',
$action);
} else {
}
}
}
}
'value' => $tag_data,
));
}
}
return '';
}
}
$vars = array(
'class' =>
'float');
}
}
throw new \InvalidArgumentException('$vars needs to be a string or an array');
}
if (!array_key_exists(
'class',
$vars)) {
$vars[
'class'] = array();
}
if (!is_array(
$vars[
'class'])) {
}
$vars[
'class'][] =
"elgg-icon-$name";
}
$entities =
$user->getFriends(array(
'limit' => 0));
} else {
$entities = array();
}
$collections[
$key]->entities = $entities;
}
}
return elgg_view(
'core/friends/collections', array(
'collections' => $collections));
}
if (is_callable($function_name)) {
$CONFIG->template_handler = $function_name;
return true;
}
return false;
}
}
if (preg_match(
'~[\.-]min\.~',
$params[
'view'])) {
return;
}
}
} elseif (
$type ==
'css') {
$cssmin = new CSSmin();
}
}
}
$filter = new \Elgg\Amd\ViewFilter();
}
global $autofeed;
if (isset($autofeed) && $autofeed == true) {
if (substr_count(
$url,
'?')) {
} else {
}
'name' => 'rss',
));
}
}
header(
'X-Frame-Options: SAMEORIGIN');
}
$removed_views = array(
"1.10" => array(
'core/settings/tools',
),
);
foreach ($removed_views as
$version => $names) {
foreach ($names as
$name) {
if ($views_svc->viewExists(
$name)) {
}
}
}
}
if ($location === "/var/www/views/") {
}
}
elgg_register_js(
'require',
'/vendors/requirejs/require-2.1.10.min.js',
'head');
elgg_register_js(
'jquery-migrate',
'/vendors/jquery/jquery-migrate-1.2.1.min.js',
'head');
elgg_register_js(
'jquery-ui',
'/vendors/jquery/jquery-ui-1.10.4.min.js',
'head');
'src' => '/vendors/jquery/jquery.form.min.js',
'deps' => array('jquery'),
'exports' => 'jQuery.fn.ajaxForm',
));
'src' => '/vendors/jquery/jquery-ui-1.10.4.min.js',
'deps' => array('jquery'),
));
$viewtype_dirs = scandir($view_path);
}
}
'topbar' => array('w' => 16, 'h' => 16, 'square' => true, 'upscale' => true),
'tiny' => array('w' => 25, 'h' => 25, 'square' => true, 'upscale' => true),
'small' => array('w' => 40, 'h' => 40, 'square' => true, 'upscale' => true),
'medium' => array('w' => 100, 'h' => 100, 'square' => true, 'upscale' => true),
'large' => array('w' => 200, 'h' => 200, 'square' => false, 'upscale' => false),
'master' => array('w' => 550, 'h' => 550, 'square' => false, 'upscale' => false),
);
}
}
$events->registerHandler('boot', 'system', 'elgg_views_boot');
$events->registerHandler('init', 'system', 'elgg_views_handle_deprecated_views');
$events->registerHandler('ready', 'system', '_elgg_views_deprecate_removed_views');
};
$content
Set robots.txt action.
if(!file_exists($filename)) $icon_sizes
if($guid==elgg_get_logged_in_user_guid()) $name
elgg_get_simplecache_url($type, $view)
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
elgg_set_config($name, $value)
Set an Elgg configuration value.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$annotation
Elgg default annotation view.
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_define_js($name, $config)
Defines a JS lib as an AMD module.
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
elgg_load_css($name)
Load a CSS file for this page.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
elgg_register_js($name, $url, $location='head', $priority=null)
Register a JavaScript file for inclusion.
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_load_js($name)
Load a JavaScript resource on this page.
get_user_access_collections($owner_guid, $site_guid=0)
Returns an array of database row objects of the access collections owned by $owner_guid.
get_members_of_access_collection($collection, $idonly=false)
Get all of members of an access collection.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
elgg_format_url($url)
Handles formatting of ampersands in urls.
elgg_format_element($tag_name, array $attributes=array(), $text='', array $options=array())
Format an HTML element.
if(! $vars['title'] && $vars['title'] !==false) if(isset($vars['filter_override'])) if(!isset($vars['filter']) &&elgg_is_logged_in() && $context) $filter
if(file_exists($welcome)) $vars
get_user($guid)
Get a user object from a GUID.
clearfix elgg elgg elgg elgg page header
set_template_handler($function_name)
Registers a function to handle templates.
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
elgg_views_handle_deprecated_views()
Registers deprecated views to avoid making some pages from older plugins completely empty.
elgg_view_comments($entity, $add_comment=true, array $vars=array())
Returns rendered comments and a comment form for an entity.
elgg_view_annotation_list($annotations, array $vars=array())
Returns a rendered list of annotations, plus pagination.
elgg_get_viewtype()
Return the current view type.
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_is_registered_viewtype($viewtype)
Checks if $viewtype is registered.
_elgg_views_deprecate_removed_views()
Checks for usage of core views that have been removed.
elgg_view_menu_item(\ElggMenuItem $item, array $vars=array())
Render a menu item (usually as a link)
elgg_does_viewtype_fallback($viewtype)
Checks if a viewtype falls back to default.
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
elgg_register_viewtype($viewtype)
Register a viewtype.
elgg_view_title($title, $vars=array())
Renders a title.
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
elgg_extend_view($view, $view_extension, $priority=501, $viewtype='')
Extends a view with another view.
_elgg_views_amd($hook, $type, $content, $params)
Inserts module names into anonymous modules by handling the "simplecache:generate" hook.
elgg_unextend_view($view, $view_extension)
Unextends a view.
_elgg_views_send_header_x_frame_options()
Sends X-Frame-Options header on page requests.
_elgg_views_minify($hook, $type, $content, $params)
Minifies simplecache CSS and JS views by handling the "simplecache:generate" hook.
elgg_set_view_location($view, $location, $viewtype='')
Set an alternative base location for a view.
elgg_view_river_item($item, array $vars=array())
Renders a human-readable representation of a river item.
elgg_view_entity_icon(\ElggEntity $entity, $size='medium', $vars=array())
View the icon of an entity.
elgg_view_access_collections($owner_guid)
Displays a user's access collections, using the core/friends/collections view.
elgg_views_add_rss_link()
Add the rss link to the extras when if needed.
elgg_view_list_item($item, array $vars=array())
View an item in a list.
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
elgg_unregister_external_view($view)
Unregister a view for ajax calls.
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
elgg_view_entity(\ElggEntity $entity, $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered entity.
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades.
elgg_get_view_location($view, $viewtype='')
Returns the file location for a view.
elgg_view_page($title, $body, $page_shell='default', $vars=array())
Assembles and outputs a full page.
autoregister_views($view_base, $folder, $base_location_path, $viewtype)
Auto-registers views from a location.
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype='')
Return a parsed view.
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())
global $CURRENT_SYSTEM_VIEWTYPE
The viewtype override.
elgg_view_icon($name, $vars=array())
View one of the elgg sprite icons.
elgg_set_viewtype($viewtype="")
Manually set the viewtype.
_elgg_is_view_cacheable($view)
Check whether a view is registered as cacheable.
elgg_view_menu($menu_name, array $vars=array())
Render a menu.
elgg_view_deprecated($view, array $vars, $suggestion, $version)
Display a view with a deprecation notice.
elgg_view_entity_annotations(\ElggEntity $entity, $full_view=true)
Display a plugin-specified rendered list of annotations for an entity.
_elgg_is_valid_viewtype($viewtype)
Checks if $viewtype is a string suitable for use as a viewtype name.
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_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
elgg_view_exists($view, $viewtype='', $recurse=true)
Returns whether the specified view exists.
_elgg_views_prepare_head($title)
Prepare the variables for the html head.
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
elgg_view_tagcloud(array $options=array())
Create a tagcloud for viewing.