X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=0dc4b86b95f6520f14bb966e45f552ff6e8ad511;hb=f32ea03911e81ccb1ce9f6553f8fc3bdaa815ffb;hp=655ea84f00d958008c6d7c8fffcf6d0ed8adb1a6;hpb=d78b1f5191c7272b8f21e2a9ae4fe5ee1b44ea16;p=friendica.git diff --git a/src/App.php b/src/App.php index 655ea84f00..ff118ac725 100644 --- a/src/App.php +++ b/src/App.php @@ -4,15 +4,12 @@ */ namespace Friendica; -use Friendica\Core\Cache; -use Friendica\Core\Config; -use Friendica\Core\L10n; -use Friendica\Core\PConfig; -use Friendica\Core\System; - use Detection\MobileDetect; - +use DOMDocument; +use DOMXPath; use Exception; +use Friendica\Database\DBA; +use Friendica\Network\HTTPException\InternalServerErrorException; require_once 'boot.php'; require_once 'include/text.php'; @@ -32,16 +29,11 @@ require_once 'include/text.php'; */ class App { - const MODE_NORMAL = 0; - const MODE_INSTALL = 1; - const MODE_MAINTENANCE = 2; - public $module_loaded = false; public $module_class = null; - public $query_string; - public $config; - public $page; - public $page_offset; + public $query_string = ''; + public $config = []; + public $page = []; public $profile; public $profile_uid; public $user; @@ -52,30 +44,18 @@ class App public $content; public $data = []; public $error = false; - public $cmd; + public $cmd = ''; public $argv; public $argc; public $module; - public $mode = App::MODE_NORMAL; - public $pager; - public $strings; - public $basepath; - public $path; - 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 @@ -86,6 +66,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