*
* This probably should change to limit the size of this monster method.
*
- * @param App\Module $module The determined module
+ * @param App\Module $module The determined module
+ * @param App\Router $router
+ * @param PConfiguration $pconfig
+ * @throws HTTPException\InternalServerErrorException
+ * @throws \ImagickException
*/
public function runFrontend(App\Module $module, App\Router $router, PConfiguration $pconfig)
{
$module = $module->determineClass($this->args, $router, $this->config);
// Let the module run it's internal process (init, get, post, ...)
- $module->run($this->l10n, $this, $this->logger, $this->getCurrentTheme(), $_SERVER, $_POST);
-
+ $module->run($this->l10n, $this, $this->logger, $_SERVER, $_POST);
} catch (HTTPException $e) {
ModuleHTTPException::rawContent($e);
}
*
* @return Module The determined module of this call
*
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ * @throws \Exception
*/
public function determineClass(Arguments $args, Router $router, Core\Config\Configuration $config)
{
* @param Core\L10n\L10n $l10n The L10n instance
* @param App $app The whole Friendica app (for method arguments)
* @param LoggerInterface $logger The Friendica logger
- * @param string $currentTheme The chosen theme
* @param array $server The $_SERVER variable
* @param array $post The $_POST variables
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function run(Core\L10n\L10n $l10n, App $app, LoggerInterface $logger, string $currentTheme, array $server, array $post)
+ public function run(Core\L10n\L10n $l10n, App $app, LoggerInterface $logger, array $server, array $post)
{
if ($this->printNotAllowedAddon) {
info($l10n->t("You must be logged in to use addons. "));
// This endpoint doesn't need any theme initialization or other comparable stuff.
call_user_func([$this->module_class, 'rawContent']);
- // Load current theme info after module has been initialized as theme could have been set in module
- $theme_info_file = 'view/theme/' . $currentTheme . '/theme.php';
- if (file_exists($theme_info_file)) {
- require_once $theme_info_file;
- }
-
- if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
- $func = str_replace('-', '_', $currentTheme) . '_init';
- $func($app);
- }
-
if ($server['REQUEST_METHOD'] === 'POST') {
Core\Hook::callAll($this->module . '_mod_post', $post);
call_user_func([$this->module_class, 'post']);
*/
$this->initContent($module, $mode);
+ // Load current theme info after module has been initialized as theme could have been set in module
+ $currentTheme = $app->getCurrentTheme();
+ $theme_info_file = 'view/theme/' . $currentTheme . '/theme.php';
+ if (file_exists($theme_info_file)) {
+ require_once $theme_info_file;
+ }
+
+ if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
+ $func = str_replace('-', '_', $currentTheme) . '_init';
+ $func($app);
+ }
+
/* Create the page head after setting the language
* and getting any auth credentials.
*