ajaxPopupsEnabled) { // Script needed by some popups $this->assign('includeWysiwygEditor', TRUE); } $resources->addScriptFile('civicrm', 'js/crm.searchForm.js', 1, 'html-header'); $this->addButtons(array( array( 'type' => 'refresh', 'name' => ts('Search'), 'isDefault' => TRUE, ), )); $this->addClass('crm-search-form'); } /** * Add checkboxes for each row plus a master checkbox */ function addRowSelectors($rows) { $this->addElement('checkbox', 'toggleSelect', NULL, NULL, array('class' => 'select-rows')); foreach ($rows as $row) { $this->addElement('checkbox', $row['checkbox'], NULL, NULL, array('class' => 'select-row')); } } /** * Add actions menu to search results form * @param $tasks */ 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('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']); } } }