示例#1
0
 /**
  * Set flyer page actions.
  *
  * @param  Model_Flyer  $flyer
  */
 protected function _set_flyer_actions(Model_Flyer $flyer = null)
 {
     $this->view->tabs[] = array('link' => Route::get('flyer')->uri(array('id' => 'undated')), 'text' => '<i class="icon-random icon-white"></i> ' . __('Random undated flyer'));
     $this->view->tabs[] = array('link' => Route::get('flyer')->uri(array('id' => 'random')), 'text' => '<i class="icon-random icon-white"></i> ' . __('Random flyer'));
     if ($flyer) {
         // Set browse flyers to
         if ($flyer->stamp_begin) {
             $this->view->tabs['flyers']['link'] = $flyer->has_full_date() ? Route::url('flyers', array('year' => date('Y', $flyer->stamp_begin), 'month' => date('n', $flyer->stamp_begin))) : Route::url('flyers', array('year' => date('Y', $flyer->stamp_begin)));
         }
         Route::url('flyers', array('action' => '', 'year' => date('Y', $flyer->stamp_begin), 'month' => date('m', $flyer->stamp_begin)));
         if ($event = $flyer->event()) {
             $this->view->tabs[] = array('link' => Route::model($event), 'text' => '<i class="icon-calendar icon-white"></i> ' . __('Event') . ' &raquo;');
         }
     }
 }