From c794f667ef33429704bec112c7e0cfc00f612de0 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 22 Jun 2016 14:34:17 +1200 Subject: [PATCH] CRM-17154 share addTaskMenu with search forms for consistency. Pick up one extra css class in the process --- CRM/Core/Form.php | 4 ++-- CRM/Core/Form/Search.php | 21 --------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index b8bad65c5a..6482b48795 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -2173,12 +2173,12 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Add actions menu to results form. * - * @param $tasks + * @param array $tasks */ public function addTaskMenu($tasks) { if (is_array($tasks) && !empty($tasks)) { $tasks = array('' => ts('Actions')) + $tasks; - $this->add('select', 'task', NULL, $tasks, FALSE, array('class' => 'crm-select2 crm-action-menu huge crm-search-result-actions')); + $this->add('select', 'task', NULL, $tasks, FALSE, array('class' => 'crm-select2 crm-action-menu fa-check-circle-o huge crm-search-result-actions')); if (empty($this->_actionButtonName)) { $this->_actionButtonName = $this->getButtonName('next', 'action'); } diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 9156abd7b2..863e204ed2 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -119,8 +119,6 @@ class CRM_Core_Form_Search extends CRM_Core_Form { $this->addClass('crm-search-form'); - // for backwards compatibility we pass an argument to addTaskMenu even though - // it could just as well access $this->_taskList internally $tasks = $this->buildTaskList(); $this->addTaskMenu($tasks); } @@ -141,25 +139,6 @@ class CRM_Core_Form_Search extends CRM_Core_Form { } } - /** - * Add actions menu to search results form. - * - * @param array $tasks - */ - public function addTaskMenu($tasks) { - if (is_array($tasks) && !empty($tasks)) { - $tasks = array('' => ts('Actions')) + $tasks; - $this->add('select', 'task', NULL, $tasks, FALSE, array('class' => 'crm-select2 crm-action-menu fa-check-circle-o huge crm-search-result-actions')); - $this->add('submit', $this->_actionButtonName, ts('Go'), array('class' => 'hiddenElement crm-search-go-button')); - - // Radio to choose "All items" or "Selected items only" - $selectedRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', array('checked' => 'checked')); - $allRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_all'); - $this->assign('ts_sel_id', $selectedRowsRadio->_attributes['id']); - $this->assign('ts_all_id', $allRowsRadio->_attributes['id']); - } - } - /** * Add the sort-name field to the form. * -- 2.25.1