From a120e8d5c548202b119dc66c9bcb48fe893b7acf Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 14 Mar 2015 12:44:18 -0400 Subject: [PATCH] Add 2.1.0 update scripts --- install/mods-for-hesk/ajax/database-ajax.php | 3 +++ install/mods-for-hesk/installModsForHesk.php | 3 +++ install/mods-for-hesk/js/version-scripts.js | 3 +++ install/mods-for-hesk/modsForHeskSql.php | 28 ++++++++++++++++++-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/install/mods-for-hesk/ajax/database-ajax.php b/install/mods-for-hesk/ajax/database-ajax.php index df5727ec..69ed2cf0 100644 --- a/install/mods-for-hesk/ajax/database-ajax.php +++ b/install/mods-for-hesk/ajax/database-ajax.php @@ -27,6 +27,9 @@ if ($version == 1) { execute200FileUpdate(); } elseif ($version == 201) { execute201Scripts(); +} elseif ($version == 210) { + execute210Scripts(); + execute210FileUpdate(); } else { $response = 'The version "'.$version.'" was not recognized. Check the value submitted and try again.'; print $response; diff --git a/install/mods-for-hesk/installModsForHesk.php b/install/mods-for-hesk/installModsForHesk.php index c2ece65e..33322d6e 100644 --- a/install/mods-for-hesk/installModsForHesk.php +++ b/install/mods-for-hesk/installModsForHesk.php @@ -37,6 +37,9 @@ function echoInitialVersionRows($version) { if ($version < 201) { printRow('v2.0.1'); } + if ($version < 210) { + printRow('v2.1.0'); + } } function printRow($version) { diff --git a/install/mods-for-hesk/js/version-scripts.js b/install/mods-for-hesk/js/version-scripts.js index 02e936fe..aa88a6a7 100644 --- a/install/mods-for-hesk/js/version-scripts.js +++ b/install/mods-for-hesk/js/version-scripts.js @@ -26,6 +26,9 @@ function processUpdates(startingVersion) { } else if (startingVersion < 201) { startVersionUpgrade('201'); executeUpdate(201, '201', '2.0.1'); + } else if (startingVersion < 210) { + startVersionUpgrade('210'); + executeUpdate(210, '210', '2.1.0'); } else { installationFinished(); } diff --git a/install/mods-for-hesk/modsForHeskSql.php b/install/mods-for-hesk/modsForHeskSql.php index 2063a099..f3d0b73c 100644 --- a/install/mods-for-hesk/modsForHeskSql.php +++ b/install/mods-for-hesk/modsForHeskSql.php @@ -321,11 +321,35 @@ function migrateBans($creator) { } // END Version 2.0.0 -// BEGIN Version 2.0.1 +// Version 2.0.1 function execute201Scripts() { global $hesk_settings; hesk_dbConnect(); executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.0.1' WHERE `Key` = 'modsForHeskVersion'"); } -// END Version 2.0.1 \ No newline at end of file + +// BEGIN Version 2.1.0 +function execute210Scripts() { + global $hesk_settings; + + hesk_dbConnect(); + executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.1.0' WHERE `Key` = 'modsForHeskVersion'"); +} + +function execute210FileUpdate() { + //-- Add the boostrap theme property to modsForHesk_settings.inc.php + $file = file_get_contents(HESK_PATH . 'modsForHesk_settings.inc.php'); + + //-- Only add the additional settings if they aren't already there. + if (strpos($file, 'use_bootstrap_theme') === false) + { + $file .= ' + + //-- Set this to 1 to enable bootstrap-theme.css + $modsForHesk_settings[\'use_bootstrap_theme\'] = 1;'; + } + + return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file); +} +// END Version 2.1.0 \ No newline at end of file