Merge pull request #15510 from civicrm/5.19
[civicrm-core.git] / CRM / Core / I18n / Form.php
index 72a32835b77de07231de12d340d55cf90e4eff6d..dd7aa9bd31dccdc8147002b54a9d8cca10e28df5 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  * $Id$
  *
  */
 class CRM_Core_I18n_Form extends CRM_Core_Form {
+
   public function buildQuickForm() {
     $config = CRM_Core_Config::singleton();
     $tsLocale = CRM_Core_I18n::getLocale();
@@ -51,7 +52,7 @@ class CRM_Core_I18n_Form extends CRM_Core_Form {
     $this->addElement('hidden', 'field', $field);
     $this->addElement('hidden', 'id', $id);
 
-    $cols = array();
+    $cols = [];
     foreach ($this->_locales as $locale) {
       $cols[] = "{$field}_{$locale} {$locale}";
     }
@@ -66,7 +67,7 @@ class CRM_Core_I18n_Form extends CRM_Core_Form {
     $widget = $widgets[$table][$field];
 
     // attributes
-    $attributes = array('class' => '');
+    $attributes = ['class' => ''];
     if (isset($widget['rows'])) {
       $attributes['rows'] = $widget['rows'];
     }
@@ -77,7 +78,10 @@ class CRM_Core_I18n_Form extends CRM_Core_Form {
 
     if ($widget['type'] == 'RichTextEditor') {
       $widget['type'] = 'wysiwyg';
-      $attributes['class'] .= ' collapsed';
+      $attributes['class'] = 'collapsed';
+    }
+    elseif ($widget['type'] == 'Text') {
+      $attributes['class'] = 'huge';
     }
 
     $languages = CRM_Core_I18n::languages(TRUE);
@@ -123,12 +127,12 @@ class CRM_Core_I18n_Form extends CRM_Core_Form {
       CRM_Core_Error::fatal("$table.$field is not internationalized.");
     }
 
-    $cols = array();
-    $params = array(array($values['id'], 'Int'));
+    $cols = [];
+    $params = [[$values['id'], 'Int']];
     $i = 1;
     foreach ($this->_locales as $locale) {
       $cols[] = "{$field}_{$locale} = %$i";
-      $params[$i] = array($values["{$field}_{$locale}"], 'String');
+      $params[$i] = [$values["{$field}_{$locale}"], 'String'];
       $i++;
     }
     $query = "UPDATE $table SET " . implode(', ', $cols) . " WHERE id = %0";