From af5174158a4f6aaad33a29f1b9f160526fe7b921 Mon Sep 17 00:00:00 2001
From: vinot <g.vinot@ville-montrouge.fr>
Date: Sat, 27 Jun 2015 15:50:28 +0200
Subject: [PATCH] no message

---
 library/Class/Systeme/ModulesAccueil/PremierChapitre.php | 2 +-
 library/ZendAfi/View/Helper/Accueil/PremierChapitre.php  | 1 +
 library/ZendAfi/View/Helper/PremierChapitre/Frame.php    | 5 ++++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/library/Class/Systeme/ModulesAccueil/PremierChapitre.php b/library/Class/Systeme/ModulesAccueil/PremierChapitre.php
index ab359fc494c..f1d5b5a787f 100644
--- a/library/Class/Systeme/ModulesAccueil/PremierChapitre.php
+++ b/library/Class/Systeme/ModulesAccueil/PremierChapitre.php
@@ -31,7 +31,7 @@ class Class_Systeme_ModulesAccueil_PremierChapitre extends Class_Systeme_Modules
 	protected $_popupWidth = 600;
 
 
-	protected $_popupHeight = 700;
+	protected $_popupHeight = 600;
 
 	protected $_defaultValues = ['titre' => 'Premier Chapitre',
 												'intro' => '',
diff --git a/library/ZendAfi/View/Helper/Accueil/PremierChapitre.php b/library/ZendAfi/View/Helper/Accueil/PremierChapitre.php
index 7f187ef1c0f..79a5166059d 100644
--- a/library/ZendAfi/View/Helper/Accueil/PremierChapitre.php
+++ b/library/ZendAfi/View/Helper/Accueil/PremierChapitre.php
@@ -25,6 +25,7 @@ class ZendAfi_View_Helper_Accueil_PremierChapitre extends ZendAfi_View_Helper_Ac
 		$this->contenu = '';
 		if (!empty($this->preferences['intro']))
 			$this->contenu = '<p>'.$this->preferences['intro'].'</p>';
+		$this->preferences['maxWidth'] = 550;
 		$this->contenu .= $this->view->renderPremierChapitre($this->id_module, $this->preferences);
 
 		return $this->getHtmlArray();
diff --git a/library/ZendAfi/View/Helper/PremierChapitre/Frame.php b/library/ZendAfi/View/Helper/PremierChapitre/Frame.php
index 69326253fa1..e07715bbbc4 100644
--- a/library/ZendAfi/View/Helper/PremierChapitre/Frame.php
+++ b/library/ZendAfi/View/Helper/PremierChapitre/Frame.php
@@ -33,9 +33,12 @@ class ZendAfi_View_Helper_PremierChapitre_Frame extends ZendAfi_View_Helper_Prem
 			if (!$pc) return $html;
 		}
 		else return $html;
+		$w = 700; $h = 700;
+		if (!empty($preferences['maxWidth']) && $preferences['maxWidth'] < $w) $w = $preferences['maxWidth'];
+		if (!empty($preferences['maxHeight']) && $preferences['maxHeight'] < $h) $h = $preferences['maxHeight'];
 		$frm_attribs = ['id' => 'pc_frame',
 						'class' => 'iframe_premierchapitre',
-						'style' => 'width:700px; height:700px; border:none;',
+						'style' => 'width:'.$w.'px; height:'.$h.'px; border:none;',
 						'src' => $pc->getUrl()];
 		return $this->_tag('iframe',null,$frm_attribs);
 	}
-- 
GitLab