X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=8bde1afc4327ec4301db42d188b0b52e0eb4e26c;hb=19ffc0510b71096442de0456c805543378dd42d6;hp=1acd35ac348c52ea8c10adf42d3b53cda0b999c7;hpb=5af9fa0be1366f4f37e4461a0fc4fabfecc2bab5;p=friendica.git diff --git a/src/App.php b/src/App.php index 1acd35ac34..6ec61db724 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'; @@ -34,9 +31,10 @@ class App { public $module_loaded = false; public $module_class = null; - public $query_string; - public $config; - public $page; + public $query_string = ''; + public $config = []; + public $page = []; + public $pager = []; public $page_offset; public $profile; public $profile_uid; @@ -48,29 +46,18 @@ class App public $content; public $data = []; public $error = false; - public $cmd; + public $cmd = ''; public $argv; public $argc; public $module; - 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 @@ -81,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