Author: LEI
Inheritance: extends Datas
Example #1
1
 function installationMenu()
 {
     $menu = array();
     $menu[] = array('name' => 'Übersicht', 'href' => 'install.php');
     $menu[] = array('name' => 'Datenbank', 'href' => 'install.php?section=db');
     $menu[] = array('name' => 'Nachrichten', 'href' => 'install.php?section=messages');
     $menu[] = array('name' => 'Netzwerk', 'href' => 'install.php?section=network');
     $menu[] = array('name' => 'Beenden', 'href' => 'install.php?section=finish');
     $menu = Menus::checkIfSelected($menu);
     return $menu;
 }
 /**
  * Shows the dashboard view
  */
 public function indexAction()
 {
     $this->view->menu = Menus::findFirst(array('conditions' => 'id = ?1', 'order' => 'name', 'bind' => array(1 => 1)));
     $this->view->devices = Devices::find(array('order' => 'name ASC'));
     $this->view->movies = KodiMovies::getLatestMovies();
     $this->view->albums = KodiMusic::getLatestAlbums();
     $this->view->episodes = KodiTVShowEpisodes::getLatestEpisodes();
     $this->executionTime = -microtime(true);
     $this->view->phpsysinfoData = PHPSysInfo::getData($this->config);
     $this->view->PHPSysinfoExecutionTime = round($this->executionTime + microtime(true), 2) . 's';
 }
 /**
  * Crea un Controlador para el menu
  *
  */
 public function create()
 {
     //Datos del select
     $perfiles = new Perfil();
     $this->perfiles = $perfiles->find('order: nombre');
     $menus = new Menus();
     $this->menus = $menus->find('order: nombre');
     /**
      * Se verifica si el usuario envio el form (submit) y si ademas
      * dentro del array POST existe uno llamado "controllers"
      * el cual aplica la autocarga de objeto para guardar los
      * datos enviado por POST utilizando autocarga de objeto
      */
     if (Input::hasPost('controllers')) {
         /**
          * se le pasa al modelo por constructor los datos del form y ActiveRecord recoge esos datos
          * y los asocia al campo correspondiente siempre y cuando se utilice la convención
          * model.campo
          */
         $controller = new Controlador(Input::post('controllers'));
         //En caso que falle la operación
         if (!$controller->save()) {
             Flash::error('Falló Operación');
             //se hacen persistente los datos en el formulario
             $this->controllers = Input::post('controllers');
             /**
              * NOTA: para que la autocarga aplique de forma correcta, es necesario que llame a la variable de instancia
              * igual como esta el model de la vista, en este caso el model es "controllers"
              */
         }
     }
 }
 public function buttonAction()
 {
     $this->_helper->layout->disableLayout();
     $this->view->id = Zend_Auth::getInstance()->getIdentity()->id;
     $button = new Menus();
     setcookie('Zend_Auth', 'good', false, '/', false);
     $this->view->menu = $button->fetchAll(array("menutype ='button'", 'published = 1'), 'order');
 }
Example #5
0
 /**
  * Eliminar un menu
  *
  * @param int $id
  */
 public function del($id = null)
 {
     $menus = new Menus();
     if ($id) {
         //Buscando el Objeto a Borrar
         $menu = $menus->find($id);
         if (!$menu->delete()) {
             Flash::error('Falló Operación');
         }
     }
     //enrutando al index para listar los menus
     Router::redirect('admin/menus/');
 }
Example #6
0
 public function actionIndex()
 {
     $shop_id = Yii::app()->request->getParam('shop_id');
     if (!$shop_id) {
         Error::output(Error::ERR_NO_SHOPID);
     }
     //查询出改商店的一些详细信息
     $shopData = Shops::model()->findByPk($shop_id);
     if (!$shopData) {
         Error::output(Error::ERR_NO_SHOPID);
     }
     $shopData = CJSON::decode(CJSON::encode($shopData));
     //根据店铺id查询出该店铺的菜单
     $menuData = Menus::model()->with('food_sort', 'image', 'shops')->findAll(array('condition' => 't.shop_id=:shop_id AND t.status=:status', 'params' => array(':shop_id' => $shop_id, ':status' => 2)));
     $data = array();
     foreach ($menuData as $k => $v) {
         $data[$k] = $v->attributes;
         $data[$k]['index_pic'] = $v->index_pic ? Yii::app()->params['img_url'] . $v->image->filepath . $v->image->filename : '';
         $data[$k]['sort_name'] = $v->food_sort->name;
         $data[$k]['shop_name'] = $v->shops->name;
         $data[$k]['create_time'] = Yii::app()->format->formatDate($v->create_time);
         $data[$k]['status'] = Yii::app()->params['menu_status'][$v->status];
         $data[$k]['price'] = $v->price;
     }
     Out::jsonOutput(array('shop' => $shopData, 'menus' => $data));
 }
Example #7
0
 public function begin()
 {
     $this->lists = \Menus::retrieveRoot()->getDescendants();
     if (!$this->label) {
         $this->label = t('Select Parent');
     }
 }
Example #8
0
function Main()
{
    $u = unserialize($_SESSION['usu']);
    $tpl = file_get_contents("tpl/casos-conteudos.html");
    $mnu = Menus::MenusConteudos();
    $caminho = Caminhos::MontaCaminhoConteudos();
}
Example #9
0
 static function getForSelect()
 {
     $menus = Menus::all();
     $sel = array();
     foreach ($menus as $menu) {
         $sel[$menu->id] = $menu->menu_title;
     }
     return $sel;
 }
Example #10
0
 public function edit($id = null)
 {
     if ($id != null) {
         //Aplicando la autocarga de objeto, para comenzar la edición
         $this->menus = $this->Menus->find($id);
     }
     //se verifica si se ha enviado el formulario (submit)
     if ($this->has_post('menus')) {
         $menu = new Menus($this->post('menus'));
         if (!$menu->update()) {
             Flash::error('Falló Operación');
             //se hacen persistente los datos en el formulario
             $this->menus = $this->post('menus');
         } else {
             Router::route_to('action: index', 'id: 1');
         }
     }
 }
Example #11
0
    public function exibirMenuEsquerdo()
    {
        $Menus = new Menus();
        $Categorias = new Categorias();
        $menuEsquerdo = array();
        $queryMenuEsquerdo = mysql_query("SELECT * FROM menu_esquerdo ORDER BY ordem ASC");
        while ($resultadoMenuEsquerdo = mysql_fetch_assoc($queryMenuEsquerdo)) {
            $menuEsquerdo[] = $resultadoMenuEsquerdo;
        }
        $alturaMenuEsquerdo = count($menuEsquerdo) * 23 + 6;
        $exibirMenuEsquerdo = '
				<ul class="menuEsquerdo">
					<div id="bordaLateral" style="height: ' . $alturaMenuEsquerdo . 'px;">
						<img src="imagens/menuEsquerdo/bordaLateral.gif" width="6" height="' . $alturaMenuEsquerdo . '" alt="" />
					</div>
					';
        foreach ($menuEsquerdo as $informacoesBotao) {
            if ($informacoesBotao["pagina"] == "menus") {
                $url = $Menus->pegarUrl($informacoesBotao["link_id"]);
            } elseif ($informacoesBotao["pagina"] == "categorias") {
                $url = $Categorias->pegarUrl($informacoesBotao["link_id"]);
            } else {
                $url = "?p=" . $informacoesBotao["pagina"];
            }
            $exibirMenuEsquerdo .= '
							<li class="fundo' . $informacoesBotao["fundo"] . '">
								<div class="handle">
									<a href="' . $url . '">
										' . $informacoesBotao["nome"] . '
									</a>
								</div>
							</li>
						';
        }
        $exibirMenuEsquerdo .= '
					<li>
						<div id="bordaFinal">
							<img src="imagens/menuEsquerdo/barraFinal.gif" width="142" height="6" alt="" />
						</div>
					</li>
				</ul>
			';
        return $exibirMenuEsquerdo;
    }
Example #12
0
 /**
  * @param string $name
  */
 public function loadLanguage($name)
 {
     $helper = Menus::getInstance();
     $language = XoopsLocale::getLegacyLanguage();
     $path = $helper->path("decorators/{$name}/language");
     if (!($ret = XoopsLoad::loadFile("{$path}/{$language}/decorator.php"))) {
         $ret = XoopsLoad::loadFile("{$path}/english/decorator.php");
     }
     return $ret;
 }
Example #13
0
 function __construct()
 {
     parent::__construct();
     $this->table = 'grid_menus_images';
     $this->MY_table = 'menus_images';
     //library for resize
     // gd2|imagemagick
     $this->lib_resize = 'gd2';
     //path for imagemagick library
     $this->path_imagemagick = 'Z:\\usr\\local\\ImageMagick-6.8.4-Q16';
 }
 public function getMenuAction()
 {
     $fid = $this->request->getPost('fid');
     $data = '';
     $Menus = Menus::find(array("fid='" . $fid . "'"));
     $MLang = $this->inc->getLang('menus');
     foreach ($Menus as $val) {
         $data[] = array('id' => $val->id, 'title' => $MLang->_($val->title));
     }
     echo json_encode($data);
 }
Example #15
0
 private function _registerSession(Admins $admin)
 {
     // User Perm
     $arr = explode(' ', $admin->perm);
     foreach ($arr as $val) {
         $num = explode(':', $val);
         $menu = Menus::findFirst(array("id = :id:", 'bind' => array('id' => $num[0])));
         $data[$menu->url] = $num[1];
     }
     // Save
     $this->session->set('Admin', array('id' => $admin->id, 'uname' => $admin->uname, 'name' => $admin->name, 'department' => $admin->department, 'position' => $admin->position, 'perm' => $admin->perm, 'ltime' => time() + 1800, 'logged_in' => TRUE, 'perm_s' => $data));
 }
Example #16
0
 public function actionViewRoles($id)
 {
     $menus = Menus::model()->findByPk((int) $id);
     $model = new RolesMenus('search');
     $model->unsetAttributes();
     // clear any default values
     $model->menu_id = (int) $id;
     if (isset($_GET['RolesMenus'])) {
         $model->attributes = $_GET['RolesMenus'];
     }
     $this->render('viewRoles', array('model' => $model, 'id' => $id, 'menus' => $menus));
 }
Example #17
0
 public static function getMenu()
 {
     if (isset(self::$menus)) {
         return self::$menus;
     }
     /**
      * @var CWebApplication $yii
      */
     $yii = Yii::app();
     self::$menus = array(array('label' => '系统设置'), 'config' => array('label' => '基本配置', 'url' => $yii->createUrl('config')), array('label' => '测试'), 'profile' => array('label' => '测试1', 'url' => '#'), array('end' => true), array('end' => true));
     return self::getMenu();
 }
Example #18
0
File: Menu.php Project: schiz/teff
 public function run()
 {
     $menus = Menus::model()->findAll(array('condition' => 'parent_id = 0 AND dynamic = 1','order' => 'position','limit'=>6));
     $submenus = Menus::model()->findAll('parent_id > 0');
     $menu_sub = array();
     foreach($submenus as $submenu) {
         $menu_sub[$submenu->parent_id][] = $submenu;
     }
     $this->render('menu', array(
         'menus'=> $menus,
         'submenu'=>$menu_sub
     ));
 }
Example #19
0
 function __construct()
 {
     parent::__construct();
     // Load the library "lib_menus_types"
     $this->load->driver('lib_menus_types');
     /*
     $this->config->load('lib_menus_types', TRUE);
     $this->valid_drivers = $this->config->item('type', 'lib_menus_types');
     foreach($this->valid_drivers as $value){
         $this->prefix[] = str_replace('lib_menus_types_','',$value);
     }
     */
 }
Example #20
0
 /**
  * @param MenusMenu $obj
  */
 public function __construct(MenusMenu $obj)
 {
     global $menu_id;
     $xoops = Xoops::getInstance();
     $helper = Menus::getInstance();
     $this_handler = $helper->getHandlerMenu();
     $decorators = MenusDecorator::getAvailableDecorators();
     $title = $obj->isNew() ? sprintf(_AM_MENUS_ADD_MENUS) : sprintf(_AM_MENUS_EDIT_MENUS);
     parent::__construct($title, 'form', 'admin_menu.php', 'post', true);
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_TITLE, 'title', 50, 255, $obj->getVar('title'), ''), true);
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_ALTTITLE, 'alt_title', 50, 255, $obj->getVar('alt_title'), ''));
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_LINK, 'link', 50, 255, $obj->getVar('link'), ''));
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_IMAGE, 'image', 50, 255, $obj->getVar('image'), ''));
     $criteria = new CriteriaCompo(new Criteria('mid', $menu_id));
     $criteria->add(new Criteria('id', $obj->getVar('id'), '<>'));
     $criteria->setSort('weight');
     $criteria->setOrder('ASC');
     $results = $this_handler->getAll($criteria, array('title', 'id', 'pid'));
     $parent_tree = new XoopsObjectTree($results, 'id', 'pid');
     $parent_select = $parent_tree->makeSelBox('pid', 'title', '-- ', $obj->getVar('pid'), true);
     $this->addElement(new Xoops\Form\Label(_AM_MENUS_MENU_PARENT, $parent_select));
     $formvis = new Xoops\Form\Select(_AM_MENUS_MENU_VISIBLE, "visible", $obj->getVar('visible'));
     $formvis->addOption("0", XoopsLocale::NO);
     $formvis->addOption("1", XoopsLocale::YES);
     $this->addElement($formvis);
     $formtarget = new Xoops\Form\Select(_AM_MENUS_MENU_TARGET, "target", $obj->getVar('target'));
     $formtarget->addOption("_self", _AM_MENUS_MENU_TARG_SELF);
     $formtarget->addOption("_blank", _AM_MENUS_MENU_TARG_BLANK);
     $formtarget->addOption("_parent", _AM_MENUS_MENU_TARG_PARENT);
     $formtarget->addOption("_top", _AM_MENUS_MENU_TARG_TOP);
     $this->addElement($formtarget);
     $formgroups = new Xoops\Form\SelectGroup(_AM_MENUS_MENU_GROUPS, "groups", true, $obj->getVar('groups'), 5, true);
     $formgroups->setDescription(_AM_MENUS_MENU_GROUPS_HELP);
     $this->addElement($formgroups);
     $formhooks = new Xoops\Form\Select(_AM_MENUS_MENU_ACCESS_FILTER, "hooks", $obj->getVar('hooks'), 5, true);
     $accessFilter = array();
     foreach ($decorators as $decorator) {
         $decorator->accessFilter($accessFilter);
     }
     foreach ($accessFilter as $result) {
         $formhooks->addOption($result['method'], $result['name']);
     }
     $this->addElement($formhooks);
     $formcss = new Xoops\Form\Text(_AM_MENUS_MENU_CSS, 'css', 50, 255, $obj->getVar('css'));
     $this->addElement($formcss);
     $this->addElement(new Xoops\Form\Hidden('id', $obj->getVar('id')));
     $this->addElement(new Xoops\Form\Hidden('mid', $obj->getVar('mid')));
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Example #21
0
 public static function getActionName($id)
 {
     $model = Menus::model()->findByPk((int) $id);
     $roles = $model->rolesMenus;
     $sRoles = '';
     if (count($roles) > 0) {
         for ($i = 0; $i < count($roles); $i++) {
             if ($roles[$i]->role) {
                 $sRoles .= $roles[$i]->role->role_name . ' (' . $roles[$i]->actions . ')<br/> ';
             }
         }
         $sRoles = substr($sRoles, 0, -2);
     }
     return $sRoles;
 }
Example #22
0
 public function handleRequest($command)
 {
     switch ($command) {
         case 'get':
             $menus = Menus::getCurrentMenus();
             break;
         default:
             throw new Exception("Unsupported property!");
             break;
     }
     if (empty($menus)) {
         throw new Exception("Nothing found");
     }
     render('menus', array('menus' => $menus));
 }
Example #23
0
    function grid_render()
    {
        parent::grid_render();
        //------------- Обработчики событий для полей с использованием FCKeditor -----------
        //для вывода полей с использованием FCKeditor
        echo '<script>';
        echo '$grid.bind(\'jqGridAddEditAfterShowForm\', function(event, $form)
			{

                //var oFCKeditor = new FCKeditor( "description" ) ;
				//oFCKeditor.BasePath = "/wysiwyg/fckeditor/" ;
                //oFCKeditor.Height = 300 ;
                //oFCKeditor.ToolbarSet = "BasicA";
				//oFCKeditor.ReplaceTextarea() ;

				gridEditWysiwyg("description");
			});
		';
        //echo '</script>';
        //echo "<script>";
        // Для записи изменений с использованием FCKeditor
        echo '$grid.bind(\'jqGridAddEditClickSubmit\', function(event, $form)
			{
				oEditor = FCKeditorAPI.GetInstance("description"); //получаем ссылку на объект "редактор"
				//description   = oEditor.GetXHTML("html");

				//text = oEditor.GetXHTML("html");
				return {
			     description: oEditor.GetHTML() //вызываем метод у объекта
			    };
			});
        ';
        echo 'function gridEditWysiwyg(field)
			{
                var oFCKeditor = new FCKeditor( field ) ;
				oFCKeditor.BasePath = "/wysiwyg/fckeditor/" ;
                oFCKeditor.Height = 300 ;
                oFCKeditor.ToolbarSet = "BasicA";
				oFCKeditor.ReplaceTextarea() ;
			}';
        echo '</script>';
    }
 public function testAction()
 {
     //$this->view->disable();
     //$admin = $this->session->get('Admin');
     //print_r($_SESSION);
     $C = $this->dispatcher->getControllerName();
     $menu = Menus::findFirst(array("url = :url:", 'bind' => array('url' => $C)));
     if ($menu->fid) {
         $this->_getMenuPositive($menu->id);
     } else {
         $this->_getMenuPositive($menu->id);
     }
     //$this->flash->success('Goodbye!');
     //echo 1232;
     //echo $c = $this->dispatcher->getControllerName();
     //print_r($_SESSION);
     //$this->response->setStatusCode(404, "Not Found");
     //$this->forward('users/login');
     //$this->view->partial('welcome/index');
     //$this->view->partial('welcome/index');
 }
Example #25
0
 protected function getModuleMenus($dirname, $pid)
 {
     static $id = -1;
     $xoops = Xoops::getInstance();
     $helper = Menus::getInstance();
     $ret = array();
     /* @var $plugin MenusPluginInterface */
     if ($plugin = \Xoops\Module\Plugin::getPlugin($dirname, 'menus')) {
         if (is_array($subMenus = $plugin->subMenus())) {
             foreach ($subMenus as $menu) {
                 $obj = $helper->getHandlerMenu()->create();
                 $obj->setVar('title', $menu['name']);
                 $obj->setVar('alt_title', $menu['name']);
                 $obj->setVar('link', $xoops->url("modules/{$dirname}/{$menu['url']}"));
                 $obj->setVar('id', $id);
                 $obj->setVar('pid', $pid);
                 $ret[] = $obj->getValues();
                 $id--;
             }
         }
     }
     return $ret;
 }
Example #26
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Menus::model()->findByPk($id);
     if ($model === null) {
         Yii::log('The requested page does not exist.');
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #27
0
 public function findchildLevel1($id)
 {
     if (!empty($id)) {
         return Menus::model()->findAll(array('condition' => 'parent_id=' . $id));
     }
     return array();
 }
Example #28
0
echo $form->labelEx($model, 'role_id');
?>
                <?php 
echo $form->dropDownList($model, 'role_id', Roles::loadItems());
?>
		<?php 
echo $form->error($model, 'role_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'menu_id');
?>
                <?php 
echo Menus::getDropDownList('RolesMenus[menu_id]', 'RolesMenus_menu_id', $model->menu_id, true);
?>
		<?php 
echo $form->error($model, 'menu_id');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
?>
 public function permAction()
 {
     $Lang = $this->inc->getLang('menus');
     $html = '';
     $permArr = $this->splitPerm($this->request->getPost('perm'));
     $actionM = MenuAction::find();
     $menu1 = Menus::find('fid=0');
     foreach ($menu1 as $m1) {
         $ck = isset($permArr[$m1->id]) ? 'checked' : '';
         $title1 = $Lang->_($m1->title);
         $html .= '<div id="oneMenuPerm" class="perm">';
         $html .= '    <span class="text1"><input type="checkbox" value="' . $m1->id . '" ' . $ck . ' /></span>';
         $html .= '    <span>[<a href="#">-</a>] ' . $title1 . '</span>';
         $html .= '</div>';
         $menu2 = Menus::find('fid=' . $m1->id);
         foreach ($menu2 as $m2) {
             $ck = isset($permArr[$m2->id]) ? 'checked' : '';
             $title2 = $Lang->_($m2->title);
             $html .= '<div id="twoMenuPerm" class="perm">';
             $html .= '    <span class="text2"><input type="checkbox" value="' . $m2->id . '" ' . $ck . ' /></span>';
             $html .= '    <span>[<a href="#">-</a>] ' . $title2 . '</span>';
             $html .= '</div>';
             $menu3 = Menus::find('fid=' . $m2->id);
             foreach ($menu3 as $m3) {
                 $ck = isset($permArr[$m3->id]) ? 'checked' : '';
                 $title3 = $Lang->_($m3->title);
                 $html .= '<div id="threeMenuPerm" class="perm perm_action">';
                 $html .= '      <span class="text3"><input type="checkbox" name="threeMenuPerm" value="' . $m3->id . '" ' . $ck . ' /></span>';
                 $html .= '      <span>[<a href="#">-</a>] ' . $title3 . '</span>';
                 $html .= '  <span id="actionPerm_' . $m3->id . '"> ( ';
                 foreach ($actionM as $val) {
                     if (intval($m3->perm) & intval($val->perm)) {
                         $ck = @$permArr[$m3->id] & intval($val->perm) ? 'checked' : '';
                         $name = $Lang->_($val->name);
                         $html .= '<span><input type="checkbox" value="' . $val->perm . '" ' . $ck . ' /></span><span class="text">' . $name . '</span>';
                     }
                 }
                 $html .= ')</span>';
                 $html .= '</div>';
             }
         }
     }
     $this->view->setVar('menusHtml', $html);
     $this->view->pick("system/admin/perm");
 }
Example #30
0
 function __construct()
 {
     parent::__construct();
     $this->table = 'grid_menus_settings';
 }