Beispiel #1
0
 function bender_theme_update($current_version)
 {
     if ($current_version == 0) {
         bender_theme_install();
     }
     osc_delete_preference('default_logo', 'bender');
     $logo_prefence = osc_get_preference('logo', 'bender');
     $logo_name = 'bender_logo';
     $temp_name = WebThemes::newInstance()->getCurrentThemePath() . 'images/logo.jpg';
     if (file_exists($temp_name) && !$logo_prefence) {
         $img = ImageResizer::fromFile($temp_name);
         $ext = $img->getExt();
         $logo_name .= '.' . $ext;
         $img->saveToFile(osc_uploads_path() . $logo_name);
         osc_set_preference('logo', $logo_name, 'bender');
     }
     osc_set_preference('version', '301', 'bender');
     if ($current_version < 313 || $current_version == '3.0.1') {
         // add preferences
         osc_set_preference('defaultLocationShowAs', 'dropdown', 'bender');
         osc_set_preference('version', '313', 'bender');
     }
     osc_set_preference('version', '314', 'bender');
     osc_reset_preferences();
 }
Beispiel #2
0
 function check_install_bender_theme()
 {
     $current_version = osc_get_preference('version', 'bender_theme');
     //check if current version is installed or need an update<
     if (!$current_version) {
         bender_theme_install();
     } else {
         if ($current_version < BENDER_THEME_VERSION) {
             bender_theme_update();
         }
     }
 }