From: Philipp Holzer Date: Thu, 15 Aug 2019 18:52:42 +0000 (+0200) Subject: Add Page class for Frontend X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9f68e6b589e71a88d8562e9d689005fef7ce5948;p=friendica.git Add Page class for Frontend - Move frontend logic (stylesheet, footerscript, content) to Page class --- diff --git a/src/App.php b/src/App.php index 749cbe9cc9..e7381ab125 100644 --- a/src/App.php +++ b/src/App.php @@ -5,11 +5,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; @@ -44,6 +43,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; @@ -77,9 +79,7 @@ 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 @@ -213,43 +213,23 @@ 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