Skip to content

Commit

Permalink
Merge pull request #26550 from larssandergreen/Navigation-menu-select…
Browse files Browse the repository at this point in the history
…-ease-of-use

Improve select for Add Navigation Menu Item > Parent
  • Loading branch information
demeritcowboy authored Jun 16, 2023
2 parents 753258b + 8eb6aa4 commit 6d325e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CRM/Admin/Form/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function buildQuickForm() {

//make separator location configurable
$separator = CRM_Core_SelectValues::navigationMenuSeparator();
$this->add('select', 'has_separator', ts('Separator'), $separator);
$this->add('select', 'has_separator', ts('Separator'), $separator, FALSE, ['class' => 'crm-select2']);

$active = $this->add('advcheckbox', 'is_active', ts('Enabled'));

Expand All @@ -95,7 +95,7 @@ public function buildQuickForm() {
$homeMenuId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Home', 'id', 'name');
unset($parentMenu[$homeMenuId]);

$this->add('select', 'parent_id', ts('Parent'), ['' => ts('Top level')] + $parentMenu, FALSE, ['class' => 'crm-select2']);
$this->add('select', 'parent_id', ts('Parent'), ['' => ts('Top level')] + $parentMenu, FALSE, ['class' => 'crm-select2 huge']);
}
}

Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/BAO/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ public static function getNavigationList() {
$domainID = CRM_Core_Config::domainID();
$query = "
SELECT id, label, parent_id, weight, is_active, name
FROM civicrm_navigation WHERE domain_id = $domainID";
FROM civicrm_navigation WHERE domain_id = $domainID
ORDER BY weight";
$result = CRM_Core_DAO::executeQuery($query);

$pidGroups = [];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form/Instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static function buildForm(&$form) {
// navigation field
$parentMenu = CRM_Core_BAO_Navigation::getNavigationList();

$form->add('select', 'parent_id', ts('Parent Menu'), ['' => ts('- select -')] + $parentMenu);
$form->add('select', 'parent_id', ts('Parent Menu'), ['' => ts('- select -')] + $parentMenu, FALSE, ['class' => 'crm-select2 huge']);

// For now we only providing drilldown for one primary detail report only. In future this could be multiple reports
foreach ($form->_drilldownReport as $reportUrl => $drillLabel) {
Expand Down

0 comments on commit 6d325e7

Please sign in to comment.