public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $dossiers_tree = $this->getParam('tree');
     $dossiers_commands = Album::tree2commands($dossiers_tree);
     $dossiers_tree_move = Album::tree2move($dossiers_tree, $this->getParam('dossier_id'));
     $dossiers_commands_move = Album::tree2commands($dossiers_tree_move);
     //Kernel::MyDebug( $dossiers_commands_move );
     $tpl->assign('album_id', $this->getParam('album_id'));
     $tpl->assign('dossier_id', $this->getParam('dossier_id'));
     $tpl->assign('dossier', $this->getParam('dossier'));
     $tpl->assign('commands', $dossiers_commands);
     $tpl->assign('commands_move', $dossiers_commands_move);
     $tpl->assign('dossiermenu', $this->getParam('dossiermenu'));
     switch ($this->getParam('mode')) {
         case 'htmllist':
             $toReturn = $tpl->fetch('dossierstree_htmllist.tpl');
             break;
         case 'combo':
         default:
             $toReturn = $tpl->fetch('dossierstree_combo.tpl');
             break;
     }
     return true;
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $blog = $this->getParam('blog', '');
     $comment = $this->getParam('comment', NULL);
     //on récupère l'ensemble des articles du blog
     $dao = _dao('blog|blogarticle');
     //$article = $dao->getArticleByUrl($blog->id_blog, $this->getParam('article', ''));
     list($id_bact, ) = explode("-", $this->getParam('article', ''));
     $article = $dao->getArticleById($blog->id_blog, $id_bact);
     if (!$article) {
         $toReturn = '{/}' . $tpl->fetch('showarticle.tpl');
         return true;
     }
     //encodage des URL des catégories pour caractères spéciaux
     if (is_array($article->categories)) {
         foreach ($article->categories as $key => $categorie) {
             $article->categories[$key]->url_bacg = urlencode($categorie->url_bacg);
         }
     }
     $tpl->assign('article', $article);
     // Recherche de tous les commentaires associés à cet article
     $commentDAO = _dao('blog|blogarticlecomment');
     $res = $commentDAO->findCommentOrderBy($article->id_bact, 1);
     $listComment = array();
     foreach ($res as $r) {
         $r->time_bacc = BDToTime($r->time_bacc);
         array_push($listComment, $r);
     }
     if ($comment) {
         $toEdit = $comment;
     } else {
         // On récupère l'utilisateur connecté
         $user = BlogAuth::getUserInfos();
         $toEdit = _record('blogarticlecomment');
         $toEdit->authorid_bacc = $user->userId;
         $toEdit->authorname_bacc = $user->name;
         $toEdit->authoremail_bacc = $user->email;
         $toEdit->authorweb_bacc = $user->web;
     }
     $tpl->assign('blog', $blog);
     $tpl->assign('toEdit', $toEdit);
     $tpl->assign('listComment', $listComment);
     $tpl->assign('errors', $this->getParam('errors', null));
     $tpl->assign('showErrors', $this->getParam('showErrors', false));
     $tpl->assign('canComment', BlogAuth::canComment($blog->id_blog));
     $plugStats = CopixPluginRegistry::get("stats|stats");
     $plugStats->setParams(array('objet_a' => $article->id_bact));
     // retour de la fonction :
     $toReturn = $article->name_bact . '{/}' . $tpl->fetch('showarticle.tpl');
     return true;
 }
 public function _createContent(&$toReturn)
 {
     //load TPL
     $tpl = new CopixTpl();
     //get the id for current zone (force int)
     $idZone = $this->getParam('idZone') * 1;
     $catalog = $this->getParam('catalog');
     $enseignants = array();
     $oEns = array();
     //check the matrix right for current classe :
     if ($this->matrix->ecole($idZone)->_right->enseignant->voir) {
         $annuaireService =& CopixClassesFactory::Create('annuaire|AnnuaireService');
         //get the children's node
         $childNodeDatas = Kernel::getNodeChilds('BU_ECOLE', $idZone, false, array('skip_user' => true));
         //if the child is a CLASSE get the enseignant
         foreach ($childNodeDatas as $child) {
             if ($child['type'] == 'BU_CLASSE') {
                 $enseignants[] = $annuaireService->getEnseignantInClasse($child['id']);
             }
         }
         /*
          * delete the multiple ereg
          */
         $uniqueEnsId = array();
         foreach ($enseignants as $enseignant) {
             foreach ($enseignant as $ens) {
                 //check if the ens is already ereg
                 if (in_array($ens['id'], $uniqueEnsId)) {
                     continue;
                 } else {
                     $oEns[] = $ens;
                     $uniqueEnsId[] = $ens['id'];
                 }
             }
         }
         /*
          * get the school's picture
          */
         $pic = $this->model->query('SELECT photo FROM module_fiches_ecoles WHERE id = ' . $idZone)->toString();
         $tpl->assign('ens', $oEns);
         $tpl->assign('pic', $pic);
         $tpl->assign('idZone', $idZone);
         $tpl->assign('catalog', $catalog);
         //return the html content
         $toReturn = $tpl->fetch('zone.dashboard.ecole.tpl');
         return true;
     }
     //if the uses have no right : display a default tpl
     $toReturn = $tpl->fetch('zone.dashboard.noRight.tpl');
     return true;
 }
 public function _createContent(&$toReturn)
 {
     //Création du sous template.
     $tpl = new CopixTpl();
     CopixClassesFactory::fileInclude('cms|ServicesCMSPage');
     CopixContext::push('cms');
     $sHeadings = CopixClassesFactory::getInstanceOf('copixheadings|CopixHeadingsServices');
     $headings = $sHeadings->getTree();
     $cmsPages = new ServicesCMSPage();
     $pages = $cmsPages->getList();
     if (isset($this->_params['onlyLastVersion']) && $this->_params['onlyLastVersion'] == 1) {
         $pages = $this->_filterLastVersion($pages);
     }
     CopixContext::pop();
     //pagination
     foreach ($pages as $page) {
         $arPages[$page->id_head][] = $page;
     }
     $tpl->assign('arPublished', $arPages);
     $tpl->assign('arHeadings', $headings);
     $tpl->assign('select', $this->getParam('select'));
     $tpl->assign('back', $this->getParam('back'));
     $tpl->assign('popup', $this->getParam('popup'));
     $tpl->assign('height', Copixconfig::get('htmleditor|height'));
     $tpl->assign('width', Copixconfig::get('htmleditor|width'));
     //$tpl->assign ('editorType' , CopixConfig::get('htmleditor|type'));
     $tpl->assign('editorName', $this->getParam('editorName'));
     $toReturn = $tpl->fetch('page.select.ptpl');
     return true;
 }
 /**
  * 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 _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;
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $tpl->assign('homepageUrl', CopixConfig::get('|homePage'));
     $toReturn = $tpl->fetch('selecthomepage.form.tpl');
     return true;
 }
 /**
  * Affiche la fiche détaillée d'un utilisateur (login, nom, prénom...)
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2006/01/04
  * @param string $type Type de personne (USER_ELE, USER_ELE...)
  * @param integer $id Id
  */
 public function _createContent(&$toReturn)
 {
     $type = $this->getParam('type') ? $this->getParam('type') : NULL;
     $id = $this->getParam('id') ? $this->getParam('id') : NULL;
     if ($type && $id) {
         $usr = Kernel::getUserInfo($type, $id);
         //print_r($usr);
         /*
         $res = '<?xml version="1.0" ?>
         <person>
         <login>'.$login.'</login>
         <sexe>'.$usr['sexe'].'</sexe>
         <firstname>'.$usr['prenom'].'</firstname>
         <name>'.$usr['nom'].'</name>
         </person>
         ';
         */
         $tpl = new CopixTpl();
         $tpl->assign('usr', $usr);
         //$toReturn = utf8_encode($tpl->fetch ('getuser.tpl'));
         $toReturn = $tpl->fetch('getuser.tpl');
         //$toReturn = $res;
     }
     return true;
 }
 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);
     }
 }
Пример #10
0
 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;
 }
 public function _createContent(&$toReturn)
 {
     //Getting the user.
     //Create Services, and DAO
     $tpl = new CopixTpl();
     $id_blog = $this->getParam('id_blog', '');
     $tpl->assign('blog', $this->getParam('blog', null));
     $tpl->assign('id_blog', $id_blog);
     $tpl->assign('kind', $this->getParam('kind', ''));
     $tpl->assign('tabBlogFunctions', $this->getParam('tabBlogFunctions', null));
     $tpl->assign('can_format_articles', CopixConfig::get('blog|blog.default.can_format_articles'));
     $tpl->assign('RESULT', $this->getParam('RESULT', ''));
     $parent = Kernel::getModParentInfo("MOD_BLOG", $id_blog);
     if ($parent) {
         $mods = Kernel::getModEnabled($parent['type'], $parent['id'], '', 0, 1);
         // _dump($mods);
         $mods = Kernel::filterModuleList($mods, 'MOD_MAGICMAIL');
         if (count($mods)) {
             $magicmail_infos = _dao('module_magicmail')->get($mods[0]->module_id);
             $tpl->assign('magicmail_infos', $magicmail_infos);
             // _dump($magicmail_infos);
             /*
                'id' => '32',
                'login' => 'cepapeti',
                'domain' => 'magicmail.iconito.fr',
             */
         }
     }
     // retour de la fonction :
     $toReturn = $tpl->fetch('blog.show.tpl');
     return true;
 }
 /**
  * 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);
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $blog = $this->getParam('blog', '');
     $cat = $this->getParam('cat', null);
     $critere = $this->getParam('critere', null);
     //on récupère l'ensemble des articles du blog
     $dao = _dao('blog|blogarticle');
     if ($cat == null) {
         $date = $this->getParam('date', null);
         $arData = $dao->getAllArticlesFromBlog($blog->id_blog, $date);
     } else {
         $arData = $dao->getAllArticlesFromBlogByCat($blog->id_blog, $cat->id_bacg);
         $tpl->assign('cat', $cat);
     }
     //on filtre si on a fait une recherche sur les articles
     if ($critere != null) {
         $arData = $dao->getAllArticlesFromBlogByCritere($blog->id_blog, $critere);
     }
     //var_dump($arData);
     //on construit un tableau associatif entre l'identifiant de l'article et le nombre de commentaires
     foreach ($arData as $article) {
         //var_dump($article);
         $daoArticleComment =& CopixDAOFactory::getInstanceOf('blog|blogarticlecomment');
         $record = _record('blog|blogarticlecomment');
         $criteres = _daoSp();
         $criteres->addCondition('id_bact', '=', $article->id_bact);
         $criteres->addCondition('is_online', '=', 1);
         $resultat = $daoArticleComment->findBy($criteres);
         $arNbCommentByArticle[$article->id_bact] = count($resultat);
     }
     if (count($arData) > 0) {
         //encodage des URL des catégories pour caractères spéciaux
         foreach ($arData as $key => $data) {
             //Modification suite à apparition d'un warning due à l'absence de catégories , vboniface 06.11.2006
             $arData[$key]->key = $key;
             if (isset($arData[$key]->categories)) {
                 foreach ($arData[$key]->categories as $keyCat => $categorie) {
                     $arData[$key]->categories[$keyCat]->url_bacg = urlencode($categorie->url_bacg);
                 }
             }
         }
         if (count($arData) <= intval(CopixConfig::get('blog|nbMaxArticles'))) {
             $tpl->assign('pager', "");
             $tpl->assign('listArticle', $arData);
             $tpl->assign('arNbCommentByArticle', $arNbCommentByArticle);
         } else {
             $params = array('perPage' => intval(CopixConfig::get('blog|nbMaxArticles')), 'delta' => 5, 'recordSet' => $arData, 'template' => '|pager.tpl');
             $Pager = CopixPager::Load($params);
             $tpl->assign('pager', $Pager->GetMultipage());
             $tpl->assign('listArticle', $Pager->data);
             $tpl->assign('arNbCommentByArticle', $arNbCommentByArticle);
         }
         //rajout suite à bug mantis 54 vboniface 06.11.2006
         $tpl->assign('blog', $blog);
     }
     // retour de la fonction :
     $toReturn = $tpl->fetch('listarticle.tpl');
     return true;
 }
 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;
 }
 /**
  * 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);
 }
 /**
  * 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);
 }
 /**
  * Visualisation de l'aide
  *
  * @param string $toReturn
  * @return string
  */
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $displayAide = true;
     $daoAide = _ioDao('simplehelp');
     $sp = _daoSp()->addCondition('page_sh', '=', $this->getParam('page_sh', null, null))->addCondition('key_sh', '=', $this->getParam('key_sh', null, null));
     $arAide = $daoAide->findBy($sp);
     if (count($arAide) > 0) {
         $aide = $arAide[0];
     } else {
         $displayAide = false;
         $aide = null;
     }
     // cette variable est crée pour différencier si l'aide doit être afficher dans un popup classique ou un popuinformation
     $popup = false;
     if ($this->getParam('popup', null, true) === "true") {
         $popup = true;
     }
     $tpl->assign('aide', $aide);
     $tpl->assign('displayAide', $displayAide);
     $tpl->assign('popup', $popup);
     // $tpl->assign ('nofloat', $this->getParam ('nofloat', false));
     $toReturn = $tpl->fetch('showaide.tpl');
     return true;
 }
 /**
  * Création du contenu de la page
  */
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $tpl->assign('arModulesPath', CopixConfig::instance()->arModulesPath);
     $tpl->assign('arModules', $this->_getModuleOrderByDescription());
     $toReturn = $tpl->fetch('modules.list.tpl');
 }
 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') . " &raquo; " . 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);
 }
 /**
  * Commentaires d'une procedure
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2008/01/30
  * @param object $rFiche Recordset de la procedure
  */
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $rFiche = $this->getParam('rFiche');
     $mondroit = $this->getParam('mondroit');
     $daoinfo =& _dao('infosupp');
     $sql = 'SELECT * FROM module_teleprocedure_infosupp WHERE idinter=' . $rFiche->idinter . '';
     $canCheckVisible = TeleproceduresService::canMakeInTelep('CHECK_VISIBLE', $mondroit);
     $canAddComment = TeleproceduresService::canMakeInTelep('ADD_COMMENT', $mondroit);
     if (!$canCheckVisible) {
         $sql .= " AND info_message!='' AND info_message IS NOT NULL";
     }
     $sql .= " ORDER BY dateinfo ASC, idinfo ASC";
     $results = _doQuery($sql);
     // Pour chaque message on cherche les infos de son auteur
     $list = array();
     foreach ($results as $r) {
         $userInfo = Kernel::getUserInfo("ID", $r->iduser);
         //var_dump($userInfo);
         $avatar = Prefs::get('prefs', 'avatar', $r->iduser);
         $userInfo['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : '';
         $r->user = $userInfo;
         $list[] = $r;
     }
     //print_r($rFiche);
     $tpl->assign('info_message_edition', CopixZone::process('kernel|edition', array('field' => 'info_message', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
     $tpl->assign('info_commentaire_edition', CopixZone::process('kernel|edition', array('field' => 'info_commentaire', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
     $tpl->assign('canCheckVisible', $canCheckVisible);
     $tpl->assign('canAddComment', $canAddComment);
     $tpl->assign('list', $list);
     $tpl->assign('rFiche', $rFiche);
     $toReturn = $tpl->fetch('fiche-comms-zone.tpl');
     return true;
 }
 /**
  * Affiche la liste des actualites d'un blog
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2008/11/10
  * @param string $titre Titre a donner a la zone
  * @param string $blog URL_blog du blog
  * @param integer $nb Nombre d'articles a afficher
  * @param integer $article Id d'un article precis a afficher
  * @param integer $colonnes Nb de colonnes. Par defaut : 1
  * @param integer $chapo Si on veut afficher les chapos. Par defaut : 0
  * @param string $hreflib Si renseigne, affiche ce texte comme libelle d'un lien menant a l'accueil du blog
  * @param boolean $hr Affiche un HR entre chaque article. Par defaut : 0
  * @param boolean $showtitle (option) Si on veut afficher le titre des articles. Par defaut : true
  * @param boolean $showdate (option) Si on veut afficher la date des articles. Par defaut : true
  * @param boolean $showcategorie (option) Si on veut afficher les categories des articles. Par defaut : true
  */
 public function _createContent(&$toReturn)
 {
     $titre = $this->getParam('titre');
     $blog = $this->getParam('blog');
     $colonnes = $this->getParam('colonnes', 1);
     $nb = $this->getParam('nb');
     $chapo = $this->getParam('chapo', false);
     $hreflib = $this->getParam('hreflib');
     $hr = $this->getParam('hr', false);
     $article = $this->getParam('article');
     $showtitle = $this->getParam('showtitle', true);
     $showdate = $this->getParam('showdate', true);
     $showcategorie = $this->getParam('showcategorie', true);
     $tpl = new CopixTpl();
     $tpl->assign('titre', $titre);
     $tpl->assign('blog', $blog);
     $tpl->assign('nb', $nb);
     $tpl->assign('colonnes', $colonnes);
     $tpl->assign('chapo', $chapo);
     $tpl->assign('hreflib', $hreflib);
     $tpl->assign('hr', $hr);
     $tpl->assign('article', $article);
     $tpl->assign('showtitle', $showtitle);
     $tpl->assign('showdate', $showdate);
     $tpl->assign('showcategorie', $showcategorie);
     $toReturn = $tpl->fetch('zone_actualites.tpl');
     return true;
 }
 /**
  * Affiche les infos d'une classe (enseignant et �l�ves)
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2006/01/18
  * @param integer $rClasse Recordset de la classe
  */
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $annuaireService =& CopixClassesFactory::Create('annuaire|AnnuaireService');
     $rClasse = $this->getParam('rClasse') ? $this->getParam('rClasse') : NULL;
     if ($rClasse) {
         $classe = $rClasse['id'];
         $enseignants = $annuaireService->getEnseignantInClasse($classe);
         $eleves = $annuaireService->getElevesInClasse($classe);
         $rClasse["eleves"] = $eleves;
         $rClasse["enseignants"] = $enseignants;
         $matrix =& enic::get('matrixCache');
         $matrix->display();
         $droit = $matrix->classe($classe)->_right->USER_ENS->voir;
         if (!$droit) {
             $rClasse["enseignants"] = 'NONE';
         }
         $canWrite = $matrix->classe($classe)->_right->USER_ENS->communiquer;
         $tpl->assign('canWriteUSER_ENS', $canWrite);
         $droit = $matrix->classe($classe)->_right->USER_ELE->voir;
         if (!$droit) {
             $rClasse["eleves"] = 'NONE';
         }
         $canWrite = $matrix->classe($classe)->_right->USER_ELE->communiquer;
         $tpl->assign('canWriteUSER_ELE', $canWrite);
         $tpl->assign('classe', $rClasse);
         $toReturn = $tpl->fetch('infosclasse.tpl');
     }
     return true;
 }
 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 _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $blog = $this->getParam('blog', '');
     $tpl->assign('blog', $blog);
     $toReturn = $tpl->fetch('listsearch.tpl');
     return true;
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     //$service = & CopixClassesFactory::Create ('Album');
     $nbPages = intval($this->getParam('nbPages'));
     $page = intval($this->getParam('page'));
     $url = $this->getParam('url');
     $separator_type = $this->getParam('separator', '?');
     // Nb de pages � afficher de chaque c�t� de la page courante
     $autour = $this->getParam('autour', 3);
     // Nb de pages � chaque bout de la r�gle
     $extremite = $this->getParam('extremite', 1);
     if ($nbPages < 2) {
         return true;
     }
     $autourFrom = $page - $autour < 1 ? 1 : $page - $autour;
     $autourTo = $page + $autour > $nbPages ? $nbPages : $page + $autour;
     //print_r2($autourFrom);
     //print_r2($autourTo);
     $sep1 = $sep2 = '...';
     $pages1 = $pages2 = $pages3 = array();
     $pages1 = range(1, 0 + $extremite);
     $pages2 = range($autourFrom, $autourTo);
     $pages3 = range($nbPages - $extremite + 1, $nbPages);
     if ($autourFrom <= $extremite + 1) {
         // Les premiers ... sautent
         $sep1 = '';
     }
     if ($autourTo >= $nbPages - $extremite) {
         // Les deuxi�mes ... sautent
         $sep2 = '';
     }
     if (!$sep1) {
         // On fusionne les premiers tableaux
         $pages2 = array_unique(array_merge($pages1, $pages2));
         $pages1 = array();
     }
     if (!$sep2) {
         // On fusionne les derniers tableaux
         $pages2 = array_unique(array_merge($pages2, $pages3));
         $pages3 = array();
     }
     $pages = range(1, $nbPages);
     $tpl->assign('nbPages', $nbPages);
     $tpl->assign('page', $page);
     //$tpl->assign('pages', $pages);
     $tpl->assign('pages1', $pages1);
     $tpl->assign('pages2', $pages2);
     $tpl->assign('pages3', $pages3);
     $tpl->assign('url', $url);
     $tpl->assign('sep1', $sep1);
     $tpl->assign('sep2', $sep2);
     $tpl->assign('separator', $separator_type);
     // retour de la fonction :
     $toReturn = $tpl->fetch('reglettepages.tpl');
     return true;
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $blog = $this->getParam('blog', '');
     $dao = _dao('blog|blogfluxrss');
     $tpl->assign('listFluxRss', $dao->getAllFluxRssFromBlog($blog->id_blog));
     $toReturn = $tpl->fetch('listfluxrss.tpl');
     return true;
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $tpl->assign('childs', $this->getParam('childs'));
     $tpl->assign('type', $this->getParam('type'));
     $tpl->assign('id', $this->getParam('id'));
     $toReturn = $tpl->fetch('userlist.tpl');
     return true;
 }
 /**
  * Affichage des dernieres pages d'un blog au format Javascript
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2009/01/23
  * @param mixed $blog Recordset du blog
  * @param integer $nb (option) Nombre de pages a afficher. Si null, prend nbJsArticles dans la conf. Par defaut : null
  * @param integer $page (option) Id d'une page precise a afficher
  * @param boolean $content (option) Indique si on affiche le corps des pages. Par defaut : false
  * @param integer $colonnes Nb de colonnes. Par defaut : 1
  * @param boolean $hr (option) Si on veut afficher un HR entre les pages. Par defaut : false
  * @param boolean $showtitle (option) Si on veut afficher le titre des articles. Par defaut : true
  * @param integer $truncate (option) Limit de cesure du texte. Par defaut : 0 (pas de cesure)
  */
 public function _createContent(&$toReturn)
 {
     $blog = $this->getParam('blog', null);
     $nb = $this->getParam('nb', null);
     $nb = intval($nb);
     $colonnes = $this->getParam('colonnes');
     $colonnes = intval($colonnes);
     if (!$colonnes) {
         $colonnes = 1;
     }
     $content = $this->getParam('content', false);
     $hr = $this->getParam('hr', false);
     $page = $this->getParam('page', null);
     $page = intval($page);
     $showtitle = $this->getParam('showtitle', true);
     $truncate = $this->getParam('truncate', 0);
     $tpl = new CopixTpl();
     $listPage = array();
     if ($page) {
         // Page precise
         if (($rPage = _dao('blog|blogpage')->get($page)) && $rPage->id_blog == $blog->id_blog) {
             $listPage[] = $rPage;
         }
     } else {
         // Les dernieres pages
         if (!$nb || $nb < 0 || $nb > 20) {
             $nb = CopixConfig::get('blog|nbJsArticles');
         }
         //on récupère l'ensemble des articles du blog
         $dao = _dao('blog|blogpage');
         $arData = $dao->getAllPagesFromBlog($blog->id_blog);
         if (count($arData) <= $nb) {
             $listPage = $arData;
         } else {
             $params = array('perPage' => $nb, 'delta' => 1, 'recordSet' => $arData, 'template' => '|pager.tpl');
             $Pager = CopixPager::Load($params);
             $tpl->assign('pager', $Pager->GetMultipage());
             $listPage = $Pager->data;
         }
     }
     $tpl->assign('listPage', $listPage);
     $nbPages = count($listPage);
     // Nb elements par colonnes
     $parCols = ceil($nbPages / $colonnes);
     $tpl->assign('blog', $blog);
     $tpl->assign('content', $content);
     $tpl->assign('hr', $hr);
     $tpl->assign('parCols', $parCols);
     $tpl->assign('widthColonne', round(100 / $colonnes, 1) . '%');
     $tpl->assign('showtitle', $showtitle);
     $tpl->assign('truncate', $truncate);
     $txt = $tpl->fetch('listpagejs.tpl');
     $txt = trim(str_replace("\r\n", "", $txt));
     $txt = trim(str_replace("\n", "", $txt));
     $toReturn = "var blogJsPages='" . addslashes($txt) . "';";
     return true;
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $albumlist = array();
     $tpl->assign('albumlist', $albumlist);
     // retour de la fonction :
     $toReturn = $tpl->fetch('albumlist.tpl');
     return true;
 }
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $size = CacheServices::getCacheSize();
     // Cherche
     $tpl->assign('size', $size);
     $toReturn = $tpl->fetch('cache.status.tpl');
     return true;
 }