Ejemplo n.º 1
0
 public function updateDatabase()
 {
     global $navigation;
     global $htmlOutput;
     require_once __DIR__ . '/../update_1_0_2_beta_to_1_0_3_beta/parameters_refractor.php';
     $answer = '';
     if (\Db_100::getSystemVariable('version') != '1.0.9') {
         $sql = "ALTER TABLE `" . DB_PREF . "content_element` CHANGE `row_number` `row_number` DOUBLE NOT NULL DEFAULT '0' ";
         $rs = mysql_query($sql);
         if (!$sql) {
             trigger_error($sql . ' ' . mysql_error());
         }
         $module = \Db_100::getModule(null, 'standard', 'menu_management');
         $parametersRefractor = new \update_1_0_2_beta_to_1_0_3_beta\ParametersRefractor();
         $group = $parametersRefractor->getParametersGroup($module['id'], 'admin_translations');
         if ($group) {
             if (!\Db_100::getParameter('standard', 'menu_management', 'admin_translations', 'general')) {
                 \Db_100::addStringParameter($group['id'], 'General', 'general', 'General', 1);
             }
             if (!\Db_100::getParameter('standard', 'menu_management', 'admin_translations', 'seo')) {
                 \Db_100::addStringParameter($group['id'], 'Seo', 'seo', 'SEO', 1);
             }
             if (!\Db_100::getParameter('standard', 'menu_management', 'admin_translations', 'advanced')) {
                 \Db_100::addStringParameter($group['id'], 'Advanced', 'advanced', 'Advanced', 1);
             }
             if (!\Db_100::getParameter('standard', 'menu_management', 'admin_translations', 'copy')) {
                 \Db_100::addStringParameter($group['id'], 'Copy', 'copy', 'Copy', 1);
             }
             if (!\Db_100::getParameter('standard', 'menu_management', 'admin_translations', 'paste')) {
                 \Db_100::addStringParameter($group['id'], 'Paste', 'paste', 'Paste', 1);
             }
             if (!\Db_100::getParameter('standard', 'menu_management', 'admin_translations', 'cancel')) {
                 \Db_100::addStringParameter($group['id'], 'Cancel', 'cancel', 'Cancel', 1);
             }
         }
         if ($this->curStep == $this->stepCount) {
             \Db_100::setSystemVariable('version', '1.0.9');
         }
     }
     if ($this->curStep == $this->stepCount) {
         header("location: " . $navigation->generateLink($navigation->curStep() + 1));
     } else {
         header("location: " . $navigation->generateLink($navigation->curStep(), $navigation->curScript() + 1));
     }
     return $answer;
 }
Ejemplo n.º 2
0
 public function updateDatabase()
 {
     global $navigation;
     global $htmlOutput;
     require_once 'db/db100.php';
     require_once __DIR__ . '/db.php';
     require_once __DIR__ . '/../update_1_0_2_beta_to_1_0_3_beta/parameters_refractor.php';
     $answer = '';
     if (\Db_100::getSystemVariable('version') != '1.0.8') {
         $parametersRefractor = new \update_1_0_2_beta_to_1_0_3_beta\ParametersRefractor();
         //add table widget
         $widgetGroup = Db::getWidgetGroup('text_photos');
         $newWidget = array('name' => 'table', 'group_id' => $widgetGroup['id'], 'dynamic' => 0, 'translation' => 'Table', 'version' => '1.00', 'row_number' => Db::getMaxWidgetGroupRow($widgetGroup['id']) + 1);
         Db::addWidget($widgetGroup['id'], $newWidget);
         //add parameters group
         $module = \Db_100::getModule(null, 'standard', 'content_management');
         $parameterGroup = $parametersRefractor->getParametersGroup($module['id'], 'widget_table');
         if ($parameterGroup) {
             $parameterGroupId = $parameterGroup['id'];
         } else {
             $parameterGroupId = $parametersRefractor->addParameterGroup($module['id'], 'widget_table', 'Widget table', 1);
         }
         if (!\Db_100::getParameter('standard', 'content_management', 'widget_table', 'widget_title')) {
             \Db_100::addStringParameter($parameterGroupId, 'Widget title', 'widget_title', 'Table', 1);
         }
         Db::createTableWidgetTables();
         //upate contact form widget
         Db::updateContactFormWidget();
         Db::updateContactFormTextareaFiel();
         //update contact form widget parameters
         $parametersRefractor->deleteParameter('standard', 'content_management', 'widget_contact_form', 'text_field');
         $parametersRefractor->deleteParameter('standard', 'content_management', 'widget_contact_form', 'text_row');
         $module = \Db_100::getModule(null, 'community', 'user');
         $group = $parametersRefractor->getParametersGroup($module['id'], 'translations');
         if ($group) {
             if (!\Db_100::getParameter('community', 'user', 'translations', 'autologin')) {
                 \Db_100::addStringParameter($group['id'], 'Autologin', 'autologin', 'Remember me', 0);
             }
         }
         $group = $parametersRefractor->getParametersGroup($module['id'], 'options');
         if ($group) {
             if (!\Db_100::getParameter('community', 'user', 'options', 'enable_autologin')) {
                 \Db_100::addBoolParameter($group['id'], 'Enable autologin', 'enable_autologin', true, 1);
             }
             if (!\Db_100::getParameter('community', 'user', 'options', 'require_email_confirmation')) {
                 \Db_100::addBoolParameter($group['id'], 'Require email confirmation', 'require_email_confirmation', true, 1);
             }
             if (!\Db_100::getParameter('community', 'user', 'options', 'autologin_after_registration')) {
                 \Db_100::addBoolParameter($group['id'], 'Autologin after registration', 'autologin_after_registration', true, 1);
             }
             if (!\Db_100::getParameter('community', 'user', 'options', 'autologin_time')) {
                 \Db_100::addIntegerParameter($group['id'], 'Autologin time (days)', 'autologin_time', 300, 1);
             }
         }
         $module = \Db_100::getModule(null, 'standard', 'content_management');
         $group = $parametersRefractor->getParametersGroup($module['id'], 'widget_contact_form');
         if ($group) {
             if (!\Db_100::getParameter('standard', 'content_management', 'widget_contact_form', 'text')) {
                 \Db_100::addStringParameter($group['id'], 'Text', 'text', 'Text', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'widget_contact_form', 'text_multiline')) {
                 \Db_100::addStringParameter($group['id'], 'Text (multiline)', 'text_multiline', 'Text (multiline)', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'widget_contact_form', 'select')) {
                 \Db_100::addStringParameter($group['id'], 'Select', 'select', 'Select', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'widget_contact_form', 'checkbox')) {
                 \Db_100::addStringParameter($group['id'], 'Checkbox', 'checkbox', 'Checbox', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'widget_contact_form', 'radio')) {
                 \Db_100::addStringParameter($group['id'], 'Radio', 'radio', 'Radio', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'widget_contact_form', 'values_popup_title')) {
                 \Db_100::addStringParameter($group['id'], 'Values popup title', 'values_popup_title', 'Values', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'widget_contact_form', 'values_field_title')) {
                 \Db_100::addStringParameter($group['id'], 'Values field title', 'values_field_title', 'Enter available values. Each value on a new line.', 1);
             }
         }
         $group = $parametersRefractor->getParametersGroup($module['id'], 'admin_translations');
         if ($group) {
             if (!\Db_100::getParameter('standard', 'content_management', 'admin_translations', 'warning_not_saved')) {
                 \Db_100::addStringParameter($group['id'], 'Warning not saved', 'warning_not_saved', 'Your changes are not saved', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'admin_translations', 'saved')) {
                 \Db_100::addStringParameter($group['id'], 'Saved', 'saved', 'Saved', 1);
             }
             if (!\Db_100::getParameter('standard', 'content_management', 'admin_translations', 'save_now')) {
                 \Db_100::addStringParameter($group['id'], 'Save now', 'save_now', 'Save now', 1);
             }
         }
         $module = \Db_100::getModule(null, 'standard', 'configuration');
         $group = $parametersRefractor->getParametersGroup($module['id'], 'system_translations');
         if ($group) {
             if (!\Db_100::getParameter('standard', 'configuration', 'system_translations', 'system_message')) {
                 \Db_100::addStringParameter($group['id'], 'System message', 'system_message', 'System message', 1);
             }
             if (!\Db_100::getParameter('standard', 'configuration', 'system_translations', 'help')) {
                 \Db_100::addStringParameter($group['id'], 'Help', 'help', 'Help', 1);
             }
         }
         if ($this->curStep == $this->stepCount) {
             \Db_100::setSystemVariable('version', '1.0.8');
         }
     }
     if ($this->curStep == $this->stepCount) {
         header("location: " . $navigation->generateLink($navigation->curStep() + 1));
     } else {
         header("location: " . $navigation->generateLink($navigation->curStep(), $navigation->curScript() + 1));
     }
     return $answer;
 }