mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Fixes to installMenus function
This commit is contained in:
parent
d0b4065ccf
commit
a2fadc5945
@ -770,15 +770,14 @@ class Plugins {
|
||||
*/
|
||||
public static function installMenus($templateName, $categories, $clearOld = true)
|
||||
{
|
||||
global $db;
|
||||
if (!$db->hasTable(TABLE_PREFIX . 'menu')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($clearOld) {
|
||||
Menu::where('template', $templateName)->delete();
|
||||
}
|
||||
|
||||
if (Menu::count()) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($categories as $category => $menus) {
|
||||
$i = 0;
|
||||
foreach ($menus as $name => $link) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user