Ejemplo n.º 1
0
 protected function adjustNavLinks()
 {
     foreach (phpQuery::pq('a', $this->doc) as $node) {
         $href = $node->getAttribute('href');
         if (!Utils::isExternalNavLink($href)) {
             $node->setAttribute('href', 'sitecake.php?page=' . $href);
         }
     }
 }
Ejemplo n.º 2
0
 function test_isExternalNavLink()
 {
     $this->assertTrue(Utils::isExternalNavLink('/'));
     $this->assertTrue(Utils::isExternalNavLink('http://google.com'));
     $this->assertTrue(Utils::isExternalNavLink('/about.html'));
     $this->assertTrue(Utils::isExternalNavLink('/dir/about.html'));
     $this->assertTrue(Utils::isExternalNavLink('dir/about.html'));
     $this->assertFalse(Utils::isExternalNavLink('about.html'));
 }