56 $allowed_views = $ajax_api->getViews();
69 foreach ($request->getHttpRequest()->query->keys() as
$name) {
73 if (isset(
$vars[
'guid'])) {
77 if (isset(
$vars[
'river_id'])) {
88 $content_type =
'text/html';
91 $content_type =
_elgg_services()->mimetype->getMimeType($file, $content_type);
Controller to handle /ajax requests.
const ELGG_HTTP_FORBIDDEN
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Exception thrown if an argument is not of the expected type.
getParam(string $key, $default=null, bool $filter_result=true)
Get some input from variables passed submitted through GET or POST.
if(!$user||!$user->canDelete()) $name
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_get_viewtype()
Return the current view type.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_set_http_header(string $header, bool $replace=true)
Set a response HTTP header.
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
elgg_error_response(string|array $message= '', string $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
__invoke(Request $request)
Respond to a request.
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page...
get_entity(int $guid)
Loads and returns an entity object from a guid.
if(!empty($avatar)&&!$avatar->isValid()) elseif(empty($avatar)) if(!$owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
const ELGG_HTTP_BAD_REQUEST
const ELGG_HTTP_NOT_FOUND
elgg_get_river_item_from_id(int $id)
Get river item from its ID.
_elgg_services()
Get the global service provider.
elgg_view_exists(string $view, string $viewtype= '', bool $recurse=true)
Returns whether the specified view exists.
elgg_admin_gatekeeper()
Used at the top of a page to mark it as admin only.