public function should_render_inherited_template()
 {
     $h2o = new H2o('inherited.html', $this->option);
     expects($h2o->render())->should_be('header,extended body,footer');
     # extend nested blocks
     $h2o->loadTemplate('nested_inherit');
     expects($h2o->render())->should_be('h2o template rocks so hard ! and plays so hard');
 }
示例#2
0
 public function should_be_able_to_load_template_lazily()
 {
     $h2o = new H2o('a.html', array('searchpath' => 'templates'));
     expects($h2o->render())->should_not_be_empty();
     $h2o = new H2o(null, array('searchpath' => 'templates'));
     $h2o->loadTemplate('b.html');
     expects($h2o->render())->should_not_be_empty();
 }
示例#3
0
 public function should_be_able_to_include_in_nested_fashion()
 {
     $h2o = new H2o('page.html', $this->option);
     $result = $h2o->render();
     expects($result)->should_match('/layout text/');
     expects($result)->should_match('/Page footer/');
     expects($result)->should_match('/page menu/');
 }
 /**
  * Renders a template using h2o
  *
  * @param string $template template file name
  * @return string
  */
 public function render($template)
 {
     if (!array_key_exists('searchpath', self::$h2o_options)) {
         self::$h2o_options['searchpath'] = $this->getTemplatesDirectory() . '/';
     }
     $this->_load_h2o();
     $h2o = new \H2o($template, self::$h2o_options);
     return $h2o->render($this->data);
 }
 public function get_display_list()
 {
     global $include_path, $scan_request_scripts;
     $tpl = $include_path . '/templates/scan_request/scan_requests_list.tpl.html';
     if (file_exists($include_path . '/templates/scan_request/scan_requests_list_subst.tpl.html')) {
         $tpl = $include_path . '/templates/scan_request/scan_requests_list_subst.tpl.html';
     }
     $h2o = new H2o($tpl);
     return $scan_request_scripts . $h2o->render(array('scan_requests' => $this));
 }
示例#6
0
 /**
  * Renders a template using h2o
  *
  * @param string $template template file name
  * @return string
  */
 public function render($template)
 {
     if (!array_key_exists('searchpath', $this->h2o_options)) {
         $this->h2o_options['searchpath'] = $this->getTemplatesDirectory() . '/';
     }
     // Make sure H2o is loaded
     $this->_load_h2o();
     $h2o = new H2o($template, $this->h2o_options);
     return $h2o->render($this->data);
 }
示例#7
0
 function should_be_able_to_load_template_lazily()
 {
     chdir(dirname(__FILE__));
     $paths = array(dirname(__FILE__) . DS . 'templates' . DS);
     $h2o = h2o('a.html', array('searchpath' => $paths));
     expects($h2o->render())->should_not_be_empty();
     $h2o = new H2o('a.html', array('searchpath' => 'templates'));
     expects($h2o->render())->should_not_be_empty();
     $h2o = new H2o(null, array('searchpath' => 'templates'));
     $h2o->loadTemplate('b.html');
     expects($h2o->render())->should_not_be_empty();
 }
 /**
  * Permet de générer l'affichage d'un élément de liste de type autorité
  * @param authority $authority
  * @param bool $recherche_ajax_mode
  * @param int $group_id Identifiant du groupe
  * @return string 
  */
 private function generate_authority($authority, $recherche_ajax_mode, $group_id)
 {
     global $include_path;
     $template_path = $include_path . '/templates/authorities/list/' . $authority->get_string_type_object() . '.html';
     if (file_exists($include_path . '/templates/authorities/list/' . $authority->get_string_type_object() . '_subst.html')) {
         $template_path = $include_path . '/templates/authorities/list/' . $authority->get_string_type_object() . '_subst.html';
     }
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $context = array('list_element' => $authority, 'group_id' => $group_id);
         return $h2o->render($context);
     }
     return '';
 }
 public function get_isbd()
 {
     global $msg, $include_path;
     $template_path = $include_path . '/templates/authorities/isbd/titre_uniforme.html';
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $authority = new authority(0, $this->id, AUT_TABLE_TITRES_UNIFORMES);
         return $h2o->render(array('oeuvre' => $authority));
     }
     return $this->tu_isbd;
 }
示例#10
0
<?php

/**
 *   Simple example rendering a user list
 *   ------------------------------------
 *   
 *   @credit - adapt from ptemplates sample
 */
require '../../h2o.php';
$template = new H2o('index.html', array('cache_dir' => dirname(__FILE__)));
$time_start = microtime(true);
echo $template->render(array('users' => array(array('username' => 'peter <h1>asdfasdf</h1>', 'tasks' => array('school', 'writing'), 'user_id' => 1), array('username' => 'anton', 'tasks' => array('go shopping <h1>je</h1'), 'user_id' => 2), array('username' => 'john doe', 'tasks' => array('write report', 'call tony', 'meeting with arron'), 'user_id' => 3), array('username' => 'foobar', 'tasks' => array(), 'user_id' => 4))));
echo "in " . (microtime(true) - $time_start) . " seconds\n<br/>";
示例#11
0
 public function render($context = array())
 {
     global $opac_authorities_templates_folder;
     if (!$opac_authorities_templates_folder) {
         $opac_authorities_templates_folder = "./includes/templates/authorities/common";
     }
     $template_path = $opac_authorities_templates_folder . "/" . $this->get_type_autority() . ".html";
     if (!file_exists($template_path)) {
         $template_path = "./includes/templates/authorities/common/" . $this->get_type_autority() . ".html";
     }
     if (file_exists($opac_authorities_templates_folder . "/" . $this->get_type_autority() . "_subst.html")) {
         $template_path = $opac_authorities_templates_folder . "/" . $this->get_type_autority() . "_subst.html";
     }
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $h2o->addLookup(array($this, "lookup"));
         echo $h2o->render($context);
     }
 }
                            $resas_datas['flag_resa_possible'] = false;
                        }
                        if ($opac_show_exemplaires) {
                            $obj['display_expls'] = pmb_bidi(notice_affichage::expl_list("m", 0, $id));
                        }
                    } else {
                        $resas_datas['flag_resa_visible'] = false;
                    }
                    // On envoie le tout au template
                    if (file_exists($include_path . "/templates/record/" . $opac_notices_format_django_directory . "/bulletin_without_record_extended_display.tpl.html")) {
                        $template = $include_path . "/templates/record/" . $opac_notices_format_django_directory . "/bulletin_without_record_extended_display.tpl.html";
                    } else {
                        $template = $include_path . "/templates/record/common/bulletin_without_record_extended_display.tpl.html";
                    }
                    $h2o = new H2o($template);
                    print $h2o->render(array('bulletin' => $obj, 'parent' => $notice3, 'liens_opac' => $liens_opac, 'resas_datas' => $resas_datas));
                }
            }
        }
    }
}
pmb_mysql_free_result($resdep);
function do_carroussel($bull)
{
    global $gestion_acces_active, $gestion_acces_empr_notice, $opac_navigateur_bulletin_number;
    global $msg;
    if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
        $ac = new acces();
        $dom_2 = $ac->setDomain(2);
        $join_noti = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.num_notice");
        $join_bull = $dom_2->getJoin($_SESSION["id_empr_session"], 4, "bulletins.bulletin_notice");
 private static function render($notice_id, $tpl)
 {
     $h2o = new H2o($tpl);
     $h2o->addLookup("record_display::lookup");
     $h2o->set(array('notice_id' => $notice_id));
     return $h2o->render();
 }
<?php

include_once "h2o/h2o.php";
$tpl = new H2o("index.tpl.html", array('cache_dir' => dirname(__FILE__)));
$arr = array("grid" => "Grilla", "grid_config" => "Configuraci&oacute;n de la grilla", "home" => "Inicio", "edit" => "Edición", "attention" => "Atención", "delete" => "eliminar", "move" => "Drag", "insert" => "Insertar", "information" => "Información general", "save" => "Guardar", "safe_ok" => "Guardado Correctamente", "block_functions" => "Bloque de Funciones", "by_default" => "Por defecto", "info_msg" => "Información", "info_dialog" => "Dialogo de Informacion", "warning_msg" => "Advertencia", "micro_count" => "Contador", "title_bar" => "Barra de Titulo", "disable" => "Desactivar", "bordered" => "Sombreado", "page_title" => "Titulo de Pagina", "rich_text" => "Texto", "preview_list" => "Lista de Vista Previa", "progress_bar" => "Barra de Progreso", "notice" => "Noticias", "title" => "Titulo", "dynamic_components" => "Componentes Dinamicos", "accordion" => "Acordion", "ready" => "Exito", "slider" => "Carrusel", "developer" => "Desarrollador", "preview" => "Vista previa", "undo" => "Deshacer", "clean" => "Limpiar", "download" => "Descargar", "save" => "Guardar", "design" => "Diseño", "redo" => "Rehacer", "function" => "Funcion", "basic" => "Basico", "error_msg" => "Error", "left_alig" => "Alinear a la Izq.", "right_align" => "Alinear a la Der.", "bottom" => "Fondo", "Center" => "Centrar", "title_list" => "Lista de Tit.", "help" => "Ayuda", "table" => "Tabla", "align" => "Alinear", "no_style" => "Sin Estilo", "style" => "Estilo", "mark" => "Marca", "reference_block" => "Bloque de Referencia", "vertical_align" => "Alineación vertical", "with_line" => "Alineación vertical", "button" => "Boton", "button_group" => "Grupo de Botones", "size" => "Tamaño", "large" => "Largo", "small" => "Pequeño", "disable" => "Deshabilitar", "enable" => "Habilitar", "danger" => "Peligro", "inverse" => "Inverso", "warning" => "Advertencia", "mini" => "Mini", "normal" => "Normal", "extend" => "Extendido", "res_1" => "Cerrar", "res_2" => "Ancho fijo", "res_3" => "Ancho adaptable", "res_4" => "HTML limpia generada a continuación, puede copiar y pegar el código en su proyecto.", "res_5" => "Descargar", "res_6" => "Cerrar", "res_7" => "Guardar", "res_8" => "Debido a que el cielo no es el más hermoso.", "res_9" => "Cada vez mirando las estrellas, siempre cierro los ojos,", "res_10" => "Un muro de contención, sólo una bahía cubra su galaxia.", "res_11" => "Un viento, simplemente pasear en un valle;", "res_12" => "Bajo construcción ...", "res_13" => "Extensión de aplicación", "res_14" => "Andar en bicicleta como una herramienta para que coincida con la velocidad del deporte.1896 fue de los primeros Juegos Olímpicos como un evento oficial.Tour de Francia como Campeonato de ciclismo más famosos del mundo.", "res_15" => "Bicicleta", "res_16" => "Surfeando las olas son impulsados ​​por sus excelentes habilidades y equilibrio, una campaña de lucha contra las olas.Los jugadores se colocan en una tabla de surf, o usan la web, tableros de rodillas, alfombras de goma inflables, remo, kayak y otros deportes acuáticos para controlar una ola.", "res_17" => "Navegar", "res_18" => "El béisbol es un tipo de palo de jugar como las principales características de los colectivos altamente confrontacionales proyectos, juegos de pelota en los Estados Unidos, Japón, es particularmente popular.", "res_19" => "Béisbol", "msg_1" => "Tenga en cuenta que su privacidad personal.");
echo $tpl->render($arr);
示例#15
0
 /**
  * renders the template in the given context
  * 
  * @param $context array or object of context
  * @return string the rendered template
  */
 public function render($context = array())
 {
     return $this->template->render($context);
 }
 public static function render($file, &$vars = array())
 {
     $template = new H2o($file, array('cache' => 'file', 'cache_dir' => dirname($file) . '/cache'));
     echo $template->render($vars);
 }
示例#17
0
function render_to_string($templateFile, $templateArr)
{
    $templateArr = array_merge($templateArr, $GLOBALS['SETTINGS']);
    $templateArr['user'] = User::get_current();
    $h2oConfig = pjango_ini_get('H2O_CONFIG');
    $template = new H2o($templateFile, $h2oConfig);
    return $template->render($templateArr);
}
示例#18
0
<?php

require '../../h2o.php';
$template = new H2o('trans.html', array('cache' => false, 'i18n' => array('locale' => isset($_GET['lang']) ? $_GET['lang'] : false, 'charset' => 'UTF-8', 'gettext_path' => strtoupper(PHP_OS) == 'LINUX' ? '/usr/bin/' : '../bin/gettext/bin/', 'extract_message' => true, 'compile_message' => true)));
# Setup custom gettext resolver
$time_start = microtime(true);
echo $template->render(array('users' => array(array('username' => 'peter', 'tasks' => array('school', 'writing'), 'user_id' => 1), array('username' => 'anton', 'tasks' => array('go shopping'), 'user_id' => 2), array('username' => 'john doe', 'tasks' => array('write report', 'call tony', 'meeting with arron'), 'user_id' => 3), array('username' => 'foobar', 'tasks' => array(), 'user_id' => 4), array('username' => 'test', 'tasks' => null, 'user_id' => 5))));
echo "in " . (microtime(true) - $time_start) . " seconds\n<br/>";
示例#19
0
function show_serial_info($serial_id, $page, $nbr_lignes)
{
    global $serial_action_bar;
    global $dbh;
    global $msg;
    global $nb_per_page_a_search;
    global $charset;
    global $deflt_collstate_location, $location;
    global $pmb_etat_collections_localise, $pmb_droits_explr_localises, $explr_invisible, $explr_visible_unmod;
    // barre de restriction des bulletins affichés
    global $aff_bulletins_restrict_numero, $aff_bulletins_restrict_date, $aff_bulletins_restrict_periode;
    global $sort_children;
    global $pmb_opac_url;
    global $pmb_url_base, $categ, $sub, $quoi, $view, $tab_page, $tab_nb_per_page;
    if ($pmb_etat_collections_localise) {
        if ($view == "collstate") {
            global $id;
            if (isset($id) && $deflt_collstate_location === "0") {
                //Affiche tous les états de collection après création/modification
                $location = $deflt_collstate_location;
            } else {
                $location = (string) $location == "" ? $deflt_collstate_location : $location;
            }
        } else {
            $location = (string) $location == "" ? $deflt_collstate_location : $location;
        }
    }
    $url_suffix = "";
    if ($quoi) {
        $url_suffix .= "&quoi=" . $quoi;
    }
    if ($tab_page) {
        $url_suffix .= "&tab_page=" . $tab_page . "&tab_nb_per_page=" . $tab_nb_per_page;
    }
    // lien d'ajout d'une notice mère à un caddie
    $selector_prop = "toolbar=no, dependent=yes, width=500, height=400, resizable=yes, scrollbars=yes";
    $cart_click_noti = "onClick=\"openPopUp('./cart.php?object_type=NOTI&item=!!item!!', 'cart', 600, 700, -2, -2, '{$selector_prop}')\"";
    $cart_link = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_noti}>";
    if ($current !== false) {
        $print_action = "&nbsp;<a href='#' onClick=\"openPopUp('./print.php?current_print={$current}&notice_id=" . $serial_id . "&action_print=print_prepare','print',500,600,-2,-2,'scrollbars=yes,menubar=0'); w.focus(); return false;\"><img src='./images/print.gif' border='0' align='center' alt=\"" . $msg["histo_print"] . "\" title=\"" . $msg["histo_print"] . "\"/></a>";
    }
    $visualise_click_notice = "\n\t<script type=\"text/javascript\" src='./javascript/select.js'></script>\n\t\n\t<a href='#' onClick='show_frame(\"{$pmb_opac_url}" . "notice_view.php?id={$serial_id}\")'><img src='./images/search.gif' align='middle' title=\"{$msg["noti_see_gestion"]}\" border='0' /></a>";
    $base_url = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}";
    $serial_action_bar = str_replace('!!serial_id!!', $serial_id, $serial_action_bar);
    if ($serial_id) {
        $myQuery = pmb_mysql_query("SELECT * FROM notices WHERE notice_id={$serial_id} ", $dbh);
    }
    if ($serial_id && pmb_mysql_num_rows($myQuery)) {
        //Bulletins
        $myPerio = pmb_mysql_fetch_object($myQuery);
        // function serial_display ($id, $level='1', $action_serial='', $action_analysis='', $action_bulletin='', $lien_suppr_cart="", $lien_explnum="", $bouton_explnum=1,$print=0,$show_explnum=1, $show_statut=0, $show_opac_hidden_fields=true ) {
        $isbd = new serial_display($myPerio, 5, "", "", "", "", "./catalog.php?categ=serials&sub=explnum_form&serial_id=!!serial_id!!&explnum_id=!!explnum_id!!");
        $perio_header = $isbd->header;
        // isbd du périodique
        $perio_isbd = $isbd->isbd;
        $isbd->get_etat_periodique();
        $perio_isbd .= $isbd->print_etat_periodique();
        global $avis_quoifaire, $valid_id_avis;
        $perio_isbd = str_replace('<!-- !!avis_notice!! -->', avis_notice($serial_id, $avis_quoifaire, $valid_id_avis), $perio_isbd);
        if (!$page) {
            $page = 1;
        }
        $debut = ($page - 1) * $nb_per_page_a_search;
        switch ($view) {
            case "abon":
                $base_url = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}&view=abon" . $url_suffix;
                require_once "views/view_abon.inc.php";
                break;
            case "modele":
                require_once "views/view_modeles.inc.php";
                break;
            case "collstate":
                $base_url = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}&view=collstate" . $url_suffix;
                require_once "views/view_collstate.inc.php";
                break;
            default:
                // barre de restriction des bulletins affichés
                $clause = "";
                if ($aff_bulletins_restrict_numero) {
                    $clause = " and bulletin_numero like '%" . str_replace("*", "%", $aff_bulletins_restrict_numero) . "%' ";
                    $base_url .= "&aff_bulletins_restrict_numero=" . urlencode($aff_bulletins_restrict_numero);
                }
                if ($aff_bulletins_restrict_date) {
                    $aff_bulletins_restrict_date_traite = str_replace("*", "%", $aff_bulletins_restrict_date);
                    $tab_bulletins_restrict_date = explode($msg[format_date_input_separator], $aff_bulletins_restrict_date_traite);
                    if (count($tab_bulletins_restrict_date) == 3) {
                        $aff_bulletins_restrict_date_traite = $tab_bulletins_restrict_date[2] . "-" . $tab_bulletins_restrict_date[1] . "-" . $tab_bulletins_restrict_date[0];
                    }
                    if (count($tab_bulletins_restrict_date) == 2) {
                        $aff_bulletins_restrict_date_traite = $tab_bulletins_restrict_date[1] . "-" . $tab_bulletins_restrict_date[0];
                    }
                    if (count($tab_bulletins_restrict_date) == 1) {
                        $aff_bulletins_restrict_date_traite = $tab_bulletins_restrict_date[0];
                    }
                    $clause .= " and date_date like '%" . $aff_bulletins_restrict_date_traite . "%'";
                    $base_url .= "&aff_bulletins_restrict_date=" . urlencode($aff_bulletins_restrict_date);
                }
                if ($aff_bulletins_restrict_periode) {
                    $aff_bulletins_restrict_periode_traite = str_replace("*", "%", $aff_bulletins_restrict_periode);
                    $clause .= " and mention_date like '%" . $aff_bulletins_restrict_periode_traite . "%'";
                    $base_url .= "&aff_bulletins_restrict_periode=" . urlencode($aff_bulletins_restrict_periode);
                }
                $base_url .= $url_suffix;
                //On compte les expl de la localisation
                $rqt = "SELECT COUNT(1) FROM bulletins " . ($location ? ", exemplaires" : "") . " WHERE " . ($location ? "(expl_bulletin=bulletin_id and expl_location='{$location}' or expl_location is null) and " : "") . " bulletin_notice='{$serial_id}'  ";
                $myQuery = pmb_mysql_query($rqt, $dbh);
                $nb_expl_loc = pmb_mysql_result($myQuery, 0, 0);
                //On compte les bulletins de la localisation
                $rqt = "SELECT count(distinct bulletin_id) FROM bulletins " . ($location ? ",exemplaires " : "") . " WHERE " . ($location ? "(expl_bulletin=bulletin_id and expl_location='{$location}') and " : "") . " bulletin_notice='{$serial_id}' ";
                $myQuery = pmb_mysql_query($rqt, $dbh);
                if ($execute_query && pmb_mysql_num_rows($myQuery)) {
                    $nb_bull_loc = pmb_mysql_result($myQuery, 0, 0);
                }
                //On compte les bulletinsà afficher
                $rqt = "SELECT count(distinct bulletin_id) FROM bulletins " . ($location ? ", exemplaires" : "") . " WHERE " . ($location ? "(expl_bulletin=bulletin_id and expl_location='{$location}' or expl_location is null) and " : "") . " bulletin_notice='{$serial_id}' {$clause} ";
                $myQuery = pmb_mysql_query($rqt, $dbh);
                $nbr_lignes = pmb_mysql_result($myQuery, 0, 0);
                require_once "views/view_bulletins.inc.php";
                break;
        }
        // Gestion de la supression de la notice si les droits de modification des exemplaires sont localisés.
        $flag_no_delete_notice = 0;
        //visibilité des exemplaires
        if ($pmb_droits_explr_localises) {
            global $explr_visible_mod;
            $explr_tab_modif = explode(",", $explr_visible_mod);
            $requete = "SELECT expl_location from exemplaires, bulletins,notices where\n\t\t\t\texpl_bulletin=bulletin_id and bulletin_notice=notice_id and notice_id= {$serial_id}";
            $execute_query = pmb_mysql_query($requete);
            if ($execute_query && pmb_mysql_num_rows($execute_query)) {
                while ($r = pmb_mysql_fetch_object($execute_query)) {
                    if (!in_array($r->expl_location, $explr_tab_modif)) {
                        $flag_no_delete_notice = 1;
                    }
                }
            }
        }
        if (!$flag_no_delete_notice) {
            $serial_action_bar = str_replace('!!delete_serial_button!!', "<input type='button' class='bouton' onclick=\"confirm_serial_delete();\" value='{$msg['63']}' />", $serial_action_bar);
        } else {
            $serial_action_bar = str_replace('!!delete_serial_button!!', "", $serial_action_bar);
        }
        $serial_action_bar = str_replace('!!issn!!', $myPerio->code, $serial_action_bar);
        // action_bar : serials.tpl.php...
        // mise à jour des info du javascript
        $serial_action_bar = str_replace('!!nb_bulletins!!', $isbd->serial_nb_bulletins, $serial_action_bar);
        $serial_action_bar = str_replace('!!nb_articles!!', $isbd->serial_nb_articles, $serial_action_bar);
        $serial_action_bar = str_replace('!!nb_expl!!', $isbd->serial_nb_exemplaires, $serial_action_bar);
        $serial_action_bar = str_replace('!!nb_etat_coll!!', $isbd->serial_nb_etats_collection, $serial_action_bar);
        $serial_action_bar = str_replace('!!nb_abo!!', $isbd->serial_nb_abo_actif, $serial_action_bar);
        // titre général du périodique
        print pmb_bidi("<div class='row'>\n\t  \t\t\t<div class='notice-perio'>{$isbd->aff_statut}\n\t\t\t\t\t<h2 style='display: inline;'>" . str_replace('!!item!!', $serial_id, $cart_link) . $print_action . $visualise_click_notice . " " . $perio_header . "</h2>\n\t        \t\t\t\t\t<div class='row'>{$perio_isbd}</div>\n\t\t\t\t\t\t\t<div class='row'>{$collections_state}</div>\n\t        \t\t\t\t<hr />\n\t        \t\t\t\t<div class='row'>\n\t        \t\t\t\t\t{$serial_action_bar}\n\t        \t\t\t\t\t</div>\n\t        \t\t\t\t</div>\n\t        \t\t\t</div>");
        // bulletinage
        $onglets = "\n\t\t<div id='content_onglet_perio'>\n\t\t\t<span class='" . (!$view ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\" onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . $url_suffix . "'\">" . $msg["abts_onglet_bull"] . "</a></span>\n\t\t\t<span class='" . ($view == "abon" ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\" onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . "&view=abon" . $url_suffix . "'\">" . $msg["abts_onglet_abt"] . "</a></span>\n\t\t\t<span class='" . ($view == "modele" ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\"  onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . "&view=modele" . $url_suffix . "'\">" . $msg["abts_onglet_modele"] . "</a></span>\n\t\t\t<span class='" . ($view == "collstate" ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\"  onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . "&view=collstate" . $url_suffix . "'\">" . $msg["abts_onglet_collstate"] . "</a></span>\n\t\t</div>\n\t\t";
        print $onglets;
        $totaux_loc = "";
        $temp_location = 0;
        $list_locs = "";
        switch ($view) {
            case "modele":
                $list_locs = "";
                break;
            case "abon":
                if ($location) {
                    $temp_location = $location;
                }
                $list_locs = docs_location::gen_combo_box_empr($temp_location, 1, "document.filter_form.location.value=this.options[this.selectedIndex].value; document.filter_form.submit();");
                $link_bulletinage = "<a href='./catalog.php?categ=serials&sub=pointage&serial_id={$serial_id}&location_view={$location}'>" . $msg["link_notice_to_bulletinage"] . "</a>";
                break;
            case "collstate":
                if ($pmb_etat_collections_localise) {
                    if ($location) {
                        $temp_location = $location;
                    }
                    $list_locs = docs_location::gen_combo_box_empr($temp_location, 1, "document.filter_form.location.value=this.options[this.selectedIndex].value; document.filter_form.submit();");
                }
                $link_bulletinage = "<input type='button' class='bouton' value='" . $msg["collstate_add_collstate"] . "' \n\t\t\t\tonClick=\"document.location='./catalog.php?categ=serials&sub=collstate_form&serial_id={$serial_id}&id=';\">";
                break;
            default:
                if ($location) {
                    $temp_location = $location;
                }
                $list_locs = docs_location::gen_combo_box_empr($temp_location, 1, "document.filter_form.location.value=this.options[this.selectedIndex].value; document.filter_form.submit();");
                $link_bulletinage = "<a href='./catalog.php?categ=serials&sub=pointage&serial_id={$serial_id}&location_view={$location}'>" . $msg["link_notice_to_bulletinage"] . "</a>";
                if ($nb_bull_loc) {
                    if ($temp_location && $list_locs) {
                        $totaux_loc = "<strong>{$nb_bull_loc}</strong> " . $msg["serial_nb_bulletin"] . "\n\t\t\t\t\t\t<strong>{$nb_expl_loc}</strong> " . $msg["bulletin_nb_ex"];
                    }
                }
                break;
        }
        print pmb_bidi("\n\t\t<div class='bulletins-perio'>\n\t\t\t<div class='row'>\n\t\t\t\t<h3>" . ($view == "abon" ? $msg["perio_abts_title"] : ($view == "modele" ? $msg["perio_modeles_title"] : ($view == "collstate" ? $msg["abts_onglet_collstate"] : $msg["4001"]))) . "&nbsp;{$list_locs}\n\t\t\t\t{$link_bulletinage}\n\t\t\t\t</h3>\n\t\t\t\t{$totaux_loc}\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<div align='center'>\n\t\t\t\t\t{$pages_display}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t{$bulletins}\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<div align='center'>\n\t\t\t\t\t{$pages_display}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>");
        $template_path_serial_tabs = "./includes/templates/records/records_elements_tabs.html";
        if (file_exists("./includes/templates/records/records_elements_tabs_subst.html")) {
            $template_path_serial_tabs = "./includes/templates/records/records_elements_tabs_subst.html";
        }
        if (file_exists($template_path_serial_tabs)) {
            $h2o_serial_tabs = new H2o($template_path_serial_tabs);
            $records_tabs = new records_tabs(new notice($isbd->notice_id));
            $records_list_ui = $records_tabs->get_record()->get_records_list_ui();
            if ($records_list_ui) {
                $records_list_ui->set_current_url($pmb_url_base . 'catalog.php?categ=' . $categ . '&sub=' . $sub . '&serial_id=' . $isbd->notice_id . '&quoi=' . $quoi . ($view ? '&view=' . $view : ''));
            }
            print $h2o_serial_tabs->render(array('records_tabs' => $records_tabs));
        }
    }
}
示例#20
0
function show_bulletinage_info_catalogage($bul_id, $show_in_receptions = false)
{
    global $dbh, $msg, $charset, $base_path;
    global $liste_script;
    global $liste_debut;
    global $liste_fin;
    global $bul_action_bar;
    global $bul_cb_form;
    global $cart_click_bull;
    global $pmb_droits_explr_localises;
    global $explr_visible_mod;
    global $flag_no_delete_bulletin;
    global $pmb_resa_planning;
    global $categ, $quoi, $action, $sub;
    $form = '';
    if ($bul_id) {
        if (!$show_in_receptions) {
            $myBul = new bulletinage($bul_id, 0, "./catalog.php?categ=serials&sub=bulletinage&action=explnum_form&bul_id={$bul_id}&explnum_id=!!explnum_id!!");
            $myBul->b_notice_show_expl = 0;
            $myBul->make_display();
            //Refait pour avoir la notice de bulletin sans ses exemplaires et ses docnums
            $affichage_expl = get_expl($myBul->expl);
            $cpt_expl = get_expl($myBul->expl, 0, true);
        } else {
            $myBul = new bulletinage($bul_id, 0, '');
            $myBul->b_notice_show_expl = 0;
            $myBul->make_display();
            //Refait pour avoir la notice de bulletin sans ses exemplaires et ses docnums
            $affichage_expl = get_expl($myBul->expl, 1);
            $cpt_expl = get_expl($myBul->expl, 1, true);
        }
        $bul_titre = $myBul->bulletin_titre;
        $bul_isbd = $myBul->display;
        $aff_expl_num = $myBul->explnum;
        $txt_drag = "";
        if ($myBul->bulletin_numero) {
            $txt_drag .= $myBul->bulletin_numero . " ";
        }
        if ($myBul->mention_date) {
            $txt_drag .= " (" . $myBul->mention_date . ") ";
        }
        $txt_drag .= "[" . $myBul->aff_date_date . "]";
        if (!$show_in_receptions) {
            // lien vers la notice chapeau
            $link_parent = "<a href=\"./catalog.php?categ=serials\">";
            $link_parent .= $msg[4010] . "</a>";
            $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">";
            $link_parent .= "<a href=\"./catalog.php?categ=serials&sub=view&serial_id=";
            $link_parent .= $myBul->bulletin_notice . "\">" . $myBul->tit1 . '</a>';
            $link_parent .= "<img src=\"./images/d.gif\" align=\"middle\" hspace=\"5\">";
            $link_parent .= $txt_drag;
            if ($bul_titre) {
                $link_parent .= " : " . htmlentities($bul_titre, ENT_QUOTES, $charset);
            }
            $form .= "<div class='row'><div class='perio-barre'>" . $link_parent . "</div></div>";
            $cart_link = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_bull}>";
            $cart_link = str_replace('!!item!!', $bul_id, $cart_link);
            $cart_link .= "<span id='BULL_drag_" . $bul_id . "'  dragicon=\"{$base_path}/images/icone_drag_notice.png\" dragtext=\"" . htmlentities($txt_drag, ENT_QUOTES, $charset) . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>";
            $bul_action_bar = str_replace('!!bul_id!!', $bul_id, $bul_action_bar);
            $bul_action_bar = str_replace('!!serial_id!!', $myBul->bulletin_notice, $bul_action_bar);
            $bul_action_bar = str_replace('!!nb_expl!!', sizeof($myBul->expl), $bul_action_bar);
            global $avis_quoifaire, $valid_id_avis;
            if ($myBul->bull_num_notice) {
                $bul_isbd = str_replace('<!-- !!avis_notice!! -->', avis_notice($myBul->bull_num_notice, $avis_quoifaire, $valid_id_avis), $bul_isbd);
            }
            if (!$flag_no_delete_bulletin) {
                $bul_action_bar = str_replace("!!bulletin_delete_button!!", "<input type='button' class='bouton' onclick=\"confirm_bul_delete();\" value='{$msg['63']}' />", $bul_action_bar);
            } else {
                $bul_action_bar = str_replace("!!bulletin_delete_button!!", "", $bul_action_bar);
            }
            if ($myBul->bull_num_notice) {
                $form .= $liste_script;
            }
            $form .= "\n\t\t\t<div class='bulletins-perio'>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<h2>{$cart_link} {$bul_isbd}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t{$bul_action_bar}\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
            // affichage des exemplaires associés
            $list_expl = "<div class='exemplaires-perio'>";
            $list_expl .= "<h3>" . $msg[4012] . " (" . $cpt_expl . ")</h3>";
            $list_expl .= "<div class='row'>" . $affichage_expl . "</div></div>";
            $form .= $list_expl;
            if ($aff_expl_num) {
                $list_expl = "<div class='exemplaires-perio'><h3>" . $msg[explnum_docs_associes] . " (" . $myBul->nbexplnum . ")</h3>";
                $list_expl .= "<div class='row'>" . $aff_expl_num . "</div></div>";
                $form .= $list_expl;
            }
            if (!$explr_visible_mod && $pmb_droits_explr_localises == 1) {
                $etiquette_expl = "";
                $btn_ajouter_expl = "";
                $saisie_num_expl = "<div class='colonne10'><img src='./images/error.png' /></div>";
                $saisie_num_expl .= "<div class='colonne-suite'><span class='erreur'>" . $msg["err_add_invis_expl"] . "</span></div>";
            } else {
                $etiquette_expl = "<div class='row'>\n\t\t\t\t\t\t\t<label class='etiquette' for='form_cb'>{$msg['291']}</label>\n\t\t\t\t\t\t\t</div>";
                $btn_ajouter_expl = "<input type='submit' class='bouton' value=' {$msg['expl_ajouter']} ' onClick=\"return test_form(this.form)\">";
                global $pmb_numero_exemplaire_auto, $pmb_numero_exemplaire_auto_script, $include_path;
                if ($pmb_numero_exemplaire_auto == 1 || $pmb_numero_exemplaire_auto == 3) {
                    $num_exemplaire_auto = " {$msg['option_num_auto']} <INPUT type=checkbox name='option_num_auto' value='num_auto'";
                    $checked = true;
                    if ($pmb_numero_exemplaire_auto_script) {
                        if (file_exists($include_path . "/{$pmb_numero_exemplaire_auto_script}")) {
                            require_once $include_path . "/{$pmb_numero_exemplaire_auto_script}";
                            if (function_exists('is_checked_by_default')) {
                                $checked = is_checked_by_default(0, $bul_id);
                            }
                        }
                    }
                    if ($checked) {
                        $num_exemplaire_auto .= " checked='checked'";
                    }
                    $num_exemplaire_auto .= " >";
                }
                $saisie_num_expl = "<input type='text' class='saisie-20em' name='noex' value=''>" . $num_exemplaire_auto;
            }
            $req = "select * from serialcirc_copy, bulletins where num_serialcirc_copy_bulletin=bulletin_id and bulletin_id= {$bul_id}";
            $resultat = pmb_mysql_query($req);
            $i = 0;
            if (pmb_mysql_num_rows($resultat)) {
                $btn_print_ask = "<input type='button' class='bouton' value=' " . $msg["serialcirc_circ_list_reproduction_isdone_bt"] . " ' onClick=\"document.location='./catalog.php?categ=serials&sub=bulletinage&action=copy_isdone&bul_id=" . $bul_id . "';\" />";
            }
            $bul_cb_form = str_replace('!!bul_id!!', $bul_id, $bul_cb_form);
            $bul_cb_form = str_replace('!!etiquette!!', $etiquette_expl, $bul_cb_form);
            $bul_cb_form = str_replace('!!saisie_num_expl!!', $saisie_num_expl, $bul_cb_form);
            $bul_cb_form = str_replace('!!btn_ajouter!!', $btn_ajouter_expl, $bul_cb_form);
            $bul_cb_form = str_replace('!!btn_print_ask!!', $btn_print_ask, $bul_cb_form);
            $form .= "<div class='row'>" . $bul_cb_form . "</div>";
            // zone d'affichage des dépouillements
            $liste = get_analysis($bul_id);
            if ($liste) {
                $icones_exp .= $liste_debut . "&nbsp;<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title='" . $msg[400] . "' onClick=\"openPopUp('./cart.php?object_type=BULL&item=" . $bul_id . "&what=DEP', 'cart', 500, 400, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes')\">";
                $liste_dep = $liste;
                $liste_dep .= $liste_fin;
                // inclusion du javascript inline
                $liste_dep .= !$myBul->bull_num_notice ? $liste_script : "";
            } else {
                $icones_exp .= "";
                $liste_dep .= "<div class='row'>" . $msg['bulletin_no_analysis'] . "</div>";
            }
            $link_new_dep = "<input type='button' class='bouton' value=' {$msg['4021']} ' onClick=\"document.location='./catalog.php?categ=serials&sub=analysis&action=analysis_form&bul_id={$bul_id}&analysis_id=0';\" />";
            $form .= "\n\t\t\t\t<div class='depouillements-perio'>\n\t\t\t\t\t<h3>" . $msg[4013] . $icones_exp . " {$link_new_dep}</h3>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t{$liste_dep}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>";
            //reservations et previsions
            $rqt_nt = "select count(*) from exemplaires, bulletins, docs_statut where exemplaires.expl_statut=docs_statut.idstatut and bulletins.bulletin_id=exemplaires.expl_bulletin and pret_flag=1 and bulletins.bulletin_id=" . $bul_id;
            $result = pmb_mysql_query($rqt_nt, $dbh) or die($rqt_nt . " " . pmb_mysql_error());
            $nb_expl_reservables = pmb_mysql_result($result, 0, 0);
            $aff_resa = resa_list(0, $bul_id, 0);
            $ouvrir_reserv = "onclick=\"parent.location.href='./circ.php?categ=resa_from_catal&id_bulletin=" . $bul_id . "'; return(false) \"";
            if ($aff_resa) {
                $form .= "<b>" . $msg['resas'] . "</b><br />";
                if ($nb_expl_reservables) {
                    $form .= "<input type='button' class='bouton' value='" . $msg[351] . "' {$ouvrir_reserv}><br /><br />";
                }
                $form .= $aff_resa . "<br />";
            } else {
                if ($nb_expl_reservables) {
                    $form .= "<b>" . $msg['resas'] . "</b><br /><input type='button' class='bouton' value='" . $msg[351] . "' {$ouvrir_reserv}><br /><br />";
                }
            }
            if ($pmb_resa_planning) {
                $aff_resa_planning = planning_list(0, $bul_id, 0);
                //TODO
                $ouvrir_reserv = "onclick=\"parent.location.href='" . $base_path . "/circ.php?categ=resa_planning_from_catal&id_bulletin=" . $bul_id . "'; return(false) \"";
                if ($aff_resa_planning) {
                    $form .= "<b>" . $msg['resas_planning'] . "</b><br />";
                    if ($nb_expl_reservables) {
                        $form .= "<input type='button' class='bouton' value='" . $msg['resa_planning_add'] . "' {$ouvrir_reserv}><br /><br />";
                    }
                    $form .= $aff_resa_planning . "<br />";
                } else {
                    if ($nb_expl_reservables && !($categ == "resa_planning") && !$id_empr && $nb_expl_reservables) {
                        $form .= "<b>" . $msg['resas_planning'] . "</b><br /><input type='button' class='bouton' value='" . $msg['resa_planning_add'] . "' {$ouvrir_reserv}><br /><br />";
                    }
                }
            }
        } else {
            $form .= "<div class='notice-parent' id='_bull_'>\n\t\t\t\t\t\t<img hspace='3' border='0' onclick=\"expandBase('_bull_', true); return false;\" title='" . $msg['plus_detail'] . "' id='_bull_Img' name='imEx' class='img_plus' src='" . $base_path . "/images/minus.gif' />\n\t\t\t\t\t\t<span class='notice-heada'>" . htmlentities($myBul->tit1 . '.' . $txt_drag, ENT_QUOTES, $charset);
            if ($bul_titre) {
                $form .= " : " . htmlentities($bul_titre, ENT_QUOTES, $charset);
            }
            $form .= "\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style='margin-bottom: 6px; display: none; width: 94%;' class='notice-child' id='_bull_Child'>\n\t\t\t\t\t\t<br /><b>" . htmlentities($msg[4012], ENT_QUOTES, $charset) . "</b>\n\t\t\t\t\t\t{$affichage_expl}\n\t\t\t\t\t\t<br ><b>" . htmlentities($msg['explnum_docs_associes'], ENT_QUOTES, $charset) . "</b>\n\t\t\t\t\t\t{$aff_expl_num};\n\t\t\t\t\t</div>";
        }
        /**
         * TODO : onglets 
         */
        if ($myBul->bull_num_notice) {
            $template_path_records_tabs = "./includes/templates/records/records_elements_tabs.html";
            if (file_exists("./includes/templates/records/records_elements_tabs_subst.html")) {
                $template_path_records_tabs = "./includes/templates/records/records_elements_tabs_subst.html";
            }
            if (file_exists($template_path_records_tabs)) {
                $h2o_record_tabs = new H2o($template_path_records_tabs);
                $records_tabs = new records_tabs(new notice($myBul->bull_num_notice));
                $records_list_ui = $records_tabs->get_record()->get_records_list_ui();
                if ($records_list_ui) {
                    $records_list_ui->set_current_url($pmb_url_base . 'catalog.php?categ=' . $categ . '&bul_id=' . $myBul->bulletin_id . '&sub=' . $sub . '&action=' . $action . '&quoi=' . $quoi);
                }
                $form .= $h2o_record_tabs->render(array('records_tabs' => $records_tabs, 'bulletin_id' => $myBul->bulletin_id));
            }
        }
    }
    return $form;
}
示例#21
0
<?php

require '../h2o/h2o.php';
require '../templates/menu_sections.php';
h2o::load('i18n');
$var_template = 'jobs.html';
$var_title = 'Empleo';
$active_section = 'Jobs';
//Values= Names on ../templates/menu_sections.php
$template = new H2o('../templates/' . $var_template, array('cache_dir' => dirname(__FILE__), 'searchpath' => 'h2o'));
echo $template->render(array('title' => $var_title, 'menu_items' => $menu_sections, 'active_section' => $active_section));
示例#22
0
 public function render($context = array())
 {
     $template_path = "./includes/templates/authorities/" . $this->get_string_type_object() . ".html";
     if (file_exists("./includes/templates/authorities/" . $this->get_string_type_object() . "_subst.html")) {
         $template_path = "./includes/templates/authorities/" . $this->get_string_type_object() . "_subst.html";
     }
     if (file_exists($template_path)) {
         $h2o = new H2o($template_path);
         $h2o->addLookup(array($this, "lookup"));
         echo $h2o->render($context);
     }
 }
示例#23
0
<?php

require '../../h2o/h2o.php';
require '../../templates/menu_sections.php';
h2o::load('i18n');
$var_template = 'survey.html';
$var_title = 'Community Survey';
//None in this case
#$active_section= 'Community'; //Values= Names on ../templates/menu_sections.php
$template = new H2o('../../templates/' . $var_template, array());
echo $template->render(array('title' => $var_title, 'menu_items' => $menu_sections));
示例#24
0
            $num_exemplaire_auto .= " >";
        }
        $etiquette_expl = "<label class='etiquette' for='form_cb'>{$msg['291']}</label>";
        $btn_ajouter_expl = "<input type='submit' class='bouton' value=' {$msg['expl_ajouter']} ' onClick=\"return test_form(this.form)\">";
        $saisie_num_expl = "<input type='text' class='saisie-20em' name='noex' value=''>" . $num_exemplaire_auto;
    }
    $expl_new = str_replace('!!etiquette!!', $etiquette_expl, $expl_new);
    $expl_new = str_replace('!!saisie_num_expl!!', $saisie_num_expl, $expl_new);
    $expl_new = str_replace('!!btn_ajouter!!', $btn_ajouter_expl, $expl_new);
    $expl_new = str_replace('!!id!!', $id, $expl_new);
    print "<div class=\"row\">";
    print $expl_new;
    print "</div>";
    if ($categ == 'update') {
        //Modification de la globale categ pour ne pas retomber dans le cas update au changement de page affichage onglet
        $categ = 'isbd';
    }
    $template_path_records_tabs = "./includes/templates/records/records_elements_tabs.html";
    if (file_exists("./includes/templates/records/records_elements_tabs_subst.html")) {
        $template_path_records_tabs = "./includes/templates/records/records_elements_tabs_subst.html";
    }
    if (file_exists($template_path_records_tabs)) {
        $h2o_record_tabs = new H2o($template_path_records_tabs);
        $records_tabs = new records_tabs(new notice($isbd->notice_id));
        $records_list_ui = $records_tabs->get_record()->get_records_list_ui();
        if ($records_list_ui) {
            $records_list_ui->set_current_url($pmb_url_base . 'catalog.php?categ=' . $categ . '&id=' . $isbd->notice_id . '&quoi=' . $quoi);
        }
        print $h2o_record_tabs->render(array('records_tabs' => $records_tabs));
    }
}