X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FApp.php;h=7622a1a0ce3aacb5e2795fbdd6b9c1e7b572e78e;hb=78a7e130ae7f5e5bca1fa51a49000ae3ef7a16f5;hp=eca5c4b7dbda4f7624de6f58386e64aba30fab54;hpb=d487c399dd05e65b4b0990eb7c3ee86b4cc78e22;p=friendica.git diff --git a/src/App.php b/src/App.php index eca5c4b7db..7622a1a0ce 100644 --- a/src/App.php +++ b/src/App.php @@ -4,16 +4,13 @@ */ namespace Friendica; +use Detection\MobileDetect; +use Exception; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; -use Friendica\Database\DBM; -use dba; - -use Detection\MobileDetect; - -use Exception; +use Friendica\Database\DBA; require_once 'boot.php'; require_once 'include/dba.php'; @@ -34,9 +31,20 @@ require_once 'include/text.php'; */ class App { - const MODE_NORMAL = 0; - const MODE_INSTALL = 1; - const MODE_MAINTENANCE = 2; + 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; @@ -59,7 +67,7 @@ class App public $argv; public $argc; public $module; - public $mode = App::MODE_NORMAL; + public $mode = App::MODE_INSTALL; public $strings; public $basepath; public $urlpath; @@ -88,6 +96,41 @@ class App public $force_max_items = 0; public $theme_events_in_profile = true; + public $stylesheets = []; + public $footerScripts = []; + + /** + * 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 App->initHead() + * + * @param string $path + */ + public function registerStylesheet($path) + { + $url = str_replace($this->get_basepath() . DIRECTORY_SEPARATOR, '', $path); + + $this->stylesheets[] = trim($url, '/'); + } + + /** + * Register a javascript file path to be included in the