Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
madhavikhatal committed Dec 6, 2016
1 parent a3c1396 commit a865109
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/Helpers/LAHelper.php
Expand Up @@ -409,7 +409,7 @@ public static function print_menu_editor($menu)
public static function print_menu($menu, $active = false)
{
$childrens = \Dwij\Laraadmin\Models\Menu::where("parent", $menu->id)->orderBy('hierarchy', 'asc')->get();

$treeview = "";
$subviewSign = "";
if(count($childrens)) {
Expand All @@ -426,7 +426,10 @@ public static function print_menu($menu, $active = false)
if(count($childrens)) {
$str .= '<ul class="treeview-menu">';
foreach($childrens as $children) {
$str .= LAHelper::print_menu($children);
$module = Module::get($children->url);
if(Module::hasAccess($module->id)) {
$str .= LAHelper::print_menu($children);
}
}
$str .= '</ul>';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Module.php
Expand Up @@ -916,7 +916,7 @@ public static function get($module_name)
if(is_int($module_name)) {
$module = Module::find($module_name);
} else {
$module = Module::where('name', $module_name)->first();
$module = Module::where('name', $module_name)->orWhere('name_db', $module_name)->first();
}

// If Module is found in database also attach its field array to it.
Expand Down
5 changes: 3 additions & 2 deletions src/Models/ModuleFields.php
Expand Up @@ -95,8 +95,7 @@ public static function createField($request)
}
} else {
$field->popup_vals = "";
}
$field->save();
}

// Get number of Module fields
$modulefields = ModuleFields::where('module', $module_id)->get();
Expand Down Expand Up @@ -126,6 +125,8 @@ public static function createField($request)
});
}
}
$field->save();

return $field->id;
}

Expand Down

0 comments on commit a865109

Please sign in to comment.