function getone()
 {
     global $__in, $__out;
     $translation = new translation();
     $__out['translation'] = $translation->get_one_by_key($__in['key']);
     return true;
 }
 /**
  * Template translation parsing
  *
  * @param array $matches
  * @return string
  */
 private function translationReplacer($matches)
 {
     $retval = $matches[1];
     $retval = mb_substr($retval, 3, -1);
     $retval = $this->translation->get($retval);
     return $retval;
 }
Exemplo n.º 3
0
 /**
  * RPM permission
  */
 public function permission($do = null, $id = null)
 {
     $response = null;
     $arrTplParams = array();
     $request = $this->getRequest();
     // permission home
     if (is_null($do)) {
         $arrGridPrepare = array();
         $arrTplParams['grid'] = translation::getTranslations($arrGridPrepare, $request->getParam(), $render = true);
         // check for ajax grid request
         if (!$request->isAjax()) {
             $template = $this->template('rpm/permission/index.tpl.php', $arrTplParams);
             $response = $this->response($template);
         } else {
             $response = $this->response($arrTplParams['grid']);
         }
     } else {
         if ($do == 'add') {
         }
     }
     return $response;
 }
Exemplo n.º 4
0
 function get_link()
 {
     global $dbh, $onglet_persopac, $launch_search;
     global $opac_view_filter_class;
     //$myQuery = pmb_mysql_query("SELECT * FROM search_persopac order by search_name ", $dbh);
     $myQuery = pmb_mysql_query("SELECT search_persopac.*, group_concat(id_categ_empr) as categ_restrict FROM search_persopac left join search_persopac_empr_categ on id_search_persopac = search_id group by search_id order by search_name ", $dbh);
     $this->search_persopac_list = array();
     $link = "";
     if (pmb_mysql_num_rows($myQuery)) {
         $i = 0;
         //on récupère la catégorie du lecteur...
         if ($_SESSION['id_empr_session']) {
             $req = "select empr_categ from empr where id_empr = " . $_SESSION['id_empr_session'];
             $res = pmb_mysql_query($req);
             if (pmb_mysql_num_rows($res)) {
                 $empr_categ = pmb_mysql_result($res, 0, 0);
             } else {
                 $empr_categ = 0;
             }
         } else {
             $empr_categ = 0;
         }
         while ($r = pmb_mysql_fetch_object($myQuery)) {
             if ($opac_view_filter_class) {
                 if (!$opac_view_filter_class->is_selected("search_perso", $r->search_id)) {
                     continue;
                 }
             }
             $empr_categ_restrict = $r->categ_restrict != '' ? explode(",", $r->categ_restrict) : array();
             if (count($empr_categ_restrict) == 0 || in_array($empr_categ, $empr_categ_restrict)) {
                 $name = translation::get_text($r->search_id, "search_persopac", "search_name", $r->search_name);
                 $shortname = translation::get_text($r->search_id, "search_persopac", "search_shortname", $r->search_shortname);
                 if ($r->search_directlink) {
                     if ($shortname) {
                         $libelle = $shortname;
                     } else {
                         $libelle = $name;
                     }
                     $my_search = new search();
                     $backup_search = $my_search->serialize_search();
                     $my_search->unserialize_search($r->search_query);
                     $forms_search .= "\n" . $my_search->make_hidden_search_form("./index.php?search_type_asked=extended_search&onglet_persopac=" . $r->search_id . "&limitsearch=" . $r->search_limitsearch, "search_form" . $r->search_id) . "\n";
                     $my_search->destroy_global_env();
                     $my_search->unserialize_search($backup_search);
                     if ($onglet_persopac == $r->search_id) {
                         $li_id = " id='current' ";
                         if (!$r->search_limitsearch || !$launch_search) {
                             $lien = $libelle;
                         } else {
                             $lien = "<a href=\"javascript:document.forms['search_form" . $r->search_id . "'].submit();\">" . $libelle . "</a>";
                         }
                     } else {
                         $li_id = "";
                         $lien = "<a href=\"javascript:document.forms['search_form" . $r->search_id . "'].submit();\">" . $libelle . "</a>";
                     }
                     $link .= "\n\t\t\t\t\t\t<li {$li_id} >\n\t\t\t\t\t\t\t{$lien}\t\n\t\t\t\t\t\t</li>";
                 }
                 $this->search_persopac_list[$i] = new stdClass();
                 $this->search_persopac_list[$i]->id = $r->search_id;
                 $this->search_persopac_list[$i]->name = $name;
                 $this->search_persopac_list[$i]->shortname = $shortname;
                 $this->search_persopac_list[$i]->query = $r->search_query;
                 $this->search_persopac_list[$i]->human = $r->search_human;
                 $this->search_persopac_list[$i]->directlink = $r->search_directlink;
                 $this->search_persopac_list[$i]->limitsearch = $r->search_limitsearch;
                 $i++;
             }
         }
     }
     $this->directlink_user = $link;
     $this->directlink_user_form = $forms_search;
     return true;
 }
Exemplo n.º 5
0
if (!$config) {
    echo HTML_FONT_ERROR . 'Öffnen oder Lesen der Konfigurations-Datei nicht möglich. Lansuite wird beendet.' . HTML_NEWLINE . "\n      Überprüfe die Datei <b>config.php</b> im Verzeichnis inc/base/" . HTML_FONT_END;
    error_log('Öffnen oder Lesen der Konfigurations-Datei inc/base/config.php nicht möglich');
    exit;
}
### Include and Initialize base classes
$lang = array();
// For old $lang
if ($config['lansuite']['debugmode'] > 0) {
    include_once "inc/classes/class_debug.php";
    // Debug initialisieren
    $debug = new debug($config['lansuite']['debugmode']);
}
include_once "inc/classes/class_translation.php";
// Load Translationclass. No t()-Function before this point!
$translation = new translation();
include_once 'ext_scripts/smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = '.';
$smarty->compile_dir = './ext_inc/templates_c/';
$smarty->cache_dir = './ext_inc/templates_cache/';
$smarty->caching = false;
$smarty->cache_lifetime = 0;
// sec
#$smarty->compile_check = 0;
if (isset($debug)) {
    $debug->tracker("Include and Init Smarty");
}
include_once "inc/classes/class_display.php";
// Display Functions (to load the lansuite-templates)
$dsp = new display();
Exemplo n.º 6
0
function ajax_translation_recreate($param) {
  if(!lang_code_check($param['lang']))
    return false;

  $t=new translation($param['lang']);

  $ret=array();
  $data=$t->read();
  foreach($data as $file=>$d) {
    $ret[$file]=array();
  }

  $t->save($ret, array("msg"=>"Updated translation {$param['lang']} to the newest version"));
}
Exemplo n.º 7
0
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "DocsWell_Session"));
// Disabling cache
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// HTTP/1.0
require "./include/config.inc";
require "./include/lib.inc";
require "./include/translation.inc";
require "./include/lang.inc";
require "./include/box.inc";
$t = new translation($la);
$db = new DB_DocsWell();
$bx = new box("95%", $th_box_frame_color, 0, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta http-equiv="expires" content="0">
   <meta http-equiv="Refresh" content="1200; URL=<?php 
echo $sys_url . "sitebar.php";
?>
">
   <title><?php 
echo $sys_name;
?>
 function do_form()
 {
     global $msg, $tpl_search_persopac_form, $charset, $base_path;
     global $thesaurus_liste_trad;
     global $id_search_persopac;
     $this->load_xml();
     // titre formulaire
     $my_search = new search(false, "search_fields_opac", "{$base_path}/temp/");
     if ($this->id) {
         $libelle = $msg["search_persopac_form_edit"];
         $link_delete = "<input type='button' class='bouton' value='" . $msg[63] . "' onClick=\"confirm_delete();\" />";
         $button_modif_requete = "<input type='button' class='bouton' value=\"" . $msg["search_perso_modif_requete"] . "\" onClick=\"document.modif_requete_form_" . $this->id . ".submit();\">";
         //Mémorisation de recherche prédéfinie en édition
         if ($id_search_persopac) {
             $this->query = $my_search->serialize_search();
             $this->human = $my_search->make_human_query();
             $my_search->unserialize_search($this->query);
         } else {
             $my_search->unserialize_search($this->query);
             $this->query = $my_search->serialize_search();
             $this->human = $my_search->make_human_query();
         }
         $form_modif_requete = $this->make_hidden_search_form();
     } else {
         $libelle = $msg["search_persopac_form_add"];
         $link_delete = "";
         $button_modif_requete = "";
         $form_modif_requete = "";
         $this->query = $my_search->serialize_search();
         $this->human = $my_search->make_human_query();
     }
     // Champ éditable
     $tpl_search_persopac_form = str_replace('!!id!!', htmlentities($this->id, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $trans = new translation($this->id, "search_persopac", "search_name", $thesaurus_liste_trad);
     $field_name = $trans->get_form($msg["search_persopac_form_name"], "form_nom", "name", $this->name, "saisie-80em");
     $tpl_search_persopac_form = str_replace('!!name!!', $field_name, $tpl_search_persopac_form);
     $trans = new translation($this->id, "search_persopac", "search_shortname", $thesaurus_liste_trad);
     $field_name = $trans->get_form($msg["search_persopac_form_shortname"], "shortname", "shortname", $this->shortname, "saisie-80em");
     $tpl_search_persopac_form = str_replace('!!shortname!!', $field_name, $tpl_search_persopac_form);
     $checked = '';
     if ($this->directlink) {
         $checked = " checked='checked' ";
     }
     $tpl_search_persopac_form = str_replace('!!directlink!!', $checked, $tpl_search_persopac_form);
     $checked = '';
     if ($this->limitsearch) {
         $checked = " checked='checked' ";
     }
     $tpl_search_persopac_form = str_replace('!!limitsearch!!', $checked, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!query!!', htmlentities($this->query, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!human!!', htmlentities($this->human, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $action = "./admin.php?categ=opac&sub=search_persopac&section=liste&action=collstate_update&serial_id=" . $this->serial_id . "&id=" . $this->id;
     $tpl_search_persopac_form = str_replace('!!action!!', $action, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!delete!!', $link_delete, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!libelle!!', htmlentities($libelle, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $link_annul = "onClick=\"unload_off();history.go(-1);\"";
     $tpl_search_persopac_form = str_replace('!!annul!!', $link_annul, $tpl_search_persopac_form);
     //restriction aux catégories de lecteur
     $requete = "SELECT id_categ_empr, libelle FROM empr_categ ORDER BY libelle ";
     $res = pmb_mysql_query($requete);
     if (pmb_mysql_num_rows($res) > 0) {
         $categ = "\n\t\t\t<label for='empr_restrict'>" . $msg['search_perso_form_user_restrict'] . "</label><br />\n\t\t\t<select id='empr_restrict' name='empr_restrict[]' multiple>";
         while ($obj = pmb_mysql_fetch_object($res)) {
             $categ .= "\n\t\t\t\t<option value='" . $obj->id_categ_empr . "' " . (in_array($obj->id_categ_empr, $this->empr_categ_restrict) ? "selected=selected" : "") . ">" . $obj->libelle . "</option>";
         }
         $categ .= "\n\t\t\t</select>";
     } else {
         $categ = "";
     }
     $tpl_search_persopac_form = str_replace('!!categorie!!', $categ, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!requete!!', htmlentities($this->query, ENT_QUOTES, $charset), $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!requete_human!!', $this->human, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!bouton_modif_requete!!', $button_modif_requete, $tpl_search_persopac_form);
     $tpl_search_persopac_form = str_replace('!!form_modif_requete!!', $form_modif_requete, $tpl_search_persopac_form);
     return $tpl_search_persopac_form;
 }
 /**
  * displays a login screen
  *
  * @param string $extra_vars for login url
  */
 function login_screen($extra_vars)
 {
     $tmpl = new Template($GLOBALS['egw_info']['server']['template_dir']);
     $tmpl->set_file(array('login_form' => 'login.tpl'));
     $tmpl->set_var('lang_message', $GLOBALS['loginscreenmessage']);
     $last_loginid = $_COOKIE['last_loginid'];
     if ($GLOBALS['egw_info']['server']['show_domain_selectbox']) {
         foreach ($GLOBALS['egw_domain'] as $domain => $data) {
             $domains[$domain] = $domain;
         }
         $tmpl->set_var(array('lang_domain' => lang('domain'), 'select_domain' => html::select('logindomain', $_COOKIE['last_domain'], $domains, true, 'tabindex="2"')));
     } else {
         /* trick to make domain section disapear */
         $tmpl->set_block('login_form', 'domain_selection');
         $tmpl->set_var('domain_selection', $GLOBALS['egw_info']['user']['domain'] ? html::input_hidden('logindomain', $GLOBALS['egw_info']['user']['domain']) : '');
         if ($last_loginid !== '') {
             reset($GLOBALS['egw_domain']);
             list($default_domain) = each($GLOBALS['egw_domain']);
             if ($_COOKIE['last_domain'] != $default_domain && !empty($_COOKIE['last_domain'])) {
                 $last_loginid .= '@' . $_COOKIE['last_domain'];
             }
         }
     }
     $config_reg = config::read('registration');
     if ($config_reg['enable_registration'] == 'True') {
         if ($config_reg['register_link'] == 'True') {
             $reg_link = '&nbsp;<a href="' . $GLOBALS['egw']->link('/registration/index.php', 'lang_code=' . $_GET['lang']) . '">' . lang('Not a user yet? Register now') . '</a><br/>';
         }
         if ($config_reg['lostpassword_link'] == 'True') {
             $lostpw_link = '&nbsp;<a href="' . $GLOBALS['egw']->link('/registration/index.php', 'menuaction=registration.uireg.lostpw_step1_ask_login&lang_code=' . $_GET['lang']) . '">' . lang('Lost password') . '</a><br/>';
         }
         if ($config_reg['lostid_link'] == 'True') {
             $lostid_link = '&nbsp;<a href="' . $GLOBALS['egw']->link('/registration/index.php', 'menuaction=registration.uireg.lostid_step1_ask_email&lang_code=' . $_GET['lang']) . '">' . lang('Lost Login Id') . '</a><br/>';
         }
         /* if at least one option of "registration" is activated display the registration section */
         if ($config_reg['register_link'] == 'True' || $config_reg['lostpassword_link'] == 'True' || $config_reg['lostid_link'] == 'True') {
             $tmpl->set_var(array('register_link' => $reg_link, 'lostpassword_link' => $lostpw_link, 'lostid_link' => $lostid_link));
         } else {
             /* trick to make registration section disapear */
             $tmpl->set_block('login_form', 'registration');
             $tmpl->set_var('registration', '');
         }
     }
     $tmpl->set_var('login_url', $GLOBALS['egw_info']['server']['webserver_url'] . '/login.php' . $extra_vars);
     $tmpl->set_var('version', $GLOBALS['egw_info']['server']['versions']['phpgwapi']);
     $tmpl->set_var('cd', check_logoutcode($_GET['cd']));
     $tmpl->set_var('cookie', $last_loginid);
     $tmpl->set_var('lang_username', lang('username'));
     $tmpl->set_var('lang_password', lang('password'));
     $tmpl->set_var('lang_login', lang('login'));
     $tmpl->set_var('website_title', $GLOBALS['egw_info']['server']['site_title']);
     $tmpl->set_var('template_set', $this->template);
     if (substr($GLOBALS['egw_info']['server']['login_logo_file'], 0, 4) == 'http' || strpos($GLOBALS['egw_info']['server']['login_logo_file'], '//') !== false) {
         $var['logo_file'] = $GLOBALS['egw_info']['server']['login_logo_file'];
     } else {
         $var['logo_file'] = common::image('phpgwapi', $GLOBALS['egw_info']['server']['login_logo_file'] ? $GLOBALS['egw_info']['server']['login_logo_file'] : 'logo');
     }
     $var['logo_url'] = $GLOBALS['egw_info']['server']['login_logo_url'] ? $GLOBALS['egw_info']['server']['login_logo_url'] : 'http://www.eGroupWare.org';
     if (substr($var['logo_url'], 0, 4) != 'http') {
         $var['logo_url'] = 'http://' . $var['logo_url'];
     }
     $var['logo_title'] = $GLOBALS['egw_info']['server']['login_logo_title'] ? $GLOBALS['egw_info']['server']['login_logo_title'] : 'www.eGroupWare.org';
     $tmpl->set_var($var);
     /* language section if activated in site config */
     if (@$GLOBALS['egw_info']['server']['login_show_language_selection']) {
         $tmpl->set_var(array('lang_language' => lang('Language'), 'select_language' => html::select('lang', $GLOBALS['egw_info']['user']['preferences']['common']['lang'], translation::get_installed_langs(), true, 'tabindex="1"')));
     } else {
         $tmpl->set_block('login_form', 'language_select');
         $tmpl->set_var('language_select', '');
     }
     /********************************************************\
     		* Check if authentification via cookies is allowed       *
     		* and place a time selectbox, how long cookie is valid   *
     		\********************************************************/
     if ($GLOBALS['egw_info']['server']['allow_cookie_auth']) {
         $tmpl->set_block('login_form', 'remember_me_selection');
         $tmpl->set_var('lang_remember_me', lang('Remember me'));
         $tmpl->set_var('select_remember_me', html::select('remember_me', '', array('' => lang('not'), '1hour' => lang('1 Hour'), '1day' => lang('1 Day'), '1week' => lang('1 Week'), '1month' => lang('1 Month'), 'forever' => lang('Forever')), true, 'tabindex="3"'));
     } else {
         /* trick to make remember_me section disapear */
         $tmpl->set_block('login_form', 'remember_me_selection');
         $tmpl->set_var('remember_me_selection', '');
     }
     $tmpl->set_var('autocomplete', $GLOBALS['egw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : '');
     $GLOBALS['egw']->js->set_onload('document.login_form.login.focus();');
     $this->render($tmpl->fp('loginout', 'login_form'), false, false);
 }
Exemplo n.º 10
0
// HTTP/1.1
header("Pragma: no-cache");
// HTTP/1.0
require "./include/config.inc";
require "./include/newlib.inc";
require "./include/entlib.inc";
require "./include/conlib.inc";
require "./include/svclib.inc";
require "./include/prolib.inc";
require "./include/sollib.inc";
require "./include/cuslib.inc";
require "./include/cmtlib.inc";
require "./include/translation.inc";
require "./include/lang.inc";
require "./include/box.inc";
$t = new translation($la);
$db = new DB_SourceBiz();
$bx = new box("95%", $th_box_frame_color, 0, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta http-equiv="expires" content="0">
   <meta http-equiv="Refresh" content="1200; URL=<?php 
echo $sys_url . "sitebar.php";
?>
">
   <title><?php 
echo $sys_name;
?>