Skip to content
Snippets Groups Projects
Commit 960ca306 authored by efalcy's avatar efalcy
Browse files

Ajout d'une option permettant de rendre la 3eme colonne d'un site toujours visible

parent 980de632
Branches
Tags
No related merge requests found
......@@ -11,14 +11,31 @@
if ($this->profil->getNbDivisions() == 1) {
echo $this->division($this->profil, 1, 'colContenu', $this->actionContent);
} else {
if ($this->profil->isDivisionsFromRightToLeft()) {
echo $this->division($this->profil, 2, 'colContenu', $this->actionContent);
echo $this->division($this->profil, 1, 'colDroite');
if ($this->profil->isDivisionsFromRightToLeft()) {
if ($this->profil->getDivisionThreeAlwaysVisible()) {
echo $this->division($this->profil, 3, 'colGauche');
echo $this->division($this->profil, 2, 'colMilieu', $this->actionContent);
}
else {
echo $this->division($this->profil, 2, 'colContenu', $this->actionContent);
}
echo $this->division($this->profil, 1, 'colDroite');
} else {
echo $this->division($this->profil, 1, 'colGauche');
echo $this->division($this->profil, 2, 'colContenu', $this->actionContent);
if ($this->profil->getDivisionThreeAlwaysVisible()) {
echo $this->division($this->profil, 2, 'colMilieu', $this->actionContent);
echo $this->division($this->profil, 3, 'colDroite');
}
else {echo $this->division($this->profil, 2, 'colContenu', $this->actionContent);}
}
}
}
?>
<div class="clear"></div>
</div> <!-- col_wrapper -->
......
......@@ -41,6 +41,7 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe
"largeur_division3" => 150,
"marge_division3" => 10,
"ref_description" => '',
"division_three_always_visible" => false,
"ref_tags" => '');
$cfg_modules = array();
......
......@@ -289,6 +289,7 @@ abstract class AbstractCmsControllerArticleViewByDateTest extends AbstractContro
->whenCalled('getArticlesByPreferences')
->answers($articles);
$this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true);
}
}
......@@ -346,6 +347,68 @@ class CmsControllerArticleViewByDateTest extends AbstractCmsControllerArticleVie
}
class CmsControllerProfilDivisionTest extends AbstractCmsControllerArticleViewByDateTest {
public function setUp() {
parent::setUp();
$cfg_accueil_jeunesse = ['modules' => ['1' => ['division' => '4',
'type_module' => 'RECH_SIMPLE',
'preferences' => ['recherche_avancee' => "on",
'select_doc' => 'on',
'select_annexe' => 'on']],
'10' => ['division' => '3',
'type_module' => 'NEWSLETTERS',
'preferences' => ['titre' => 'Lettres d\'informations']],
'11' => ['division' => '1',
'type_module' => 'MULTIMEDIA',
'preferences' => ['titre' => 'Postes multimédia']],
]];
Class_Profil::getCurrentProfil()->setCfgAccueil($cfg_accueil_jeunesse);
$this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true);
}
/** @test */
public function boiteNewsletterShouldNotBeDisplayed() {
$this->assertNotXPath("//div[contains(@class, 'colDroite')]//div[@class='boite_newsletters']",$this->_response->getBody());
}
public function selectedDivisionThreeAlwaysVisible() {
$cfg_site=Class_Profil::getCurrentProfil()-> getCfgSiteAsArray();
$cfg_site['division_three_always_visible']=true;
Class_Profil::getCurrentProfil()->setCfgSite($cfg_site);
}
/** @test */
public function boiteNewsletterShouldBeDisplayedIfDivisionThreeVisibleSelected() {
$this->selectedDivisionThreeAlwaysVisible();
$this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true);
$this->assertXPath("//div[contains(@class, 'colDroite')]//div[@class='boite_newsletters']",$this->_response->getBody());
}
/** @test */
public function boiteNewsletterShouldNotBeDisplayedWhenReverseOrder() {
Class_Profil::getCurrentProfil()->setOrdreDivisions(1);
$this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true);
$this->assertNotXPath("//div[contains(@class, 'colGauche')]//div[@class='boite_newsletters']",$this->_response->getBody());
}
/** @test */
public function boiteNewsletterShouldBeDisplayedWhenReverseOrderAndDivisionThreeVisibleSelected() {
$this->selectedDivisionThreeAlwaysVisible();
Class_Profil::getCurrentProfil()->setOrdreDivisions(1);
$this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true);
$this->assertXPath("//div[contains(@class, 'colGauche')]//div[@class='boite_newsletters']",$this->_response->getBody());
}
}
class CmsControllerCalendarDisplayOrderTest extends AbstractCmsControllerArticleViewByDateTest {
......
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