10 use Elgg\Traits\Loggable;
22 protected bool $rendering =
false;
82 'sticky_enabled' => false,
84 'sticky_ignored_fields' => [],
89 'elgg-form-' . preg_replace(
'/[^a-z0-9]/i',
'-',
$action)],
99 $this->esm->import(
'input/form-ajax');
114 $this->rendering =
true;
122 $body = $this->views->renderView(
'elements/forms/body', [
130 $body .= $this->views->renderView(
'elements/forms/footer', [
131 'footer' => $this->getFooter(),
138 $this->rendering =
false;
171 $fields = (array) $this->events->triggerResults(
'form:register:fields',
"{$entity_type}:{$entity_subtype}", [
177 $default_form_vars = [
178 'sticky_enabled' =>
true,
183 $default_body_vars = [
205 "{$entity_type}/{$entity_subtype}/edit",
206 "{$entity_subtype}/edit",
209 foreach ($forms as
$view) {
215 return 'entity/edit';
230 "{$entity_type}/{$entity_subtype}/edit",
231 "{$entity_subtype}/edit",
240 throw new DomainException(
"No form action found for {$entity_type}/{$entity_subtype}");
254 if (!$this->rendering) {
255 throw new LogicException(
'Form footer can only be set and retrieved during form rendering, anywhere in elgg_view_form() call stack (e.g. form view, extending views, or view events)');
268 if (!$this->rendering) {
269 throw new LogicException(
'Form footer can only be set and retrieved during form rendering, anywhere in elgg_view_form() call stack (e.g. form view, extending views, or view events)');
$fields
Save the configuration of the security.txt contents.
if(!empty($avatar) &&! $avatar->isValid()) elseif(empty($avatar)) if(! $owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
if(!elgg_view_exists("plugins/{$plugin_id}/settings")) $form_vars
foreach($categories as $key=> $category) $body
Exception thrown if a value does not adhere to a defined valid data domain.
Exception thrown if an argument is not of the expected type.
Exception that represents error in the program logic.
Keeps track of ES modules.
elgg_extract_class(array $array, array|string $existing=[], string $extract_key='class')
Extract class names from an array, optionally merging into a preexisting set.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_action_exists(string $action)
Check if an action is registered and its script exists.
elgg_view_exists(string $view, string $viewtype='', bool $recurse=true)
Returns whether the specified view exists.
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.
elgg_generate_action_url(string $action, array $query=[], bool $add_csrf_tokens=true)
Generate an action URL.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.
if(! $menu instanceof \Elgg\Menu\PreparedMenu) $actions