static function generate_select($auth_bit, $array_auth = array(), $array_ranks_default = array(), $idselect = '', $disabled = '', $disabled_advanced_auth = false) { global $Sql, $LANG, $CONFIG, $array_ranks, $Group; $array_ranks = is_array($array_ranks) ? $array_ranks : array('-1' => $LANG['guest'], '0' => $LANG['member'], '1' => $LANG['modo'], '2' => $LANG['admin']); $idselect = (string) $idselect == '' ? $auth_bit : $idselect; $Template = new Template('framework/groups_auth.tpl'); $Template->assign_vars(array('C_NO_ADVANCED_AUTH' => $disabled_advanced_auth ? true : false, 'C_ADVANCED_AUTH' => $disabled_advanced_auth ? false : true, 'THEME' => get_utheme(), 'PATH_TO_ROOT' => TPL_PATH_TO_ROOT, 'IDSELECT' => $idselect, 'DISABLED_SELECT' => empty($disabled) ? 'if (disabled == 0)' : '', 'L_USERS' => $LANG['member_s'], 'L_ADD_USER' => $LANG['add_member'], 'L_REQUIRE_PSEUDO' => addslashes($LANG['require_pseudo']), 'L_RANKS' => $LANG['ranks'], 'L_GROUPS' => $LANG['groups'], 'L_GO' => $LANG['go'], 'L_ADVANCED_AUTHORIZATION' => $LANG['advanced_authorization'], 'L_SELECT_ALL' => $LANG['select_all'], 'L_SELECT_NONE' => $LANG['select_none'], 'L_EXPLAIN_SELECT_MULTIPLE' => $LANG['explain_select_multiple'])); ##### Génération d'une liste à sélection multiple des rangs et membres ##### //Liste des rangs $j = -1; foreach ($array_ranks as $idrank => $group_name) { //Si il s'agit de l'administrateur, il a automatiquement l'autorisation if ($idrank == 2) { $Template->assign_block_vars('ranks_list', array('ID' => $j, 'IDRANK' => $idrank, 'RANK_NAME' => $group_name, 'DISABLED' => '', 'SELECTED' => ' selected="selected"')); } else { $selected = ''; if (array_key_exists('r' . $idrank, $array_auth) && ((int) $array_auth['r' . $idrank] & (int) $auth_bit) !== 0 && empty($disabled)) { $selected = ' selected="selected"'; } $selected = isset($array_ranks_default[$idrank]) && $array_ranks_default[$idrank] === true && empty($disabled) ? 'selected="selected"' : $selected; $Template->assign_block_vars('ranks_list', array('ID' => $j, 'IDRANK' => $idrank, 'RANK_NAME' => $group_name, 'DISABLED' => !empty($disabled) ? 'disabled = "disabled" ' : '', 'SELECTED' => $selected)); } $j++; } foreach ($Group->get_groups_array() as $idgroup => $group_name) { $selected = ''; if (array_key_exists($idgroup, $array_auth) && ((int) $array_auth[$idgroup] & (int) $auth_bit) !== 0 && empty($disabled)) { $selected = ' selected="selected"'; } $Template->assign_block_vars('groups_list', array('IDGROUP' => $idgroup, 'GROUP_NAME' => $group_name, 'DISABLED' => $disabled, 'SELECTED' => $selected)); } ##### Génération du formulaire pour les autorisations membre par membre. ##### $array_auth_members = array(); if (is_array($array_auth)) { foreach ($array_auth as $type => $auth) { if (substr($type, 0, 1) == 'm') { if (array_key_exists($type, $array_auth) && ((int) $array_auth[$type] & (int) $auth_bit) !== 0) { $array_auth_members[$type] = $auth; } } } } $advanced_auth = count($array_auth_members) > 0; $Template->assign_vars(array('ADVANCED_AUTH_STYLE' => $advanced_auth ? 'display:block;' : 'display:none;')); if ($advanced_auth) { $result = $Sql->query_while("SELECT user_id, login\n\t\t\tFROM " . PREFIX . "member\n\t\t\tWHERE user_id IN(" . implode(str_replace('m', '', array_keys($array_auth_members)), ', ') . ")", __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { $Template->assign_block_vars('members_list', array('USER_ID' => $row['user_id'], 'LOGIN' => $row['login'])); } $Sql->query_close($result); } return $Template->parse(TEMPLATE_STRING_MODE); }
private function assign_template(Template $tpl) { $tpl->put('CONTENT', 'fruits:'); foreach ($this->fruits as $fruit) { $tpl->assign_block_vars('elements', array('NAME' => $fruit)); } }
private function generate_cell(HTMLTableRowCell $cell) { $cell_values = array('VALUE' => $cell->get_value(), 'C_COLSPAN' => $cell->is_multi_column(), 'COLSPAN' => $cell->get_colspan()); $this->add_css_vars($cell, $cell_values); $this->add_id_vars($cell, $cell_values); $this->tpl->assign_block_vars('row.cell', $cell_values); }
function get_search_form($args = null) { global $User, $MODULES, $Errorh, $CONFIG, $CONFIG_FORUM, $Cache, $CAT_FORUM, $LANG, $Sql; import('io/template'); $Tpl = new Template('forum/forum_search_form.tpl'); if (isset($MODULES['forum']) && $MODULES['forum']['activ'] == 1) { if (!$User->check_auth($MODULES['forum']['auth'], ACCESS_MODULE)) { $Errorh->handler('e_auth', E_USER_REDIRECT); } } require_once PATH_TO_ROOT . '/forum/forum_functions.php'; require_once PATH_TO_ROOT . '/forum/forum_defines.php'; load_module_lang('forum'); $Cache->load('forum'); $search = $args['search']; $idcat = !empty($args['ForumIdcat']) ? numeric($args['ForumIdcat']) : -1; $time = !empty($args['ForumTime']) ? numeric($args['ForumTime']) : 0; $where = !empty($args['ForumWhere']) ? strprotect($args['ForumWhere']) : 'all'; $colorate_result = !empty($args['ForumColorate_result']) ? true : false; $Tpl->assign_vars(array('L_DATE' => $LANG['date'], 'L_DAY' => $LANG['day'], 'L_DAYS' => $LANG['day_s'], 'L_MONTH' => $LANG['month'], 'L_MONTHS' => $LANG['month'], 'L_YEAR' => $LANG['year'], 'IS_SELECTED_30000' => $time == 30000 ? ' selected="selected"' : '', 'IS_SELECTED_1' => $time == 1 ? ' selected="selected"' : '', 'IS_SELECTED_7' => $time == 7 ? ' selected="selected"' : '', 'IS_SELECTED_15' => $time == 15 ? ' selected="selected"' : '', 'IS_SELECTED_30' => $time == 30 ? ' selected="selected"' : '', 'IS_SELECTED_180' => $time == 180 ? ' selected="selected"' : '', 'IS_SELECTED_360' => $time == 360 ? ' selected="selected"' : '', 'L_OPTIONS' => $LANG['options'], 'L_TITLE' => $LANG['title'], 'L_CONTENTS' => $LANG['content'], 'IS_TITLE_CHECKED' => $where == 'title' ? ' checked="checked"' : '', 'IS_CONTENTS_CHECKED' => $where == 'contents' ? ' checked="checked"' : '', 'IS_ALL_CHECKED' => $where == 'all' ? ' checked="checked"' : '', 'L_COLORATE_RESULTS' => $LANG['colorate_result'], 'IS_COLORATION_CHECKED' => $colorate_result ? 'checked="checked"' : '', 'L_CATEGORY' => $LANG['category'], 'L_ALL_CATS' => $LANG['all'], 'IS_ALL_CATS_SELECTED' => $idcat == '-1' ? ' selected="selected"' : '')); if (is_array($CAT_FORUM)) { foreach ($CAT_FORUM as $id => $key) { if ($User->check_auth($CAT_FORUM[$id]['auth'], READ_CAT_FORUM)) { $Tpl->assign_block_vars('cats', array('MARGIN' => $key['level'] > 0 ? str_repeat('----------', $key['level']) : '----', 'ID' => $id, 'L_NAME' => $key['name'], 'IS_SELECTED' => $id == $idcat ? ' selected="selected"' : '')); } } } return $Tpl->parse(TEMPLATE_STRING_MODE); }
function display($Template = false) { global $LANG, $Errorh; if (!is_object($Template) || strtolower(get_class($Template)) != 'template') { $Template = new Template('framework/builder/forms/fieldset.tpl'); } $Template->assign_vars(array('C_DISPLAY_WARNING_REQUIRED_FIELDS' => $this->fieldset_display_required, 'L_FORMTITLE' => $this->fieldset_title, 'L_REQUIRED_FIELDS' => $LANG['require'])); foreach ($this->fieldset_errors as $error) { $Template->assign_block_vars('errors', array('ERROR' => $Errorh->display($error['errstr'], $error['errno']))); } foreach ($this->fieldset_fields as $Field) { foreach ($Field->get_errors() as $error) { $Template->assign_block_vars('errors', array('ERROR' => $Errorh->display($error['errstr'], $error['errno']))); } $Template->assign_block_vars('fields', array('FIELD' => $Field->display())); } return $Template->parse(TEMPLATE_STRING_MODE); }
function display($Template = false) { global $LANG; if (!is_object($Template) || strtolower(get_class($Template)) != 'template') { $Template = new Template('framework/builder/forms/form.tpl'); } $Template->assign_vars(array('C_DISPLAY_PREVIEW' => $this->display_preview, 'C_DISPLAY_RESET' => $this->display_reset, 'FORMCLASS' => $this->form_class, 'U_FORMACTION' => $this->form_action, 'L_FORMNAME' => $this->form_name, 'L_FIELD_CONTENT_PREVIEW' => $this->field_identifier_preview, 'L_SUBMIT' => $this->form_submit, 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'])); foreach ($this->form_fieldsets as $Fieldset) { foreach ($Fieldset->get_fields() as $Field) { $field_required_alert = $Field->get_required_alert(); if (!empty($field_required_alert)) { $Template->assign_block_vars('check_form', array('FIELD_ID' => $Field->get_id(), 'FIELD_REQUIRED_ALERT' => str_replace('"', '\\"', $field_required_alert))); } } $Template->assign_block_vars('fieldsets', array('FIELDSET' => $Fieldset->display())); } return $Template->parse(TEMPLATE_STRING_MODE); }
function display() { $Template = new Template('framework/builder/forms/field_box.tpl'); $Template->assign_vars(array('ID' => $this->field_id, 'FIELD' => $this->field_options, 'L_FIELD_TITLE' => $this->field_title, 'L_EXPLAIN' => $this->field_sub_title, 'L_REQUIRE' => $this->field_required ? '* ' : '')); foreach ($this->field_options as $Option) { $Option->field_name = $this->field_name; $Template->assign_block_vars('field_options', array('OPTION' => $Option->display())); } return $Template->parse(TEMPLATE_STRING_MODE); }
function get_html_results(&$results, &$html_results, &$results_name) { global $CONFIG; $modules = new ModulesDiscoveryService(); $display_all_results = $results_name == 'all' ? true : false; $tpl_results = new Template('search/search_generic_pagination_results.tpl'); $tpl_results->assign_vars(array('RESULTS_NAME' => $results_name, 'C_ALL_RESULTS' => $display_all_results)); $nb_pages = round(count($results) / NB_RESULTS_PER_PAGE) + 1; $nb_results = count($results); if (!$display_all_results) { $module = $modules->get_module(strtolower($results_name)); $results_data = array(); $personnal_parse_results = $module->has_functionality('compute_search_results') && $module->has_functionality('parse_search_result'); if ($personnal_parse_results && $results_name != 'all') { $results_data = $module->functionality('compute_search_results', array('results' => $results)); $nb_results = min($nb_results, count($results_data)); } } for ($num_page = 0; $num_page < $nb_pages; $num_page++) { $tpl_results->assign_block_vars('page', array('NUM_PAGE' => $num_page, 'BLOCK_DISPLAY' => $num_page == 0 ? 'block' : 'none')); for ($i = 0; $i < NB_RESULTS_PER_PAGE; $i++) { $num_item = $num_page * NB_RESULTS_PER_PAGE + $i; if ($num_item >= $nb_results) { break; } if ($display_all_results || !$personnal_parse_results) { $tpl_result = new Template('search/search_generic_results.tpl'); if ($display_all_results) { $module = $modules->get_module($results[$num_item]['module']); $tpl_result->assign_vars(array('C_ALL_RESULTS' => true, 'L_MODULE_NAME' => $module->get_name())); } else { $tpl_result->assign_vars(array('C_ALL_RESULTS' => false, 'L_MODULE_NAME' => $module->get_name())); } $tpl_result->assign_vars(array('TITLE' => $results[$num_item]['title'], 'U_LINK' => url($results[$num_item]['link']))); $tpl_results->assign_block_vars('page.results', array('result' => $tpl_result->parse(TEMPLATE_STRING_MODE))); } else { $tpl_results->assign_block_vars('page.results', array('result' => $module->functionality('parse_search_result', $results_data[$num_item]))); } } } $html_results = $tpl_results->parse(TEMPLATE_STRING_MODE); }
function display() { $Template = new Template('framework/builder/forms/field_select.tpl'); if ($this->field_multiple) { $field = '<select name="' . $this->field_name . '[]" multiple="multiple">' . $this->field_options . '</select>'; } else { $field = '<select name="' . $this->field_name . '">' . $this->field_options . '</select>'; } $Template->assign_vars(array('ID' => $this->field_id, 'C_SELECT_MULTIPLE' => $this->field_multiple, 'L_FIELD_NAME' => $this->field_name, 'L_FIELD_TITLE' => $this->field_title, 'L_EXPLAIN' => $this->field_sub_title, 'L_REQUIRE' => $this->field_required ? '* ' : '')); foreach ($this->field_options as $Option) { $Option->field_name = $this->field_name; $Template->assign_block_vars('field_options', array('OPTION' => $Option->display())); } return $Template->parse(TEMPLATE_STRING_MODE); }
function afficher() { $html = ''; if ($this->existe()) { $t = new Template('modules/archi/templates/'); $t->set_filenames(array('afficherErreurs' => 'listeErreurs.tpl')); foreach ($this->array_erreurs as $message) { $t->assign_block_vars('erreur', array('message' => $message)); } ob_start(); $t->pparse('afficherErreurs'); $html = ob_get_contents(); ob_get_clean(); } return $html; }
exit; } } } include_once "class/Easy_Mail.class.php"; include_once "class/class.Erro.php"; $theme = "."; $model = new Template($theme); $model->set_filenames(array('cabecalho' => 'cabecalho.htm')); $model->assign_block_vars('sub_titulo', array()); if (isset($layout)){ switch ($layout){ case "inicio": $model->assign_vars(array('SUB_MENU_ATIVO' => "1")); // $model->assign_vars(array('MENU_1' => "current")); // $model->assign_block_vars('sub_titulo.sub_cadastro', array()); break; case "cadastro": $model->assign_vars(array('SUB_MENU_ATIVO' => "2")); // $model->assign_vars(array('MENU_1' => "current")); // $model->assign_block_vars('sub_titulo.sub_cadastro', array()); break; case "movimento": $model->assign_vars(array('SUB_MENU_ATIVO' => "3")); // $model->assign_vars(array('MENU_1' => "current"));
if ($session->isInSession('archiIdVilleGeneral') && $session->getFromSession('archiIdVilleGeneral') != '' && $session->getFromSession('archiIdVilleGeneral') != '1') { $arrayIdVilleGeneral['archiIdVilleGeneral'] = $session->getFromSession('archiIdVilleGeneral'); } $listPages = archiPage::getListMenu(LANG); $htmlListPages = ""; foreach ($listPages as $page) { $htmlListPages .= "<li><a href='index.php?archiAffichage=page&idPage=" . $page["id"] . "'>" . $page["title"] . "</a></li>"; } // liens $t->assign_vars(array('listeUtilisateurs' => $config->creerUrl('', 'utilisateurListe'), 'administration' => $config->creerUrl('', 'administration'), 'seDeconnecter' => $config->creerUrl('deconnexion', 'authentification'), 'recherche' => $config->creerUrl('', 'recherche'), 'edito' => $config->creerUrl('', 'edito'), 'quiSommesNous' => $config->creerUrl('', 'quiSommesNous'), 'faq' => $config->creerUrl('', 'faq'), 'inscription' => $config->creerUrl('', 'inscription'), 'listeDossiers' => $config->creerUrl('', 'listeDossiers', $arrayIdVilleGeneral), 'ajoutNouveauDossier' => $config->creerUrl('', 'ajoutNouveauDossier'), "ajoutNouvellePersonne" => $config->creerUrl("", "ajoutNouvelPersonne"), 'contact' => $config->creerUrl('', 'contact'), 'urlMotDePasseOublie' => $config->creerUrl('', 'formulaireMotDePasseOublie'), 'publiciteMedias' => $config->creerUrl('', 'publiciteArticlesPresse'), 'nosSources' => $config->creerUrl('', 'nosSources'), 'faireUnDon' => $config->creerUrl('', 'faireUnDon'), 'ajaxFunctions' => $ajax->getAjaxFunctions(), 'calqueFunctions' => "<script >" . $calque->getJSFunctionContextualHelp() . " " . $i->getJsSetOpacityFunction(array('noBalisesJs' => true)) . "</script>", 'titrePage' => stripslashes($titre), 'descriptionPage' => $description, 'motsCle' => $motsCle, 'urlCheminSite' => $recherche->getHtmlArborescence(), 'titreSite' => $titreSite, 'parcours' => $config->creerUrl('', 'parcours'), 'jsHeader' => $headerJS, "lang" => LANG, "lang_short" => substr(LANG, 0, 2), "listPages" => $htmlListPages, "urlOpendata" => $config->creerUrl('', 'lienOpendata'))); // headerJS = variables contenant le javascript recupéré des fonctions du site que l'on collecte et que l'on place dans la balise header $labelConnexion = _("Connexion"); $imgConnexion = "images/logo_connexion.png"; if ($authentification->estConnecte() !== true) { // utilisateur pas connecté $t->assign_block_vars('utilisateurNonConnecte', array()); if ($authentification->estConnecte()) { $t->assign_vars(array('etatConnexion' => _("Vous êtes connecté!"))); } else { $t->assign_vars(array('etatConnexion' => _("Vous n'êtes pas connecté"))); } $t->assign_vars(array('formulaireConnexion' => $authentification->afficheFormulaireAuthentification('compact'), 'formulaireRecherche' => $recherche->afficheFormulaire(array(), 0, array('noDisplayRechercheAvancee' => false, 'noDisplayCheckBoxResultatsCarte' => false)), 'inscriptionDeconnexion' => _("Inscrivez-vous !"), 'urlInscriptDeconnexion' => $config->creerUrl('', 'inscription'), 'urlAccueil' => $config->creerUrl('', 'afficheAccueil'), 'txtAccueil' => 'Accueil', 'classAuthLinkWrapper' => 'notConnectedAuthLink')); $t->assign_block_vars('linkConnected', array('authLinkOneClass' => ' authLinkOneClass forgetPasswordLabel', 'authLinkUrl' => $config->creerUrl('', 'formulaireMotDePasseOublie'), 'authLinkLabel' => 'Mot de passe oublié ?')); $t->assign_block_vars('linkConnected', array('authLinkOneClass' => 'authLinkTwoClass subscribeLabel', 'authLinkUrl' => $config->creerUrl('', 'inscription'), 'authLinkLabel' => 'Inscrivez-vous !')); } else { if ($authentification->estAdmin()) { $t->assign_block_vars('isAdmin', array()); } // utilisateur connecté $classFastConnect = "hidden"; $userId = $authentification->getIdUtilisateur();
/** * It Renders content according to Part['Type'] * * @author Fernando Ontiveros Lira <*****@*****.**> * * @param intPos = 0 * @return void * */ public function RenderContent0($intPos = 0, $showXMLFormName = false) { global $G_FORM; global $G_TABLE; global $G_TMP_TARGET; global $G_OP_MENU; global $G_IMAGE_FILENAME; global $G_IMAGE_PARTS; global $_SESSION; //Changed from $HTTP_SESSION_VARS global $G_OBJGRAPH; //For graphLayout component $this->intPos = $intPos; $Part = $this->Parts[$intPos]; $this->publishType = $Part['Type']; switch ($this->publishType) { case 'externalContent': $G_CONTENT = new Content(); if ($Part['Content'] != "") { $G_CONTENT = G::LoadContent($Part['Content']); } G::LoadTemplateExternal($Part['Template']); break; case 'image': $G_IMAGE_FILENAME = $Part['File']; $G_IMAGE_PARTS = $Part['Data']; break; case 'appform': global $APP_FORM; $G_FORM = $APP_FORM; break; case 'xmlform': case 'dynaform': global $G_FORM; if ($Part['AbsolutePath']) { $sPath = $Part['AbsolutePath']; } else { if ($this->publishType == 'xmlform') { $sPath = PATH_XMLFORM; } else { $sPath = PATH_DYNAFORM; } } //if the xmlform file doesn't exists, then try with the plugins folders if (!is_file($sPath . $Part['File'] . '.xml')) { $aux = explode(PATH_SEP, $Part['File']); //check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment if (count($aux) > 2) { //Subfolders $filename = array_pop($aux); $aux0 = implode(PATH_SEP, $aux); $aux = array(); $aux[0] = $aux0; $aux[1] = $filename; } if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) { $oPluginRegistry =& PMPluginRegistry::getSingleton(); if ($response = $oPluginRegistry->isRegisteredFolder($aux[0])) { if ($response !== true) { $sPath = PATH_PLUGINS . $response . PATH_SEP; } else { $sPath = PATH_PLUGINS; } } } } if (!class_exists($Part['Template']) || $Part['Template'] === 'xmlform') { $G_FORM = new Form($Part['File'], $sPath, SYS_LANG, false); } else { eval('$G_FORM = new ' . $Part['Template'] . ' ( $Part[\'File\'] , "' . $sPath . '");'); } if ($this->publishType == 'dynaform' && ($Part['Template'] == 'xmlform' || $Part['Template'] == 'xmlform_preview')) { $dynaformShow = isset($G_FORM->printdynaform) && $G_FORM->printdynaform ? 'gulliver/dynaforms_OptionsPrint' : 'gulliver/dynaforms_Options'; $G_FORM->fields = G::array_merges(array('__DYNAFORM_OPTIONS' => new XmlForm_Field_XmlMenu(new Xml_Node('__DYNAFORM_OPTIONS', 'complete', '', array('type' => 'xmlmenu', 'xmlfile' => $dynaformShow, 'parentFormId' => $G_FORM->id)), SYS_LANG, PATH_XMLFORM, $G_FORM)), $G_FORM->fields); } //Needed to make ajax calls //The action in the form tag. if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') { $G_FORM->action = urlencode(G::encrypt($Part['Target'], URL_KEY)); } else { $G_FORM->action = $Part['Target']; } if (!(isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '')) { if ($this->publishType == 'dynaform') { $Part['ajaxServer'] = '../gulliver/defaultAjaxDynaform'; } else { $Part['ajaxServer'] = '../gulliver/defaultAjax'; } } if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') { $G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY)); } else { $G_FORM->ajaxServer = $Part['ajaxServer']; } $G_FORM->setValues($Part['Data']); $G_FORM->setValues(array('G_FORM_ID' => $G_FORM->id)); //Asegurese de que no entre cuando $Part['Template']=="grid" //de hecho soo deberia usarse cuando $Part['Template']=="xmlform" if ($this->publishType == 'dynaform' && $Part['Template'] == "xmlform" || $Part['Template'] == "xmlform") { $G_FORM->values = G::array_merges(array('__DYNAFORM_OPTIONS' => isset($Part['Data']['__DYNAFORM_OPTIONS']) ? $Part['Data']['__DYNAFORM_OPTIONS'] : ''), $G_FORM->values); if (isset($G_FORM->nextstepsave)) { switch ($G_FORM->nextstepsave) { // this condition validates if the next step link is configured to Save and Go the next step or show a prompt case 'save': // Save and Next only if there are no required fields can submit the form. $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {document.getElementById("' . $G_FORM->id . '").submit();}return false;'; break; case 'prompt': // Show Prompt only if there are no required fields can submit the form. $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {if(dynaFormChanged(document.getElementsByTagName(\'form\').item(0))) {new leimnud.module.app.confirm().make({label:"@G::LoadTranslation(ID_DYNAFORM_SAVE_CHANGES)", action:function(){document.getElementById("' . $G_FORM->id . '").submit();}.extend(this), cancel:function(){window.location = getField("DYN_FORWARD").href;}.extend(this)});return false;} else {window.location = getField("DYN_FORWARD").href;return false;}}return false;'; break; } } } if (isset($_SESSION)) { $_SESSION[$G_FORM->id] = $G_FORM->values; } // by default load the core template if ($Part['Template'] == 'xmlform_preview') { $Part['Template'] = 'xmlform'; } $template = PATH_CORE . 'templates/' . $Part['Template'] . '.html'; //erik: new feature, now templates such as xmlform.html can be personalized via skins if (defined('SYS_SKIN') && strtolower(SYS_SKIN) != 'classic') { // First, verify if the template exists on Custom skins path if (is_file(PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html')) { $template = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html'; //Second, verify if the template exists on base skins path } elseif (is_file(G::ExpandPath("skinEngine") . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html')) { $template = G::ExpandPath("skinEngine") . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html'; } } //end new feature if ($Part['Template'] == 'grid') { print '<form class="formDefault">'; } $scriptCode = ''; if ($this->localMode != '') { // @# las modification by erik in 09/06/2008 $G_FORM->mode = $this->localMode; } print $G_FORM->render($template, $scriptCode); if ($Part['Template'] == 'grid') { print '</form>'; } $oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher->addScriptFile($G_FORM->scriptURL); $oHeadPublisher->addScriptCode($scriptCode); /** * We've implemented the conditional show hide fields.. * * @author Erik A. Ortiz <*****@*****.**> * @date Fri Feb 19, 2009 */ if ($this->publishType == 'dynaform') { if (isset($_SESSION['CURRENT_DYN_UID']) || isset($_SESSION['CONDITION_DYN_UID'])) { require_once "classes/model/FieldCondition.php"; $oFieldCondition = new FieldCondition(); //This dynaform has show/hide field conditions if (isset($_SESSION['CURRENT_DYN_UID']) && $_SESSION['CURRENT_DYN_UID'] != '') { $ConditionalShowHideRoutines = $oFieldCondition->getConditionScript($_SESSION["CURRENT_DYN_UID"]); //lsl } else { if (isset($_SESSION['CONDITION_DYN_UID']) && $_SESSION['CONDITION_DYN_UID'] != '') { $ConditionalShowHideRoutines = $oFieldCondition->getConditionScript($_SESSION["CONDITION_DYN_UID"]); //lsl } } } } if (isset($ConditionalShowHideRoutines) && $ConditionalShowHideRoutines) { G::evalJScript($ConditionalShowHideRoutines); } break; case 'pagedtable': global $G_FORM; //if the xmlform file doesn't exists, then try with the plugins folders $sPath = PATH_XMLFORM; if (!is_file($sPath . $Part['File'])) { $aux = explode(PATH_SEP, $Part['File']); if (count($aux) == 2) { $oPluginRegistry =& PMPluginRegistry::getSingleton(); if ($oPluginRegistry->isRegisteredFolder($aux[0])) { $sPath = PATH_PLUGINS; // . $aux[0] . PATH_SEP ; } } } $G_FORM = new Form($Part['File'], $sPath, SYS_LANG, true); if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') { $G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY)); } else { $G_FORM->ajaxServer = $Part['ajaxServer']; } $G_FORM->setValues($Part['Data']); if (isset($_SESSION)) { $_SESSION[$G_FORM->id] = $G_FORM->values; } G::LoadSystem('pagedTable'); $oTable = new pagedTable(); $oTable->template = 'templates/' . $Part['Template'] . '.html'; $G_FORM->xmlform = ''; $G_FORM->xmlform->fileXml = $G_FORM->fileName; $G_FORM->xmlform->home = $G_FORM->home; $G_FORM->xmlform->tree->attribute = $G_FORM->tree->attributes; $G_FORM->values = array_merge($G_FORM->values, $Part['Data']); $oTable->setupFromXmlform($G_FORM); if (isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '') { $oTable->ajaxServer = $Part['ajaxServer']; } /* Start Block: Load user configuration for the pagedTable */ G::LoadClass('configuration'); $objUID = $Part['File']; $conf = new Configurations(); $conf->loadConfig($oTable, 'pagedTable', $objUID, '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '', ''); $oTable->__OBJ_UID = $objUID; /* End Block */ /* Start Block: PagedTable Right Click */ G::LoadClass('popupMenu'); $pm = new popupMenu('gulliver/pagedTable_PopupMenu'); $pm->name = $oTable->id; $fields = array_keys($oTable->fields); foreach ($fields as $f) { switch (strtolower($oTable->fields[$f]['Type'])) { case 'javascript': case 'button': case 'private': case 'hidden': case 'cellmark': break; default: $label = $oTable->fields[$f]['Label'] != '' ? $oTable->fields[$f]['Label'] : $f; $label = str_replace("\n", ' ', $label); $pm->fields[$f] = new XmlForm_Field_popupOption(new Xml_Node($f, 'complete', '', array('label' => $label, 'type' => 'popupOption', 'launch' => $oTable->id . '.showHideField("' . $f . '")'))); $pm->values[$f] = ''; } } $sc = ''; $pm->values['PAGED_TABLE_ID'] = $oTable->id; print $pm->render(PATH_CORE . 'templates/popupMenu.html', $sc); /* End Block */ $oTable->renderTable(); /* Start Block: Load PagedTable Right Click */ print '<script type="text/javascript">'; print $sc; print 'loadPopupMenu_' . $oTable->id . '();'; print '</script>'; /* End Block */ break; case 'propeltable': global $G_FORM; //if the xmlform file doesn't exists, then try with the plugins folders if ($Part['AbsolutePath']) { $sPath = ''; } else { $sPath = PATH_XMLFORM; } if (!is_file($sPath . $Part['File'])) { $aux = explode(PATH_SEP, $Part['File']); //search in PLUGINS folder, probably the file is in plugin if (count($aux) == 2) { $oPluginRegistry =& PMPluginRegistry::getSingleton(); if ($oPluginRegistry->isRegisteredFolder($aux[0])) { $sPath = PATH_PLUGINS; // . $aux[0] . PATH_SEP ; } } //search in PATH_DYNAFORM folder if (!is_file($sPath . PATH_SEP . $Part['File'] . '.xml')) { $sPath = PATH_DYNAFORM; } } //PATH_DATA_PUBLIC ??? if (!file_exists($sPath . PATH_SEP . $Part['File'] . '.xml') && defined('PATH_DATA_PUBLIC')) { $sPath = PATH_DATA_PUBLIC; } $G_FORM = new Form($Part['File'], $sPath, SYS_LANG, true); if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') { $G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY)); } else { $G_FORM->ajaxServer = $Part['ajaxServer']; } if (isset($_SESSION)) { $_SESSION[$G_FORM->id] = $G_FORM->values; } G::LoadClass('propelTable'); $oTable = new propelTable(); $oTable->template = $Part['Template']; $oTable->criteria = $Part['Content']; if (isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '') { $oTable->ajaxServer = $Part['ajaxServer']; } if (!isset($G_FORM->xmlform)) { $G_FORM->xmlform = new stdclass(); } $G_FORM->xmlform->fileXml = $G_FORM->fileName; $G_FORM->xmlform->home = $G_FORM->home; if (!isset($G_FORM->xmlform->tree)) { $G_FORM->xmlform->tree = new stdclass(); } $G_FORM->xmlform->tree->attribute = $G_FORM->tree->attributes; if (is_array($Part['Data'])) { $G_FORM->values = array_merge($G_FORM->values, $Part['Data']); } $oTable->setupFromXmlform($G_FORM); /* Start Block: Load user configuration for the pagedTable */ G::LoadClass('configuration'); $objUID = $Part['File']; $conf = new Configurations($oTable); $conf->loadConfig($oTable, 'pagedTable', $objUID, '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '', ''); $oTable->__OBJ_UID = $objUID; //$oTable->__OBJ_UID = ''; /* End Block */ /* Start Block: PagedTable Right Click */ G::LoadClass('popupMenu'); $pm = new popupMenu('gulliver/pagedTable_PopupMenu'); $sc = $pm->renderPopup($oTable->id, $oTable->fields); /* End Block */ //krumo ( $Part ); if ($this->ROWS_PER_PAGE) { $oTable->rowsPerPage = $this->ROWS_PER_PAGE; } try { if (is_array($Part['Data'])) { $oTable->renderTable('', $Part['Data']); } else { $oTable->renderTable(); } print $sc; } catch (Exception $e) { $aMessage['MESSAGE'] = $e->getMessage(); $this->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage); } break; case 'panel-init': global $mainPanelScript; global $panelName; global $tabCount; //G::LoadThirdParty( 'pear/json', 'class.json' ); //$json = new Services_JSON(); $tabCount = 0; $panelName = $Part['Template']; $data = $Part['File']; if (!is_array($data)) { $data = array(); } $data = G::array_merges(array('title' => '', 'style' => array(), 'left' => 'getAbsoluteLeft(mycontent)', 'top' => 'getAbsoluteTop(mycontent)', 'width' => 700, 'height' => 600, 'drag' => true, 'close' => true, 'modal' => true, 'roll' => false, 'resize' => false, 'tabWidth' => 120, 'tabStep' => 3, 'blinkToFront' => true, 'tabSpace' => 10), $data); $mainPanelScript = 'var ' . $panelName . '={},' . $panelName . 'Tabs=[];' . 'leimnud.event.add(window,"load",function(){' . $panelName . ' = new leimnud.module.panel();' . 'var mycontent=document.getElementById("' . $this->publisherId . '[' . $intPos . ']");' . $panelName . '.options={' . 'size:{w:' . $data['width'] . ',h:' . $data['height'] . '},' . 'position:{x:' . $data['left'] . ',y:' . $data['top'] . '},' . 'title:"' . addcslashes($data['title'], '\\"') . '",' . 'theme:"processmaker",' . 'statusBar:true,' . 'headerBar:true,' . 'control:{' . ' close:' . ($data['close'] ? 'true' : 'false') . ',' . ' roll:' . ($data['roll'] ? 'true' : 'false') . ',' . ' drag:' . ($data['drag'] ? 'true' : 'false') . ',' . ' resize:' . ($data['resize'] ? 'true' : 'false') . '},' . 'fx:{' . ' drag:' . ($data['drag'] ? 'true' : 'false') . ',' . ' modal:' . ($data['modal'] ? 'true' : 'false') . ',' . ' blinkToFront:' . ($data['blinkToFront'] ? 'true' : 'false') . '}' . '};' . $panelName . '.setStyle=' . Bootstrap::json_encode($data['style']) . ';' . $panelName . '.tab={' . 'width:' . ($data['tabWidth'] + $data['tabSpace']) . ',' . 'optWidth:' . $data['tabWidth'] . ',' . 'step :' . $data['tabStep'] . ',' . 'options:[]' . '};'; print ' '; break; case 'panel-tab': global $tabCount; global $mainPanelScript; global $panelName; $onChange = $Part['Content']; $beforeChange = $Part['Data']; if (SYS_LANG == 'es') { $mainPanelScript = str_replace("120", "150", $mainPanelScript); } else { $mainPanelScript = str_replace("150", "120", $mainPanelScript); } $mainPanelScript .= $panelName . 'Tabs[' . $tabCount . ']=' . 'document.getElementById("' . $Part['File'] . '");' . $panelName . '.tab.options[' . $panelName . '.tab.options.length]=' . '{' . 'title :"' . addcslashes($Part['Template'], '\\"') . '",' . 'noClear :true,' . 'content :function(){' . ($beforeChange != '' ? 'if (typeof(' . $beforeChange . ')!=="undefined") {' . $beforeChange . '();}' : '') . $panelName . 'Clear();' . $panelName . 'Tabs[' . $tabCount . '].style.display="";' . ($onChange != '' ? 'if (typeof(' . $onChange . ')!=="undefined") {' . $onChange . '();}' : '') . '}.extend(' . $panelName . '),' . 'selected:' . ($tabCount == 0 ? 'true' : 'false') . '};'; $tabCount++; break; case 'panel-close': global $mainPanelScript; global $panelName; global $tabCount; $mainPanelScript .= $panelName . '.make();'; $mainPanelScript .= 'for(var r=0;r<' . $tabCount . ';r++)' . 'if (' . $panelName . 'Tabs[r])' . $panelName . '.addContent(' . $panelName . 'Tabs[r]);'; $mainPanelScript .= '});'; $mainPanelScript .= 'function ' . $panelName . 'Clear(){'; $mainPanelScript .= 'for(var r=0;r<' . $tabCount . ';r++)' . 'if (' . $panelName . 'Tabs[r])' . $panelName . 'Tabs[r].style.display="none";}'; $oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher->addScriptCode($mainPanelScript); break; case 'blank': print ' '; break; case 'varform': global $G_FORM; $G_FORM = new Form(); G::LoadSystem("varform"); $xml = new varForm(); //$xml->parseFile ( ); $xml->renderForm($G_FORM, $Part['File']); $G_FORM->Values = $Part['Data']; $G_FORM->SetUp($Part['Target']); $G_FORM->width = 500; break; case 'table': $G_TMP_TARGET = $Part['Target']; $G_TABLE = G::LoadRawTable($Part['File'], $this->dbc, $Part['Data']); break; case 'menu': $G_TMP_TARGET = $Part['Target']; $G_OP_MENU = new Menu(); $G_OP_MENU->Load($Part['File']); break; case 'smarty': //To do: Please check it 26/06/07 $template = new Smarty(); $template->compile_dir = PATH_SMARTY_C; $template->cache_dir = PATH_SMARTY_CACHE; $template->config_dir = PATH_THIRDPARTY . 'smarty/configs'; $template->caching = false; $dataArray = $Part['Data']; // verify if there are templates folders registered, template and method folders are the same $folderTemplate = explode('/', $Part['Template']); $oPluginRegistry =& PMPluginRegistry::getSingleton(); if ($oPluginRegistry->isRegisteredFolder($folderTemplate[0])) { $template->templateFile = PATH_PLUGINS . $Part['Template'] . '.html'; } else { $template->templateFile = PATH_TPL . $Part['Template'] . '.html'; } // last change to load the template, maybe absolute path was given if (!is_file($template->templateFile)) { $template->templateFile = strpos($Part['Template'], '.html') !== false ? $Part['Template'] : $Part['Template'] . '.html'; } //assign the variables and use the template $template $template->assign($dataArray); print $template->fetch($template->templateFile); break; case 'template': //To do: Please check it 26/06/07 if (gettype($Part['Data']) == 'array') { G::LoadSystem('template'); //template phpBB $template = new Template(); $template->set_filenames(array('body' => $Part['Template'] . '.html')); $dataArray = $Part['Data']; if (is_array($dataArray)) { foreach ($dataArray as $key => $val) { if (is_array($val)) { foreach ($val as $key_val => $val_array) { $template->assign_block_vars($key, $val_array); } } else { $template->assign_vars(array($key => $val)); } } } $template->pparse('body'); } if (gettype($Part['Data']) == 'object' && strtolower(get_class($Part['Data'])) == 'templatepower') { $Part['Data']->printToScreen(); } return; break; case 'view': case 'content': //check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment $aux = explode(PATH_SEP, $Part['Template']); if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) { //if the template doesn't exists, then try it with the plugins folders, after the normal Template $userTemplate = G::ExpandPath('templates') . $Part['Template']; $globalTemplate = PATH_TEMPLATE . $Part['Template']; if (!is_file($userTemplate) && !is_file($globalTemplate)) { $oPluginRegistry =& PMPluginRegistry::getSingleton(); if ($oPluginRegistry->isRegisteredFolder($aux[0])) { $pluginTemplate = PATH_PLUGINS . $Part['Template'] . '.php'; include $pluginTemplate; } } } break; case 'graphLayout': //Added by JHL to render GraphLayout component $G_OBJGRAPH = $Part['Data']; $G_TMP_TARGET = $Part['Target']; $G_TMP_FILE = $Part['File']; break; } //krumo( $Part['Template'] ); //check if this LoadTemplate is used, byOnti 12th Aug 2008 G::LoadTemplate($Part['Template']); $G_TABLE = null; }
function get_home_page() { global $Sql, $User, $Template, $Cache, $Bread_crumb, $_WIKI_CONFIG, $_WIKI_CATS, $LANG; load_module_lang('wiki'); include_once '../wiki/wiki_functions.php'; $bread_crumb_key = 'wiki'; require_once '../wiki/wiki_bread_crumb.php'; unset($Template); $Template = new Template(); $Template->set_filenames(array('wiki' => 'wiki/wiki.tpl', 'index' => 'wiki/index.tpl')); $Template->assign_vars(array('WIKI_PATH' => $Template->get_module_data_path('wiki'))); if ($_WIKI_CONFIG['last_articles'] > 1) { $result = $Sql->query_while("SELECT a.title, a.encoded_title, a.id\n\t\t\tFROM " . PREFIX . "wiki_articles a\n\t\t\tLEFT JOIN " . PREFIX . "wiki_contents c ON c.id_contents = a.id_contents\n\t\t\tWHERE a.redirect = 0\n\t\t\tORDER BY c.timestamp DESC\n\t\t\tLIMIT 0, " . $_WIKI_CONFIG['last_articles'], __LINE__, __FILE__); $articles_number = $Sql->num_rows($result, "SELECT COUNT(*) FROM " . PREFIX . "wiki_articles WHERE encoded_title = '" . $encoded_title . "'", __LINE__, __FILE__); $Template->assign_block_vars('last_articles', array('L_ARTICLES' => $LANG['wiki_last_articles_list'], 'RSS' => $articles_number > 0 ? '<a href="{PATH_TO_ROOT}/syndication.php?m=wiki"><img src="../templates/' . get_utheme() . '/images/rss.png" alt="RSS" /></a>' : '')); $i = 0; while ($row = $Sql->fetch_assoc($result)) { $Template->assign_block_vars('last_articles.list', array('ARTICLE' => $row['title'], 'TR' => $i > 0 && $i % 2 == 0 ? '</tr><tr>' : '', 'U_ARTICLE' => url('wiki.php?title=' . $row['encoded_title'], $row['encoded_title']))); $i++; } if ($articles_number == 0) { $Template->assign_vars(array('L_NO_ARTICLE' => '<td style="text-align:center;" class="row2">' . $LANG['wiki_no_article'] . '</td>')); } } if ($_WIKI_CONFIG['display_cats'] != 0) { $Template->assign_block_vars('cat_list', array('L_CATS' => $LANG['wiki_cats_list'])); $i = 0; foreach ($_WIKI_CATS as $id => $infos) { if ($infos['id_parent'] == 0) { $Template->assign_block_vars('cat_list.list', array('CAT' => $infos['name'], 'U_CAT' => url('wiki.php?title=' . url_encode_rewrite($infos['name']), url_encode_rewrite($infos['name'])))); $i++; } } if ($i == 0) { $Template->assign_vars(array('L_NO_CAT' => $LANG['wiki_no_cat'])); } } $Template->assign_vars(array('TITLE' => !empty($_WIKI_CONFIG['wiki_name']) ? $_WIKI_CONFIG['wiki_name'] : $LANG['wiki'], 'INDEX_TEXT' => !empty($_WIKI_CONFIG['index_text']) ? second_parse(wiki_no_rewrite($_WIKI_CONFIG['index_text'])) : $LANG['wiki_empty_index'], 'L_EXPLORER' => $LANG['wiki_explorer'], 'U_EXPLORER' => url('explorer.php'), 'WIKI_PATH' => $Template->get_module_data_path('wiki'))); $page_type = 'index'; include '../wiki/wiki_tools.php'; $tmp = $Template->pparse('wiki', TRUE); return $tmp; }
switch ($update->get_priority()) { case ADMIN_ALERT_VERY_HIGH_PRIORITY: $priority = 'priority_very_high'; break; case ADMIN_ALERT_HIGH_PRIORITY: $priority = 'priority_high'; break; case ADMIN_ALERT_MEDIUM_PRIORITY: $priority = 'priority_medium'; break; default: $priority = 'priority_low'; break; } $short_description = $update->get_description(); $maxlength = 300; $length = strlen($short_description) > $maxlength ? $maxlength + strpos(substr($short_description, $maxlength), ' ') : 0; $length = $length > $maxlength * 1.1 ? $maxlength : $length; $tpl->assign_block_vars('apps', array('type' => $update->get_type(), 'name' => $update->get_name(), 'version' => $update->get_version(), 'short_description' => $length > 0 ? substr($short_description, 0, $length) . '...' : $short_description, 'identifier' => $update->get_identifier(), 'L_PRIORITY' => $LANG[$priority], 'priority_css_class' => 'row_' . $priority, 'download_url' => $update->get_download_url(), 'update_url' => $update->get_update_url())); } if ($updates_availables = count($updates) > 0) { $tpl->assign_vars(array('L_UPDATES_ARE_AVAILABLE' => $LANG['updates_are_available'], 'L_AVAILABLES_UPDATES' => $LANG['availables_updates'], 'L_TYPE' => $LANG['type'], 'L_DESCRIPTION' => $LANG['description'], 'L_PRIORITY' => $LANG['priority'], 'L_UPDATE_DOWNLOAD' => $LANG['app_update__download'], 'L_NAME' => $LANG['name'], 'L_VERSION' => $LANG['version'], 'L_MORE_DETAILS' => $LANG['more_details'], 'L_DETAILS' => $LANG['details'], 'L_DOWNLOAD_PACK' => $LANG['app_update__download_pack'], 'L_DOWNLOAD_THE_COMPLETE_PACK' => $LANG['download_the_complete_pack'], 'L_UPDATE_PACK' => $LANG['app_update__update_pack'], 'L_DOWNLOAD_THE_UPDATE_PACK' => $LANG['download_the_update_pack'], 'C_ALL' => $update_type == '')); } else { $tpl->assign_vars(array('L_NO_AVAILABLES_UPDATES' => $LANG['no_available_update'])); } } else { $tpl->assign_vars(array('L_INCOMPATIBLE_PHP_VERSION' => sprintf($LANG['incompatible_php_version'], PHP_MIN_VERSION_UPDATES), 'C_INCOMPATIBLE_PHP_VERSION' => true)); } $tpl->assign_vars(array('L_WEBSITE_UPDATES' => $LANG['website_updates'], 'L_KERNEL' => $LANG['kernel'], 'L_MODULES' => $LANG['modules'], 'L_THEMES' => $LANG['themes'], 'C_UPDATES' => $updates_availables, 'U_CHECK' => 'updates.php?check=1' . (!empty($update_type) ? '&type=' . $update_type : '') . '&token=' . $Session->get_token(), 'L_CHECK_FOR_UPDATES_NOW' => $LANG['check_for_updates_now'])); $tpl->parse(); require_once PATH_TO_ROOT . '/admin/admin_footer.php';
/** * Display a single event with event data in input * * @param unknown $evenement * @return string */ public function displaySingleEvent($evenement) { $t = new Template('modules/archi/templates/'); $t->set_filenames(array('evenement' => 'evenement/singleEvent.tpl')); //Filling the template with the infos $t->assign_block_vars('evenement', $evenement['evenementData']); //Menu (ajouter image/event, modifier image/event etc..) if (isset($evenement['menuArray'])) { foreach ($evenement['menuArray'] as $menuElt) { $t->assign_block_vars($menuElt[0], $menuElt[1]); } } //Personnes if (isset($evenement['arrayPersonne'])) { foreach ($evenement['arrayPersonne'] as $personne) { $t->assign_block_vars($personne[0], $personne[1]); } } //Formulaire pour les modifications d'images if (isset($evenement['arrayFormEvent'])) { $t->assign_block_vars($personne[0], $personne[1]); } //Courant architectural if (isset($evenement['arrayCourantArchi'])) { foreach ($evenement['arrayCourantArchi'] as $courantArchi) { $t->assign_block_vars($courantArchi[0], $courantArchi[1]); } } ob_start(); $t->pparse('evenement'); $html .= ob_get_contents(); ob_end_clean(); return $html; }
Authentication::suspendUser($_POST['user']); $successAlert = 1; } // Deal with unban form if ($_GET['action'] == 'unban' && isset($_POST['unbanID'])) { Authentication::reinstateUser($_POST['unbanID']); $successAlert = 1; } if ($_GET['action'] == 'deactivate' && isset($_POST['uid'])) { Authentication::deactivateUser($_POST['uid']); $successAlert = 1; } } $sqlSuspend = "SELECT * FROM `users` WHERE `suspended` = '0'"; $resultSuspend = openRailwayCore::dbQuery($sqlSuspend); $sqlReinstate = "SELECT * FROM `users` WHERE `suspended` = '1'"; $resultReinstate = openRailwayCore::dbQuery($sqlReinstate); $main = new Template(); $main->set_custom_template("includes/", 'default'); $main->assign_var('ROOT', ROOT); while ($accountSuspend = mysql_fetch_assoc($resultSuspend)) { $main->assign_block_vars('user_loop', array('UID' => $accountSuspend['user_id'], 'NAME' => $accountSuspend['username'], 'SID' => $accountSuspend['staff_id'])); } while ($accountReinstate = mysql_fetch_assoc($resultReinstate)) { $main->assign_block_vars('user_sus_loop', array('UID' => $accountReinstate['user_id'], 'NAME' => $accountReinstate['username'], 'SID' => $accountReinstate['staff_id'])); } if (mysql_num_rows($resultReinstate) == 0) { $main->assign_block_vars('if_no_results', array()); } $main->set_filenames(array('main' => "usr_ban.html")); $main->display('main');
public function getPrivateProfil() { $auth = new ArchiAuthentification(); if ($auth->estConnecte()) { $userId = $auth->getIdUtilisateur(); } else { $this->messages->addError("Identifiant d'utilisateur incorrect"); $this->messages->display(); return false; } //Utilisateur banni if (!$this->isUtilisateurBanni(array('idUtilisateur' => $idUtilisateur))) { $t = new Template('modules/archi/templates/utilisateur'); $t->set_filenames(array('general' => 'profile.tpl', 'userStats' => 'statistics.tpl')); //Presentation $presentation = $this->getUserPresentation($userId); //Statistics $statistics = $this->getProfileStatistics($userId); foreach ($statistics as $stat) { $t->assign_block_vars('statistic', $stat); } //Informations $info = $this->getUserInfos($userId); //Formulaire $form = $this->getUserForm(); //Get contributions $contributions = $this->getAllContribution($userId); $t->assign_vars(array('userPresentation' => $presentation, 'userFormInfo' => $form, 'userInformations' => $info, 'userContributions' => $contributions)); $t->assign_var_from_handle('userStatistics', 'userStats'); $t->pparse('general'); } else { $this->messages->addWarning("Cet utilisateur est banni"); $this->messages->display(); return false; } }
include 'include_dao.php'; session_start(); // on precise le repertoire ou se trouve les fichiers templates et le répèrtoire ou on met les fichiers compilés (cache) $template = new Template('template', 'cache'); $template->assign_var('LOG', FALSE); $template->assign_var('LICENCE', FALSE); // on precise la variable langage $template->set_language_var($lang); page_header('Gérer mes licences', 'Gérer mes licences', 'GERERLICENCES'); page_footer(); $template->set_filenames(array('body' => 'gererlicence.html')); $adherents = new AdherentMySqlDAO(); if (isset($_SESSION['Nom'])) { $template->assign_var('LOG', TRUE); $adherentsQuery = $adherents->queryByIdDemandeur($_SESSION['idDemandeur']); if (is_null($adherentsQuery) == false) { $template->assign_var('LICENCE', TRUE); $clubs = new ClubMySqlDAO(); $clubQuery = $clubs->queryAll(); $ligue = new LigueMySqlDAO(); $ligueQuery = $ligue->queryAll(); foreach ($adherentsQuery as $key => $value) { $template->assign_block_vars('adherents', array('ID' => $value->idAdherent, 'NOM' => $value->nom, 'PRENOM' => $value->prenom, 'CLUB' => $clubQuery[$value->idCLub - 1]->nom, 'LIGUE' => $ligueQuery[$clubQuery[$value->idCLub - 1]->idLigue - 1]->libelle, 'NUMLICENCE' => $value->numLicence, 'ID' => $value->idAdherent)); } } else { $template->assign_var('MESSAGE', "Aucune licence enregistrée, veuillez vous rendre <a href='ajouterlicence.php'>ici</a> afin d'en ajouter une."); } } else { $template->assign_var('MESSAGE', "Vous devez être connecté pour accéder à cette partie du site !"); } $template->display('body');
public function afficherOpendata() { $html = ""; $t = new Template('modules/archi/templates/'); $t->set_filenames(array('opendata' => 'opendata/index.tpl')); $t->assign_vars(array('urlContact' => $this->creerUrl('', 'contact'))); $filesArray = array(array('name' => 'Adresses par architectes', 'xml' => 'opendata-adressesArchitecte.xml', 'csv' => 'opendata-adressesArchitecte.csv', 'filename' => 'adressesArchitecte'), array('name' => 'Adresses par quartiers', 'xml' => 'opendata-adressesQuartier.xml', 'csv' => 'opendata-adressesQuartier.csv', 'filename' => 'adressesQuartier'), array('name' => 'Adresses par rues', 'xml' => 'opendata-adressesRue.xml', 'csv' => 'opendata-adressesRue.csv', 'filename' => 'adressesRue'), array('name' => 'Quartiers par villes', 'xml' => 'opendata-quartiersVille.xml', 'csv' => 'opendata-quartiersVille.csv', 'filename' => 'quartiersVille'), array('name' => 'Rues par quartiers', 'xml' => 'opendata-ruesQuartier.xml', 'csv' => 'opendata-ruesQuartier.csv', 'filename' => 'ruesQuartier'), array('name' => 'Rues par sous quartiers', 'xml' => 'opendata-ruesSousQuartier.xml', 'csv' => 'opendata-ruesSousQuartier.csv', 'filename' => 'ruesSousQuartier'), array('name' => 'Rues par villes', 'xml' => 'opendata-ruesVille.xml', 'csv' => 'opendata-ruesVille.csv', 'filename' => 'ruesVille'), array('name' => 'Photos par quartiers', 'xml' => 'opendata-urlPhotosQuartier.xml', 'csv' => 'opendata-urlPhotosQuartier.csv', 'filename' => 'urlPhotosQuartier'), array('name' => 'Photos par rues', 'xml' => 'opendata-urlPhotosRue.xml', 'csv' => 'opendata-urlPhotosRue.csv', 'filename' => 'urlPhotosRue')); foreach ($filesArray as $file) { if (file_exists("modules/opendata/xml/" . $file['filename'] . ".xml")) { $file['date'] = date("d/m/Y H:i:s", filemtime("modules/opendata/xml/" . $file['filename'] . ".xml")); } $t->assign_block_vars('fichier', $file); } ob_start(); $t->pparse('opendata'); $html .= ob_get_contents(); ob_end_clean(); return $html; }
'SEXOM' => ($sexo=="M")?' CHECKED ':'', 'SEXOF' => ($sexo=="F")?' CHECKED ':'' )); /* DISSERTATIVA */ $qtde_item = 1; $qtde_inicio = 0; if (is_object($perg)){ if (is_object($perg->getTipoPergunta())){ if ($perg->getTipoPergunta()->getId()=="1"){ for ($i=0; $i<$perg->getQtdeResposta(); $i++){ $qtde_inicio = $i+1; $model->assign_block_vars('dissertativa',array('RESPOSTA' => $perg->getResposta($i)->getId(), 'RESPOSTA_TEXTO' => $perg->getResposta($i)->getRespostaTexto(), 'CLASSE' => ($i%2==0)?"class='odd'":"", 'I' => $i )); } } } } /* MULTIPLA-ESCOLHA */ $qtde_item = 10; $qtde_inicio = 0; if (is_object($perg)){ if (is_object($perg->getTipoPergunta())){ if ($perg->getTipoPergunta()->getId()=="2"){ for ($i=0; $i<$perg->getQtdeResposta(); $i++){ $qtde_inicio = $i+1;
function adr_update_general_config() { global $db, $lang, $phpEx, $userdata, $phpbb_root_path, $table_prefix; $template = new Template($phpbb_root_path); include_once $phpbb_root_path . 'adr/includes/adr_constants.' . $phpEx; $template->set_filenames(array('cache' => 'adr/cache/cache_tpls/cache_config_def.tpls')); $sql = "SELECT * FROM " . ADR_GENERAL_TABLE . "\n\t\t\tORDER BY config_name ASC"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Unable to query config infos (updating cache)', '', __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) { $id = $row['config_name']; $cell_res = $row['config_value']; $template->assign_block_vars('cache_row', array('ID' => sprintf("'%s'", str_replace("'", "\\'", $id)), 'CELLS' => sprintf("'%s'", str_replace("'", "\\'", $cell_res)))); } $template->assign_var_from_handle('cache', 'cache'); $res = "<?php\n" . $template->_tpldata['.'][0]['cache'] . "\n?>"; $fname = $phpbb_root_path . './adr/cache/cache_config' . '.' . $phpEx; @chmod($fname, 0666); $handle = @fopen($fname, 'w'); @fwrite($handle, $res); @fclose($handle); }
$check_rewrite = -1; } $template->assign_vars(array('C_SERVER_CONFIG' => true, 'C_PHP_VERSION_OK' => phpversion() >= '4.1.0', 'C_GD_LIBRAIRY_ENABLED' => @extension_loaded('gd'), 'C_URL_REWRITING_KNOWN' => $check_rewrite != -1, 'C_URL_REWRITING_ENABLED' => $check_rewrite == 1)); @clearstatcache(); $chmod_dir = array('../cache', '../cache/backup', '../cache/syndication', '../cache/tpl', '../images/avatars', '../images/group', '../images/maths', '../images/smileys', '../kernel/db', '../lang', '../menus', '../templates', '../upload'); $all_dirs_ok = true; foreach ($chmod_dir as $dir) { $is_writable = $is_dir = true; if (file_exists($dir) && is_dir($dir)) { if (!is_writable($dir)) { $is_writable = @chmod($dir, 0777) ? true : false; } } else { $is_dir = $is_writable = ($fp = @mkdir($dir, 0777)) ? true : false; } $template->assign_block_vars('chmod', array('TITLE' => str_replace('..', '', $dir), 'C_EXISTING_DIR' => $is_dir, 'C_WRITIBLE_DIR' => $is_writable)); if ($all_dirs_ok && (!$is_dir || !$is_writable)) { $all_dirs_ok = false; } } if (retrieve(POST, 'submit', false)) { if (!$all_dirs_ok) { $template->assign_vars(array('C_ERROR' => true, 'L_ERROR' => $LANG['config_server_dirs_not_ok'])); } else { redirect(HOST . FILE . add_lang('?step=' . (STEP_SERVER_CONFIG + 1), true)); } } $template->assign_vars(array('L_CONFIG_SERVER_TITLE' => $LANG['config_server_title'], 'L_CONFIG_SERVER_EXPLAIN' => $LANG['config_server_explain'], 'L_PHP_VERSION' => $LANG['php_version'], 'L_CHECK_PHP_VERSION' => $LANG['check_php_version'], 'L_CHECK_PHP_VERSION_EXPLAIN' => $LANG['check_php_version_explain'], 'L_EXTENSIONS' => $LANG['extensions'], 'L_CHECK_EXTENSIONS' => $LANG['check_extensions'], 'L_GD_LIBRARY' => $LANG['gd_library'], 'L_GD_LIBRARY_EXPLAIN' => $LANG['gd_library_explain'], 'L_URL_REWRITING' => $LANG['url_rewriting'], 'L_URL_REWRITING_EXPLAIN' => $LANG['url_rewriting_explain'], 'L_AUTH_DIR' => $LANG['auth_dir'], 'L_CHECK_AUTH_DIR' => $LANG['check_auth_dir'], 'L_EXISTING' => $LANG['existing'], 'L_NOT_EXISTING' => $LANG['unexisting'], 'L_WRITABLE' => $LANG['writable'], 'L_NOT_WRITABLE' => $LANG['unwritable'], 'L_REFRESH' => $LANG['refresh_chmod'], 'L_RESULT' => $LANG['result'], 'L_QUERY_LOADING' => $LANG['query_loading'], 'L_QUERY_SENT' => $LANG['query_sent'], 'L_QUERY_PROCESSING' => $LANG['query_processing'], 'L_QUERY_SUCCESS' => $LANG['query_success'], 'L_QUERY_FAILURE' => $LANG['query_failure'], 'L_NEXT_STEP' => $LANG['next_step'], 'L_PREVIOUS_STEP' => $LANG['previous_step'], 'U_PREVIOUS_STEP' => add_lang('install.php?step=' . (STEP_SERVER_CONFIG - 1)), 'U_CURRENT_STEP' => add_lang('install.php?step=' . STEP_SERVER_CONFIG), 'U_NEXT_STEP' => add_lang('install.php?step=' . (STEP_SERVER_CONFIG + 1)))); break; case STEP_DB_CONFIG: require_once 'functions.php';
$template->set_filenames(array('rss' => 'rss.tpl')); // Fonction d'erreur utilisant le template $erreur = false; function erreur_fatale($msg) { global $template; $template->assign_block_vars('MSG_ERREUR', array('DESCR' => $msg)); header('Content-type: text/html; charset=utf-8'); $template->pparse('root'); exit(0); } // Variables globales, ie communes à tous les modules $template->assign_var('TITRE', $conf['titre']); $template->assign_var('TEMPLATE_URL', 'data/templates/' . $utilisateur->template()); // Menu $template->assign_block_vars('MENU', array('LIEN' => 'index.php', 'TEXTE' => 'Accueil')); $template->assign_block_vars('MENU', array('LIEN' => 'index.php?mod=liste_projets', 'TEXTE' => 'Projets')); // Connexion if ($utilisateur->estAnonyme()) { $template->assign_block_vars('MENU2_CONN', array()); } else { $template->assign_block_vars('MENU2_DECO', array('PSEUDO' => $utilisateur->pseudo())); } // Page d'administration if ($utilisateur->autorise(PERM_MANAGE_USERS) || $utilisateur->autorise(PERM_MANAGE_PROJECT)) { $template->assign_block_vars('LIEN_ADMIN', array()); } if (in_array($mod, array('index', 'projet', 'liste_projets', 'edit_projet', 'versions', 'demande', 'liste_demandes', 'edit_demande', 'connexion', 'deconnexion', 'perso', 'admin', 'edit_user'))) { // Appel du module spécifié include 'mod/' . $mod . '.inc.php'; $template->assign_var_from_handle('ROOT_CONTENT', $mod);
<?php require_once '../admin/admin_begin.php'; define('TITLE', $LANG['administration']); require_once '../admin/admin_header.php'; $template = new Template('admin/admin_system_report.tpl'); $template->assign_vars(array('L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_UNKNOWN' => $LANG['unknown'], 'L_SYSTEM_REPORT' => $LANG['system_report'], 'L_SERVER' => $LANG['server'], 'L_PHPINFO' => $LANG['phpinfo'], 'L_PHP_VERSION' => $LANG['php_version'], 'L_DBMS_VERSION' => $LANG['dbms_version'], 'L_GD_LIBRARY' => $LANG['dg_library'], 'L_URL_REWRITING' => $LANG['url_rewriting'], 'L_REGISTER_GLOBALS_OPTION' => $LANG['register_globals_option'], 'L_SERVER_URL' => $LANG['serv_name'], 'L_SITE_PATH' => $LANG['serv_path'], 'L_PHPBOOST_CONFIG' => $LANG['phpboost_config'], 'L_KERNEL_VERSION' => $LANG['kernel_version'], 'L_DEFAULT_THEME' => $LANG['default_theme'], 'L_DEFAULT_LANG' => $LANG['default_language'], 'L_DEFAULT_EDITOR' => $LANG['choose_editor'], 'L_START_PAGE' => $LANG['start_page'], 'L_OUTPUT_GZ' => $LANG['output_gz'], 'L_COOKIE_NAME' => $LANG['cookie_name'], 'L_SESSION_LENGTH' => $LANG['session_time'], 'L_SESSION_GUEST_LENGTH' => $LANG['session invit'], 'L_DIRECTORIES_AUTH' => $LANG['directories_auth'], 'L_SUMMERIZATION' => $LANG['system_report_summerization'], 'L_SUMMERIZATION_EXPLAIN' => $LANG['system_report_summerization_explain'])); $temp_var = function_exists('apache_get_modules') ? apache_get_modules() : array(); $server_path = !empty($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); if (!$server_path) { $server_path = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); } $server_path = trim(str_replace('/admin', '', dirname($server_path))); $server_name = 'http://' . (!empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : getenv('HTTP_HOST')); $lang_ini_file = load_ini_file('../lang/', get_ulang()); $template_ini_file = load_ini_file('../templates/' . get_utheme() . '/config/', get_ulang()); $directories_summerization = ''; $directories_list = array('/', '/cache', '/cache/backup', '/cache/syndication/', '/cache/tpl', '/images/avatars', '/images/group', '/images/maths', '/images/smileys', '/lang', '/menus', '/templates', '/upload'); foreach ($directories_list as $dir) { $dir_status = is_dir('..' . $dir) && is_writable('..' . $dir); $template->assign_block_vars('directories', array('NAME' => $dir, 'C_AUTH_DIR' => $dir_status)); $directories_summerization .= $dir . str_repeat(' ', 25 - strlen($dir)) . ": " . (int) $dir_status . "\n"; } $summerization = "---------------------------------System report---------------------------------\n-----------------------------generated by PHPBoost-----------------------------\n\nSERVER CONFIGURATION-----------------------------------------------------------\n\nphp version : " . phpversion() . "\ndbms version : " . $Sql->get_dbms_version() . "\ngd library : " . (int) @extension_loaded('gd') . "\nurl rewriting : " . (function_exists('apache_get_modules') ? (int) (!empty($temp_var[5])) : "?") . "\nregister globals : " . (int) (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') . "\nserver url : " . $server_name . "\nsite path : " . $server_path . "\n\nPHPBOOST CONFIGURATION---------------------------------------------------------\n\nphpboost version : " . phpboost_version() . "\nserver url : " . $CONFIG['server_name'] . "\nsite path : " . $CONFIG['server_path'] . "\ndefault theme : " . $template_ini_file['name'] . "\ndefault language : " . get_ulang() . "\ndefault editor : " . $CONFIG['editor'] . "\nstart page : " . $CONFIG['start_page'] . "\nurl rewriting : " . $CONFIG['rewrite'] . "\noutput gz : " . $CONFIG['ob_gzhandler'] . "\nsession cookie name : " . $CONFIG['site_cookie'] . "\nsession length : " . $CONFIG['site_session'] . "\nguest session length : " . $CONFIG['site_session_invit'] . "\n\nDIRECTORIES AUTHORIZATIONS-----------------------------------------------------\n\n" . $directories_summerization; $template->assign_vars(array('PHP_VERSION' => phpversion(), 'DBMS_VERSION' => $Sql->get_dbms_version(), 'C_SERVER_GD_LIBRARY' => @extension_loaded('gd'), 'C_URL_REWRITING_KNOWN' => function_exists('apache_get_modules'), 'C_SERVER_URL_REWRITING' => function_exists('apache_get_modules') ? !empty($temp_var[5]) : false, 'C_REGISTER_GLOBALS' => @ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on', 'SERV_SERV_URL' => $server_name, 'SERV_SITE_PATH' => $server_path, 'KERNEL_VERSION' => phpboost_version(), 'KERNEL_SERV_URL' => $CONFIG['server_name'], 'KERNEL_SITE_PATH' => $CONFIG['server_path'], 'KERNEL_DEFAULT_THEME' => $template_ini_file['name'], 'KERNEL_DEFAULT_LANGUAGE' => $lang_ini_file['name'], 'KERNEL_DEFAULT_EDITOR' => $CONFIG['editor'] == 'tinymce' ? 'TinyMCE' : 'BBCode', 'KERNEL_START_PAGE' => $CONFIG['start_page'], 'C_KERNEL_URL_REWRITING' => (bool) $CONFIG['rewrite'], 'C_KERNEL_OUTPUT_GZ' => (bool) $CONFIG['ob_gzhandler'], 'COOKIE_NAME' => $CONFIG['site_cookie'], 'SESSION_LENGTH' => $CONFIG['site_session'], 'SESSION_LENGTH_GUEST' => $CONFIG['site_session_invit'], 'SUMMERIZATION' => $summerization)); $template->parse(); require_once '../admin/admin_footer.php';
$pagination = new Pagination(); $template->assign_vars(array('C_CONTRIBUTION_LIST' => true)); $num_contributions = 1; define('CONTRIBUTIONS_PER_PAGE', 20); $criteria = retrieve(GET, 'criteria', 'current_status'); $order = retrieve(GET, 'order', 'asc'); if (!in_array($criteria, array('entitled', 'module', 'status', 'creation_date', 'fixing_date', 'poster_id', 'fixer_id'))) { $criteria = 'current_status'; } $order = $order == 'desc' ? 'desc' : 'asc'; foreach (ContributionService::get_all_contributions($criteria, $order) as $this_contribution) { $creation_date = $this_contribution->get_creation_date(); $fixing_date = $this_contribution->get_fixing_date(); if ($User->check_auth($this_contribution->get_auth(), CONTRIBUTION_AUTH_BIT) || $User->get_attribute('user_id') == $this_contribution->get_poster_id()) { if ($num_contributions > CONTRIBUTIONS_PER_PAGE * ($pagination->get_current_page() - 1) && $num_contributions <= CONTRIBUTIONS_PER_PAGE * $pagination->get_current_page()) { $template->assign_block_vars('contributions', array('ENTITLED' => $this_contribution->get_entitled(), 'MODULE' => $this_contribution->get_module_name(), 'STATUS' => $this_contribution->get_status_name(), 'CREATION_DATE' => $creation_date->format(DATE_FORMAT_SHORT), 'FIXING_DATE' => $fixing_date->format(DATE_FORMAT_SHORT), 'POSTER' => $this_contribution->get_poster_login(), 'FIXER' => $this_contribution->get_fixer_login(), 'ACTIONS' => '', 'U_FIXER_PROFILE' => PATH_TO_ROOT . '/member/' . url('member.php?id=' . $this_contribution->get_fixer_id(), 'member-' . $this_contribution->get_fixer_id() . '.php'), 'U_POSTER_PROFILE' => PATH_TO_ROOT . '/member/' . url('member.php?id=' . $this_contribution->get_poster_id(), 'member-' . $this_contribution->get_poster_id() . '.php'), 'U_CONSULT' => PATH_TO_ROOT . '/member/' . url('contribution_panel.php?id=' . $this_contribution->get_id()), 'C_FIXED' => $this_contribution->get_status() == EVENT_STATUS_PROCESSED, 'C_PROCESSING' => $this_contribution->get_status() == EVENT_STATUS_BEING_PROCESSED)); } $num_contributions++; } } if ($num_contributions > 1) { $template->assign_vars(array('PAGINATION' => $pagination->display('contribution_panel.php?p=%d&criteria=' . $criteria . '&order=' . $order, $num_contributions - 1, 'p', CONTRIBUTIONS_PER_PAGE, 3))); } else { $template->assign_vars(array('C_NO_CONTRIBUTION' => true, 'L_NO_CONTRIBUTION_TO_DISPLAY' => $LANG['no_contribution'])); } define('NUMBER_OF_MODULES_PER_LINE', 4); $i_module = 0; foreach ($MODULES as $module_name => $module_infos) { $module_ini = load_ini_file(PATH_TO_ROOT . '/' . $module_name . '/lang/', get_ulang()); if (!empty($module_ini['contribution_interface'])) { if ($i_module % NUMBER_OF_MODULES_PER_LINE == 0) {
/** * This function display the informations related to the addresses whom idHistoriqueAdresse is given in param * * @param array of idHistorique $idList : a list of idHistoriqueAdresse to display * @return $html : the list of addresses to display */ public function displayList($idList = array(), $nbResult = 0) { $html = ""; //Template loading $t = new Template('modules/archi/templates/'); $t->set_filenames(array('addressesList' => 'addressesList.tpl')); if (empty($idList)) { $t->assign_vars(array('messageInfo' => "Aucun résultat !", 'titre' => 'Résultats')); $this->messages->addWarning("Aucun résultat à afficher."); $this->messages->display(); } else { $starttime = microtime(true); $optionsPagination = array('nbResult' => 0, 'nbPages' => 0, 'currentPage' => 0, 'nextPage' => 0, 'previousPage' => 0, 'nbResultPerPage' => 10, 'offset' => 4); //Pagination display if (isset($this->variablesGet['debut']) && $this->variablesGet['debut'] != '') { $optionsPagination['currentPage'] = $this->variablesGet['debut'] / $optionsPagination['nbResultPerPage']; } else { $optionsPagination['debut'] = 0; $optionsPagination['currentPage'] = 0; } $addressesInfromations = $this->getAddressesInfoFromIdHA($idList, $optionsPagination); if ($nbResult > 1) { $optionsPagination['nbResult'] = $nbResult; $nbReponses = $nbResult; $optionsPagination['nbPages'] = ceil($nbReponses / $optionsPagination['nbResultPerPage']); if ($optionsPagination['currentPage'] < $optionsPagination['nbPages']) { $optionsPagination['nextPage'] = $optionsPagination['currentPage'] + 1; } else { $optionsPagination['nextPage'] = $optionsPagination['nbPages']; } if ($optionsPagination['currentPage'] > 1) { $optionsPagination['previousPage'] = $optionsPagination['currentPage'] - 1; } else { $optionsPagination['previousPage'] = 1; } $url = array(); //Call link generation $url = $this->generatePaginationLinks($optionsPagination); $nbReponses .= " réponses"; } else { $nbReponses = $nbResult . " réponse"; } $t->assign_vars(array('nbReponses' => $nbReponses, 'titre' => 'Résultats')); // Template filling $paramsUrlDesc = $this->variablesGet; $paramsUrlAsc = $this->variablesGet; $paramsUrlDesc['order'] = "desc"; $paramsUrlAsc['order'] = "asc"; $urlAsc = $this->creerUrl('', '', $paramsUrlAsc); $urlDesc = $this->creerUrl('', '', $paramsUrlDesc); $t->assign_block_vars('liens', array('urlDesc' => $urlAsc, 'urlAsc' => $urlDesc)); //Generating next/previous pagination link $siblingIndex = $this->getNextPreviousPages($optionsPagination['currentPage'], $optionsPagination['nbPages']); $indexToDisplay = $this->getPaginationIndex($optionsPagination); foreach ($indexToDisplay as $indexPage) { $t->assign_block_vars('nav', array('urlNbOnClick' => '', 'urlNb' => $url[$indexPage], 'nb' => $indexPage + 1, 'urlPrecendant' => $url[$siblingIndex['previousPage']], 'urlSuivant' => $url[$siblingIndex['nextPage']])); // Dirty hack for displaying strong tag on current page if ($indexPage == $optionsPagination['currentPage']) { $t->assign_block_vars('nav.courant', array()); } } $t->assign_block_vars('urlNextPagination', array('urlSuivant' => $url[$siblingIndex['nextPage']])); $t->assign_block_vars('urlBackPagination', array('urlPrecedent' => $url[$siblingIndex['previousPage']])); /* * Addresses display * Loop on each address infos * * * Structure of $info : * * Array ( [nom] => 22 rue du général castelnau [idHistoriqueAdresse] => 2 [idAdresse] => 2 [idEvenementGroupeAdresse] => 1289 [titresEvenements] => Array ( [0] => 22 rue du général castelnau [1] => Photos de nuit [2] => Visite des appartements [3] => Evenement sans titre [4] => Visite des parties communes [5] => détails art nouveau ) ) */ foreach ($addressesInfromations as $info) { $titreEvenements = ""; $illustration = $this->getUrlImageFromAdresse($info['idHistoriqueAdresse'], 'moyen', array('idEvenementGroupeAdresse' => $info['idEvenementGroupeAdresse'], 'placeholder' => "images/placeholder.jpg")); //Processing name of the address $nom = ucfirst($info['nom']); $fulladdress = ucfirst($this->getIntituleAdresseFrom($info['idEvenementGroupeAdresse'], $type = 'idEvenementGroupeAdresse')); $titre = $info['titre']; $input = array('idEvenementGA' => $info['idEvenementGroupeAdresse'], 'idAdresse' => $info['idAdresse']); $intituleAdresse = ""; if (isset($titre) && !empty($titre) && $titre != '') { $intituleAdresse = "<b>" . $titre . "</b> "; } $intituleAdresse .= $fulladdress . ' '; $arrayUrl = $this->generateUrlListAddresses($input, $this->variablesGet['modeAffichage'], $intituleAdresse); //Regular case //Personne case if (isset($info['idPersonne']) && $info['idPersonne'] != '') { $urlImageIllustration = archiPersonne::getImage($info['idPersonne'], 'resized', true, array('height' => 130, 'width' => 130)); $addressUrl = $this->creerUrl('', 'evenementListe', array('selection' => 'personne', "id" => $info['idPersonne'])); $titre = $info['nom']; $urlDetailOnClick = ''; } else { $urlImageIllustration = $illustration['url']; $addressUrl = $this->creerUrl('', '', array('archiAffichage' => 'adresseDetail', "archiIdAdresse" => $info['idAdresse'], "archiIdEvenementGroupeAdresse" => $info['idEvenementGroupeAdresse'])); $addressUrl = $arrayUrl['urlDetailHref']; $urlDetailOnClick = $arrayUrl['urlDetailOnClick']; } // Event title $titreEvenements = implode(" - ", $info['titresEvenements']); // Getting all the events links on one line $modeAffichage = $this->variablesGet['modeAffichage']; if ($modeAffichage == 'calqueImage' || $modeAffichage == 'calqueImageChampsMultiples' || $modeAffichage == 'calqueImageChampsMultiplesRetourSimple' || $modeAffichage == 'calqueEvenement' || $modeAffichage == 'popupRechercheAdressePrisDepuis' || $modeAffichage == 'popupRechercheAdresseVueSur' || $modeAffichage == "popupAjoutAdressesLieesSurEvenement" || $modeAffichage == "popupDeplacerEvenementVersGroupeAdresse" || $modeAffichage == 'popupRechercheAdresseAdminParcours') { $titreEvenements = ""; } else { $titreEvenements = implode(" - ", $info['titresEvenements']); // Getting all the events links on one line } $t->assign_block_vars('adresses', array('nom' => $titre, 'adresseComplete' => $fulladdress, 'urlImageIllustration' => $urlImageIllustration, 'alt' => $nom, 'urlDetailHref' => $addressUrl, 'titresEvenements' => $titreEvenements, 'urlDetailOnClick' => $urlDetailOnClick)); } //End foreach } //End else (regular display w/ errors) //Filling template, getting content, returning it ob_start(); $t->pparse('addressesList'); $html .= ob_get_contents(); ob_end_clean(); return $html; }
} } if (extension_loaded('Reflection') && $debug == 'true') { $dbg_msg .= show_info('dummy', 0); } /* * Finish up the html with the description of the message classifications */ if ($legend == 'true') { $legend_msg = "<table style=\"font-size:x-small;\" cellpadding=0 border=0 cellspacing=0>\n\t<tr>\n\t\t<td><b><font color=green>Passed CLEAN</font></b>:</td><td> </td><td>clean or '\$tag_level' < '\$tag2_level'</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=green>Passed SPAM</font></b>:</td><td></td><td>classified as SPAM but delivered because '\$tag_level' < '\$kill_level'</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=green>Passed BANNED</font></b>:</td><td></td><td>classified as BANNED but delivered</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=green>Passed BAD-HEADER</font></b>:</td><td></td><td>classified as BAD-HEADER but delivered</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked SPAM</font></b>:</td><td></td><td>not delivered, spam classified with '\$tag_level' >= '\$kill_level' and '\$final_spam_destiny' != 'pass'</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked BANNED</font></b>:</td><td></td><td>not delivered, banned file extension attached.</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked BAD-HEADER</font></b>:</td><td></td><td>not delivered, contains bad headers.</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Blocked INFECTED</font></b>:</td><td></td><td>not delivered, contains virus</td>\n\t</tr>\n\t<tr>\n\t\t<td><b><font color=red>Not Delivered</font></b>:</td><td></td><td>could not be delivered, e.g. destination host refuses to accept delivery.</td>\n\t</tr>\n</table>\n"; } $template = new Template($as_root_path . $template_path); $template->assign_vars(array("PAGE_TITLE" => $title)); $template->set_filenames(array('body' => 'index_body.tpl')); $template->assign_vars(array('S_CONTENT_DIRECTION' => 'ltr', 'S_CONTENT_ENCODING' => 'iso-8859-1', 'RATE' => $rate, 'META_REFRESH' => $refresh && is_numeric($refresh) && $refresh > 0 ? "<meta http-equiv=\"refresh\" content=\"{$refresh}\">" : NULL, 'REFRESH' => $refresh && is_numeric($refresh) && $refresh > 0 ? $refresh : 0, 'LEGEND' => $legend, 'LEGEND_MSG' => $legend_msg, 'SPAN' => $span, 'PGRAPH' => asLoadStats($host) ? asPGraph("{$imgdir}/passed-{$span}.png", $now, $span) : "No statistics available.", 'VGRAPH' => asLoadStats($host) ? asVGraph("{$imgdir}/virus-{$span}.png", $now, $span) : "No statistics available.", 'SBGRAPH' => asLoadStats($host) ? asSBGraph("{$imgdir}/sb-{$span}.png", $now, $span) : "No statistics available.", 'VERSION' => $as_version, 'OUT_MSG' => $out_msg ? $out_msg : '', 'DBG_MSG' => $dbg_msg ? $dbg_msg : '', "PAGE_TITLE" => $title, 'HOST' => $host)); $template->assign_block_vars("time_date_row", array("CURRENT_DATE" => strftime("%A %B %d %H:%M:%S (GMT%z)", time()))); $template->assign_block_vars("button_row", array("BUTTON" => $debug != 'true' ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug=true&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=debug\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug=false&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=nodebug\"></a>")); $template->assign_block_vars("button_row", array("BUTTON" => $rate != 3600 ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate=3600&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=hour\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate=60&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=min\"></a>")); $button_text = array('daily', 'weekly', 'monthly', 'yearly'); for ($i = 0; $i < count($button_text); $i++) { $template->assign_block_vars("button_row", array("BUTTON" => $span != $button_text[$i] ? "<a href=\"{$me}?host={$host}&span={$button_text[$i]}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=" . $button_text[$i] . "\"></a>" : "<img src=\"{$me}?text=" . $button_text[$i] . "&button={$button_selected}\">")); } if (!$host_list) { $template->assign_block_vars("button_row", array("BUTTON" => $legend != 'true' ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=true\"><img src=\"{$me}?button={$button_unselected}&text=legend\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=false\"><img src=\"{$me}?button={$button_selected}&text=legend\"></a>")); } else { $template->assign_block_vars('hostlist_row', array()); $template->assign_block_vars("hostlist_row.button_row2", array("BUTTON" => $legend != 'true' ? "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=true\"><img src=\"{$me}?button={$button_unselected}&text=legend\"></a>" : "<a href=\"{$me}?host={$host}&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend=false\"><img src=\"{$me}?button={$button_unselected}&text=nolegend\"></a>")); $template->assign_block_vars("hostlist_row.button_row2", array("BUTTON" => $host ? "<a href=\"{$me}?host=&span={$span}&refresh={$refresh}&debug={$debug}&rate={$rate}&legend={$legend}\"><img src=\"{$me}?button={$button_unselected}&text=ALL\"></a>" : "<img src=\"{$me}?text=ALL&button={$button_selected}\">")); $cnt = 1; for ($i = 0; $i < count($host_list); $i++) { if ($cnt == 3) {
protected function display_menus(Template $template) { $menus = MenusCache::load()->get_menus(); $columns_disabled = ThemesManager::get_theme(AppContext::get_current_user()->get_theme())->get_columns_disabled(); foreach ($menus as $cached_menu) { $menu = $cached_menu->get_menu(); if ($menu->check_auth() && !$columns_disabled->menus_column_is_disabled($menu->get_block())) { $display = false; $filters = $menu->get_filters(); $nbr_filters = count($filters); foreach ($filters as $filter) { if ($nbr_filters > 1 && $filter->get_pattern() != '/' || $filter->match() && !$display) { $display = true; } } if ($display) { $menu_content = $cached_menu->has_cached_string() ? $cached_menu->get_cached_string() : $menu->display(); $block = $menu->get_block(); switch ($block) { case Menu::BLOCK_POSITION__HEADER: $template->put('C_MENUS_HEADER_CONTENT', true); $template->assign_block_vars('menus_header', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__SUB_HEADER: $template->put('C_MENUS_SUB_HEADER_CONTENT', true); $template->assign_block_vars('menus_sub_header', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__LEFT: $template->put('C_MENUS_LEFT_CONTENT', true); $template->assign_block_vars('menus_left', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__RIGHT: $template->put('C_MENUS_RIGHT_CONTENT', true); $template->assign_block_vars('menus_right', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__TOP_CENTRAL: $template->put('C_MENUS_TOPCENTRAL_CONTENT', true); $template->assign_block_vars('menus_top_central', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__BOTTOM_CENTRAL: $template->put('C_MENUS_BOTTOM_CENTRAL_CONTENT', true); $template->assign_block_vars('menus_bottom_central', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__TOP_FOOTER: $template->put('C_MENUS_TOP_FOOTER_CONTENT', true); $template->assign_block_vars('menus_top_footer', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__FOOTER: $template->put('C_MENUS_FOOTER_CONTENT', true); $template->assign_block_vars('menus_footer', array('MENU' => $menu_content)); } } } } }
/** * @desc Displays the bread crumb. */ public function display(Template $tpl) { if (empty($this->array_links)) { $this->add($this->get_page_title(), REWRITED_SCRIPT); } $tpl->put_all(array('START_PAGE' => TPL_PATH_TO_ROOT . '/', 'L_INDEX' => LangLoader::get_message('home', 'main'))); $output = array_slice($this->array_links, -1, 1); foreach ($this->array_links as $key => $array) { $tpl->assign_block_vars('link_bread_crumb', array('C_CURRENT' => $output[0] == $array, 'URL' => $array[1], 'TITLE' => $array[0])); } }