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 (func_num_args() == 5) {
elgg_log(__FUNCTION__ .
' now has only 3 arguments. Update your usage.',
'ERROR');
}
}
}
}
}
}
}
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',
];
}
}
}
'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 false;
}
$annotation_views = [
"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,
'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 false;
}
$relationship_views = [
"relationship/$name",
"relationship/default",
];
foreach ($relationship_views as
$view) {
break;
}
}
}
}
$view =
'output/friendlytime';
];
}
return false;
}
return false;
}
$vars[
'show_add_form'] = $add_comment;
$default_id = 'comments';
$default_id .= "-{$entity->guid}";
}
}
}
}
}
}
return '';
}
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) {
break;
}
}
}
}
}
}
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'];
}
$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['#']);
$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 '';
}
}
}
}
}
}
}
return false;
}
}
]);
]);
'deps' => ['jquery-ui/widgets/autocomplete'],
]);
'deps' => ['elgg/touch_punch'],
]);
}
if ($message_delay < 1) {
$message_delay = 6;
}
return [
'elgg.config.message_delay' => $message_delay * 1000,
'elgg.security.interval' => (int)
_elgg_services()->csrf->getActionTokenTimeout() * 333,
];
}
elgg_log(
'"elgg.data" plugin hook handlers must return an array. Returned ' . gettype(
$data) .
'.',
'ERROR');
}
$elgg = [
'config' => [
],
'security' => [
'token' => [
],
],
'session' => [
'user' => null,
],
'_data' => (object)
$data,
];
}
$user_object =
$user->toObject();
$user_object->admin =
$user->isAdmin();
$elgg['session']['user'] = $user_object;
$elgg['user'] = (array) $user_object;
}
return $elgg;
}
$current_view_type = null;
}
if (isset($current_view_type)) {
}
return $ret;
}
}
}