Skip to content
Snippets Groups Projects
Commit 4e9c7bd7 authored by vinot's avatar vinot
Browse files

fix affichage de la fenetre d'administration du bloc + ajout de l'action...

fix affichage de la fenetre d'administration du bloc + ajout de l'action panier sur le controller opac pour la symetrie avec les fonctions du bloc premier-chapitre
/premierchapitre/panier/id/numero ou /premierchapitre/panier/id_panier/numero
parent 2d3539bd
2 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!960Premier chapitre v1.1
<script>
function pc_conf_view(type) {
if (type == 0) {
$("#pc_conf_panier").hide();
$("#pc_conf_nb_aleat").show();
$("#pc_conf_format").show();
}
if (type == 1) {
$("#pc_conf_nb_aleat").hide();
$("#pc_conf_panier").show();
$("#pc_conf_format").show();
}
if (type == 2) {
$("#pc_conf_nb_aleat").hide();
$("#pc_conf_panier").hide();
$("#pc_conf_format").hide();
}
}
</script>
<center>
<h1>Propriétés du module Premier-Chapitre</h1><br>
<div class="formTable">
......@@ -37,21 +56,25 @@
<fieldset>
<legend>Mode d'affichage</legend>
<table cellspacing="2">
<tr>
<tr id="pc_conf_type">
<td class="droite">Type de selection&nbsp;</td>
<td class="gauche">
<select name="type" id="type">
<select name="type" id="type" onchange="pc_conf_view(this.value);">
<option value="0" <?php if($this->preferences["type"]==0) print(" selected"); ?>>Aléatoire</option>
<option value="1" <?php if($this->preferences["type"]==1) print(" selected"); ?>>Panier</option>
<option value="2" <?php if($this->preferences["type"]==2) print(" selected"); ?>>Toutes les notice</option>
</select>
</td>
</tr>
<tr>
<tr id="pc_conf_nb_aleat">
<td class="droite">Nombre à afficher<br/>(en mode aléatoire)&nbsp;</td>
<td class="gauche"><input type="text" name="nb_aff" size="4" value="<?php print($this->preferences["nb_aff"]); ?>"></td>
</tr>
<tr>
<tr id="pc_conf_panier">
<td class="droite">Panier&nbsp;</td>
<td class="gauche"><?php echo $this->formSelect("id_panier", $this->preferences["id_panier"],null,$this->paniers) ?></td>
</tr>
<tr id="pc_conf_format">
<td class="droite" valign="top">Format d'affichage</td>
<td class="gauche">
<select name="format" id="format">
......@@ -61,14 +84,12 @@
</select>
</td>
</tr>
<tr>
<td class="droite">Panier&nbsp;</td>
<td class="gauche"><?php echo $this->formSelect("id_panier", $this->preferences["id_panier"],null,$this->paniers) ?></td>
</tr>
</table>
</fieldset>
<?php echo $this->formSubmit("Valider","Valider",array("class" => "bouton")) ?>
</form>
</div>
<script>
pc_conf_view(<?php print $this->preferences["type"]; ?>);
</script>
......@@ -30,7 +30,7 @@ class PremierChapitreController extends Zend_Controller_Action {
}
public function preDispatch() {
$no_front_actions = array("aleatoire", "ajout-frame");
$no_front_actions = array("aleatoire", "ajout-frame", "panier");
$request = $this->_request;
$action = $request->getActionName();
if (!$this->active && $action != 'inactive') {
......@@ -114,6 +114,24 @@ class PremierChapitreController extends Zend_Controller_Action {
$this->getResponse()->setBody($html . Class_ScriptLoader::getInstance()->html());
}
function panierAction() {
$params = $this->_request->getParams();
$id_panier = (!empty($params['id_panier']))?$params['id_panier']:((!empty($params['id']))?$params['id']:"");
$pcs = []; $html = '';
if (!empty($id_panier)) {
$pan = Class_PanierNotice::find($id_panier);
if ($pan) {
foreach ($pan->getNoticesAsArray() as $notice)
if ($pc = Class_PremierChapitre::getByNotice($notice))
$pcs[] = $pc;
}
$html = $this->view->premierChapitre_Vignettes($pcs);
}
$this->getResponse()->setHeader('Content-Type', 'text/html;charset=utf-8');
$this->getResponse()->setHeader('Pragma', 'no-cache', true);
$this->getResponse()->setBody($html . Class_ScriptLoader::getInstance()->html());
}
public function __call($method, $args) {
if ('Action' == substr($method, -6)) {
// Si une méthode d'action n'est pas trouvée,
......
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