*
* Useful in functions which require it but don't get it passed to them
*
+ * @deprecated since version 2018.09
+ * @see BaseObject::getApp()
* @return App
*/
function get_app()
return;
}
- $a = get_app();
+ $a = \get_app();
if (empty($_SESSION['sysmsg'])) {
$_SESSION['sysmsg'] = [];
}
*/
function info($s)
{
- $a = get_app();
+ $a = \get_app();
if (local_user() && PConfig::get(local_user(), 'system', 'ignore_info')) {
return;
*/
function is_site_admin()
{
- $a = get_app();
+ $a = \get_app();
$admin_email = Config::get('config', 'admin_email');
function get_temppath()
{
- $a = get_app();
+ $a = \get_app();
$temppath = Config::get("system", "temppath");
*/
function api_error($type, $e)
{
- $a = get_app();
+ $a = \get_app();
$error = ($e->getMessage() !== "" ? $e->getMessage() : $e->httpdesc);
/// @TODO: https://dev.twitter.com/overview/api/response-codes
function api_account_verify_credentials($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statuses_mediap($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
Logger::log('api_statuses_update: no user');
*/
function api_statuses_update($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
Logger::log('api_statuses_update: no user');
*/
function api_media_upload()
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
Logger::log('no user');
*/
function api_status_show($type, $item_id = 0)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
*/
function api_users_show($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
*/
function api_users_search($type)
{
- $a = get_app();
+ $a = \get_app();
$userlist = [];
*/
function api_search($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_home_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_public_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_networkpublic_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_show($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_conversation_show($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
{
global $called_api;
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statuses_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statuses_mentions($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_user_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_favorites_create_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
{
global $called_api;
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_format_items_activities($item, $type = "json")
{
- $a = get_app();
+ $a = \get_app();
$activities = [
'like' => [],
*/
function api_format_items($r, $user_info, $filter_user = false, $type = "json")
{
- $a = get_app();
+ $a = \get_app();
$ret = [];
*/
function api_lists_ownerships($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_statuses($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_f($qtype)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statusnet_config($type)
{
- $a = get_app();
+ $a = \get_app();
$name = Config::get('config', 'sitename');
$server = $a->getHostName();
throw new ForbiddenException();
}
- $a = get_app();
+ $a = \get_app();
api_get_user($a);
*/
function api_direct_messages_new($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_direct_messages_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_direct_messages_box($type, $box, $verbose)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
}
Contact::updateSelfFromUserID(api_user(), true);
// Update global directory in background
- $url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
+ $url = System::baseUrl() . '/profile/' . \get_app()->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url);
}
*/
function prepare_photo_data($type, $scale, $photo_id)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if ($user_info === false) {
*/
function api_friendica_group_show($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_group_delete($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_group_create($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_create($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_group_update($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_update($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_activity($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_notification($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_notification_seen($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_friendica_direct_messages_setseen($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
}
*/
function api_friendica_direct_messages_search($type, $box = "")
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_profile_show($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function notification($params)
{
- $a = get_app();
+ $a = \get_app();
// Temporary logging for finding the origin
if (!isset($params['language']) || !isset($params['uid'])) {
function _map_files1($rr)
{
- $a = get_app();
+ $a = \get_app();
$types = Image::supportedTypes();
$ext = $types[$rr['type']];
$filename_e = $rr['filename'];
function _map_files2($rr)
{
- $a = get_app();
+ $a = \get_app();
list($m1,$m2) = explode("/", $rr['filetype']);
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
$filename_e = $rr['filename'];
function item_post_return($baseurl, $api_source, $return_path)
{
// figure out how to return, depending on from whence we came
- $a = get_app();
+ $a = \get_app();
if ($api_source) {
return;
function lostpass_generate_password($user)
{
$o = '';
- $a = get_app();
+ $a = \get_app();
$new_password = User::generateNewPassword();
$result = User::updatePassword($user['uid'], $new_password);
function render_messages(array $msg, $t)
{
- $a = get_app();
+ $a = \get_app();
$tpl = Renderer::getMarkupTemplate($t);
$rslt = '';
function nodeinfo_cron() {
- $a = get_app();
+ $a = \get_app();
// If the addon 'statistics_json' is enabled then disable it and activate nodeinfo.
if (Addon::isEnabled('statistics_json')) {
$uid = local_user();
- $a = get_app();
+ $a = \get_app();
$counter = intval($_REQUEST['counter']);
function user_allow($hash)
{
- $a = get_app();
+ $a = \get_app();
$register = Register::getByHash($hash);
if (!DBA::isResult($register)) {
$uid = local_user();
- $a = get_app();
+ $a = \get_app();
$counter = intval($_REQUEST['counter']);
function get_theme_config_file($theme)
{
- $a = get_app();
+ $a = \get_app();
$base_theme = defaults($a->theme_info, 'extends');
if (file_exists("view/theme/$theme/config.php")) {
*/
public static function getFormSecurityToken($typename = '')
{
- $a = get_app();
+ $a = \get_app();
$timestamp = time();
$sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $timestamp . $typename);
$max_livetime = 10800; // 3 hours
- $a = get_app();
+ $a = \get_app();
$x = explode('.', $hash);
if (time() > (IntVal($x[0]) + $max_livetime)) {
public static function checkFormSecurityTokenRedirectOnError($err_redirect, $typename = '', $formname = 'form_security_token')
{
if (!self::checkFormSecurityToken($typename, $formname)) {
- $a = get_app();
+ $a = \get_app();
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
notice(self::getFormSecurityStandardErrorMessage());
public static function checkFormSecurityTokenForbiddenOnError($typename = '', $formname = 'form_security_token')
{
if (!self::checkFormSecurityToken($typename, $formname)) {
- $a = get_app();
+ $a = \get_app();
Logger::log('checkFormSecurityToken failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA);
header('HTTP/1.1 403 Forbidden');
{
$embedurl = trim($embedurl, '\'"');
- $a = get_app();
+ $a = \get_app();
$cache_key = 'oembed:' . $a->videowidth . ':' . $embedurl;
*/
private static function iframe($src, $width, $height)
{
- $a = get_app();
+ $a = \get_app();
if (!$height || strstr($height, '%')) {
$height = '200';
public static function contactBlock()
{
$o = '';
- $a = get_app();
+ $a = \get_app();
$shown = PConfig::get($a->profile['uid'], 'system', 'display_friend_count', 24);
if ($shown == 0) {
*/
public static function findPeople()
{
- $a = get_app();
+ $a = \get_app();
$global_dir = Config::get('system', 'directory');
if (Config::get('system', 'invitation_only')) {
*/
public static function categories($baseurl, $selected = '')
{
- $a = get_app();
+ $a = \get_app();
if (!Feature::isEnabled($a->profile['profile_uid'], 'categories')) {
return '';
*/
public static function tagCloud($limit = 50)
{
- $a = get_app();
+ $a = \get_app();
if (!$a->profile['profile_uid'] || !$a->profile['url']) {
return '';
* @return string Formated HTML of the calendar widget.
*/
public static function getHTML() {
- $a = get_app();
+ $a = \get_app();
if (empty($a->data['user'])) {
return;
throw new \RuntimeException('DocBlox isn\'t available.');
}
- $dir = get_app()->getBasePath();
+ $dir = \get_app()->getBasePath();
//stack for dirs to search
$dirstack = [];
protected function doExecute()
{
- $a = get_app();
+ $a = \get_app();
if ($this->getOption('v')) {
$this->out('Class: ' . __CLASS__);
protected function doExecute()
{
- $a = get_app();
+ $a = \get_app();
if ($this->getOption('v')) {
$this->out('Class: ' . __CLASS__);
protected function doExecute()
{
- $a = get_app();
+ $a = \get_app();
if ($this->getOption('v')) {
$this->out('Class: ' . __CLASS__);
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
}
- $a = get_app();
+ $a = \get_app();
$phpfile = realpath($this->getArgument(0));
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
}
- $a = get_app();
+ $a = \get_app();
$pofile = realpath($this->getArgument(0));
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
}
- $a = get_app();
+ $a = \get_app();
$php_path = $a->getConfigValue('config', 'php_path', 'php');
return $info;
}
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
$theme_file = file_get_contents("view/theme/$theme/theme.php");
$a->saveTimestamp($stamp1, "file");
if ($root !== '' && $root[strlen($root) - 1] !== '/') {
$root = $root . '/';
}
- $theme_info = get_app()->theme_info;
+ $theme_info = \get_app()->theme_info;
if (is_array($theme_info) && array_key_exists('extends', $theme_info)) {
$parent = $theme_info['extends'];
} else {
$parent = 'NOPATH';
}
- $theme = get_app()->getCurrentTheme();
+ $theme = \get_app()->getCurrentTheme();
$thname = $theme;
$ext = substr($file, strrpos($file, '.') + 1);
$paths = [
*/
public static function getStylesheetPath($theme)
{
- $a = get_app();
+ $a = \get_app();
$opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
if (file_exists('view/theme/' . $theme . '/style.php')) {
*/
public static function processQueue($run_cron = true)
{
- $a = get_app();
+ $a = \get_app();
self::$up_start = microtime(true);
*/
public static function execute($queue)
{
- $a = get_app();
+ $a = \get_app();
$mypid = getmypid();
*/
private static function execFunction($queue, $funcname, $argv, $method_call)
{
- $a = get_app();
+ $a = \get_app();
$mypid = getmypid();
* @param string $query The database query that will be analyzed
*/
private static function logIndex($query) {
- $a = get_app();
+ $a = \get_app();
if (!$a->getConfigVariable('system', 'db_log_index')) {
return;
* @return bool|object statement object or result object
*/
public static function p($sql) {
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
* @return boolean Was the query successfull? False is returned only if an error occurred
*/
public static function e($sql) {
- $a = get_app();
+ $a = \get_app();
$stamp = microtime(true);
* @return array current row
*/
public static function fetch($stmt) {
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
* @return boolean was the close successful?
*/
public static function close($stmt) {
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
public static function photoMenu(array $contact, $uid = 0)
{
// @todo Unused, to be removed
- $a = get_app();
+ $a = \get_app();
$contact_url = '';
$pm_url = '';
{
$result = ['cid' => -1, 'success' => false, 'message' => ''];
- $a = get_app();
+ $a = \get_app();
// remove ajax junk, e.g. Twitter
$url = str_replace('/#!/', '/', $url);
*/
public static function updateSuggestions()
{
- $a = get_app();
+ $a = \get_app();
$done = [];
if ($notify) {
// We have to avoid duplicates. So we create the GUID in form of a hash of the plink or uri.
// We add the hash of our own host because our host is the original creator of the post.
- $prefix_host = get_app()->getHostName();
+ $prefix_host = \get_app()->getHostName();
} else {
$prefix_host = '';
public static function insert($item, $force_parent = false, $notify = false, $dontcache = false)
{
- $a = get_app();
+ $a = \get_app();
// If it is a posting where users should get notifications, then define it as wall posting
if ($notify) {
public static function isRemoteSelf($contact, &$datarray)
{
- $a = get_app();
+ $a = \get_app();
if (!$contact['remote_self']) {
return false;
*/
public static function send($recipient = 0, $body = '', $subject = '', $replyto = '')
{
- $a = get_app();
+ $a = \get_app();
if (!$recipient) {
return -1;
$micro = System::baseUrl() . '/photo/' . $hash . '-6.' . $Image->getExt() . $suffix;
// Remove the cached photo
- $a = get_app();
+ $a = \get_app();
$basepath = $a->getBasePath();
if (is_dir($basepath . "/photo")) {
*/
private static function sidebar($profile, $block = 0, $show_connect = true)
{
- $a = get_app();
+ $a = \get_app();
$o = '';
$location = false;
public static function getBirthdays()
{
- $a = get_app();
+ $a = \get_app();
$o = '';
if (!local_user() || $a->is_mobile || $a->is_tablet) {
public static function getEventsReminderHTML()
{
- $a = get_app();
+ $a = \get_app();
$o = '';
if (!local_user() || $a->is_mobile || $a->is_tablet) {
*/
public static function openWebAuthInit($token)
{
- $a = get_app();
+ $a = \get_app();
// Clean old OpenWebAuthToken entries.
OpenWebAuthToken::purge('owt', '3 MINUTE');
*/
public static function create(array $data)
{
- $a = get_app();
+ $a = \get_app();
$return = ['user' => null, 'password' => ''];
$using_invites = Config::get('system', 'invitation_only');
return false;
}
- $a = get_app();
+ $a = \get_app();
Logger::log('Removing user: ' . $uid);
public function loginUser($uid)
{
Logger::log("FKOAuth1::loginUser $uid");
- $a = get_app();
+ $a = \get_app();
$record = DBA::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]);
if (!DBA::isResult($record)) {
*/
private static function ownHost($host)
{
- $own_host = get_app()->getHostName();
+ $own_host = \get_app()->getHostName();
$parts = parse_url($host);
$string = $this->asString();
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
file_put_contents($path, $string);
Logger::log('Image: guessType: '.$filename . ($fromcurl?' from curl headers':''), Logger::DEBUG);
$type = null;
if ($fromcurl) {
- $a = get_app();
+ $a = \get_app();
$headers=[];
$h = explode("\n", $header);
foreach ($h as $l) {
} else {
$tempfile = tempnam(get_temppath(), "cache");
- $a = get_app();
+ $a = \get_app();
$stamp1 = microtime(true);
file_put_contents($tempfile, $img_str);
$a->saveTimestamp($stamp1, "file");
*/
public static function feed($dfrn_id, $owner_nick, $last_update, $direction = 0, $onlyheader = false)
{
- $a = get_app();
+ $a = \get_app();
$sitefeed = ((strlen($owner_nick)) ? false : true); // not yet implemented, need to rewrite huge chunks of following logic
$public_feed = (($dfrn_id) ? false : true);
*/
public static function deliver($owner, $contact, $atom, $dissolve = false, $legacy_transport = false)
{
- $a = get_app();
+ $a = \get_app();
// At first try the Diaspora transport layer
if (!$dissolve && !$legacy_transport) {
*/
public static function transmit($owner, $contact, $atom, $public_batch = false)
{
- $a = get_app();
+ $a = \get_app();
if (!$public_batch) {
if (empty($contact['addr'])) {
*/
private static function processSuggestion($xpath, $suggestion, $importer)
{
- $a = get_app();
+ $a = \get_app();
Logger::log("Processing suggestions");
/// @todo Do we really need this check for HTML elements? (It was copied from the old function)
if ((strpos($item['body'], '<') !== false) && (strpos($item['body'], '>') !== false)) {
- $base_url = get_app()->getBaseURL();
+ $base_url = \get_app()->getBaseURL();
$item['body'] = HTML::relToAbs($item['body'], $base_url);
$item['body'] = HTML::toBBCodeVideo($item['body']);
*/
private static function receiveRequestMakeFriend(array $importer, array $contact)
{
- $a = get_app();
+ $a = \get_app();
if ($contact["rel"] == Contact::SHARING) {
DBA::update(
*/
public static function transmit(array $owner, array $contact, $envelope, $public_batch, $queue_run = false, $guid = "", $no_queue = false)
{
- $a = get_app();
+ $a = \get_app();
$enabled = intval(Config::get("system", "diaspora_enabled"));
if (!$enabled) {
*/
public static function import($xml, $importer, &$contact, &$hub, $simulate = false) {
- $a = get_app();
+ $a = \get_app();
if (!$simulate) {
Logger::log("Import Atom/RSS feed '".$contact["name"]."' (Contact ".$contact["id"].") for user ".$importer["uid"], Logger::DEBUG);
*/
private static function addHeader(DOMDocument $doc, array $owner, $filter, $feed_mode = false)
{
- $a = get_app();
+ $a = \get_app();
$root = $doc->createElementNS(NAMESPACE_ATOM1, 'feed');
$doc->appendChild($root);
*/
public static function load($cid, $uid, $zcid, $url)
{
- $a = get_app();
+ $a = \get_app();
if ($cid) {
if (!$url || !$uid) {
{
parent::__construct();
- $a = get_app();
+ $a = \get_app();
$theme = $a->getCurrentTheme();
// setTemplateDir can be set to an array, which Smarty will parse in order.
$s = new FriendicaSmarty();
}
- $r['$APP'] = get_app();
+ $r['$APP'] = \get_app();
// "middleware": inject variables into templates
$arr = [
public function getTemplateFile($file, $root = '')
{
- $a = get_app();
+ $a = \get_app();
$template = new FriendicaSmarty();
// Make sure $root ends with a slash /
*/
private function isUser(array $aCommand)
{
- $a = get_app();
+ $a = \get_app();
// Check if there is a username
if (!isset($aCommand[1])) {
*/
private function auth(array $aCommand)
{
- $a = get_app();
+ $a = \get_app();
// check user authentication
if (sizeof($aCommand) != 4) {
$stamp1 = microtime(true);
- $a = get_app();
+ $a = \get_app();
$parts = parse_url($url);
$path_parts = explode('/', defaults($parts, 'path', ''));
return CurlResult::createErrorCurl($url);
}
- $a = get_app();
+ $a = \get_app();
$ch = curl_init($url);
if (($redirects > 8) || (!$ch)) {
*/
public static function finalUrl($url, $depth = 1, $fetchbody = false)
{
- $a = get_app();
+ $a = \get_app();
$url = self::stripTrackingQueryParams($url);
*/
public static function getSiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1)
{
- $a = get_app();
+ $a = \get_app();
$siteinfo = [];
*/
public static function getDateofBirthField($dob)
{
- $a = get_app();
+ $a = \get_app();
list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
'type' => 'image/png'
]
];
- $app = get_app();
+ $app = \get_app();
$app->argc = 2;
$result = api_media_upload();
function get_scheme_info($scheme)
{
- $theme = get_app()->getCurrentTheme();
+ $theme = \get_app()->getCurrentTheme();
$themepath = 'view/theme/' . $theme . '/';
$scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'scheme'));
function _js_in_foot() {
/** @purpose insert stuff in bottom of page
*/
- $a = get_app();
+ $a = \get_app();
$ssl_state = null;
$baseurl = System::baseUrl($ssl_state);
$bottom['$baseurl'] = $baseurl;
function vier_community_info()
{
- $a = get_app();
+ $a = \get_app();
$show_pages = get_vier_config("show_pages", 1);
$show_profiles = get_vier_config("show_profiles", 1);