/** * Affichage de la fiche d'une ecole * * @author Christophe Beyer <*****@*****.**> * @since 2008/09/03 * @param integer $id Id de l'ecole * @param integer $popup 1 pour afficher la fiche en popup Fancybox */ public function fiche() { $id = $this->getRequest('id', null); $iPopup = CopixRequest::getInt('popup'); $ecoleDAO = CopixDAOFactory::create('kernel|kernel_bu_ecole'); $ficheDAO = CopixDAOFactory::create("fiches_ecoles"); $criticErrors = array(); if (!($rEcole = $ecoleDAO->get($id))) { $criticErrors[] = CopixI18N::get('fichesecoles.error.param'); } elseif (!FichesEcolesService::canMakeInFicheEcole($id, 'VIEW')) { $criticErrors[] = CopixI18N::get('kernel|kernel.error.noRights'); } if ($criticErrors) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => implode('<br/>', $criticErrors), 'back' => CopixUrl::get('annuaire||'))); } $rFiche = $ficheDAO->get($id); $tpl = new CopixTpl(); CopixHtmlHeader::addJSLink(CopixUrl::get() . 'js/iconito/module_fichesecoles.js'); $fiche = CopixZone::process('fiche', array('rEcole' => $rEcole, 'rFiche' => $rFiche)); $main = $fiche; $title = $rEcole->nom; if ($rEcole->type) { $title .= ' (' . $rEcole->type . ')'; } $tpl->assign('TITLE_PAGE', $title); // Get vocabulary catalog to use $nodeVocabularyCatalogDAO = _ioDAO('kernel|kernel_i18n_node_vocabularycatalog'); $vocabularyCatalog = $nodeVocabularyCatalogDAO->getCatalogForNode('BU_ECOLE', $rEcole->numero); if (strtolower($rEcole->type) == 'crèche') { $tpl->assign('TITLE_CONTEXT', CopixI18N::get('kernel|kernel.codes.mod_fichesecoles_creche')); } else { $tpl->assign('TITLE_CONTEXT', CopixCustomI18N::get('kernel|kernel.codes.mod_fiche%%structure%%', array('catalog' => $vocabularyCatalog->id_vc))); } $menu = array(); $menu[] = array('url' => CopixUrl::get('public||getListBlogs'), 'txt' => CopixCustomI18N::get('public|public.blog.annuaire.%%structures%%', array('catalog' => $vocabularyCatalog->id_vc))); if (Kernel::is_connected()) { $menu[] = array('url' => CopixUrl::get('annuaire||getAnnuaireEcole', array('ecole' => $rEcole->numero)), 'txt' => CopixCustomI18N::get('annuaire|annuaire.back%%structure%%', array('catalog' => $vocabularyCatalog->id_vc))); } if (CopixConfig::exists('|can_annuaire_menu') && !CopixConfig::get('|can_annuaire_menu')) { $menu = array(); } $tpl->assign('MENU', $menu); $tpl->assign("MAIN", $main); if ($iPopup) { $ppo = new CopixPPO(); $ppo->fiche = $fiche; $ppo->TITLE = $title; return _arPPO($ppo, array('template' => 'fiche_popup.tpl', 'mainTemplate' => 'main|main_fancy.php')); } return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Construction du message * @param mixed $pParams tableau de paramètre ou clef * @param mixed $pContent null (i18n n'est pas censé recevoir de contenu) * @return string message traduit */ public function process($pParams, $pContent = null) { if (!is_array($pParams)) { $pParams = array('key' => $pParams); } if (!isset($pParams['key'])) { throw new CopixTagException("[CopixTagCustomI18N] Missing key parameter"); return; } if (isset($pParams['lang'])) { $lang = $pParams['lang']; unset($pParams['lang']); } else { $lang = null; } $key = $pParams['key']; unset($pParams['key']); if (isset($pParams['pNb'])) { switch ($pParams['pNb']) { case 0: $key .= '_0'; break; case 1: $key .= '_1'; break; default: $key .= '_N'; break; } } if (isset($pParams['noEscape'])) { $noEscape = $pParams['noEscape']; unset($pParams['noEscape']); } if (count($pParams) == 0) { $pParams = null; } $message = CopixCustomI18N::get($key, $pParams, $lang); if (!isset($noEscape)) { return _copix_utf8_htmlentities($message); } return $message; }
public function processShowMultipleAccountsListing() { $ppo = new CopixPPO(); // Récupération des informations des comptes créés $ppo->accounts = _sessionGet('gestionautonome|addMultipleStudents|success'); // Récupérations des informations des modifications apportées $accountsInSession = _sessionGet('modules|gestionautonome|passwordsList'); if (!is_array($accountsInSession)) { $accountsInSession = array(); } else { $toDisplay = array(); foreach ($accountsInSession as $lines) { foreach ($lines as $data) { $toDisplay[] = $data; } } $ppo->accountsInSession = $toDisplay; } // Récupération du format de sortie demandé if (!_request('format') || trim(_request('format')) == '') { $format = "default"; } else { $format = _request('format'); } // Breadcrumbs $nodeInfos = Kernel::getNodeInfo($ppo->nodeType, $ppo->nodeId, true); // Get vocabulary catalog to use $nodeVocabularyCatalogDAO = _ioDAO('kernel|kernel_i18n_node_vocabularycatalog'); $ppo->vocabularyCatalog = $nodeVocabularyCatalogDAO->getCatalogForNode($ppo->nodeType, $ppo->nodeId); $breadcrumbs = Kernel::generateBreadcrumbs($nodeInfos); $breadcrumbs[] = array('txt' => CopixCustomI18N::get('gestionautonome|gestionautonome.message.add%%structure_element_persons%%list', array('catalog' => $ppo->vocabularyCatalog->id_vc))); $ppo->breadcrumbs = Kernel::PetitPoucet($breadcrumbs, ' » '); $ppo->TITLE_PAGE = CopixConfig::get('gestionautonome|moduleTitle'); $ppo->title = 'Importer ' . CopixCustomI18N::get('gestionautonome|gestionautonome.message.%%structure_element_persons%%', array('catalog' => $ppo->vocabularyCatalog->id_vc)); $ppo->msgSuccess = CopixCustomI18N::get('gestionautonome|gestionautonome.message.%%structure_element_Persons%%', array('catalog' => $ppo->vocabularyCatalog->id_vc)) . ' ajoutés !'; $ppo->subTitle = 'Liste ' . CopixCustomI18N::get('gestionautonome|gestionautonome.message.%%indefinite__structure_element_persons%%', array('catalog' => $ppo->vocabularyCatalog->id_vc)) . ' ajoutés'; // Sortie suivant le format demandé $tplResult = new CopixTpl(); $tplResult->assign('accounts', $ppo->accounts); switch ($format) { case 'default': return _arPPO($ppo, 'account_listing.tpl'); case 'html': $result = $tplResult->fetch('account_listing_html.tpl'); return _arContent($result, array('filename' => 'Logins-' . date('YmdHi') . '.html', 'content-disposition' => 'inline', 'content-type' => CopixMIMETypes::getFromExtension('.html'))); break; case 'csv': $result = $tplResult->fetch('account_listing_csv.tpl'); return _arContent($result, array('filename' => 'Logins-' . date('YmdHi') . '.csv', 'content-disposition' => 'attachement', 'content-type' => CopixMIMETypes::getFromExtension('.csv'))); break; } }
/** * Définition du pays à utiliser * <code> * //on demande à utiliser le pays france * CopixI18N::setCountry ('FR'); * </code> * @param string $pCountry Le code du pays à définir */ public static function setCountry($pCountry) { self::$_country = strtoupper($pCountry); }