use DOMDocument;
use DOMXPath;
use Friendica\App;
+use Friendica\Capabilities\ICanHandleRequests;
use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
* - head.tpl template
*
* @param App $app The Friendica App instance
- * @param Module $module The loaded Friendica module
+ * @param Arguments $args The Friendica App Arguments
* @param L10n $l10n The l10n language instance
* @param IManageConfigValues $config The Friendica configuration
* @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
*
* @throws HTTPException\InternalServerErrorException
*/
- private function initHead(App $app, Module $module, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig)
+ private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig)
{
$interval = ((local_user()) ? $pConfig->get(local_user(), 'system', 'update_interval') : 40000);
}
// Default title: current module called
- if (empty($this->page['title']) && $module->getName()) {
- $this->page['title'] = ucfirst($module->getName());
+ if (empty($this->page['title']) && $args->getModuleName()) {
+ $this->page['title'] = ucfirst($args->getModuleName());
}
// Prepend the sitename to the page title
* - module content
* - hooks for content
*
- * @param Module $module The module
- * @param Mode $mode The Friendica execution mode
+ * @param ICanHandleRequests $module The module
+ * @param Mode $mode The Friendica execution mode
*
* @throws HTTPException\InternalServerErrorException
*/
- private function initContent(Module $module, Mode $mode)
+ private function initContent(ICanHandleRequests $module, Mode $mode)
{
$content = '';
try {
- $moduleClass = $module->getClass();
-
$arr = ['content' => $content];
- Hook::callAll( $moduleClass::getClassName() . '_mod_content', $arr);
+ Hook::callAll($module->getClassName() . '_mod_content', $arr);
$content = $arr['content'];
- $arr = ['content' => $moduleClass::content()];
- Hook::callAll($moduleClass::getClassName() . '_mod_aftercontent', $arr);
- $content .= $arr['content'];
+ $content .= $module->content();
} catch (HTTPException $e) {
- $content = ModuleHTTPException::content($e);
+ $content = (new ModuleHTTPException())->content($e);
}
// initialise content region
*
* @param App $app The Friendica App
* @param BaseURL $baseURL The Friendica Base URL
+ * @param Arguments $args The Friendica App arguments
* @param Mode $mode The current node mode
- * @param Module $module The loaded Friendica module
+ * @param ICanHandleRequests $module The loaded Friendica module
* @param L10n $l10n The l10n language class
* @param IManageConfigValues $config The Configuration of this node
* @param IManagePersonalConfigValues $pconfig The personal/user configuration
*
* @throws HTTPException\InternalServerErrorException
*/
- public function run(App $app, BaseURL $baseURL, Mode $mode, Module $module, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig)
+ public function run(App $app, BaseURL $baseURL, Arguments $args, Mode $mode, ICanHandleRequests $module, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig)
{
- $moduleName = $module->getName();
+ $moduleName = $args->getModuleName();
/* Create the page content.
* Calls all hooks which are including content operations
* all the module functions have executed so that all
* theme choices made by the modules can take effect.
*/
- $this->initHead($app, $module, $l10n, $config, $pconfig);
+ $this->initHead($app, $args, $l10n, $config, $pconfig);
/* Build the page ending -- this is stuff that goes right before
* the closing </body> tag