Merge pull request #4951 from MrPetovan/bug/4946-move-current-theme-to-app
Move current_theme() to App
This commit is contained in:
commit
bd0ba24518
11 changed files with 284 additions and 294 deletions
|
@ -14,24 +14,23 @@ use Friendica\App;
|
|||
*
|
||||
* @todo Check if this is really needed.
|
||||
*/
|
||||
function load_page(App $a) {
|
||||
if(isset($_GET["mode"]) && ($_GET["mode"] == "minimal")) {
|
||||
require "view/theme/frio/minimal.php";
|
||||
} elseif((isset($_GET["mode"]) && ($_GET["mode"] == "none"))) {
|
||||
require "view/theme/frio/none.php";
|
||||
function load_page(App $a)
|
||||
{
|
||||
if (isset($_GET['mode']) && ($_GET['mode'] == 'minimal')) {
|
||||
require 'view/theme/frio/minimal.php';
|
||||
} elseif ((isset($_GET['mode']) && ($_GET['mode'] == 'none'))) {
|
||||
require 'view/theme/frio/none.php';
|
||||
} else {
|
||||
$template = 'view/theme/' . current_theme() . '/'
|
||||
. ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php';
|
||||
if(file_exists($template))
|
||||
require_once($template);
|
||||
else
|
||||
require_once(str_replace('theme/' . current_theme() . '/', '', $template));
|
||||
$template = 'view/theme/' . $a->getCurrentTheme() . '/'
|
||||
. ((x($a->page, 'template')) ? $a->page['template'] : 'default' ) . '.php';
|
||||
if (file_exists($template)) {
|
||||
require_once $template;
|
||||
} else {
|
||||
require_once str_replace('theme/' . $a->getCurrentTheme() . '/', '', $template);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Check if page is a modal page
|
||||
*
|
||||
|
|
|
@ -19,9 +19,11 @@
|
|||
*/
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
require_once 'boot.php';
|
||||
|
||||
function get_scheme_info($scheme)
|
||||
{
|
||||
$theme = current_theme();
|
||||
$theme = get_app()->getCurrentTheme();
|
||||
$themepath = 'view/theme/' . $theme . '/';
|
||||
$scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'scheme'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue