芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/www/resuamer/site/application/classes/controller/accueil.php
template = View::factory(I18n::$lang . '/' . $this->layout); $this->template->content = null; if ($this->request->is_initial()) $this->tpl = & $this->template->content; else $this->tpl = & $this->template; } public function action_index() { $this->template->title = I18n::get('titreAccueil'); $this->template->description = I18n::get('descriptionAccueil'); $this->template->page = 1; $this->tpl = View::factory(I18n::$lang . '/accueil/index'); $langNow = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); $this->tpl->obama = ORM::factory('candidatlang')->where('candidat_id', '=', 1)->and_where('lang_id', '=', $langNow->id)->find(); //Récup dernière anecdote Obama $idTypeAnecdoteO = ORM::factory('typeevenementlang') ->where('libelle', '=', 'Anecdote') ->find() ->typeevenement_id; $derAnecO = ORM::factory('evenement') ->where('candidat_id', '=', '1') ->and_where('typeevenement_id', '=',$idTypeAnecdoteO) ->order_by('date','DESC') ->find() ->date; $anecdoteO = ORM::factory('evenement') ->where('date', '=', $derAnecO) ->find(); $anecdoteLandO = ORM::factory('evenementlang') ->where('evenement_id','=',$anecdoteO->id) ->and_where('lang_id', '=', $langNow->id) ->find(); $this->tpl->anecdoteO = $anecdoteLandO; //Récup dernière anecdote Romney $idTypeAnecdoteR = RRM::factory('typeevenementlang') ->where('libelle', '=', 'Anecdote') ->find() ->typeevenement_id; $derAnecR = RRM::factory('evenement') ->where('candidat_id', '=', '2') ->and_where('typeevenement_id', '=',$idTypeAnecdoteR) ->order_by('date','DESC') ->find() ->date; $anecdoteR = RRM::factory('evenement') ->where('date', '=', $derAnecR) ->find(); $anecdoteLandR = RRM::factory('evenementlang') ->where('evenement_id','=',$anecdoteR->id) ->and_where('lang_id', '=', $langNow->id) ->find(); $this->tpl->anecdoteR = $anecdoteLandR; //Récup dernière vidéo //Récup dernière citation } public function action_candidates() { $this->template->title = I18n::get('titreCandidats'); $this->template->description = I18n::get('descriptionCandidats'); $this->template->page = 2; $this->tpl = View::factory(I18n::$lang . '/accueil/candidates'); $langNow = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); $this->tpl->obama = ORM::factory('candidatlang')->where('candidat_id', '=', 1)->and_where('lang_id', '=', $langNow->id)->find(); $this->tpl->romney = ORM::factory('candidatlang')->where('candidat_id', '=', 2)->and_where('lang_id', '=', $langNow->id)->find(); } public function action_parties() { $this->template->title = I18n::get('titreParties'); $this->template->description = I18n::get('descriptionParties'); $this->template->page = 5; $this->tpl = View::factory(I18n::$lang . '/accueil/parties'); $langNow = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); /* $this->tpl->obama = ORM::factory('candidatlang')->where('candidat_id','=',1)->and_where('lang_id', '=', $langNow->id)->find(); $this->tpl->romney = ORM::factory('candidatlang')->where('candidat_id','=',2)->and_where('lang_id', '=', $langNow->id)->find(); */ } public function action_howdoesitwork() { $this->template->title = I18n::get('howdoesitwork.title'); $this->template->description = I18n::get('howdoesitwork.description'); $this->template->page = 5; $this->tpl = View::factory(I18n::$lang . '/accueil/howdoesitwork'); $langNow = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); /* $this->tpl->obama = ORM::factory('candidatlang')->where('candidat_id','=',1)->and_where('lang_id', '=', $langNow->id)->find(); $this->tpl->romney = ORM::factory('candidatlang')->where('candidat_id','=',2)->and_where('lang_id', '=', $langNow->id)->find(); */ } public function action_obama() { $this->template->title = I18n::get('obama.title'); $this->template->description = I18n::get('obama.description'); $this->template->page = 2; $this->tpl = View::factory(I18n::$lang . '/candidat/obama'); $langNow = ORM::factory('lang')->where('name', '=', I18n::$lang)->find(); /* $this->tpl->obama = ORM::factory('candidatlang')->where('candidat_id','=',1)->and_where('lang_id', '=', $langNow->id)->find(); $this->tpl->romney = ORM::factory('candidatlang')->where('candidat_id','=',2)->and_where('lang_id', '=', $langNow->id)->find(); */ } }