Skip to content
Snippets Groups Projects
Commit 4188b486 authored by llaffont's avatar llaffont
Browse files

Le titre de la page des évènements est paramétrable

parent 42d8c10e
No related merge requests found
......@@ -119,7 +119,10 @@ class Admin_ModulesController extends Zend_Controller_Action {
}
// Redirection sur le bon formulaire
$viewRenderer = $this->getHelper('ViewRenderer');
$viewRenderer->renderScript('modules/cms_all.phtml');
if ($this->action == "articleviewbydate")
$viewRenderer->renderScript('modules/cms_'.$this->action.'.phtml');
else
$viewRenderer->renderScript('modules/cms_all.phtml');
}
......@@ -233,7 +236,7 @@ class Admin_ModulesController extends Zend_Controller_Action {
}
// viewnotice -> Consolidation des onglets (si de nouveaux ont ete ajoutes)
if($this->action=="viewnotice") $this->noticeConsolidationOnglets();
if ($this->action=="viewnotice") $this->noticeConsolidationOnglets();
// Redirection sur le bon formulaire
$viewRenderer = $this->getHelper('ViewRenderer');
......
<a name="Top"></a>
<?php $this->openBoite("Calendrier"); ?>
<?php $this->openBoite($this->_current_module["preferences"]["titre"]); ?>
<div class="calendar_event_list articleviewbydate">
<?php if (0 < count($this->articles)) { ?>
......
......@@ -66,7 +66,7 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract {
'resultat' => array('libelle' => 'Résultat', 'popup_width' => 710, 'popup_height' => 620),
'resultatsimple' => array('libelle' => 'Résultat', 'titre' => 'test', 'popup_width' => 710, 'popup_height' => 620),
'viewnotice' => array('libelle' => 'Notice', 'popup_width' => 700, 'popup_height' => 720),
'saisie' => array('libelle' => 'Nouvelle recherchere', 'popup_width' => 800, 'popup_height' => 400)),
'saisie' => array('libelle' => 'Nouvelle recherche', 'popup_width' => 800, 'popup_height' => 400)),
'noticeajax' => array(
'*' => array('libelle' => 'Notice', 'popup_width' => 500, 'popup_height' => 300),
......@@ -74,7 +74,8 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract {
),
'cms' => array(
'*' => array('libelle' => 'Articles', 'popup_width' => 500, 'popup_height' => 200)
'*' => array('libelle' => 'Articles', 'popup_width' => 500, 'popup_height' => 200),
'articleviewbydate' => array('libelle' => 'Calendrier', 'popup_width' => 500, 'popup_height' => 300)
),
'rss' => array(
......@@ -290,7 +291,9 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract {
$ret = array();
switch ((string)$action) {
case "articleviewbydate" : $ret["barre_nav"] = "Calendrier";
case "articleviewbydate" :
$ret["barre_nav"] = "Calendrier";
$ret["titre"] = "Calendrier";
break;
default: $ret["barre_nav"] = "Article";
break;
......
......@@ -49,7 +49,6 @@ class ModulesControllerRechercheTest extends Admin_AbstractControllerTestCase {
class ModulesControllerVariousConfigTest extends Admin_AbstractControllerTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/admin/modules/auth?config=site&type_module=auth&id_profil=1&action1=boitelogin&action2=');
......@@ -192,4 +191,15 @@ class ModulesControllerConfigRechercheResultatWithPreferencesTest extends Admin_
}
}
class ModulesControllerCmsArticleViewByDateTest extends Admin_AbstractControllerTestCase {
/** @test */
function inputForTitreShouldBePresent() {
$this->dispatch('/admin/modules/cms?config=site&id_profil=2&type_module=cms&action1=articleviewbydate&action2=', true);
$this->assertXPath('//input[@type="text"][@name="titre"]');
}
}
?>
......@@ -317,6 +317,12 @@ class CmsControllerArticleViewByDateWithOnlyArticlePortailTest extends AbstractC
public function emptyBibliothequeLibelleShouldNotBeDisplayedAsPortail() {
$this->assertNotXpathContentContains('//h2', 'Portail', $this->_response->getBody());
}
/** @test */
public function titreBoiteShouldBeCalendrier() {
$this->assertXPathContentContains('//div[@class="titre"]', 'Calendrier');
}
}
......@@ -328,6 +334,9 @@ class CmsControllerArticleViewByDateCategorie23AndNoProfilParamTest extends Abst
public function setUp() {
parent::setUp();
Class_Profil::getCurrentProfil()
->setCfgModules(['cms' => ['articleviewbydate' => ['titre' => 'Agenda de la bib']]]);
$this->_article_loader = Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Article')
->whenCalled('getArticlesByPreferences')
->answers(array())
......@@ -348,6 +357,12 @@ class CmsControllerArticleViewByDateCategorie23AndNoProfilParamTest extends Abst
function contenuShouldContainsAucunContenu() {
$this->assertXPathContentContains('//div', 'Aucun contenu', $this->_response->getBody());
}
/** @test */
public function titreBoiteShouldBeAgendaDeLaBib() {
$this->assertXPathContentContains('//div[@class="titre"]', 'Agenda de la bib');
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment