X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=6ec61db724c4b136b1f85ed109f1f4884d17af5b;hb=19ffc0510b71096442de0456c805543378dd42d6;hp=0dc4b86b95f6520f14bb966e45f552ff6e8ad511;hpb=71ec84f6dc83f753fe80170cfdfd32d202850d90;p=friendica.git diff --git a/src/App.php b/src/App.php index 0dc4b86b95..6ec61db724 100644 --- a/src/App.php +++ b/src/App.php @@ -5,15 +5,13 @@ namespace Friendica; use Detection\MobileDetect; +use DOMDocument; +use DOMXPath; use Exception; -use Friendica\Core\Config; -use Friendica\Core\L10n; -use Friendica\Core\PConfig; -use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\Network\HTTPException\InternalServerErrorException; require_once 'boot.php'; -require_once 'include/dba.php'; require_once 'include/text.php'; /** @@ -31,21 +29,6 @@ require_once 'include/text.php'; */ class App { - const MODE_LOCALCONFIGPRESENT = 1; - const MODE_DBAVAILABLE = 2; - const MODE_DBCONFIGAVAILABLE = 4; - const MODE_MAINTENANCEDISABLED = 8; - - /** - * @deprecated since version 2008.08 Use App->isInstallMode() instead to check for install mode. - */ - const MODE_INSTALL = 0; - - /** - * @deprecated since version 2008.08 Use the precise mode constant to check for a specific capability instead. - */ - const MODE_NORMAL = App::MODE_LOCALCONFIGPRESENT | App::MODE_DBAVAILABLE | App::MODE_DBCONFIGAVAILABLE | App::MODE_MAINTENANCEDISABLED; - public $module_loaded = false; public $module_class = null; public $query_string = ''; @@ -67,25 +50,14 @@ class App public $argv; public $argc; public $module; - public $mode = App::MODE_INSTALL; - public $strings; - public $basepath; - public $urlpath; - public $hooks = []; public $timezone; public $interactive = true; - public $addons; - public $addons_admin = []; - public $apps = []; public $identities; public $is_mobile = false; public $is_tablet = false; - public $is_friendica_app; public $performance = []; public $callstack = []; public $theme_info = []; - public $backend = true; - public $nav_sel; public $category; // Allow themes to control internal parameters // by changing App values in theme.php @@ -96,6 +68,76 @@ class App public $force_max_items = 0; public $theme_events_in_profile = true; + public $stylesheets = []; + public $footerScripts = []; + + /** + * @var App\Mode The Mode of the Application + */ + private $mode; + + /** + * @var string The App base path + */ + private $basePath; + + /** + * @var string The App URL path + */ + private $urlPath; + + /** + * @var bool true, if the call is from the Friendica APP, otherwise false + */ + private $isFriendicaApp; + + /** + * @var bool true, if the call is from an backend node (f.e. worker) + */ + private $isBackend; + + /** + * @var string The name of the current theme + */ + private $currentTheme; + + /** + * @var bool check if request was an AJAX (xmlhttprequest) request + */ + private $isAjax; + + /** + * Register a stylesheet file path to be included in the tag of every page. + * Inclusion is done in App->initHead(). + * The path can be absolute or relative to the Friendica installation base folder. + * + * @see initHead() + * + * @param string $path + */ + public function registerStylesheet($path) + { + $url = str_replace($this->getBasePath() . DIRECTORY_SEPARATOR, '', $path); + + $this->stylesheets[] = trim($url, '/'); + } + + /** + * Register a javascript file path to be included in the