| 1 | <?php namespace NukaCode\Menu; |
||
| 13 | class DropDown { |
||
| 14 | use Linkable; |
||
| 15 | use Activate; |
||
| 16 | use Insertable; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | public $slug; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string|null |
||
| 25 | */ |
||
| 26 | public $name; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var bool |
||
| 30 | */ |
||
| 31 | public $activateWithLinks = true; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Construct a menu |
||
| 35 | * |
||
| 36 | * @param $dropDownName The name of the drop down |
||
| 37 | */ |
||
| 38 | 10 | public function __construct($dropDownName = null) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Check if the current object is a drop down |
||
| 49 | * |
||
| 50 | * @return bool |
||
| 51 | */ |
||
| 52 | 3 | public function isDropDown() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Check if the dropdown has links |
||
| 59 | * |
||
| 60 | * @return bool |
||
| 61 | */ |
||
| 62 | 2 | public function hasLinks() |
|
| 66 | |||
| 67 | /** |
||
| 68 | * This stops the drop down from becoming active |
||
| 69 | * because a child link is active. |
||
| 70 | */ |
||
| 71 | 1 | public function disableActiveParentage() |
|
| 75 | |||
| 76 | /** |
||
| 77 | * Check if the drop down should become active along |
||
| 78 | * with it's links. |
||
| 79 | */ |
||
| 80 | 3 | public function activeParentage() |
|
| 84 | } |
||
| 85 |