default_template = "
{{info.header}}
{% for sommaire in sommaires %}
{% if sommaire.level==1 %}
-
{{sommaire.title}}
{% endif %}
{% endfor %}
{% for sommaire in sommaires %}
{% if sommaire.level==1 %}
{{sommaire.title}}
{% endif %}
{% if sommaire.level==2 %}
{{sommaire.title}}
{% endif %}
{% if sommaire.level==3 %}
{{sommaire.title}}
{% endif %}
{% for record in sommaire.records %}
{{record.render}}
{% endfor %}
{% endfor %}
{{info.footer}}
";
}
public function get_form(){
if(!isset($this->parameters['used_template'])) $this->parameters['used_template'] = '';
if(!isset($this->parameters['nb_notices'])) $this->parameters['nb_notices'] = '';
$form = parent::get_form()
."
".notice_tpl::gen_tpl_select("cms_module_bannette_view_django_template_record_content",$this->parameters['used_template'])."
";
return $form;
}
public function save_form(){
global $cms_module_bannette_view_bannette_nb_notices;
global $cms_module_bannette_view_django_template_record_content;
$this->parameters['nb_notices'] = (int) $cms_module_bannette_view_bannette_nb_notices;
$this->parameters['used_template'] = $cms_module_bannette_view_django_template_record_content;
return parent::save_form();
}
public function render($datas){
global $dbh;
global $opac_url_base;
global $opac_show_book_pics;
global $opac_book_pics_url;
global $opac_notice_affichage_class;
global $opac_bannette_notices_depliables;
global $opac_bannette_notices_format;
global $opac_bannette_notices_order;
global $liens_opac;
if($datas['id']) {
$bannette = new bannette($datas['id']);
$info_header = $bannette->construit_liens_HTML();
$datas['info']['header'] = $info_header;
$bannette->notice_tpl = $this->parameters['used_template'];
$bannette->document_notice_tpl = $this->parameters['used_template'];
if(!empty($this->parameters['nb_notices'])) {
$bannette->nb_notices_diff = $this->parameters['nb_notices'];
}
$bannette->get_datas_content();
$datas = array_merge($datas,$bannette->data_document);
}
return parent::render($datas);
}
public function get_format_data_structure(){
return array_merge(array(
array(
'var' => "name",
'desc'=> $this->msg['cms_module_bannette_view_bannette_name_desc']
),
array(
'var' => "comment",
'desc'=> $this->msg['cms_module_bannette_view_bannette_comment_desc']
),
array(
'var' => "info",
'desc' => $this->msg['cms_module_bannette_view_bannette_info_desc'],
'children' => array(
array(
'var' => "info.header",
'desc'=> $this->msg['cms_module_bannette_view_bannette_info_header_desc']
),
array(
'var' => "info.footer",
'desc'=> $this->msg['cms_module_bannette_view_bannette_info_footer_desc']
)
)
),
array(
'var' => "sommaires",
'desc' => $this->msg['cms_module_bannette_view_bannette_sommaires_desc'],
'children' => array(
array(
'var' => "sommaires[i].title",
'desc'=> $this->msg['cms_module_bannette_view_bannette_sommaire_title_desc']
),
array(
'var' => "sommaires[i].level",
'desc'=> $this->msg['cms_module_bannette_view_bannette_sommaire_level_desc']
),
array(
'var' => "sommaires[i].records",
'desc' => $this->msg['cms_module_bannette_view_bannette_records_desc'],
'children' => array(
array(
'var' => "sommaires[i].records[j].id",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_id_desc']
),
array(
'var' => "sommaires[i].records[j].title",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_title_desc']
),
array(
'var' => "sommaires[i].records[j].link",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_link_desc']
),
array(
'var' => "sommaires[i].records[j].url_vign",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_url_vign_desc']
),
array(
'var' => "sommaires[i].records[j].render",
'desc'=> $this->msg['cms_module_bannette_view_bannette_notices_record_render_desc']
)
)
)
)
),
array(
'var' => "record_number",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_number_desc']
),
array(
'var' => "records",
'desc' => $this->msg['cms_module_bannette_view_bannette_records_desc'],
'children' => array(
array(
'var' => "records[i].id",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_id_desc']
),
array(
'var' => "records[i].title",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_title_desc']
),
array(
'var' => "records[i].link",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_link_desc']
),
array(
'var' => "records[i].url_vign",
'desc'=> $this->msg['cms_module_bannette_view_bannette_record_url_vign_desc']
),
array(
'var' => "records[i].render",
'desc'=> $this->msg['cms_module_bannette_view_bannette_notices_record_render_desc']
)
)
),
array(
'var' => "flux_rss",
'desc' => $this->msg['cms_module_bannette_view_bannette_flux_rss_desc'],
'children' => array(
array(
'var' => "flux_rss[i].id",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_id_desc']
),
array(
'var' => "flux_rss[i].name",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_name_desc']
),
array(
'var' => "flux_rss[i].opac_link",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_opac_link_desc']
),
array(
'var' => "flux_rss[i].link",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_link_desc']
),
array(
'var' => "flux_rss[i].lang",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_lang_desc']
),
array(
'var' => "flux_rss[i].copy",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_copy_desc']
),
array(
'var' => "flux_rss[i].editor_mail",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_editor_mail_desc']
),
array(
'var' => "flux_rss[i].webmaster_mail",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_webmaster_mail_desc']
),
array(
'var' => "flux_rss[i].ttl",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_ttl_desc']
),
array(
'var' => "flux_rss[i].img_url",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_img_url_desc']
),
array(
'var' => "flux_rss[i].img_title",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_img_title_desc']
),
array(
'var' => "flux_rss[i].img_link",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_img_link_desc']
),
array(
'var' => "flux_rss[i].format",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_format_desc']
),
array(
'var' => "flux_rss[i].content",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_content_desc']
),
array(
'var' => "flux_rss[i].date_last",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_date_last_desc']
),
array(
'var' => "flux_rss[i].export_court",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_export_court_desc']
),
array(
'var' => "flux_rss[i].template",
'desc'=> $this->msg['cms_module_bannette_view_bannette_flux_rss_template_desc']
)
)
)
),parent::get_format_data_structure());
}
}