Version20160302133200.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Application\Migrations\Schema\V111;
  4. use Application\Migrations\AbstractMigrationChamilo;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * Class Version20160302133200
  8. */
  9. class Version20160302133200 extends AbstractMigrationChamilo
  10. {
  11. /**
  12. * @param Schema $schema
  13. *
  14. * @throws \Doctrine\DBAL\Schema\SchemaException
  15. */
  16. public function up(Schema $schema)
  17. {
  18. $allowSendPushNotification = $this->getConfigurationValue('messaging_allow_send_push_notification');
  19. $this->addSettingCurrent(
  20. 'messaging_allow_send_push_notification',
  21. null,
  22. 'radio',
  23. 'WebServices',
  24. ($allowSendPushNotification ? 'true' : 'false'),
  25. 'MessagingAllowSendPushNotificationTitle',
  26. 'MessagingAllowSendPushNotificationComment',
  27. null,
  28. '',
  29. 1,
  30. true,
  31. false,
  32. [
  33. ['value' => 'true', 'text' => 'Yes'],
  34. ['value' => 'false', 'text' => 'No'],
  35. ]
  36. );
  37. $gdcProjectNumber = $this->getConfigurationValue('messaging_gdc_project_number');
  38. $this->addSettingCurrent(
  39. 'messaging_gdc_project_number',
  40. null,
  41. 'textfield',
  42. 'WebServices',
  43. !empty($gdcProjectNumber) ? $gdcProjectNumber : '',
  44. 'MessagingGDCProjectNumberTitle',
  45. 'MessagingGDCProjectNumberComment',
  46. null,
  47. '',
  48. 1,
  49. true,
  50. false
  51. );
  52. $gdcApiKey = $this->getConfigurationValue('messaging_gdc_api_key');
  53. $this->addSettingCurrent(
  54. 'messaging_gdc_api_key',
  55. null,
  56. 'textfield',
  57. 'WebServices',
  58. !empty($gdcApiKey) ? $gdcApiKey : '',
  59. 'MessagingGDCApiKeyTitle',
  60. 'MessagingGDCApiKeyComment',
  61. null,
  62. '',
  63. 1,
  64. true,
  65. false
  66. );
  67. }
  68. /**
  69. * @param Schema $schema
  70. */
  71. public function down(Schema $schema)
  72. {
  73. }
  74. }