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.
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
$CURRENT_SYSTEM_VIEWTYPE = $viewtype;
return true;
}
if (empty($CURRENT_SYSTEM_VIEWTYPE)) {
}
}
return $viewtype;
}
return $CONFIG->view;
}
return 'default';
}
$GLOBALS['_ELGG']->view_types = array();
}
if (!in_array($viewtype, $GLOBALS[
'_ELGG']->
view_types)) {
$GLOBALS['_ELGG']->view_types[] = $viewtype;
}
return true;
}
return false;
}
return in_array($viewtype, $GLOBALS[
'_ELGG']->
view_types);
}
if (!is_string($viewtype) || $viewtype === '') {
return false;
}
if (preg_match('/\W/', $viewtype)) {
return false;
}
return true;
}
}
}
}
}
if ($cacheable) {
}
}
}
}
}
}
function elgg_view(
$view,
$vars = array(), $ignore1 =
false, $ignore2 =
false, $viewtype =
'') {
}
}
}
}
}
return Minify_CSS_UriRewriter::prepend(
$css,
$path);
}
if (!$timer->hasEnded(['build page'])) {
$timer->end(['build page']);
}
$timer->begin([__FUNCTION__]);
if ($system_messages->count()) {
$messages = $system_messages->dumpRegister();
$errors = array(
);
}
}
$vars[
'page_shell'] = $page_shell;
$timer->end([__FUNCTION__]);
}
$view =
"resources/$name";
}
}
} else {
}
}
'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',
);
if (substr_count(
$url,
'?')) {
} else {
}
'rel' => 'alternative',
'type' => 'application/rss+xml',
'title' => 'RSS',
);
}
}
$head_params['links']['apple-touch-icon'] = array(
'rel' => 'apple-touch-icon',
);
$head_params['links']['icon-ico'] = array(
'rel' => 'icon',
);
$head_params['links']['icon-vector'] = array(
'rel' => 'icon',
'sizes' => '16x16 32x32 48x48 64x64 128x128',
'type' => 'image/svg+xml',
);
$head_params['links']['icon-16'] = array(
'rel' => 'icon',
'sizes' => '16x16',
'type' => 'image/png',
);
$head_params['links']['icon-32'] = array(
'rel' => 'icon',
'sizes' => '32x32',
'type' => 'image/png',
);
$head_params['links']['icon-64'] = array(
'rel' => 'icon',
'sizes' => '64x64',
'type' => 'image/png',
);
$head_params['links']['icon-128'] = array(
'rel' => 'icon',
'sizes' => '128x128',
'type' => 'image/png',
);
return $head_params;
}
if (!$timer->hasEnded(['build page'])) {
$timer->end(['build page']);
}
$timer->begin([__FUNCTION__]);
$param_array['layout'] = $layout_name;
} else {
}
$timer->end([__FUNCTION__]);
}
unset(
$vars[
'menu_view']);
} elseif (
$menu instanceof UnpreparedMenu) {
}
if (!
$menu instanceof Menu) {
throw new \InvalidArgumentException('$menu must be a menu name, a Menu, or UnpreparedMenu');
}
$views = [
$menu_view,
"navigation/menu/$name",
'navigation/menu/default',
];
foreach ($views as
$view) {
}
}
}
if (!isset(
$vars[
'class'])) {
$vars[
'class'] =
'elgg-menu-content';
}
}
if (preg_match(
'~<[a-z]~',
$text)) {
} else {
}
}
if (!isset(
$vars[
'rel']) && !isset(
$vars[
'is_trusted'])) {
$vars[
'is_trusted'] =
true;
}
}
}
if (!$entity || !($entity instanceof \
ElggEntity)) {
return false;
}
'full_view' => true,
);
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']) {
}
}
}
if (!$entity || !($entity instanceof \
ElggEntity)) {
return false;
}
}
}
}
}
}
'full_view' => true,
);
$name = $annotation->name;
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,
);
$vars[
"pagination"] =
false;
}
if (
$vars[
'list_type'] ==
'table') {
} elseif (
$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(
'entity' => $entity,
)
);
}
}
$view =
'output/friendlytime';
$vars = [
'time' => $time];
}
return false;
}
$vars[
'show_add_form'] = $add_comment;
} else {
}
}
}
}
return '';
}
$view = $item->getView();
return '';
}
$object = $item->getObjectEntity();
return '';
}
$river_views = array(
"river/item",
);
foreach ($river_views as
$view) {
break;
}
}
}
}
}
}
}
if (isset(
$vars[
'help'])) {
}
if (isset(
$vars[
'field_class'])) {
unset(
$vars[
'field_class']);
}
}
_elgg_services()->logger->error(__FUNCTION__ .
'(): $params["#type"] is required.');
return '';
}
return '';
}
$hidden_types = ['hidden', 'securitytoken'];
}
$id =
"elgg-field-" . base_convert(mt_rand(), 10, 36);
}
$element_vars = [];
$make_special_checkbox_label = false;
} else {
$make_special_checkbox_label = true;
}
}
}
}
unset($element_vars['class']);
$element_vars[
'class'] =
$params[
'#class'];
}
unset($element_vars['help']);
$element_vars[
'help'] =
$params[
'#help'];
}
unset($element_vars['label']);
$element_vars[
'label'] =
$params[
'#label'];
}
$element_vars[
'label'] =
elgg_view(
'elements/forms/label', $element_vars);
$element_vars[
'help'] =
elgg_view(
'elements/forms/help', $element_vars);
if ($make_special_checkbox_label) {
unset($element_vars['label']);
}
return elgg_view(
'elements/forms/field', $element_vars);
}
}
}
'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";
}
}
}
if (isset($GLOBALS['autofeed']) && is_bool($GLOBALS['autofeed'])) {
return $GLOBALS['autofeed'];
}
}
$entities =
$user->getFriends(array(
'limit' => 0));
} else {
$entities = array();
}
$collections[
$key]->entities = $entities;
}
}
return elgg_view(
'core/friends/collections', array(
'collections' => $collections));
}
return _elgg_services()->views->autoregisterViews($view_base, $folder, $viewtype);
}
if (preg_match(
'~[\.-]min\.~',
$params[
'view'])) {
return;
}
}
} elseif (
$type ==
'css') {
$cssmin = new CSSmin();
}
}
}
$filter = new \Elgg\Amd\ViewFilter();
}
if (substr_count(
$url,
'?')) {
} else {
}
'name' => 'rss',
));
}
}
header(
'X-Frame-Options: SAMEORIGIN');
}
if ($views->viewIsExtended(
$view) || $views->viewHasHookHandlers(
$view)) {
return true;
}
if (0 === strpos(
$path,
'/') || preg_match(
'~^([A-Za-z]\:)?\\\\~',
$path)) {
} else {
$root = dirname(dirname(__DIR__));
$expected_path =
"$root/views/$viewtype/" . ltrim(
$path,
'/\\');
}
$view_path = $views->findViewFile(
$view, $viewtype);
return realpath($view_path) !== realpath($expected_path);
}
_elgg_services()->views->registerPluginViews(realpath(__DIR__ .
'/../../'));
$file = dirname(__DIR__) .
'/views.php';
$spec = Includer::includeFile(
$file);
if (is_array($spec)) {
}
}
}
'deps' => ['jquery-ui'],
]);
$viewtype_dirs = scandir($view_path);
foreach ($viewtype_dirs as $viewtype) {
}
}
if (!isset($CONFIG->icon_sizes)) {
'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),
);
}
}
static $allow_delay_pagesetup = true;
if (isset($GLOBALS['_ELGG']->pagesetupdone) || empty($CONFIG->boot_complete)) {
return;
}
$allow_delay = $allow_delay_pagesetup;
$allow_delay_pagesetup = false;
if ($allow_delay && (0 === strpos(
$view,
'resources/'))) {
return;
}
$GLOBALS['_ELGG']->pagesetupdone = true;
_elgg_services()->hooks->unregisterHandler(
'view_vars',
'all',
'_elgg_manage_pagesetup');
}
}
return [
'elgg.security.interval' => (int)
_elgg_services()->actions->getActionTokenTimeout() * 333,
];
}
elgg_log(
'"elgg.data" plugin hook handlers must return an array. Returned ' . gettype(
$data) .
'.',
'ERROR');
}
$elgg = array(
'config' => array(
),
'security' => array(
'token' => array(
),
),
'session' => array(
'user' => null,
),
'_data' => (
object)
$data,
);
$elgg['config']['load_sync_code'] = true;
}
}
$user_object =
$user->toObject();
$user_object->admin =
$user->isAdmin();
$elgg['session']['user'] = $user_object;
}
return $elgg;
}
if ($viewtype) {
}
if ($viewtype) {
}
return $ret;
}
$events->registerHandler('boot', 'system', 'elgg_views_boot');
$hooks->registerHandler('view_vars', 'all', '_elgg_manage_pagesetup', 1000);
};