Skip to content

Commit

Permalink
adding support for turning the strict ID checks off
Browse files Browse the repository at this point in the history
  • Loading branch information
SignpostMarv committed Apr 29, 2012
1 parent 0345fa2 commit 0d454db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libAurora/Template/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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.');
Expand Down Expand Up @@ -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>';
}
Expand Down

0 comments on commit 0d454db

Please sign in to comment.