use_jquery = true; $this->default_template = " "; parent::__construct($id); } public function get_form(){ if(!$this->parameters['css']){ $this->parameters['css'] = $this->managed_datas['css']; } $form = "
parameters['autostart'] ? "checked='checked'" : "")."/> ".$this->format_text($this->msg['cms_module_carousel_view_carousel_yes'])."  parameters['autostart'] ? "checked='checked'" : "")."/> ".$this->format_text($this->msg['cms_module_carousel_view_carousel_no'])."
parameters['autohover'] ? "checked='checked'" : "")."/> ".$this->format_text($this->msg['cms_module_carousel_view_carousel_yes'])."  parameters['autohover'] ? "checked='checked'" : "")."/> ".$this->format_text($this->msg['cms_module_carousel_view_carousel_no'])."
parameters['pager'] ? "checked='checked'" : "")."/> ".$this->format_text($this->msg['cms_module_carousel_view_carousel_yes'])."  parameters['pager'] ? "checked='checked'" : "")."/> ".$this->format_text($this->msg['cms_module_carousel_view_carousel_no'])."
". parent::get_form() ."
".notice_tpl::gen_tpl_select("cms_module_common_view_django_template_record_content",$this->parameters['used_template'])."
"; return $form; } public function save_form(){ global $cms_module_carousel_view_carousel_mode; global $cms_module_carousel_view_carousel_speed; global $cms_module_carousel_view_carousel_pause; global $cms_module_carousel_view_carousel_display_quantity; global $cms_module_carousel_view_carousel_slide_quantity; global $cms_module_carousel_view_carousel_autostart; global $cms_module_carousel_view_carousel_css; global $cms_module_common_view_django_template_record_content; global $cms_module_carousel_view_carousel_autohover; global $cms_module_carousel_view_carousel_pager; $this->parameters['mode'] = $cms_module_carousel_view_carousel_mode; $this->parameters['speed'] = $cms_module_carousel_view_carousel_speed+0; $this->parameters['pause'] = $cms_module_carousel_view_carousel_pause+0; $this->parameters['display_quantity'] = $cms_module_carousel_view_carousel_display_quantity+0; $this->parameters['slide_quantity'] = $cms_module_carousel_view_carousel_slide_quantity+0; $this->parameters['autostart'] = $cms_module_carousel_view_carousel_autostart==1 ? true : false; $this->parameters['css'] = stripslashes($cms_module_carousel_view_carousel_css); $this->parameters['used_template'] = $cms_module_common_view_django_template_record_content; $this->parameters['autohover'] = $cms_module_carousel_view_carousel_autohover==1 ? true : false; $this->parameters['pager'] = $cms_module_carousel_view_carousel_pager==1 ? true : false; return parent::save_form(); } public function get_headers(){ global $base_path; $headers = parent::get_headers(); $headers[]= ""; $args = array( 'do' => "generate_css" ); $headers[]= ""; return $headers; } public function render($datas){ $html2return = ""; if(count($datas['records'])){ $id = "carousel_".$this->get_module_dom_id(); $datas['id']=$this->get_module_dom_id(); $html2return.= H2o::parseString($this->parameters['active_template'])->render($datas); $html2return.= " "; } return $html2return; } public function execute_ajax(){ global $do; $response = array(); switch($do){ case "generate_css" : $response['content'] = $this->generate_css(); $response['content-type'] = 'text/css'; break; } return $response; } protected function generate_css(){ return str_replace("{{identifiant_dom_du_cadre}}",$this->get_module_dom_id(),$this->parameters['css']); } protected function get_managed_template_form($cms_template){ global $opac_url_base; if($cms_template != "new"){ $infos = $this->managed_datas['templates'][$cms_template]; }else{ $infos = array( 'name' => "Nouveau Template", 'content' => $this->default_template ); } if(!$this->managed_datas) $this->managed_datas = array(); if ($this->managed_datas['css'] == ""){ $this->managed_datas['css'] = " #{{identifiant_dom_du_cadre}} { overflow : hidden; } #{{identifiant_dom_du_cadre}} .bx-wrapper { width : inherit !important; height : inherit !important; } #{{identifiant_dom_du_cadre}} ul li { text-align: center; } #{{identifiant_dom_du_cadre}} .bx-wrapper { width : inherit !important; height : inherit !important; } #{{identifiant_dom_du_cadre}} ul li a { display: block; width: 150px; margin: 0 auto; text-align: center; text-decoration: none; } /* pour l'image vide...*/ #{{identifiant_dom_du_cadre}} .bx-wrapper ul li a img { height: 145px; background-repeat: no-repeat; -moz-box-shadow: 1px 1px 2px #cccccc; -o-box-shadow: 1px 1px 2px #cccccc; -webkit-box-shadow: 1px 1px 2px #cccccc; box-shadow: 1px 1px 2px #cccccc; }"; } //nom $form.="
"; //contenu $form.="
".$this->get_format_data_structure_tree("cms_module_common_view_django_template_content")."
"; // css $form.="

".$this->format_text($this->msg['cms_manage_module'])."

"; return $form; } public function save_manage_form($managed_datas){ global $cms_template; global $cms_template_delete; global $cms_module_common_view_django_template_name,$cms_module_common_view_django_template_content; global $cms_module_carousel_view_carousel_manage_default_css; if($cms_template_delete){ unset($managed_datas['templates'][$cms_template_delete]); }else{ if($cms_template == "new"){ $cms_template = "template".(cms_module_common_view_django::get_max_template_id($managed_datas['templates'])+1); } $managed_datas['templates'][$cms_template] = array( 'name' => stripslashes($cms_module_common_view_django_template_name), 'content' => stripslashes($cms_module_common_view_django_template_content), 'css' => stripslashes($cms_module_carousel_view_carousel_manage_default_css) ); } return $managed_datas; } public function get_format_data_structure(){ $datas = new cms_module_carousel_datasource_notices(); $format_datas = $datas->get_format_data_structure(); $format_datas[0]['children'][] = array( 'var' => "records[i].content", 'desc' => $this->msg['cms_module_carousel_view_carousel_record_content_desc'] ); $format_datas[]= array( 'var' => "id", 'desc'=> $this->msg['cms_module_carousel_view_carousel_id_desc'] ); return $format_datas; } }