Replace current_theme() and current_theme_url() calls
This commit is contained in:
parent
3213715b60
commit
fde3d6f870
9 changed files with 22 additions and 19 deletions
|
|
@ -228,14 +228,15 @@ class Addon
|
|||
/**
|
||||
* @brief Calls a single hook.
|
||||
*
|
||||
* @param string $name of the hook to call
|
||||
* @param array $hook Hook data
|
||||
* @param string|array &$data to transmit to the callback handler
|
||||
* @param \Friendica\App $a
|
||||
* @param string $name of the hook to call
|
||||
* @param array $hook Hook data
|
||||
* @param string|array &$data to transmit to the callback handler
|
||||
*/
|
||||
public static function callSingleHook($a, $name, $hook, &$data = null)
|
||||
public static function callSingleHook(\Friendica\App $a, $name, $hook, &$data = null)
|
||||
{
|
||||
// Don't run a theme's hook if the user isn't using the theme
|
||||
if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/'.current_theme()) === false) {
|
||||
if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . $a->getCurrentTheme()) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class Theme
|
|||
} else {
|
||||
$parent = 'NOPATH';
|
||||
}
|
||||
$theme = current_theme();
|
||||
$theme = get_app()->getCurrentTheme();
|
||||
$thname = $theme;
|
||||
$ext = substr($file, strrpos($file, '.') + 1);
|
||||
$paths = [
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class Profile
|
|||
|
||||
$a->set_template_engine(); // reset the template engine to the default in case the user's theme doesn't specify one
|
||||
|
||||
$theme_info_file = 'view/theme/' . current_theme() . '/theme.php';
|
||||
$theme_info_file = 'view/theme/' . $a->getCurrentTheme() . '/theme.php';
|
||||
if (file_exists($theme_info_file)) {
|
||||
require_once $theme_info_file;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class FriendicaSmarty extends Smarty
|
|||
parent::__construct();
|
||||
|
||||
$a = get_app();
|
||||
$theme = current_theme();
|
||||
$theme = $a->getCurrentTheme();
|
||||
|
||||
// setTemplateDir can be set to an array, which Smarty will parse in order.
|
||||
// The order is thus very important here
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
|
|||
$root = $root . '/';
|
||||
}
|
||||
|
||||
$theme = current_theme();
|
||||
$theme = $a->getCurrentTheme();
|
||||
$filename = $template::SMARTY3_TEMPLATE_FOLDER . '/' . $file;
|
||||
|
||||
if (file_exists("{$root}view/theme/$theme/$filename")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue