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);
     }
 }
 /**
  * Affiche la liste des blogs
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2006/03/09
  * @todo Positionner $grville
  */
 public function processGetListBlogs()
 {
     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::addJSLink(CopixUrl::get() . 'js/iconito/module_annuaire.js');
     $tpl = new CopixTpl();
     $tpl->assign('TITLE_PAGE', CopixI18N::get('public|public.blog.annuaire'));
     $kw = $this->getRequest('kw', null);
     $grville = 1;
     $tplListe = new CopixTpl();
     if ($ville_as_array = Kernel::getKernelLimits('ville_as_array')) {
         $tplListe->assign('list', CopixZone::process('GetListBlogs2', array('kw' => $kw, 'ville' => $ville_as_array)));
     } else {
         $tplListe->assign('list', CopixZone::process('GetListBlogs2', array('kw' => $kw, 'grville' => $grville)));
     }
     $tplListe->assign('kw', $kw);
     $result = $tplListe->fetch("getlistblogs.tpl");
     $tpl->assign("MAIN", $result);
     return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
 }
 /**
  * Validation d'un commentaire.
  */
 public function doValidComment()
 {
     if (Kernel::isSpam()) {
         return new CopixActionReturn(CopixActionReturn::HTTPCODE, CopixHTTPHeader::get404(), "Page introuvable");
     }
     $url_bact = _request('url_bact');
     //On verifit que le blog existe (on r�cup�re le blog avec son nom)
     $dao = CopixDAOFactory::create('blog|blog');
     if (!($blog = $dao->getBlogByName(_request('blog')))) {
         return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('blog.error.unableToFindBlog'), 'back' => CopixUrl::get('')));
     }
     // On v�rifie que le droit de lecture est pr�sent
     if (!BlogAuth::canMakeInBlog('READ', $blog)) {
         return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get('')));
     }
     if (!$blog->has_comments_activated) {
         return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('blog.add.comment.closed'), 'back' => CopixUrl::get('', array('blog' => _request('blog')))));
     }
     $id_bact = $this->getRequest('id_bact', null);
     if (!BlogAuth::canComment($blog->id_blog)) {
         return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('blog.error.cannotManageComment'), 'back' => CopixUrl::get('', array('blog' => _request('blog')))));
     }
     $tpl = new CopixTpl();
     $commentDAO = CopixDAOFactory::create('blog|blogarticlecomment');
     $comment = CopixDAOFactory::createRecord('blog|blogarticlecomment');
     $this->_validFromPostProperties($comment);
     $comment->date_bacc = date('Ymd');
     $comment->time_bacc = date('Hi');
     $comment->is_online = $blog->type_moderation_comments != 'POST' ? 0 : 1;
     $comment->authorip_bacc = $_SERVER["REMOTE_ADDR"];
     CopixHTMLHeader::addCSSLink(CopixUrl::get('blog||getBlogCss', array('id_blog' => $blog->id_blog)));
     $tpl->assign('blog', $blog);
     $errors = $commentDAO->check($comment);
     //print_r($comment);
     $showErrors = false;
     if ($errors != 1) {
         // Traitement des erreurs
         $showErrors = true;
     } else {
         // Insertion dans la base
         $commentDAO->insert($comment);
     }
     $zoneArticle = CopixZone::process('ShowArticle', array('blog' => $blog, 'article' => $this->getRequest('article', ''), 'errors' => $errors, 'showErrors' => $showErrors, 'comment' => $comment));
     list($title, $article) = explode("{/}", $zoneArticle);
     $tpl->assign('TITLE_PAGE', $title . ' - ' . $blog->name_blog);
     $tpl->assign('Article', $article);
     $tpl->assign('ListLink', CopixZone::process('ListLink', array('blog' => $blog)));
     $tpl->assign('ListCategory', CopixZone::process('ListCategory', array('blog' => $blog)));
     $tpl->assign('ListArchive', CopixZone::process('ListArchive', array('blog' => $blog)));
     $tpl->assign('ListPage', CopixZone::process('ListPage', array('blog' => $blog)));
     $tpl->assign('ListSearch', CopixZone::process('ListSearch', array('blog' => $blog)));
     if (!$showErrors) {
         if ($comment->is_online == 1) {
             return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('blog||showArticle', array('blog' => urlencode($blog->url_blog), 'article' => _request('article'))) . '#comments');
         } else {
             return CopixActionGroup::process('genericTools|Messages::getInformation', array('message' => CopixI18N::get('blog.comments.offline.info'), 'continue' => CopixUrl::get('blog|default|showArticle', array('blog' => $blog->url_blog, 'article' => $url_bact))));
         }
     }
     //		$menu = array();
     $parent = Kernel::getModParentInfo("MOD_BLOG", $blog->id_blog);
     //print_r($parent);
     $blog->parent = $parent;
     /*
             if ($parent['type']=='CLUB') {
                 $droit = Kernel::getLevel($parent['type'], $parent['id']);
                 //print_r($droit);
                 if (GroupeService::canMakeInGroupe('VIEW_HOME', $droit))
                     $menu[] = array('url'=>CopixUrl::get ('groupe||getHome', array("id"=>$parent['id'])), 'txt'=>CopixI18N::get ('blog.menuToGroup'));
             }
             if (BlogAuth::canMakeInBlog('ACCESS_ADMIN',$blog))
                 $menu[] = array('url'=>CopixUrl::get ('admin|showBlog', array("id_blog"=>$blog->id_blog)), 'txt'=>CopixI18N::get ('blog.menuAdmin'));
     */
     //print_r($menu);
     $menu = array();
     if (BlogAuth::canMakeInBlog('ACCESS_ADMIN', $blog)) {
         $menu = getBlogAdminMenu($blog);
     }
     $tpl->assign('MENU', $menu);
     CopixHtmlHeader::addOthers('<link rel="alternate" href="' . CopixUrl::get('blog||rss', array("blog" => $blog->url_blog)) . '" type="application/rss+xml" title="' . htmlentities($blog->name_blog) . '" />');
     if ($blog->template) {
         $MAIN = $tpl->fetch($blog->template);
     } else {
         $MAIN = $tpl->fetch('blog_main.tpl');
     }
     $tpl->assign('MAIN', $MAIN);
     $tpl->assign('HEADER_MODE', 'compact');
     return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
 }