123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <?php
- namespace Application\Migrations\Schema\V110;
- use Application\Migrations\AbstractMigrationChamilo;
- use Doctrine\DBAL\Schema\Schema;
- class Version20150507152600 extends AbstractMigrationChamilo
- {
-
- public function up(Schema $schema)
- {
-
-
-
-
-
-
- $value = $this->getConfigurationValue('hide_home_top_when_connected');
- $this->addSettingCurrent(
- 'hide_home_top_when_connected',
- '',
- 'radio',
- 'Platform',
- ($value ? 'true' : 'false'),
- 'HideHomeTopContentWhenLoggedInText',
- 'HideHomeTopContentWhenLoggedInComment',
- null,
- '',
- 1,
- true,
- false,
- [
- 0 => ['value' => 'true', 'text' => 'Yes'],
- 1 => ['value' => 'false', 'text' => 'No'],
- ]
- );
-
-
- $value = $this->getConfigurationValue('hide_global_announcements_when_not_connected');
- $this->addSettingCurrent(
- 'hide_global_announcements_when_not_connected',
- '',
- 'radio',
- 'Platform',
- ($value?'true':'false'),
- 'HideGlobalAnnouncementsWhenNotLoggedInText',
- 'HideGlobalAnnouncementsWhenNotLoggedInComment',
- null,
- '',
- 1,
- true,
- false,
- [
- 0 => ['value' => 'true', 'text' => 'Yes'],
- 1 => ['value' => 'false', 'text' => 'No'],
- ]
- );
-
-
- $value = $this->getConfigurationValue('course_creation_use_template');
- $this->addSettingCurrent(
- 'course_creation_use_template',
- '',
- 'textfield',
- 'Course',
- ($value?$value:''),
- 'CourseCreationUsesTemplateText',
- 'CourseCreationUsesTemplateComment',
- null,
- '',
- 1,
- true,
- false,
- [
- 0 => ['value' => 'true', 'text' => 'Yes'],
- 1 => ['value' => 'false', 'text' => 'No'],
- ]
- );
-
-
- $value = $this->getConfigurationValue('allow_strength_pass_checker');
- $this->addSettingCurrent(
- 'allow_strength_pass_checker',
- '',
- 'radio',
- 'Security',
- ($value?'true':'false'),
- 'EnablePasswordStrengthCheckerText',
- 'EnablePasswordStrengthCheckerComment',
- null,
- '',
- 1,
- true,
- false,
- [
- 0 => ['value' => 'true', 'text' => 'Yes'],
- 1 => ['value' => 'false', 'text' => 'No'],
- ]
- );
-
-
- $value = $this->getConfigurationValue('allow_captcha');
- $this->addSettingCurrent(
- 'allow_captcha',
- '',
- 'radio',
- 'Security',
- ($value?'true':'false'),
- 'EnableCaptchaText',
- 'EnableCaptchaComment',
- null,
- '',
- 1,
- true,
- false,
- [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
- );
-
-
-
- $value = $this->getConfigurationValue('captcha_number_mistakes_to_block_account');
- $this->addSettingCurrent(
- 'captcha_number_mistakes_to_block_account',
- '',
- 'textfield',
- 'Security',
- ($value?$value:5),
- 'CaptchaNumberOfMistakesBeforeBlockingAccountText',
- 'CaptchaNumberOfMistakesBeforeBlockingAccountComment',
- null,
- '',
- 1,
- true,
- false
- );
-
-
- $value = $this->getConfigurationValue('captcha_time_to_block');
- $this->addSettingCurrent(
- 'captcha_time_to_block',
- '',
- 'textfield',
- 'Security',
- ($value?$value:5),
- 'CaptchaTimeAccountIsLockedText',
- 'CaptchaTimeAccountIsLockedComment',
- null,
- '',
- 1,
- true,
- false
- );
-
-
- $value = $this->getConfigurationValue('drh_can_access_all_session_content');
- $this->addSettingCurrent(
- 'drh_can_access_all_session_content',
- '',
- 'radio',
- 'Session',
- ($value?'true':'false'),
- 'DRHAccessToAllSessionContentText',
- 'DRHAccessToAllSessionContentComment',
- null,
- '',
- 1,
- true,
- false,
- [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
- );
-
-
- $value = $this->getConfigurationValue('display_groups_forum_in_general_tool');
- $this->addSettingCurrent(
- 'display_groups_forum_in_general_tool',
- '',
- 'radio',
- 'Tools',
- ($value?'true':'false'),
- 'ShowGroupForaInGeneralToolText',
- 'ShowGroupForaInGeneralToolComment',
- null,
- '',
- 1,
- true,
- false,
- [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
- );
-
-
- $value = $this->getConfigurationValue('allow_tutors_to_assign_students_to_session');
- $this->addSettingCurrent(
- 'allow_tutors_to_assign_students_to_session',
- '',
- 'radio',
- 'Session',
- ($value?'true':'false'),
- 'TutorsCanAssignStudentsToSessionsText',
- 'TutorsCanAssignStudentsToSessionsComment',
- null,
- '',
- 1,
- true,
- false,
- [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
- );
- }
-
- public function down(Schema $schema)
- {
- $this->addSql("
- DELETE FROM settings_options WHERE variable IN ('hide_home_top_when_connected', 'hide_global_announcements_when_not_connected', 'course_creation_use_template', 'allow_strength_pass_checker', 'allow_captcha', 'captcha_number_mistakes_to_block_account', 'captcha_time_to_block', 'drh_can_access_all_session_content', 'display_groups_forum_in_general_tool', 'allow_tutors_to_assign_students_to_session')
- ");
- $this->addSql("
- DELETE FROM settings_current WHERE variable IN ('hide_home_top_when_connected', 'hide_global_announcements_when_not_connected', 'course_creation_use_template', 'allow_strength_pass_checker', 'allow_captcha', 'captcha_number_mistakes_to_block_account', 'captcha_time_to_block', 'drh_can_access_all_session_content', 'display_groups_forum_in_general_tool', 'allow_tutors_to_assign_students_to_session')
- ");
- }
- }
|