public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->set('menuActivo', 'actividad');
     $this->Crud->on('afterSave', function (\Cake\Event\Event $event) {
         if ($event->subject->created) {
             $email = new Email();
             $email->template('default')->emailFormat('html')->to('*****@*****.**')->from('*****@*****.**')->viewVars(['actividad' => $this->request->data])->send();
             $this->_compruebaMaximoActividadesPorCurso($this->request->data['curso']['_ids']);
             if ($this->request->data['destacada'] == '1') {
                 $idActividad = $event->subject->entity->id;
                 $this->_guardaDestacado($idActividad);
             }
         }
     });
 }
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->Auth->allow('add');
     $this->set('menuActivo', 'usuario');
 }
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->set('menuActivo', 'destacados');
 }
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->set("menuActivo", 'departamentos');
 }
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->set('menuActivo', 'evaluacion');
 }
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->set('menuActivo', 'slider');
 }
 public function beforeFilter(Event $event)
 {
     parent::beforeFilter($event);
     $this->set('menuActivo', 'profesores');
 }