diff --git a/nexus/Install/Update.php b/nexus/Install/Update.php index 7eec56f6..8ce91e16 100644 --- a/nexus/Install/Update.php +++ b/nexus/Install/Update.php @@ -2,6 +2,8 @@ namespace Nexus\Install; +use Nexus\Database\DB; + class Update extends Install { @@ -45,4 +47,21 @@ class Update extends Install return $data; } + public function runExtraQueries() + { + //custom field menu + $url = 'fields.php'; + $table = 'adminpanel'; + $count = get_row_count($table, "where url = " . sqlesc($url)); + if ($count == 0) { + $insert = [ + 'name' => 'Custom Field Manage', + 'url' => $url, + 'info' => 'Manage custom fields', + ]; + $id = DB::insert($table, $insert); + $this->doLog("[ADD CUSTOM FIELD MENU] insert: " . json_encode($insert) . " to table: $table, id: $id"); + } + } + } \ No newline at end of file diff --git a/nexus/Install/update/update.php b/nexus/Install/update/update.php index f2c9c118..a6dddede 100644 --- a/nexus/Install/update/update.php +++ b/nexus/Install/update/update.php @@ -147,6 +147,8 @@ if ($currentStep == 3) { } } + $update->runExtraQueries(); + $update->nextStep(); } catch (\Exception $exception) { $error = $exception->getMessage();