Пример #1
0
    $calendarMigration = $CalendarUpdate31->run();
    if ($calendarMigration !== true) {
        \DBG::dump($calendarMigration);
        return $calendarMigration;
    }
    // rewrite backendAreas
    require_once dirname(__FILE__) . '/components/core/backendAreas.php';
    $backendAreasUpdate = _updateBackendAreas();
    if ($backendAreasUpdate !== true) {
        return $backendAreasUpdate;
    }
} elseif ($objUpdate->_isNewerVersion($_CONFIG['coreCmsVersion'], '3.1.1')) {
    $calendarComponentUpdateFile = dirname(__FILE__) . '/components/module/calendar.php';
    require_once $calendarComponentUpdateFile;
    $CalendarUpdate31 = new CalendarUpdate31();
    $calendarMigration = $CalendarUpdate31->migrateContentPages();
    if ($calendarMigration !== true) {
        \DBG::dump($calendarMigration);
        return $calendarMigration;
    }
}
/***************************************
 *
 * CONTACT: Add multi-file upload field
 *
 **************************************/
if ($objUpdate->_isNewerVersion($_CONFIG['coreCmsVersion'], '3.1.0')) {
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_contact_form_field', array('id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'id_form' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'type' => array('type' => 'ENUM(\'text\',\'label\',\'checkbox\',\'checkboxGroup\',\'country\',\'date\',\'file\',\'multi_file\',\'fieldset\',\'hidden\',\'horizontalLine\',\'password\',\'radio\',\'select\',\'textarea\',\'recipient\',\'special\')', 'notnull' => true, 'default' => 'text'), 'special_type' => array('type' => 'VARCHAR(20)', 'notnull' => true), 'is_required' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '0'), 'check_type' => array('type' => 'INT(3)', 'notnull' => true, 'default' => '1'), 'order_id' => array('type' => 'SMALLINT(5)', 'unsigned' => true, 'notnull' => true, 'default' => '0')));
        // change all fields currently set to 'file' to 'multi_file' ('multi_file' is same as former 'file' in previous versions)
        \Cx\Lib\UpdateUtil::sql("UPDATE `" . DBPREFIX . "module_contact_form_field` SET `type` = 'multi_file' WHERE `type` = 'file'");