X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FBadge%2FForm%2FLayout.php;h=af93d47ee0574c9962b583d70460eb1c551c633b;hb=195ca1147d0c911a7057929bcd74447faf91ea01;hp=fbab91e3c0e5eb9829a022f4b1eb73d26af28d61;hpb=412f2d1627d0a075f872064df40968b7adfcf51f;p=civicrm-core.git diff --git a/CRM/Badge/Form/Layout.php b/CRM/Badge/Form/Layout.php index fbab91e3c0..af93d47ee0 100644 --- a/CRM/Badge/Form/Layout.php +++ b/CRM/Badge/Form/Layout.php @@ -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. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2018 + * @copyright CiviCRM LLC (c) 2004-2019 */ /** @@ -49,9 +49,9 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { $config = CRM_Core_Config::singleton(); $resources = CRM_Core_Resources::singleton(); $resources->addSetting( - array( + [ 'kcfinderPath' => $config->userFrameworkResourceURL . 'packages' . DIRECTORY_SEPARATOR, - ) + ] ); $resources->addScriptFile('civicrm', 'templates/CRM/Badge/Form/Layout.js', 1, 'html-header'); @@ -60,25 +60,25 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { $this->add('text', 'title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_PrintLabel', 'title'), TRUE); $labelStyle = CRM_Core_BAO_LabelFormat::getList(TRUE, 'name_badge'); - $this->add('select', 'label_format_name', ts('Label Format'), array('' => ts('- select -')) + $labelStyle, TRUE); + $this->add('select', 'label_format_name', ts('Label Format'), ['' => ts('- select -')] + $labelStyle, TRUE); $this->add('text', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_PrintLabel', 'title')); // get the tokens $contactTokens = CRM_Core_SelectValues::contactTokens(); - $eventTokens = array( + $eventTokens = [ '{event.event_id}' => ts('Event ID'), '{event.title}' => ts('Event Title'), '{event.start_date}' => ts('Event Start Date'), '{event.end_date}' => ts('Event End Date'), - ); + ]; $participantTokens = CRM_Core_SelectValues::participantTokens(); $tokens = array_merge($contactTokens, $eventTokens, $participantTokens); asort($tokens); - $tokens = array_merge(array('spacer' => ts('- spacer -')) + $tokens); + $tokens = array_merge(['spacer' => ts('- spacer -')] + $tokens); $fontSizes = CRM_Core_BAO_LabelFormat::getFontSizes(); $fontStyles = CRM_Core_BAO_LabelFormat::getFontStyles(); @@ -89,7 +89,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { $rowCount = self::FIELD_ROWCOUNT; for ($i = 1; $i <= $rowCount; $i++) { - $this->add('select', "token[$i]", ts('Token'), array('' => ts('- skip -')) + $tokens); + $this->add('select', "token[$i]", ts('Token'), ['' => ts('- skip -')] + $tokens); $this->add('select', "font_name[$i]", ts('Font Name'), $fontNames); $this->add('select', "font_size[$i]", ts('Font Size'), $fontSizes); $this->add('select', "font_style[$i]", ts('Font Style'), $fontStyles); @@ -103,20 +103,20 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { $this->add('select', "barcode_type", ts('Type'), $barcodeTypes); $this->add('select', "barcode_alignment", ts('Alignment'), $textAlignment); - $attributes = array('readonly' => TRUE); + $attributes = ['readonly' => TRUE]; $this->add('text', 'image_1', ts('Image (top left)'), $attributes + CRM_Core_DAO::getAttribute('CRM_Core_DAO_PrintLabel', 'title')); - $this->add('text', 'width_image_1', ts('Width (mm)'), array('size' => 6)); - $this->add('text', 'height_image_1', ts('Height (mm)'), array('size' => 6)); + $this->add('text', 'width_image_1', ts('Width (mm)'), ['size' => 6]); + $this->add('text', 'height_image_1', ts('Height (mm)'), ['size' => 6]); $this->add('text', 'image_2', ts('Image (top right)'), $attributes + CRM_Core_DAO::getAttribute('CRM_Core_DAO_PrintLabel', 'title')); - $this->add('text', 'width_image_2', ts('Width (mm)'), array('size' => 6)); - $this->add('text', 'height_image_2', ts('Height (mm)'), array('size' => 6)); + $this->add('text', 'width_image_2', ts('Width (mm)'), ['size' => 6]); + $this->add('text', 'height_image_2', ts('Height (mm)'), ['size' => 6]); $this->add('checkbox', 'show_participant_image', ts('Use Participant Image?')); - $this->add('text', 'width_participant_image', ts('Width (mm)'), array('size' => 6)); - $this->add('text', 'height_participant_image', ts('Height (mm)'), array('size' => 6)); + $this->add('text', 'width_participant_image', ts('Width (mm)'), ['size' => 6]); + $this->add('text', 'height_participant_image', ts('Height (mm)'), ['size' => 6]); $this->add('select', "alignment_participant_image", ts('Image Alignment'), $imageAlignment); $this->add('checkbox', 'is_default', ts('Default?')); @@ -130,22 +130,21 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { $this->addRule('height_participant_image', ts('Enter valid height'), 'positiveInteger'); $this->addRule('width_participant_image', ts('Enter valid height'), 'positiveInteger'); - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'refresh', - 'name' => ts('Save and Preview'), - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); + $this->addButtons([ + [ + 'type' => 'next', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'refresh', + 'name' => ts('Save and Preview'), + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** @@ -201,7 +200,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { } else { CRM_Core_Session::setStatus(ts("The badge layout '%1' has been saved.", - array(1 => $params['title']) + [1 => $params['title']] ), ts('Saved'), 'success'); } } @@ -220,7 +219,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form { } $this->_single = TRUE; - $this->_participantIds = array($participantID); + $this->_participantIds = [$participantID]; $this->_componentClause = " civicrm_participant.id = $participantID "; CRM_Badge_BAO_Badge::buildBadges($params, $this);