public function render($datas)
 {
     global $opac_notices_format;
     global $opac_etagere_order;
     // on gère l'ordre des étagères, id asc par défaut
     $critere = "id";
     $dir = "asc";
     if ($opac_etagere_order) {
         $etagere_order = explode(" ", $opac_etagere_order);
         if ($etagere_order[0] == 'name' || $etagere_order[0] == 'comment') {
             $critere = $etagere_order[0];
         }
         if (isset($etagere_order[1])) {
             $dir = $etagere_order[1];
         }
     }
     $order = array();
     foreach ($datas['shelves'] as $shelf) {
         $order[] = $shelf[$critere];
     }
     if ($dir == 'desc') {
         array_multisort($order, SORT_DESC, $datas['shelves']);
     } else {
         array_multisort($order, SORT_ASC, $datas['shelves']);
     }
     //on gère l'affichage des notices
     foreach ($datas["shelves"] as $i => $shelve) {
         $datas['shelves'][$i]['records'] = contenu_etagere($shelve['id'], $this->parameters["nb_notices"], $opac_notices_format, "", 1, './index.php?lvl=etagere_see&id=!!id!!');
     }
     //on rappelle le tout...
     return parent::render($datas);
 }
 public function render($datas)
 {
     global $opac_notice_affichage_class;
     if (!$opac_notice_affichage_class) {
         $opac_notice_affichage_class = "notice_affichage";
     }
     // $datas => id de la notice
     $notice = $datas;
     $render_datas = array();
     $render_datas['record'] = array();
     if ($notice) {
         //on calcule le template de notices...
         $notice_class = new $opac_notice_affichage_class($notice);
         $notice_class->do_header();
         if ($notice_class->notice->niveau_biblio != "b") {
             $permalink = "index.php?lvl=notice_display&id=" . $notice_class->notice_id;
         } else {
             $permalink = "index.php?lvl=bulletin_display&id=" . $notice_class->bulletin_id;
         }
         $infos = array('header' => $notice_class->notice_header, 'link' => $permalink);
         if ($this->parameters['used_template']) {
             $tpl = new notice_tpl_gen($this->parameters['used_template']);
             $infos['content'] = $tpl->build_notice($notice);
         } else {
             $notice_class->do_isbd();
             $infos['content'] = $notice_class->notice_isbd;
         }
         $render_datas['record'] = $infos;
     }
     //on rappelle le tout...
     return parent::render($render_datas);
 }
 public function get_format_data_structure()
 {
     $datasource = new cms_module_item_datasource_item();
     $datas = $datasource->get_format_data_structure();
     $format_datas = array_merge($datas, parent::get_format_data_structure());
     return $format_datas;
 }
 public function get_format_data_structure()
 {
     $menu = new cms_module_menu_datasource_menu();
     $format = $menu->get_format_data_structure();
     $format[0]['children'][] = array('var' => "items[i].current", 'desc' => $this->msg['cms_module_menu_view_menu_django']);
     $format = array_merge($format, parent::get_format_data_structure());
     return $format;
 }
 public function get_format_data_structure()
 {
     $datasource = new cms_module_watcheslist_datasource_watches();
     $datas = $datasource->get_format_data_structure();
     $datas[0]['children'][] = array('var' => "watches[i].watch.link", 'desc' => $this->msg['cms_module_watcheslist_view_django_watch_link_desc']);
     $format_datas = array_merge($datas, parent::get_format_data_structure());
     return $format_datas;
 }
 public function get_format_data_structure()
 {
     $datas = cms_article::get_format_data_structure("article", false);
     $datas[] = array('var' => "link", 'desc' => $this->msg['cms_module_articleslist_view_carousel_link_desc']);
     $format_datas = array(array('var' => "records", 'desc' => $this->msg['cms_module_carousel_view_carousel_records_desc'], 'children' => $this->prefix_var_tree($datas, "records[i]")));
     $format_datas = array_merge($format_datas, cms_module_common_view_django::get_format_data_structure());
     return $format_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].header", 'desc' => $this->msg['cms_module_common_view_record_header_desc']);
     $format_datas[0]['children'][] = array('var' => "records[i].content", 'desc' => $this->msg['cms_module_carousel_view_carousel_record_content_desc']);
     $format_datas = array_merge($format_datas, cms_module_common_view_django::get_format_data_structure());
     return $format_datas;
 }
 public function get_format_data_structure()
 {
     $datasource = new cms_module_agenda_datasource_agenda();
     $format_data = $datasource->get_format_data_structure("eventslist");
     $format_data[0]['children'][] = array('var' => "events[i].link", 'desc' => $this->msg['cms_module_agenda_view_evenslist_link_desc']);
     $format_data[] = array('var' => "title", 'desc' => $this->msg['cms_module_agenda_view_evenslist_title_desc']);
     $format_data = array_merge($format_data, cms_module_common_view_django::get_format_data_structure());
     return $format_data;
 }
 public function get_format_data_structure()
 {
     $datasource = new cms_module_itemslist_datasource_items();
     $datas = $datasource->get_format_data_structure();
     $datas[0]['children'][] = array('var' => "items[i].item.link", 'desc' => $this->msg['cms_module_itemslist_view_django_item_link_desc']);
     $datas[0]['children'][11]['children'][] = array('var' => "items[i].item.tags[j].link", 'desc' => $this->msg['cms_module_itemslist_view_django_tag_link_desc']);
     $format_datas = array_merge($datas, parent::get_format_data_structure());
     return $format_datas;
 }
 public function get_format_data_structure()
 {
     $datasource_item = new cms_module_item_datasource_item();
     $datas = array(array('var' => "tags", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_tags_desc'], 'children' => array(array('var' => "tags[i].id", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_tags_id_desc']), array('var' => "tags[i].label", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_tags_label_desc']), array('var' => "tags[i].items", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_tags_items_desc'], 'children' => $this->prefix_var_tree(docwatch_item::get_format_data_structure(), "tags[i].items[j]")), array('var' => "tags[i].link", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_tag_link_desc'])), array('var' => "items", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_items_desc'], 'children' => $this->prefix_var_tree(docwatch_item::get_format_data_structure(), "items[i]"))));
     $datas[0]['children'][2]['children'][] = array('var' => "tags[i].items[j].link", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_item_link_desc']);
     $datas[0]['children'][2]['children'][11]['children'][] = array('var' => "tags[i].items[j].tags[i].link", 'desc' => $this->msg['cms_module_itemslist_view_django_by_tags_tag_link_desc']);
     $format_datas = array_merge($datas, parent::get_format_data_structure());
     return $format_datas;
 }
 public function get_format_data_structure()
 {
     $datasource = new cms_module_agenda_datasource_agenda();
     $format_data = $datasource->get_format_data_structure("eventslist");
     $format_data[0]['children'][] = array('var' => "events[i].link", 'desc' => $this->msg['cms_module_agenda_view_calendar_django_link_desc']);
     $format_data[] = array('var' => "calendar", 'desc' => $this->msg['cms_module_agenda_view_calendar_django_calendar_desc']);
     $format_data[] = array('var' => "legends", 'desc' => $this->msg['cms_module_agenda_view_calendar_django_legends_desc'], 'children' => array(array('var' => "legends[i].calendar", 'desc' => $this->msg['cms_module_agenda_view_calendar_django_legend_calendar_desc']), array('var' => "legends[i].color", 'desc' => $this->msg['cms_module_agenda_view_calendar_django_legend_color_desc'])));
     $format_data = array_merge($format_data, cms_module_common_view_django::get_format_data_structure());
     return $format_data;
 }
 public function get_format_data_structure()
 {
     $format = array();
     $format[] = array('var' => "title", 'desc' => $this->msg['cms_module_common_view_title']);
     $sections = array('var' => "sections", 'desc' => $this->msg['cms_module_common_view_section_desc'], 'children' => $this->prefix_var_tree(cms_section::get_format_data_structure(true, true, true, true), "sections[i]"));
     $sections['children'][] = array('var' => "sections[i].link", 'desc' => $this->msg['cms_module_common_view_section_link_desc']);
     $format[] = $sections;
     $format = array_merge($format, parent::get_format_data_structure());
     return $format;
 }
 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;
     $format = array_merge($format, parent::get_format_data_structure());
     return $format;
 }
 public function render($datas)
 {
     $render_datas = array();
     $render_datas['title'] = "Liste d'évènements";
     $render_datas['events'] = array();
     foreach ($datas['events'] as $event) {
         $event['link'] = $this->get_constructed_link("article", $event['id']);
         $render_datas['events'][] = $event;
     }
     //on rappelle le tout...
     return cms_module_common_view_django::render($render_datas);
 }
 public function render($datas)
 {
     $render = parent::render($datas);
     if ($this->parameters['visionneuse']) {
         for ($i = 0; $i < count($datas['documents']); $i++) {
             $str_to_replace = substr($render, strpos($render, $datas['documents'][$i]['url']) - 1, strlen($datas['documents'][$i]['url']) + 2);
             $render = str_replace($str_to_replace, "'#' onclick='open_visionneuse(open_cms_visionneuse_" . $this->id . "," . $datas['documents'][$i]['id'] . ");return false;',", $render);
         }
         $render .= "\n\t\t\t<script type='text/javascript'>\n\t\t\t\tfunction open_cms_visionneuse_" . $this->id . "(id){\n\t\t\t\t\tvar url = 'visionneuse.php?driver=pmb_document&lvl=visionneuse&cms_type=" . $datas['type_object'] . "&num_type=" . $datas['num_object'] . "';\n\t\t\t\t\tif(id){\n\t\t\t\t\t\turl+='&explnum='+id;\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById('visionneuseIframe').src = url;\n\t\t\t\t}\n\t\t\t</script>";
     }
     return $render;
 }
 public function render($datas)
 {
     for ($i = 0; $i < count($datas['result']); $i++) {
         foreach ($datas['result'][$i] as $key => $value) {
             if (strpos($key, " ") !== false) {
                 $datas['result'][$i][str_replace(" ", "_", $key)] = $value;
                 unset($datas['result'][$i][$key]);
             }
             $datas['result'][$i][$key] = $this->charset_normalize($value, "utf-8");
         }
     }
     return parent::render($datas);
 }
 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 render($datas)
 {
     //on rajoute nos éléments...
     //le titre
     if (!is_array($datas['items'])) {
         $datas['items'] = array();
     }
     foreach ($datas['items'] as $key => $item) {
         if ($item['link'] == $_SERVER['HTTP_REFERER']) {
             $datas['items'][$key]['current'] = true;
         }
     }
     //on rappelle le tout...
     return parent::render($datas);
 }
 public function render($datas)
 {
     //on rajoute nos éléments...
     //le titre
     global $opac_url_base;
     $opac_url = substr($opac_url_base, strpos($opac_url_base, "://") + 3);
     if (!is_array($datas['items'])) {
         $datas['items'] = array();
     }
     foreach ($datas['items'] as $key => $item) {
         if (str_replace($opac_url, "", $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']) == substr($item['link'], 2)) {
             $datas['items'][$key]['current'] = true;
         }
     }
     //on rappelle le tout...
     return parent::render($datas);
 }
 public function render($datas)
 {
     //on rajoute nos éléments...
     //le titre
     $render_datas = array();
     $render_datas['title'] = "Liste d'articles";
     $render_datas['articles'] = array();
     if (is_array($datas)) {
         foreach ($datas as $article) {
             $cms_article = new cms_article($article);
             $infos = $cms_article->format_datas();
             $infos['link'] = $this->get_constructed_link("article", $article);
             $render_datas['articles'][] = $infos;
         }
     }
     //on rappelle le tout...
     return parent::render($render_datas);
 }
 public function render($datas)
 {
     //on rajoute nos éléments...
     //le titre
     $render_datas = array();
     $render_datas['title'] = "Liste de rubriques";
     $render_datas['sections'] = array();
     foreach ($datas as $section) {
         $cms_section = new cms_section($section);
         $infos = $cms_section->format_datas();
         $infos['link'] = $this->get_constructed_link("section", $section);
         foreach ($infos['articles'] as $i => $article) {
             $infos['articles'][$i]['link'] = $this->get_constructed_link("article", $article["id"]);
         }
         $render_datas['sections'][] = $infos;
     }
     //on rappelle le tout...
     return parent::render($render_datas);
 }
 public function render($datas)
 {
     $newdatas = $new_datas['categories'] = array();
     //récupération des ids des classements de veilles...
     $categories = array();
     for ($i = 0; $i < count($datas['watches']); $i++) {
         if ($datas['watches'][$i]['category']) {
             $categories[] = $datas['watches'][$i]['category']['id'];
         } else {
             $newdatas['watches'][] = $datas['watches'][$i];
         }
         $datas['watches'][$i]['link'] = $this->get_constructed_link('watch', $datas['watches'][$i]['id']);
     }
     $categories = array_unique($categories);
     //on récupère les parents jusque la racine....
     $this->get_parent($categories);
     //on regénère une structure de données..;
     $newdatas['categories'] = $this->set_children(0, $datas);
     return parent::render($newdatas);
 }
 public function get_format_data_structure()
 {
     $format_datas[] = array('var' => "no_image_url", 'desc' => $this->msg['cms_module_common_view_carousel_no_image_desc']);
     $format_datas = array_merge($format_datas, parent::get_format_data_structure());
     return $format_datas;
 }
 public function get_format_data_structure()
 {
     $datasource_watch = new cms_module_watch_datasource_watch();
     $datas = array(array('var' => "categories", 'desc' => $this->msg['cms_module_watcheslist_view_django_by_categories_categories_desc'], 'children' => array(array('var' => "categories[i].id", 'desc' => $this->msg['cms_module_watcheslist_view_django_by_categories_categories_id_desc']), array('var' => "categories[i].title", 'desc' => $this->msg['cms_module_watcheslist_view_django_by_categories_categories_title_desc']), array('var' => "categories[i].watches", 'desc' => $this->msg['cms_module_watcheslist_view_django_by_categories_categories_watches_desc'], 'children' => $this->prefix_var_tree(docwatch_watch::get_format_data_structure(), "categories[i].watches[j]")), array('var' => "categories[i].children", 'desc' => $this->msg['cms_module_watcheslist_view_django_by_categories_categories_children_desc'])), array('var' => "watches", 'desc' => $this->msg['cms_module_watcheslist_view_django_by_categories_watches_desc'], 'children' => $this->prefix_var_tree(docwatch_watch::get_format_data_structure(), "watches[i]"))));
     $datas[0]['children'][2]['children'][] = array('var' => "categories[i].watches[j].link", 'desc' => $this->msg['cms_module_watcheslist_view_django_by_categories_watch_link_desc']);
     $format_datas = array_merge($datas, parent::get_format_data_structure());
     return $format_datas;
 }
 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;
     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));
     }
     return $managed_datas;
 }
 public function __construct($id = 0)
 {
     parent::__construct($id);
     $this->default_template = "<h3>{{title}}</h3>\n<p>{{resume}}</p>\n<img src='{{logo.large}}'/>\n<p>{{content}}</p>";
 }
 public function get_format_data_structure()
 {
     $format = array();
     $format[] = array('var' => "title", 'desc' => $this->msg['cms_module_common_view_title']);
     $format[] = array('var' => "records", 'desc' => $this->msg['cms_module_commom_view_records_desc'], 'children' => array(array('var' => "records[i].id", 'desc' => $this->msg['cms_module_common_view_record_id_desc']), array('var' => "records[i].title", 'desc' => $this->msg['cms_module_common_view_record_title_desc']), array('var' => "records[i].vign", 'desc' => $this->msg['cms_module_common_view_record_vign_desc']), array('var' => "records[i].header", 'desc' => $this->msg['cms_module_common_view_record_header_desc']), array('var' => "records[i].content", 'desc' => $this->msg['cms_module_common_view_record_content_desc']), array('var' => "records[i].link", 'desc' => $this->msg['cms_module_common_view_record_link_desc'])));
     $format = array_merge($format, parent::get_format_data_structure());
     return $format;
 }
 public function get_format_data_structure()
 {
     return array_merge(array(array('var' => "record", 'desc' => "", 'children' => array(array('var' => "record.header", 'desc' => $this->msg['cms_module_common_view_record_header_desc']), array('var' => "record.content", 'desc' => $this->msg['cms_module_common_view_record_content_desc']), array('var' => "record.link", 'desc' => $this->msg['cms_module_common_view_record_link_desc'])))), parent::get_format_data_structure());
 }
 public function get_format_data_structure()
 {
     return array_merge(array(array('var' => "bannettes", 'desc' => $this->msg['cms_module_bannetteslist_view_bannettes_desc'], 'children' => array(array('var' => "bannettes[i].id", 'desc' => $this->msg['cms_module_bannetteslist_view_bannettes_id_desc']), array('var' => "bannettes[i].name", 'desc' => $this->msg['cms_module_bannetteslist_view_bannettes_name_desc']), array('var' => "bannettes[i].comment", 'desc' => $this->msg['cms_module_bannetteslist_view_bannettes_comment_desc']), array('var' => "bannettes[i].record_number", 'desc' => $this->msg['cms_module_bannetteslist_view_bannettes_record_number_desc']), array('var' => "bannettes[i].link", 'desc' => $this->msg['cms_module_bannetteslist_view_bannettes_link_desc']), array('var' => "bannettes[i].records", 'desc' => $this->msg['cms_module_bannetteslist_view_records_desc'], 'children' => array(array('var' => "bannettes[i].records[j].id", 'desc' => $this->msg['cms_module_bannetteslist_view_record_id_desc']), array('var' => "bannettes[i].records[j].title", 'desc' => $this->msg['cms_module_bannetteslist_view_record_title_desc']), array('var' => "bannettes[i].records[j].link", 'desc' => $this->msg['cms_module_bannetteslist_view_record_link_desc']), array('var' => "bannettes[i].records[j].url_vign", 'desc' => $this->msg['cms_module_bannetteslist_view_record_url_vign_desc']), array('var' => "bannettes[i].records[j].content", 'desc' => $this->msg['cms_module_bannetteslist_view_notices_record_content_desc']))), array('var' => "bannettes[i].flux_rss", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_desc'], 'children' => array(array('var' => "bannettes[i].flux_rss[j].id", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_id_desc']), array('var' => "bannettes[i].flux_rss[j].name", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_name_desc']), array('var' => "bannettes[i].flux_rss[j].opac_link", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_opac_link_desc']), array('var' => "bannettes[i].flux_rss[j].link", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_link_desc']), array('var' => "bannettes[i].flux_rss[j].lang", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_lang_desc']), array('var' => "bannettes[i].flux_rss[j].copy", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_copy_desc']), array('var' => "bannettes[i].flux_rss[j].editor_mail", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_editor_mail_desc']), array('var' => "bannettes[i].flux_rss[j].webmaster_mail", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_webmaster_mail_desc']), array('var' => "bannettes[i].flux_rss[j].ttl", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_ttl_desc']), array('var' => "bannettes[i].flux_rss[j].img_url", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_img_url_desc']), array('var' => "bannettes[i].flux_rss[j].img_title", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_img_title_desc']), array('var' => "bannettes[i].flux_rss[j].img_link", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_img_link_desc']), array('var' => "bannettes[i].flux_rss[j].format", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_format_desc']), array('var' => "bannettes[i].flux_rss[j].content", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_content_desc']), array('var' => "bannettes[i].flux_rss[j].date_last", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_date_last_desc']), array('var' => "bannettes[i].flux_rss[j].export_court", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_export_court_desc']), array('var' => "bannettes[i].flux_rss[j].template", 'desc' => $this->msg['cms_module_bannetteslist_view_flux_rss_template_desc'])))))), parent::get_format_data_structure());
 }
 public function render($datas)
 {
     $datas = $this->add_links($datas);
     return parent::render($datas);
 }