mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-03 12:49:20 +02:00
Set blank & color only if current db version supports it
This commit is contained in:
parent
2c852dea5e
commit
f4ddf2ba23
@ -770,6 +770,8 @@ class Plugins {
|
|||||||
*/
|
*/
|
||||||
public static function installMenus($templateName, $menus, $clearOld = false)
|
public static function installMenus($templateName, $menus, $clearOld = false)
|
||||||
{
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
if ($clearOld) {
|
if ($clearOld) {
|
||||||
Menu::where('template', $templateName)->delete();
|
Menu::where('template', $templateName)->delete();
|
||||||
}
|
}
|
||||||
@ -804,10 +806,14 @@ class Plugins {
|
|||||||
'link' => $link,
|
'link' => $link,
|
||||||
'category' => $category,
|
'category' => $category,
|
||||||
'ordering' => $i++,
|
'ordering' => $i++,
|
||||||
'blank' => $blank,
|
|
||||||
'color' => $color,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// support for color and blank attributes
|
||||||
|
if($db->hasColumn(TABLE_PREFIX . 'menu', 'blank') && $db->hasColumn(TABLE_PREFIX . 'menu', 'color')) {
|
||||||
|
$insert_array['blank'] = $blank;
|
||||||
|
$insert_array['color'] = $color;
|
||||||
|
}
|
||||||
|
|
||||||
Menu::create($insert_array);
|
Menu::create($insert_array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user