|
|
@@ -136,6 +136,13 @@ abstract class Zend_Navigation_Page extends Zend_Navigation_Container
|
|
|
*/
|
|
|
protected $_properties = array();
|
|
|
|
|
|
+ /**
|
|
|
+ * The type of page to use when it wasn't set
|
|
|
+ *
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ protected static $_defaultPageType;
|
|
|
+
|
|
|
// Initialization:
|
|
|
|
|
|
/**
|
|
|
@@ -181,6 +188,11 @@ abstract class Zend_Navigation_Page extends Zend_Navigation_Container
|
|
|
|
|
|
if (isset($options['type'])) {
|
|
|
$type = $options['type'];
|
|
|
+ } elseif(self::getDefaultPageType()!= null) {
|
|
|
+ $type = self::getDefaultPageType();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isset($type)) {
|
|
|
if (is_string($type) && !empty($type)) {
|
|
|
switch (strtolower($type)) {
|
|
|
case 'mvc':
|
|
|
@@ -1107,6 +1119,20 @@ abstract class Zend_Navigation_Page extends Zend_Navigation_Container
|
|
|
{
|
|
|
return str_replace(' ', '', ucwords(str_replace('_', ' ', $property)));
|
|
|
}
|
|
|
+
|
|
|
+ public static function setDefaultPageType($type = null) {
|
|
|
+ if($type !== null && !is_string($type)) {
|
|
|
+ throw new Zend_Navigation_Exception(
|
|
|
+ 'Cannot set default page type: type is no string but should be'
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ self::$_defaultPageType = $type;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function getDefaultPageType() {
|
|
|
+ return self::$_defaultPageType;
|
|
|
+ }
|
|
|
|
|
|
// Abstract methods:
|
|
|
|