private function initMenu()
 {
     $items = array();
     $items['admin'] = array('title' => 'Admin home page', 'accessCallback' => 'HTTP_BASIC');
     $items['admin/file_manger'] = array('title' => 'Manage folders and files', 'accessCallback' => 'HTTP_BASIC', 'modelMethod' => 'buildFileManager', 'template' => 'file_manager', 'blocks' => array('blockFolderList', 'blockFileList'));
     $items['admin/ajax/folder_list/%'] = array('title' => 'Get folder list based on a folder id', 'modelMethod' => 'folderList');
     Menu::setMenu($items, __CLASS__);
 }
 private function initMenu()
 {
     $items = array();
     $items['list/%'] = array('title' => 'List the pictures in a folder', 'access callback' => TRUE, 'template' => 'page-folder');
     $items['list_subfolders/%'] = array('title' => 'list the sub folders', 'access callback' => TRUE, 'modelMethod' => 'listSubFolders', 'template' => 'page-folder');
     $items['list_files/%'] = array('title' => 'list the files in the folders', 'access callback' => TRUE, 'modelMethod' => 'listFiles', 'template' => 'page-folder');
     $items['list_files_ajax/%'] = array('title' => 'list the files in the folders', 'access callback' => TRUE, 'modelMethod' => 'listFilesAjax');
     Menu::setMenu($items, __CLASS__);
 }
 private function initMenu()
 {
     $items = array();
     $items['picture/%'] = array('title' => 'Show the picture', 'access callback' => TRUE, 'template' => 'page-file');
     $items['photo/%'] = array('title' => 'Show the picture', 'access callback' => TRUE, 'template' => 'page-file');
     $items['picture/ajax/%'] = array('title' => 'Edit the picture', 'access callback' => TRUE, 'modelMethod' => 'getFileAjax');
     $items['same_picture/next_ajax/%'] = array('title' => 'Edit the picture', 'access callback' => TRUE, 'modelMethod' => 'getSameFilesNextAjax');
     $items['same_picture/prev_ajax/%'] = array('title' => 'Edit the picture', 'access callback' => TRUE, 'modelMethod' => 'getSameFilesPrevAjax');
     Menu::setMenu($items, __CLASS__);
 }
 private function initMenu()
 {
     $items = array();
     $items['webservice/submitFiles'] = array('title' => 'Adding files to the system', 'accessCallback' => 'HTTP_BASIC', 'modelMethod' => 'submitFilesAPI');
     Menu::setMenu($items, __CLASS__);
 }
Exemple #5
0
 public function setMenu($value, $link)
 {
     $menu = new Menu();
     $menu->setMenu($value, $link);
     $menu->setUrlBase($this->_url_base);
     $this->_menu = $menu;
 }
 private function initMenu()
 {
     $items = array();
     Menu::setMenu($items, __CLASS__);
 }
 /**
  * Método para inactivar/reactivar
  */
 public function estado($tipo, $key)
 {
     if (!($id = Security::getKey($key, $tipo . '_menu', 'int'))) {
         return Redirect::toAction('listar');
     }
     $menu = new Menu();
     if (!$menu->find_first($id)) {
         Flash::error('Lo sentimos, pero no se ha podido establecer la información del menú');
     } else {
         if ($menu->id <= 2) {
             Flash::warning('Lo sentimos, pero este menú no se puede editar.');
             return Redirect::toAction('listar');
         }
         if ($tipo == 'inactivar' && $menu->activo == Menu::INACTIVO) {
             Flash::info('El menú ya se encuentra inactivo');
         } else {
             if ($tipo == 'reactivar' && $menu->activo == Menu::ACTIVO) {
                 Flash::info('El menú ya se encuentra activo');
             } else {
                 $estado = $tipo == 'inactivar' ? Menu::INACTIVO : Menu::ACTIVO;
                 if (Menu::setMenu('update', $menu->to_array(), array('id' => $id, 'activo' => $estado))) {
                     $estado == Menu::ACTIVO ? Flash::valid('El menú se ha reactivado correctamente!') : Flash::valid('El menú se ha inactivado correctamente!');
                 }
             }
         }
     }
     return Redirect::toAction('listar');
 }
Exemple #8
0
 public function __construct()
 {
     Menu::setMenu();
 }
 /**
  * Método para inactivar/reactivar
  */
 public function estado($tipo, $key)
 {
     if (!($id = MkcSecurity::isValidKey($key, $tipo . '_menu', 'int'))) {
         return MkcRedirect::toAction('listar');
     }
     $menu = new Menu();
     if (!$menu->find_first($id)) {
         MkcMessage::get('id_no_found');
     } else {
         if ($menu->id <= 2) {
             MkcMessage::warning('Lo sentimos, pero este menú no se puede editar.');
             return MkcRedirect::toAction('listar');
         }
         if ($tipo == 'inactivar' && $menu->activo == Menu::INACTIVO) {
             MkcMessage::info('El menú ya se encuentra inactivo');
         } else {
             if ($tipo == 'reactivar' && $menu->activo == Menu::ACTIVO) {
                 MkcMessage::info('El menú ya se encuentra activo');
             } else {
                 $estado = $tipo == 'inactivar' ? Menu::INACTIVO : Menu::ACTIVO;
                 if (Menu::setMenu('update', $menu->to_array(), array('id' => $id, 'activo' => $estado))) {
                     $estado == Menu::ACTIVO ? MkcMessage::valid('El menú se ha reactivado correctamente!') : MkcMessage::valid('El menú se ha inactivado correctamente!');
                 }
             }
         }
     }
     return MkcRedirect::toAction('listar');
 }