Example #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $modules = Module::all();
     $permistions = Permistion::all();
     $model = Group::find($id);
     return View::make("CoreCms::group.edit")->with("model", $model)->with("modules", $modules)->with("permistions", $permistions);
 }
Example #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $model = AdminUser::findOrFail($id);
     $modules = Module::all();
     $groups = Group::all();
     $usergroups = Sentry::findUserByID($id)->getGroups();
     return View::make("CoreCms::user.edit")->with("model", $model)->with("groups", $groups)->with("modules", $modules)->with("usergroups", $usergroups);
 }
Example #3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $model = Module::findOrFail($id);
     return json_encode($model->delete() ? array("code" => 1) : array("code" => 0));
 }
Example #4
0
 private function getUserModules($user, $admintrator)
 {
     $results = array();
     $modules = \H0akd\Corecms\Models\Module::all();
     foreach ($modules as $module) {
         if ($admintrator || $this->hasPermistionAccesModule($user, $module->alias)) {
             $childs = array();
             foreach (json_decode($module->childs, 1) as $child) {
                 $child['url'] = root_uri() . (substr($child['url'], 0, 1) === "/" ? "" : "/") . $child['url'];
                 $childs[] = $child;
             }
             $results[] = array("name" => $module->name, 'childs' => $childs);
         }
     }
     return $results;
 }