public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $pAlbumId = $this->getParam('album_id'); $pDossierId = $this->getParam('dossier_id'); // $album_dao = _dao("album"); $dossier_dao = _dao("dossier"); $photo_dao = _dao("photo"); if ($pDossierId > 0) { $dossier = $dossier_dao->get($pDossierId); } else { $dossier->dossier_id = 0; $dossier->dossier_album = $this->getParam('album_id'); $dossier->dossier_parent = -1; $dossier->dossier_nom = CopixI18N::get('album|album.message.topfolder'); $dossier->dossier_comment = ""; $dossier->album_id = $pAlbumId; } if ($dossier->dossier_album != $pAlbumId) { return false; } $pictures = $photo_dao->findAllByAlbumAndFolder($pAlbumId, $pDossierId); $tpl->assign('album_id', $pAlbumId); $tpl->assign('dossier_id', $pDossierId); $tpl->assign('dossier', $dossier); $tpl->assign('pictures', $pictures); $tpl->assign('picture_thumbsize', '_s64'); $dossiers_tree = Album::getFoldersTree($pAlbumId); $dossiers_commands = Album::tree2commands($dossiers_tree); $tpl->assign('commands_move', $dossiers_commands); $toReturn = $tpl->fetch('editphotos.tpl'); return true; }
public function checkPrefs($module, $data) { define('AVATAR_MAX_BYTES', 100000); define('AVATAR_MAX_PIXELS', 100); $error = array(); if ($data['passwd1'] != '' || $data['passwd2'] != '') { if ($data['passwd1'] != $data['passwd2']) { $error['passwd2'] = CopixI18N::get('prefs.config.passwd.error.notsame'); $error['passwd1'] = " "; } if (strlen($data['passwd1']) < 5) { $error['passwd1'] = CopixI18N::get('prefs.config.passwd.error.tooshort'); } } if (isset($_FILES) && $_FILES['prefs_avatar_upload']['name']) { if (!in_array($_FILES['prefs_avatar_upload']['type'], array('image/jpeg', 'image/gif', 'image/png'))) { $error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_format'); } elseif ($_FILES['prefs_avatar_upload']['size'] > AVATAR_MAX_BYTES) { $error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_bytes'); } elseif ((list($width, $height, $type, $attr) = getimagesize($_FILES['prefs_avatar_upload']['tmp_name'])) && max($width, $height) > AVATAR_MAX_PIXELS) { $error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_pixels'); } elseif ($_FILES['prefs_avatar_upload']['error'] != 0) { $error['avatar_upload'] = CopixI18N::get('prefs.config.avatar.error_inconnue'); } } $data['alerte_mail_email'] = trim($data['alerte_mail_email']); if (isset($data['alerte_mail_email']) && $data['alerte_mail_email'] != '') { // if( !ereg( "@", $data['alerte_mail_email'] ) ) if (!validateEMail($data['alerte_mail_email'])) { $error['alerte_mail_email'] = CopixI18N::get('prefs.config.mail.bad_email'); } } return $error; }
/** * go * * Appel automatique, avec détection du noeud à afficher. * @author Frédéric Mossmann * @since 10.03.2009 * */ public function go() { if (!Kernel::is_connected()) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.nologin'), 'back' => CopixUrl::get('auth|default|login'))); } CopixHtmlHeader::addJSLink(CopixUrl::get() . 'js/iconito/module_concerto.js'); if (!_request("id") || !ereg('^[0-9]+$', _request("id"))) { return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('kernel||getNodes')); } $sql = 'SELECT login,password FROM kernel_bu_auth WHERE node_type=\'responsable\' AND node_id=' . _currentUser()->getExtra('id') . ' AND id=\'' . addslashes(_request("id")) . '\' AND service=\'concerto\''; $concerto = _doQuery($sql); if (!$concerto) { return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('kernel||getNodes')); } $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('concerto|concerto.title')); // $tpl->assign ('MENU', '<a href="'.CopixUrl::get ('groupe||getListPublic').'">'.CopixI18N::get ('groupe|groupe.annuaire').'</a> :: <a href="'.CopixUrl::get ('groupe||getListMy').'">'.CopixI18N::get ('groupe|groupe.my').'</a>'); $tplListe = new CopixTpl(); $tplListe->assign('login', $concerto[0]->login); $tplListe->assign('password', $concerto[0]->password); $result = $tplListe->fetch("concerto-form.tpl"); $tpl->assign("MAIN", $result); $tpl->assign('BODY_ON_LOAD', 'concerto_redirect();'); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
public function beforeAction() { _currentUser()->assertCredential('module:*||access|@gestionautonome'); $this->menu = array(); switch (_request('action')) { case 'createGrade': case 'validateGradeCreation': case 'manageGrades': $current = 'manageGrades'; break; default: $current = 'showTree'; } if (Kernel::isAdmin() || _currentUser()->hasAssistance('can_comptes')) { if (CopixConfig::exists('kernel|gestionAutonomeEnabled') && CopixConfig::get('kernel|gestionAutonomeEnabled')) { $this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getUsers'), 'url' => CopixUrl::get('gestionautonome||showTree'), 'type' => 'users', 'current' => $current == 'showTree' ? 'current' : ''); } else { $this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getUsers'), 'url' => CopixUrl::get('comptes||'), 'type' => 'users'); } $this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getExt'), 'url' => CopixUrl::get('comptes||getUserExt'), 'type' => 'acl', 'current' => $current == 'getUsersExt' ? 'current' : ''); } if (Kernel::isAdmin()) { $this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.getRoles'), 'url' => CopixUrl::get('comptes||getRoles'), 'type' => 'acl', 'current' => $current == 'list' ? 'current' : ''); $this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.menu.manageGrades'), 'url' => CopixUrl::get('gestionautonome||manageGrades'), 'type' => 'agendalist', 'current' => $current == 'manageGrades' ? 'current' : ''); } $session = _sessionGet('modules|comptes|doLoginCreate|success'); if ($session && is_array($session) && sizeof($session)) { $this->menu[] = array('txt' => CopixI18N::get('comptes|comptes.strings.showloginresult', sizeof($session)), 'url' => CopixUrl::get('comptes||getLoginResult'), 'size' => 145); } $this->addJs('js/iconito/module_gestionautonome.js'); }
/** * Configuration de MagicMail * * @author Frederic Mossmann <*****@*****.**> * @since 2006/08/09 */ public function getMagicMail() { $id = _request("id"); if (Kernel::getLevel("MOD_MAGICMAIL", $id) < PROFILE_CCV_ADMIN) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get('||'))); } $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('magicmail.message.title')); $dao = CopixDAOFactory::create("magicmail|magicmail"); $magic_result = $dao->get($id); $tplForm = new CopixTpl(); $tplForm->assign('id', $id); $tplForm->assign('infos', $magic_result); // $tplForm->assign ('magicmail_mail', CopixConfig::get ('magicmail|magicmail_mail')); if (_request("return")) { $tplForm->assign('return', _request("return")); } CopixHTMLHeader::addCSSLink(_resource("styles/module_prefs.css")); $tplForm->assign('msg', array('type' => 'ok', 'image_url' => _resource('img/prefs/smiley_black.png'), 'image_alt' => 'Ok !', 'value' => CopixI18N::get('prefs|prefs.msg.prefsrecorded'))); $result = $tplForm->fetch("login_form.tpl"); $tpl->assign("MAIN", $result); $menu = array(); $tpl->assign('MENU', $menu); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
public function _createContent(&$toReturn) { //Getting the user. //Create Services, and DAO $tpl = new CopixTpl(); $tpl->assign('blog', $this->getParam('blog', null)); $tpl->assign('kind', $this->getParam('kind', null)); $tpl->assign('id_blog', $this->getParam('id_blog', '')); $tpl->assign('errors', $this->getParam('errors', '')); $tpl->assign('showErrors', $this->getParam('showErrors', '')); $tpl->assign('logoPath', $this->getParam('logoPath', null)); $tpl->assign('tabBlogFunctions', $this->getParam('tabBlogFunctions', null)); $tpl->assign('can_format_articles', CopixConfig::get('blog|blog.default.can_format_articles')); $tpl->assign('is_public', array('values' => array(1, 0), 'output' => array(CopixI18N::get('blog|blog.oui'), CopixI18N::get('blog|blog.non')))); $tpl->assign('has_comments_activated', array('values' => array(1, 0), 'output' => array(CopixI18N::get('blog|blog.oui'), CopixI18N::get('blog|blog.non')))); $tpl->assign('type_moderation_comments', array('values' => array('POST', 'PRE'), 'output' => array(CopixI18N::get('blog|blog.type_moderation_comments.post'), CopixI18N::get('blog|blog.type_moderation_comments.pre')))); if (CopixConfig::get('blog|blog.default.can_format_articles')) { $formats = CopixConfig::get('blog|blog.formats_articles'); $tabFormats = explode(',', $formats); $values = $output = array(); foreach ($tabFormats as $k) { $values[] = $k; $output[] = CopixI18N::get('blog|blog.default_format_articles.' . $k); } $tpl->assign('default_format_articles', array('values' => $values, 'output' => $output)); } else { $tpl->assign('default_format_articles', CopixConfig::get('blog|blog.default.default_format_articles')); } $tpl->assign('logo_max_width', CopixConfig::get('blog|blog.default.logo_max_width')); // retour de la fonction : $toReturn = $tpl->fetch('blog.edit.tpl'); return true; }
public function getModules() { $my_modules = array(); $nodes = Kernel::getMyNodes(); if (sizeof($nodes)) { foreach ($nodes as $node_key => $node) { $modules = Kernel::getModEnabled($node->type, $node->id, _currentUser()->getExtra('type'), _currentUser()->getExtra('id')); foreach ($modules as $modules_key => $module) { if ($module->module_type != "MOD_PREFS" && preg_match('#^MOD_(.+)$#', $module->module_type, $regs)) { $mod_tmp = new CopixPPO(); $mod_tmp->type = $module->module_type; $mod_tmp->nom = $module->module_nom; $mod_tmp->rep = strtolower($regs[1]); $my_modules[$module->module_type] = $mod_tmp; unset($mod_tmp); } } } } ksort($my_modules); $pref_module['MOD_PREFS'] = new CopixPPO(); $pref_module['MOD_PREFS']->type = 'MOD_PREFS'; $pref_module['MOD_PREFS']->nom = CopixI18N::get('prefs|prefs.string.generalprefs'); $pref_module['MOD_PREFS']->rep = 'prefs'; $all_modules = array_merge($pref_module, $my_modules); return $all_modules; }
/** * instanciation d'un objet plugin. * instancie également l'objet de configuration associé * @param string $name nom du plugin * @param string $conf nom d'un fichier de configuration alternatif. si chaine vide = celui par défaut * @return CopixPlugin le plugin instancié */ function &create($name, $conf = null) { require_once COPIX_CORE_PATH . 'CopixPlugin.class.php'; $fic =& new CopixModuleFileSelector($name); $nom = strtolower($fic->fileName); $path = $fic->getPath(COPIX_PLUGINS_DIR) . $nom . '/'; $path_plugin = $path . $nom . '.plugin.php'; if (is_null($conf)) { $path_config = $path . $nom . '.plugin.conf.php'; } else { $path_config = $path . $conf; } if (is_file($path_plugin) && is_file($path_config)) { require_once $path_config; require_once $path_plugin; $classname = 'PluginConfig' . $fic->fileName; //nom de la classe de configuration. $config =& new $classname(); //en deux étapes, impossible de mettre la ligne dans les paramètres du constructeur. $name = 'Plugin' . $fic->fileName; $toReturn =& new $name($config); //nouvel objet plugin, on lui passe en paramètre son objet de configuration. } else { trigger_error(CopixI18N::get('copix:copix.error.unfounded.plugin', $name), E_USER_ERROR); $toReturn = null; } return $toReturn; }
public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $module_type = $this->getParam('module_type'); $module_id = $this->getParam('module_id'); $action = $this->getParam('action'); $date_debut = $this->getParam('date_debut', null); $date_fin = $this->getParam('date_fin', null); $dao = _dao('stats|logs'); $stats = $dao->getStatsModuleAction(array('module_type' => $module_type, 'module_id' => $module_id, 'action' => $action, 'date_debut' => $date_debut, 'date_fin' => $date_fin)); //print_r($stats); foreach ($stats as $k => $s) { // Détection du nom Copix du module list(, $module) = explode("_", strtolower($module_type)); $class = CopixClassesFactory::create("{$module}|Stats{$module}"); $obj = $class->getObjet($action, $s->objet_a); //print_r($obj); $stats[$k]->objet_name = isset($obj->name) ? $obj->name : ''; } $tpl->assign('name', CopixI18N::get('stats.action.' . $module_type . '-' . $action)); $tpl->assign('stats', $stats); //$tpl->assign ('canWriteOnline' , BlogAuth::canMakeInBlog('ADMIN_ARTICLE_MAKE_ONLINE',create_blog_object($id_blog))); // retour de la fonction : $toReturn = $tpl->fetch('module.action.tpl'); return true; }
/** * Display an error message */ function &getConfirm() { $tpl =& new CopixTpl(); $tpl->assign('TITLE_PAGE', isset($this->vars['TITLE_PAGE']) ? $this->vars['TITLE_PAGE'] : CopixI18N::get('messages.titlePage.confirm')); $tpl->assign('MAIN', CopixZone::process('PassThrough', array('title' => $this->vars['title'], 'message' => $this->vars['message'], 'confirm' => $this->vars['confirm'], 'cancel' => $this->vars['cancel'], 'template' => 'confirm.tpl'))); return $return =& new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Renvoie les préférences du module * * @author Christophe Beyer <*****@*****.**> * @since 2006/05/05 * @param array $data (option) Tableau avec les données (venues de la base) * @return array Tableau de tableaux avec toutes les préférences */ public function getPrefs($data = null) { $toReturn = array(); $toReturn['name'] = 'Minimail'; $toReturn['form'] = array(array('type' => 'titre', 'text' => CopixI18N::get('minimail|minimail.config.alerte.title'), 'expl' => CopixI18N::get('minimail|minimail.config.alerte.expl')), array('code' => 'alerte_minimail', 'type' => 'checkbox', 'text' => CopixI18N::get('minimail|minimail.config.alerte.active'), 'value' => $data['alerte_minimail'] ? true : false)); return $toReturn; }
public function processDefault() { _classInclude('sysutils|admin'); if (!Admin::canAdmin()) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get())); } echo "Récupération des classeurs de classe sans casier\n"; echo "----------------------------------------------------------------------\n\n"; // Récupération des classeurs de classe sans casier $sql = 'SELECT DISTINCT module_classeur.id' . ' FROM kernel_mod_enabled, module_classeur' . ' LEFT JOIN module_classeur_dossier ON (module_classeur_dossier.module_classeur_id = module_classeur.id)' . ' WHERE module_classeur.id = kernel_mod_enabled.module_id' . ' AND kernel_mod_enabled.module_type = "MOD_CLASSEUR"' . ' AND kernel_mod_enabled.node_type = "BU_CLASSE"' . ' AND (module_classeur_dossier.id IS NULL' . ' OR module_classeur_dossier.id NOT IN (SELECT id FROM module_classeur_dossier WHERE casier = 1 AND module_classeur_id = module_classeur.id))'; $results = _doQuery($sql); $dossierDAO = _ioDAO('classeur|classeurdossier'); _classInclude('classeur|classeurService'); echo count($results) . " casiers à créer.\n"; foreach ($results as $result) { $casier = _record('classeur|classeurdossier'); $casier->classeur_id = $result->id; $casier->parent_id = 0; $casier->nom = CopixI18N::get('classeur|classeur.casierNom'); $casier->nb_dossiers = 0; $casier->nb_fichiers = 0; $casier->taille = 0; $casier->cle = classeurService::createKey(); $casier->casier = 1; $casier->date_creation = date('Y-m-d H:i:s'); $dossierDAO->insert($casier); echo "Casier du classeur {$result->id} créé avec succès !\n"; } echo "\n\nFin de la tâche"; return _arNone(); }
public function processDefault() { $tpl = new CopixTpl(); $tplModule = new CopixTpl(); //if user is not connected : if (1) { // S'il y a un blog prevu a l'accueil $dispBlog = false; $getKernelLimitsIdBlog = Kernel::getKernelLimits('id_blog'); if ($getKernelLimitsIdBlog) { _classInclude('blog|kernelblog'); if ($blog = _ioDao('blog|blog')->getBlogById($getKernelLimitsIdBlog)) { // On v�rifie qu'il y a au moins un article $stats = KernelBlog::getStats($blog->id_blog); if ($stats['nbArticles']['value'] > 0) { $dispBlog = true; } } } if ($dispBlog) { //return CopixActionGroup::process ('blog|frontblog::getListArticle', array ('blog'=>$blog->url_blog)); return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('blog||', array('blog' => $blog->url_blog))); } if (!CopixConfig::exists('|can_public_rssfeed') || CopixConfig::get('|can_public_rssfeed')) { CopixHtmlHeader::addOthers('<link rel="alternate" href="' . CopixUrl::get('public||rss', array()) . '" type="application/rss+xml" title="' . htmlentities(CopixI18N::get('public|public.rss.flux.title')) . '" />'); } CopixHTMLHeader::addCSSLink(_resource("styles/module_fichesecoles.css")); $tplModule->assign('user', _currentUser()); $result = $tplModule->fetch('welcome|welcome_' . CopixI18N::getLang() . '.tpl'); $tpl->assign('TITLE_PAGE', '' . CopixI18N::get('public|public.welcome.title')); $tpl->assign('MAIN', $result); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); } }
public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $motcle = $this->getParam('motcle'); $clos = $this->getParam('clos'); $type = $this->getParam('type'); $ecole = $this->getParam('ecole'); $rTelep = $this->getParam('rTelep'); $admin = $this->getParam('admin'); $mondroit = $this->getParam('mondroit'); $daoType =& _dao('teleprocedures|type'); $tpl->assign('arTypes', $daoType->findForTeleprocedure($rTelep->id)); //print_r($rTelep); $canViewComboEcoles = TeleproceduresService::canMakeInTelep('VIEW_COMBO_ECOLES', $mondroit); if ($canViewComboEcoles) { $tpl->assign('comboEcolesLinesSup', array(0 => array('value' => '', 'libelle' => '---'), 1 => array('value' => '', 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllEcoles')))); } $tpl->assign('rTelep', $rTelep); $tpl->assign('admin', $admin); $tpl->assign('motcle', $motcle); $tpl->assign('clos', $clos); $tpl->assign('type', $type); $tpl->assign('ecole', $ecole); $tpl->assign('canViewComboEcoles', $canViewComboEcoles); $toReturn = $tpl->fetch('filtre-zone.tpl'); return true; }
/** * Décode uniquement si nous sommes en mode différent de UTF8 * * @param string $pString Chaine à décoder * @return string */ function _copix_utf8_decode($pString) { if (CopixI18N::getCharset() != 'UTF-8') { return utf8_decode($pString); } return $pString; }
/** * Accueil des stats * * @author Christophe Beyer <*****@*****.**> * @since 2007/03/19 */ public function home() { if (!Admin::canAdmin()) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get())); } $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.menu.stats')); $tpl->assign('MENU', Admin::getMenu('stats')); $tplStats = new CopixTpl(); $modules = Kernel::getAllModules(); $tab = array(); foreach ($modules as $mod_val) { $arModulesPath = CopixConfig::instance()->arModulesPath; foreach ($arModulesPath as $modulePath) { $class_file = $modulePath . $mod_val . '/' . COPIX_CLASSES_DIR . 'kernel' . $mod_val . '.class.php'; if (!file_exists($class_file)) { continue; } $module_class =& CopixClassesFactory::Create($mod_val . '|Kernel' . $mod_val); //print_r($module_class); if (!is_callable(array($module_class, 'getStatsRoot'))) { continue; } //$classeModule = CopixClassesFactory::create("$label|Kernel$label"); $tab[$mod_val]['module_nom'] = Kernel::Code2Name('mod_' . $mod_val); $tab[$mod_val]['stats'] = $module_class->getStatsRoot(); } } //print_r($tab); $tplStats->assign('tab', $tab); $tpl->assign('MAIN', $tplStats->fetch('sysutils|stats.modules.tpl')); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Affiche le chemin d'accès à une discussion ou un forum, depuis la racine d'un forum * * Les paramètres dépendent de la navigation dans le forum (il suffit de passer un paramètre) * * @author Christophe Beyer <*****@*****.**> * @since 2005/11/08 * @param integer $forum Id du forum * @param integer $topic Id de la discussion * @param integer $message Id du message * @param integer $modifyTopic Id de la discussion (formulaire de modification) */ public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $forum = $this->getParam('forum') ? $this->getParam('forum') : NULL; $topic = $this->getParam('topic') ? $this->getParam('topic') : NULL; $message = $this->getParam('message') ? $this->getParam('message') : NULL; $modifyTopic = $this->getParam('modifyTopic') ? $this->getParam('modifyTopic') : NULL; $res = array(); if ($forum) { $res[] = array("libelle" => CopixI18N::get('forum|forum.poucetIndex'), "lien" => CopixUrl::get('forum||getForum', array("id" => $forum->id))); } elseif ($topic) { $res[] = array("libelle" => CopixI18N::get('forum|forum.poucetIndex'), "lien" => CopixUrl::get('forum||getForum', array("id" => $topic->forum))); $res[] = array("libelle" => $topic->titre, "lien" => CopixUrl::get('forum||getTopic', array("id" => $topic->id))); } elseif ($message) { $res[] = array("libelle" => CopixI18N::get('forum|forum.poucetIndex'), "lien" => CopixUrl::get('forum||getForum', array("id" => $message->forum))); $res[] = array("libelle" => $message->topic_titre, "lien" => CopixUrl::get('forum||getTopic', array("id" => $message->topic))); } elseif ($modifyTopic) { //print_r($modifyTopic); $res[] = array("libelle" => CopixI18N::get('forum|forum.poucetIndex'), "lien" => CopixUrl::get('forum||getForum', array("id" => $modifyTopic->forum))); $res[] = array("libelle" => $modifyTopic->titre, "lien" => CopixUrl::get('forum||getTopic', array("id" => $modifyTopic->id))); } $tpl->assign('petitpoucet', $res); // retour de la fonction : $toReturn = $tpl->fetch('petitpoucet.tpl'); return true; }
public function getUsers() { $tpl = new CopixTpl(); $tplUsers = new CopixTpl(); $me_info = Kernel::getUserInfo("ME", 0); $animateurs_dao =& CopixDAOFactory::create("kernel|kernel_animateurs"); $animateur = $animateurs_dao->get($me_info['type'], $me_info['id']); $tplUsers->assign('animateur', $animateur); $ien_dao =& CopixDAOFactory::create("kernel|kernel_ien"); $ien = $ien_dao->get($me_info['type'], $me_info['id']); $tplUsers->assign('ien', $ien); $assistance_service =& CopixClassesFactory::Create('assistance|assistance'); $users = $assistance_service->getAssistanceUsers(); $tplUsers->assign('users', $users); $result = $tplUsers->fetch("users-list.tpl"); $tpl->assign('TITLE_PAGE', CopixI18N::get('assistance.moduleDescription') . " » " . CopixI18N::get('assistance.title.users')); $tpl->assign('MAIN', $result); // echo "<pre>"; print_r($_SESSION); die("</pre>"); /* $menu=array(); $menu[] = array( 'txt' => CopixI18N::get ('comptes.menu.return_getnode'), 'url' => CopixUrl::get ('comptes||getNode') ); $tpl->assign ('MENU', $menu ); */ return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Gets the registration page */ function getRegistration() { $_template =& new CopixTpl(); $_template->assign('TITLE_PAGE', 'Registration page'); $_template->assign('MAIN', '<h3>' . CopixI18N::get('|views.common.s0006') . '</h3>' . "\n" . $this->processZone('registration')); return new CopixActionReturn(COPIX_AR_DISPLAY, $_template); }
public function processSelectPage() { $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('htmleditor.title.pageSelect')); $tpl->assignZone('MAIN', 'htmleditor|SelectPage', array('onlyLastVersion' => 1, 'editorName' => CopixRequest::get('editorName', null, true), 'popup' => CopixRequest::get('popup', null, true))); return new CopixActionReturn(CopixActionReturn::DISPLAY_IN, $tpl, '|blank.tpl'); }
function getList() { $tpl =& new CopixTpl(); //assignation des différents éléments d'erreur. $tpl->assign('MAIN', $GLOBALS['COPIX']['COORD']->processZone('ProfileList')); $tpl->assign('TITLE_PAGE', CopixI18N::get('profile.title.list')); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Gets a hello the world */ function getHelloworld() { $tpl =& new CopixTpl(); $nom = isset($this->vars['nom']) ? $this->vars['nom'] : 'World'; $tpl->assign('TITLE_PAGE', CopixI18N::get('exemple.welcome.message')); $tpl->assign('MAIN', $GLOBALS['COPIX']['COORD']->processZone('exemple', array('nom' => $nom))); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Shows the login form * @return Object CopixActionReturn */ function getLoginForm() { $tpl =& new CopixTpl(); $login = isset($this->vars['login']) ? $this->vars['login'] : ''; $tpl->assign('TITLE_PAGE', CopixI18N::get('auth.titlePage.login')); $tpl->assign('MAIN', CopixZone::process('auth|loginForm', array('login' => $login, 'failed' => isset($this->vars['failed'])))); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Dépilement d'un contexte. * @return string element dépilé. (le contexte qui n'est plus d'atualité.) */ function pop() { $stack =& CopixContext::instance(); if (count($stack->_contextStack) < 1) { trigger_error(CopixI18N::get('copix:copix.error.context.stack'), E_USER_ERROR); } return array_pop($stack->_contextStack); }
function smarty_function_htmlarea($params, &$smarty) { static $_init = false; extract($params); //check the initialisation if (!$_init) { CopixHtmlHeader::addJsCode('_editor_url = "' . CopixUrl::get() . 'js/htmlarea/";'); //path of the library if (empty($path)) { $path = CopixUrl::get() . 'js/htmlarea/'; //default path under CopiX } CopixHTMLHeader::addJSLink($path . 'htmlarea.js'); CopixHTMLHeader::addJSLink($path . 'dialog.js'); if (empty($lang)) { $lang = CopixI18N::getLang(); } CopixHTMLHeader::addJSLink($path . 'lang/' . $lang . '.js'); CopixHTMLHeader::addCSSLink($path . 'htmlarea.css'); CopixHTMLHeader::addJSLink($path . 'popupwin.js'); CopixHTMLHeader::addJSCode(' HTMLArea.loadPlugin("TableOperations"); HTMLArea.loadPlugin("InsertAnchor"); HTMLArea.loadPlugin("TableToggleBorder"); HTMLArea.loadPlugin("AstonTools"); HTMLArea.loadPlugin("ContextMenu"); '); $_init = true; } if (empty($content)) { $content = ''; } //name of the textarea. if (empty($name)) { $smarty->trigger_error('htmlarea: missing name parameter'); } else { // CopixHTMLHeader::addOthers ($script); if (!$width) { $width = 500; } if (!$height) { $height = 500; } $out = '<textarea id="' . $name . '" name="' . $name . '" style="width: ' . $width . 'px; height:' . $height . 'px;" >' . $content . '</textarea>'; $out .= '<script type="text/javascript" defer="1"> var editor' . $name . ' = null; editor' . $name . ' = new HTMLArea("' . $name . '"); editor' . $name . '.registerPlugin("TableOperations"); editor' . $name . '.registerPlugin("TableToggleBorder"); editor' . $name . '.registerPlugin("InsertAnchor"); editor' . $name . '.registerPlugin("AstonTools"); editor' . $name . '.registerPlugin("ContextMenu"); editor' . $name . '.config.pageStyle = "@import url(\\"' . CopixUrl::get() . 'styles/styles_copix.css\\");"; editor' . $name . '.generate (); </script>'; } return $out; }
function smarty_function_messageI18n($params, &$this) { extract($params); if (empty($key)) { $smarty->_trigger_fatal_error("[smarty messagei18n] Missing key parameter"); return; } return CopixI18N::get($key); }
public function setUp() { CopixContext::push('copixtest'); $this->saveConfigi18n = CopixConfig::Instance()->i18n_path_enabled; CopixConfig::Instance()->i18n_path_enabled = true; CopixTpl::setTheme('testtheme'); CopixI18N::setLang('fr'); CopixI18N::setCountry('FR'); }
/** * Efface le cache de Copix (dossiers et BDD) * * @author Christophe Beyer <*****@*****.**> * @since 2006/12/05 */ public function clear() { if (!Admin::canAdmin()) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get())); } CacheServices::clearCache(); CacheServices::clearConfDB(); return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('sysutils||')); }
/** * Prépare les données pour la page d'accueil. */ function getIndex() { //création de l'objet. $tpl =& new CopixTpl(); $tpl->assign('MAIN', $GLOBALS['COPIX']['COORD']->includeStatic('welcome|welcome.htm')); $tpl->assign('TITLE_PAGE', CopixI18N::get('copix:common.version') . ': ' . COPIX_VERSION); //retour de la fonction. return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * get all available format and their caption */ function getFormatList() { $list = explode(';', CopixConfig::get('comment|textFormatList')); $toReturn = array(); foreach ((array) $list as $format) { $toReturn[$format] = CopixI18N::get('comment|comment.format.' . $format); } return $toReturn; }