Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding support for turning the strict ID checks off

  • Loading branch information...
commit 0d454dbf629862fbdf7744fe6ad9ccc786ddf25a 1 parent 0345fa2
@SignpostMarv authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 libAurora/Template/navigation.php
View
6 libAurora/Template/navigation.php
@@ -24,7 +24,7 @@ class Pages extends WORM{
public function offsetSet($offset, $value){
if(($value instanceof Page) === false){
throw new InvalidArgumentException('Only instances of libAurora::Template::navigation::Page should be appended to instances of libAurora::Template::navigation::Pages');
- }else if($offset !== $value->id()){
+ }else if(defined('libAuroraTemplateNavigationNoStrictID') === false && $offset !== $value->id()){
throw new InvalidArgumentException('Offset does not match page ID');
}else if(isset($this[$offset]) === true){
throw new InvalidArgumentException('page already set');
@@ -94,7 +94,7 @@ protected function __construct($id, $rank, $url, $target, $display){
if(is_string($id) === false){
throw new InvalidArgumentException('ID must be specified as string.');
- }else if(preg_match('/^[A-z][A-z0-9_]+$/', $id) != 1){
+ }else if(defined('libAuroraTemplateNavigationNoStrictID') === false && preg_match('/^[A-z][A-z0-9_]+$/', $id) != 1){
throw new InvalidArgumentException('ID not valid.');
}else if(is_float($rank) === false){
throw new InvalidArgumentException('Rank must be specified as float.');
@@ -168,7 +168,7 @@ public function toHTML(array $display=null){
if($this->count() > 0){
$doc .= ' <ul>';
foreach($this as $v){
- $doc .= $v->toHTML();
+ $doc .= $v->toHTML($display);
}
$doc .= '</ul>';
}
Please sign in to comment.
Something went wrong with that request. Please try again.