@@ -99,6 +99,14 @@ class Item
99
99
*/
100
100
public $ isActive = false ;
101
101
102
+ /**
103
+ * If true this prevents auto activation by matching URL
104
+ * Activation by active children keeps working.
105
+ *
106
+ * @var bool
107
+ */
108
+ private $ disableActivationByURL = false ;
109
+
102
110
/**
103
111
* Creates a new Item instance.
104
112
*
@@ -125,6 +133,9 @@ public function __construct($builder, $id, $title, $options)
125
133
} else {
126
134
$ path = Arr::only ($ options , array ('url ' , 'route ' , 'action ' , 'secure ' ));
127
135
}
136
+ if (isset ($ options ['disableActivationByURL ' ]) && true == $ options ['disableActivationByURL ' ]) {
137
+ $ this ->disableActivationByURL = true ;
138
+ }
128
139
129
140
if (!is_null ($ path )) {
130
141
$ path ['prefix ' ] = $ this ->builder ->getLastGroupPrefix ();
@@ -141,7 +152,7 @@ public function __construct($builder, $id, $title, $options)
141
152
/**
142
153
* Creates a sub Item.
143
154
*
144
- * @param string $title
155
+ * @param string $title
145
156
* @param string|array $options
146
157
* @return Item
147
158
*/
@@ -352,6 +363,9 @@ public function all()
352
363
*/
353
364
public function checkActivationStatus ()
354
365
{
366
+ if (true === $ this ->disableActivationByURL ) {
367
+ return ;
368
+ }
355
369
if (true == $ this ->builder ->conf ['restful ' ]) {
356
370
$ path = ltrim (parse_url ($ this ->url (), PHP_URL_PATH ), '/ ' );
357
371
$ rpath = ltrim (parse_url (Request::path (), PHP_URL_PATH ), '/ ' );
0 commit comments