-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
dropdown.php
54 lines (46 loc) · 1.56 KB
/
dropdown.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
HTMLHelper::_('bootstrap.framework');
$direction = Factory::getLanguage()->isRtl() ? 'dropdown-menu-right' : '';
/**
* @var string $id
* @var string $onclick
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
* @var string $hasButtons
* @var string $button
* @var string $dropdownItems
* @var string $caretClass
* @var string $toggleSplit
*/
extract($displayData, EXTR_OVERWRITE);
?>
<?php if ($hasButtons && trim($button) !== ''): ?>
<div id="<?php echo $id; ?>" class="btn-group dropdown-<?php echo $name ?? ''; ?>" role="group">
<?php echo $button; ?>
<?php if ($toggleSplit ?? true): ?>
<button type="button" class="<?php echo $caretClass ?? ''; ?> dropdown-toggle dropdown-toggle-split"
data-toggle="dropdown" data-target="#<?php echo $id; ?>" data-display="static" aria-haspopup="true" aria-expanded="false">
<span class="sr-only"><?php echo Text::_('JGLOBAL_TOGGLE_DROPDOWN'); ?></span>
</button>
<?php endif; ?>
<?php if (trim($dropdownItems) !== ''): ?>
<div class="dropdown-menu <?php echo $direction; ?>">
<?php echo $dropdownItems; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>