|
|
@@ -49,6 +49,7 @@ class Chcreateur extends Module implements WidgetInterface
|
|
|
//&& $this->registerHook('displayBlockPosition2')
|
|
|
&& $this->registerHook('displayHeader')
|
|
|
&& $this->registerHook('ModuleRoutes')
|
|
|
+ && $this->registerHook('ActionFrontControllerSetVariables')
|
|
|
&& $this->Register_SQL()
|
|
|
&& $this->_installTab()
|
|
|
&& Configuration::updateValue('CHCREATEUR_TITLE', 'Nos createurs')
|
|
|
@@ -613,4 +614,22 @@ class Chcreateur extends Module implements WidgetInterface
|
|
|
$rule = 'xipblog-single-module';
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public function hookActionFrontControllerSetVariables()
|
|
|
+ {
|
|
|
+ $posts = Chcreapost::getAllSelections(5);
|
|
|
+ $links = [];
|
|
|
+ foreach($posts as $post ) {
|
|
|
+ $links[] = [
|
|
|
+ 'id' => 'chcreapost-' . $post['id_chcreaposts'],
|
|
|
+ 'label' => $post['post_title'],
|
|
|
+ 'url' => $post['link']
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ return [
|
|
|
+ 'title' => Configuration::get('CHCREATEUR_TITLE'),
|
|
|
+ 'links' => $links,
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
}
|