default_template = "
>> {{home.title}}
{% for section in sections %}
> {{section.title}}
{% endfor %}
";
}
public function get_form(){
$form="
";
$form.= $this->get_constructor_link_form("section");
$form.="
";
$form.= parent::get_form();
return $form;
}
public function save_form(){
$this->save_constructor_link_form("section");
return parent::save_form();
}
public function render($datas){
global $opac_url_base;
$render_datas = array();
$render_datas['sections'] = array();
$render_datas['home'] = array(
'title' => $this->msg['home'],
'link' => $opac_url_base
);
foreach($datas as $section){
$cms_section = new cms_section($section);
$infos= $cms_section->format_datas(false,false);
$infos['link'] = $this->get_constructed_link("section",$section);
$render_datas['sections'][]=$infos;
}
//on rappelle le tout...
return parent::render($render_datas);
}
public function get_format_data_structure(){
//dans ce cas là, c'est assez simple, c'est la vue qui va chercher les données...
$format = array();
$format[] = array(
'var' => 'home',
'desc' => "",
'children' => array(
array(
'var' => "home.title",
'desc' => $this->msg['cms_module_common_view_home_title_desc'],
),
array(
'var' => "home.link",
'desc' => $this->msg['cms_module_common_view_home_link_desc'],
)
)
);
$sections = array(
'var' => "sections",
'desc' => $this->msg['cms_module_common_view_section_desc'],
'children' => $this->prefix_var_tree(cms_section::get_format_data_structure(false,false),"sections[i]")
);
$sections['children'][] = array(
'var' => "sections[i].link",
'desc'=> $this->msg['cms_module_common_view_section_link_desc']
);
$format[]=$sections;
return $format;
}
}