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
}
}
}
}
}
}
}
}
}
}
}
}
if (!
$timer->hasEnded([
'build page'])) {
}
$timer->begin([__FUNCTION__]);
if ($system_messages->count()) {
$messages = $system_messages->dumpRegister();
];
}
}
$vars[
'page_shell'] = $page_shell;
}
$view =
"resources/{$name}";
}
}
throw new PageNotFoundException();
}
if (!
$timer->hasEnded([
'build page'])) {
}
$timer->begin([__FUNCTION__]);
array_shift(
$vars[
'segments']);
$vars[
'layout'] = $layout_name;
$layout_views = [
"page/layouts/{$layout_name}",
'page/layouts/default',
];
foreach ($layout_views as $layout_view) {
break;
}
}
}
unset(
$vars[
'menu_view']);
}
if (!
$menu instanceof Menu) {
}
"navigation/menu/{$name}",
'navigation/menu/default',
];
}
}
return '';
}
'full_view' => true,
];
}
$entity_views = [
"{$entity_type}/{$entity_subtype}",
"{$entity_type}/default",
];
foreach ($entity_views as
$view) {
break;
}
}
}
}
}
}
}
'full_view' => true,
];
$name = $annotation->name;
return '';
}
$annotation_views = [
"annotation/{$name}",
'annotation/default',
];
foreach ($annotation_views as
$view) {
}
}
return '';
}
'items' => $entities,
'list_class' => 'elgg-list-entity',
'full_view' => true,
'pagination' => true,
'list_type' => $list_type,
'limit' => null,
];
$vars[
'pagination'] =
false;
}
$view =
"page/components/{$vars['list_type']}";
$view =
'page/components/list';
}
}
'items' => $annotations,
'offset' => null,
'limit' => null,
'list_class' => 'elgg-list-annotation',
'full_view' => true,
'list_type' => $list_type,
'offset_key' => 'annoff',
];
$vars[
'pagination'] =
false;
}
$view =
"page/components/{$vars['list_type']}";
$view =
'page/components/list';
}
}
'items' => $relationships,
'offset' => null,
'limit' => null,
'list_class' => 'elgg-list-relationship',
'full_view' => false,
'list_type' => $list_type,
'offset_key' => 'reloff',
];
$vars[
'pagination'] =
false;
}
$view =
"page/components/{$vars['list_type']}";
$view =
'page/components/list';
}
}
'full_view' => true,
];
$name = $relationship->relationship;
return '';
}
$relationship_views = [
"relationship/{$name}",
'relationship/default',
];
foreach ($relationship_views as
$view) {
}
}
return '';
}
}
$view =
'output/friendlytime';
];
}
return '';
}
$vars[
'show_add_form'] = $add_comment;
$default_id = 'comments';
$default_id .= "-{$entity->guid}";
}
}
}
}
}
}
return '';
}
}
$river_views = [
'river/item',
"river/{$type}/{$subtype}/{$action}",
"river/{$type}/{$subtype}/default",
"river/{$type}/{$action}",
"river/{$type}/default",
'river/elements/layout',
];
foreach ($river_views as
$view) {
}
}
return '';
}
}
}
}
if (!isset($prefixes)) {
$prefixes = ['#'];
}
$return = [];
$default_section = '';
foreach ($prefixes as $prefix) {
break;
} else {
}
}
}
return $return;
}
}
_elgg_services()->logger->error(__FUNCTION__ .
'(): $params["#type"] is required.');
return '';
}
return '';
}
$hidden_types = ['hidden', 'securitytoken'];
}
$params[
'id'] =
'elgg-field-' . base_convert(mt_rand(), 10, 36);
}
$make_special_checkbox_label = false;
} else {
$make_special_checkbox_label = true;
}
}
];
$element_vars = array_merge($split_params[''], $split_params['#']);
$label_vars = $element_vars;
unset($label_vars['id']);
}
$element_vars[
'label'] =
elgg_view(
'elements/forms/label', $label_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);
}
]);
}
}
}
return '';
}
}
}
}
return false;
}
}
}
_elgg_services()->logger->error(
'"elgg.data" Event handlers must return an array. Returned ' . gettype(
$data) .
'.');
}
if ($message_delay < 1) {
$message_delay = 6;
}
$elgg = [
'config' => [
'simplecache_enabled' => (int)
_elgg_services()->simpleCache->isEnabled(),
'message_delay' => $message_delay * 1000,
],
'security' => [
'interval' => (int)
_elgg_services()->csrf->getActionTokenTimeout() * 333,
'token' => [
],
],
'session' => [
'user' => null,
],
];
$user_object =
$user->toObject();
$user_object->admin =
$user->isAdmin();
$elgg['user'] = (array) $user_object;
}
return $elgg;
}
$current_view_type = null;
}
if (isset($current_view_type)) {
}
return $ret;
}
}
}
}