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

ajout de la fonction format sur l'acces par url

parent 4e9c7bd7
2 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!960Premier chapitre v1.1
......@@ -104,19 +104,24 @@ class PremierChapitreController extends Zend_Controller_Action {
function aleatoireAction() {
$nb = $this->_request->getParam('nb');
$format = $this->_request->getParam('format');
if (!preg_match('@^\d+$@',$nb))
$pcs = Class_PremierChapitre::getAleatoire();
else
$pcs = Class_PremierChapitre::getAleatoire($nb);
$html = $this->view->premierChapitre_Vignettes($pcs);
$preferences = [];
if ($format == 1 || $format == 2) $preferences['target'] = 'frame';
if ($format == 2) $preferences['linkNotice'] = true;
$html = $this->view->premierChapitre_Vignettes($pcs,$preferences);
$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());
$this->getResponse()->setBody($html . Class_ScriptLoader::getInstance()->loadJQuery()->html());
}
function panierAction() {
$params = $this->_request->getParams();
$id_panier = (!empty($params['id_panier']))?$params['id_panier']:((!empty($params['id']))?$params['id']:"");
$format = (!empty($params['format']))?$params['format']:0;
$pcs = []; $html = '';
if (!empty($id_panier)) {
$pan = Class_PanierNotice::find($id_panier);
......@@ -125,11 +130,14 @@ class PremierChapitreController extends Zend_Controller_Action {
if ($pc = Class_PremierChapitre::getByNotice($notice))
$pcs[] = $pc;
}
$html = $this->view->premierChapitre_Vignettes($pcs);
$preferences = [];
if ($format == 1 || $format == 2) $preferences['target'] = 'frame';
if ($format == 2) $preferences['linkNotice'] = true;
$html = $this->view->premierChapitre_Vignettes($pcs,$preferences);
}
$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());
$this->getResponse()->setBody($html . Class_ScriptLoader::getInstance()->loadJQuery()->html());
}
public function __call($method, $args) {
......
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