protected function setPage($page_name = null) { // Get page from request if not given as parameter (default behaviour) if (is_null($page_name)) { $page_name = $this->getRequestParameter('page', $this->startPage); } // Handle case insensitivity $page_name = strtolower($page_name); // Support default page if not specified in namespace if (substr($page_name, -1) == ':') { $page_name .= $this->startPage; } // Retrieve the page, or start a new one if cannot be found $this->page = nahoWikiPagePeer::retrieveByName($page_name); if (!$this->page) { return; } // Retrieve the revision $revision = $this->getRequestParameter('revision', $this->page->getLatestRevision()); $this->revision = $this->page->getRevision($revision); if (!$this->revision) { $this->initNewRevision(); } // Generate the URI parameters to keep trace of the requested page $this->uriParams = 'page=' . $this->page->getName(); if ($this->revision->getRevision() != $this->page->getLatestRevision()) { $this->uriParams .= '&revision=' . $this->revision->getRevision(); } // Permissions management $this->canView = $this->page->canView($this->getUser()); $this->canEdit = $this->page->canEdit($this->getUser()); // Retriev item name and type of item (tab and breadcrumbs) list($tipo, $id) = split("_", $this->page->getName()); switch ($tipo) { case 'atto': $this->item = OppAttoPeer::retrieveByPK($id); $this->item_name = Text::denominazioneAttoShort($this->item); break; case 'votazione': $this->item = OppVotazionePeer::retrieveByPK($id); $this->item_name = $this->item->getTitolo(); break; case 'emendamento': $this->item = OppEmendamentoPeer::retrieveByPK($id); $attoPortante = $this->item->getAttoPortante(); $this->item_name = "Emendamento " . $this->item->getTitolo() . " relativo a " . Text::denominazioneAttoShort($attoPortante) . " - " . $attoPortante->getTitolo(); break; } $this->item_type = $tipo; }
<?php $emendamento = OppEmendamentoPeer::retrieveByPK($result->propel_id); $atto = $emendamento->getAttoPortante(); $tipo_atto = $atto->getOppTipoAtto(); ?> <?php echo link_to_in_mail(highlight_keywords(sprintf("emendamento %s", $emendamento->getTitoloCompleto(), $term, sfConfig::get('app_lucene_result_highlighter', '<strong class="highlight">%s</strong>')), add_highlight_qs($result->getInternalUri(), $term))); ?> - presentato il <?php echo $emendamento->getDataPres('d/m/Y'); ?> , relativo a <?php echo $tipo_atto->getDescrizione(); ?> <?php echo $atto->getShortTitle(); ?> ,
/** * Executes commenti action * * @return void * @author Guglielmo Celata */ public function executeCommenti() { $this->emendamento = OppEmendamentoPeer::retrieveByPK($this->getRequestParameter('id')); $this->attoPortante = $this->emendamento->getAttoPortante(); }