X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FForm%2FSearch.php;h=5a610b57fa289f077f000fffe73405c41acccc81;hb=c73475ea7bf18847224dedfa999044115afc7fe5;hp=e3c4907faa3716d55ecba46250347d3aea3e6713;hpb=bc5479b705c153c5cd02a10b1cca400ac78d493b;p=civicrm-core.git diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index e3c4907faa..5a610b57fa 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -3,13 +3,13 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | | CiviCRM is free software; you can copy, modify, and distribute it | | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007. | + | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | | | CiviCRM is distributed in the hope that it will be useful, but | | WITHOUT ANY WARRANTY; without even the implied warranty of | @@ -17,7 +17,8 @@ | See the GNU Affero General Public License for more details. | | | | You should have received a copy of the GNU Affero General Public | - | License along with this program; if not, contact CiviCRM LLC | + | License and the CiviCRM Licensing Exception along | + | with this program; if not, contact CiviCRM LLC | | at info[AT]civicrm[DOT]org. If you have questions about the | | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | @@ -71,6 +72,25 @@ class CRM_Core_Form_Search extends CRM_Core_Form { */ protected $_context = NULL; + /** + * The list of tasks or actions that a searcher can perform on a result set. + * + * @var array + */ + protected $_taskList = array(); + + /** + * Builds the list of tasks or actions that a searcher can perform on a result set. + * + * To modify the task list, child classes should alter $this->_taskList, + * preferably by extending this method. + * + * @return array + */ + protected function buildTaskList() { + return $this->_taskList; + } + /** * Common buildform tasks required by all searches */ @@ -82,7 +102,9 @@ class CRM_Core_Form_Search extends CRM_Core_Form { $this->assign('includeWysiwygEditor', TRUE); } - $resources->addScriptFile('civicrm', 'js/crm.searchForm.js', 1, 'html-header'); + $resources + ->addScriptFile('civicrm', 'js/crm.searchForm.js', 1, 'html-header') + ->addStyleFile('civicrm', 'css/searchForm.css', 1, 'html-header'); $this->addButtons(array( array( @@ -93,6 +115,11 @@ 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); } /**