X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=c6ed818dd1a8ec23f932a1ef4eb826e8c45f7117;hb=1baa4d48afdc90a551afe381ee2798b9a827e920;hp=e9c43b21bf0bfe574c2a6c757a911befa21b6137;hpb=4f0ee4df2790574c7af4c1e98f717b2ed4e59b91;p=friendica.git diff --git a/src/App.php b/src/App.php index e9c43b21bf..c6ed818dd1 100644 --- a/src/App.php +++ b/src/App.php @@ -4,11 +4,10 @@ */ namespace Friendica; -use Detection\MobileDetect; -use DOMDocument; -use DOMXPath; use Exception; use Friendica\App\Arguments; +use Friendica\App\BaseURL; +use Friendica\App\Page; use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Core\Config\Configuration; use Friendica\Core\Config\PConfiguration; @@ -20,7 +19,6 @@ use Friendica\Model\Profile; use Friendica\Module\Login; use Friendica\Module\Special\HTTPException as ModuleHTTPException; use Friendica\Network\HTTPException; -use Friendica\Util\BaseURL; use Friendica\Util\ConfigFileLoader; use Friendica\Util\HTTPSignature; use Friendica\Util\Profiler; @@ -44,6 +42,9 @@ class App { /** @deprecated 2019.09 - use App\Arguments->getQueryString() */ public $query_string; + /** + * @var Page The current page environment + */ public $page; public $profile; public $profile_uid; @@ -53,7 +54,7 @@ class App public $contacts; public $page_contact; public $content; - public $data = []; + public $data = []; /** @deprecated 2019.09 - use App\Arguments->getCommand() */ public $cmd = ''; /** @deprecated 2019.09 - use App\Arguments->getArgv() or Arguments->get() */ @@ -65,9 +66,11 @@ class App public $timezone; public $interactive = true; public $identities; - public $is_mobile = false; - public $is_tablet = false; - public $theme_info = []; + /** @deprecated 2019.09 - Use App\Mode->isMobile() instead */ + public $is_mobile; + /** @deprecated 2019.09 - Use App\Mode->isTable() instead */ + public $is_tablet; + public $theme_info = []; public $category; // Allow themes to control internal parameters // by changing App values in theme.php @@ -77,39 +80,22 @@ class App public $videoheight = 350; public $force_max_items = 0; public $theme_events_in_profile = true; - - public $stylesheets = []; - public $footerScripts = []; + public $queue; /** * @var App\Mode The Mode of the Application */ private $mode; - /** - * @var App\Router - */ - private $router; - /** * @var BaseURL */ private $baseURL; - /** - * @var string The name of the current theme - */ + /** @var string The name of the current theme */ private $currentTheme; - - /** - * @var bool check if request was an AJAX (xmlhttprequest) request - */ - private $isAjax; - - /** - * @var MobileDetect - */ - public $mobileDetect; + /** @var string The name of the current mobile theme */ + private $currentMobileTheme; /** * @var Configuration The config @@ -141,6 +127,11 @@ class App */ private $args; + /** + * @var Core\Process The process methods + */ + private $process; + /** * Returns the current config cache of this node * @@ -213,90 +204,55 @@ class App } /** - * 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. - * - * @param string $path - * - * @see initHead() - * + * @deprecated 2019.09 - use Page->registerStylesheet instead + * @see Page::registerStylesheet() */ public function registerStylesheet($path) { - if (mb_strpos($path, $this->getBasePath() . DIRECTORY_SEPARATOR) === 0) { - $path = mb_substr($path, mb_strlen($this->getBasePath() . DIRECTORY_SEPARATOR)); - } - - $this->stylesheets[] = trim($path, '/'); + $this->page->registerStylesheet($path); } /** - * Register a javascript file path to be included in the