Esempio n. 1
0
 /**
  * Display the specified resource.
  * GET /menus/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $menus = Menu::all();
     $menu = Menu::find($id);
     // dd($menu);
     return View::make('menus.index', compact('menus', 'menu'));
 }
 public function search(DanhmucphonghopSearchIndexRequest $query)
 {
     $menus = Menu::all();
     $querys = $query->input('query');
     $danhmucphonghops = Danhmucphonghop::where('name', 'LIKE', '%' . $querys . '%')->orderBy('name')->paginate(10);
     if ($danhmucphonghops == NULL) {
         $danhmucphonghops = 'Không tìm thấy';
     }
     return view('danhmucphonghop.index')->with(array('danhmucphonghops' => $danhmucphonghops, 'menus' => $this->menus));
 }
Esempio n. 3
0
	public function configure($widgetParams, $orient)
	{
		$this->menu = $widgetParams['menu'];
		$menus = Menu::all();
		$textMenus = array();
		foreach ($menus as $menu)
		{
			$textMenus[$menu->name] = $menu->name;
		}
		$this->menus = $textMenus;
		return $this->renderConfigure('aside/menu-configure');
	}
Esempio n. 4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('menus')->truncate();
     $menu = array(array('id' => 1, 'descricao' => 'Usuarios', 'url' => '/users', 'icone' => 'ion ion-person-add', 'indice' => '', 'menu_pai' => null, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => 'blue'), array('id' => 28, 'descricao' => 'Taxas', 'url' => '/taxa', 'icone' => 'fa fa-money', 'indice' => null, 'menu_pai' => null, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => 'black'), array('id' => 29, 'descricao' => 'Corretor', 'url' => 'corretors', 'icone' => 'glyphicon glyphicon-user', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null), array('id' => 30, 'descricao' => 'Itens', 'url' => 'itens', 'icone' => 'glyphicon glyphicon-ok', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null), array('id' => 31, 'descricao' => 'Taxas', 'url' => 'taxas', 'icone' => 'glyphicon glyphicon-signal', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null), array('id' => 32, 'descricao' => 'Relatorios', 'url' => 'relatorios', 'icone' => 'glyphicon glyphicon-list-alt', 'indice' => null, 'menu_pai' => 28, 'created_at' => 'now()', 'updated_at' => 'now()', 'color' => null));
     DB::table('menus')->insert($menu);
     $menu = Menu::all();
     foreach ($menu as $value) {
         $res = UsuarioPermissao::where('usuario_id', '=', 1)->where('menu_id', '=', $value->id)->count();
         if ($res == 0) {
             $permissao = new UsuarioPermissao();
             $permissao->usuario_id = 1;
             $permissao->menu_id = $value->id;
             $permissao->save();
         }
     }
 }
	public function save($name, $description)
	{
		$menu = new Menu;
		$menu->name = $name;
		$menu->description = $description;
		
		try
		{
			$menu->save();
			$this->notice(t('Menu created'));
			$this->redirect('admin', 'menu', 'edit', $name);
		}
		catch (ValidationException $e)
		{
			$this->error(t('Menu was not saved'));
			$this->menus = Menu::all();
			$this->newMenu = $menu;
			$this->render('index');
		}
	}
 public function order()
 {
     $menu_item_order = json_decode(Input::get('order'));
     $post_categories = Menu::all();
     $order = 1;
     foreach ($menu_item_order as $menu_level_1) {
         $level1 = Menu::find($menu_level_1->id);
         if ($level1->id) {
             $level1->order = $order;
             $level1->parent_id = NULL;
             $level1->save();
             $order += 1;
         }
         if (isset($menu_level_1->children)) {
             $children_level_1 = $menu_level_1->children;
             foreach ($children_level_1 as $menu_level_2) {
                 $level2 = Menu::find($menu_level_2->id);
                 if ($level2->id) {
                     $level2->order = $order;
                     $level2->parent_id = $level1->id;
                     $level2->save();
                     $order += 1;
                 }
                 if (isset($menu_level_2->children)) {
                     $children_level_2 = $menu_level_2->children;
                     foreach ($children_level_2 as $menu_level_3) {
                         $level3 = Menu::find($menu_level_3->id);
                         if ($level3->id) {
                             $level3->order = $order;
                             $level3->parent_id = $level2->id;
                             $level3->save();
                             $order += 1;
                         }
                     }
                 }
             }
         }
     }
     return 1;
 }
Esempio n. 7
0
 function index()
 {
     $this->model = Menu::all();
 }
 public function menucreator()
 {
     $menu = Menu::all();
     return View::make('menucreator')->with("menus", $menu);
 }
 public function index()
 {
     return $this->menu->all();
 }
Esempio n. 10
0
 /**
  * List all the online links
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $menu_pages = Menu::orderBy('id')->get();
     $total_pages = Menu::all()->count();
     return View::make('admin.menu.index', array('menu_pages' => $menu_pages, 'total' => $total_pages));
 }