コード例 #1
0
 /**
  * @param String - has to be plain text for open search compatibility.
  * @return String
  */
 function getBreadcrumbTitle($divider = ' - ')
 {
     $pathParts = explode('/', $this->getRelativePath());
     // add the module to the breadcrumb trail.
     array_unshift($pathParts, $this->entity->getTitle());
     $titleParts = array_map(array('DocumentationService', 'clean_page_name'), $pathParts);
     return implode($divider, $titleParts + array($this->getTitle()));
 }
コード例 #2
0
 /**
  * @param string - has to be plain text for open search compatibility.
  *
  * @return string
  */
 public function getBreadcrumbTitle($divider = ' - ')
 {
     $pathParts = explode('/', trim($this->getRelativePath(), '/'));
     // from the page from this
     array_pop($pathParts);
     // add the module to the breadcrumb trail.
     $pathParts[] = $this->entity->getTitle();
     $titleParts = array_map(array('DocumentationHelper', 'clean_page_name'), $pathParts);
     $titleParts = array_filter($titleParts, function ($val) {
         if ($val) {
             return $val;
         }
     });
     if ($this->getTitle()) {
         array_unshift($titleParts, $this->getTitle());
     }
     return implode($divider, $titleParts);
 }
コード例 #3
0
 function testDocumentationEntityAccessing()
 {
     $entity = new DocumentationEntity('docs', '1.0', '../sapphiredocs/tests/docs/', 'My Test');
     $this->assertEquals($entity->getTitle(), 'My Test');
     $this->assertEquals($entity->getVersions(), array('1.0'));
     $this->assertEquals($entity->getLanguages(), array('en', 'de'));
     $this->assertEquals($entity->getFolder(), 'docs');
     $this->assertTrue($entity->hasVersion('1.0'));
     $this->assertFalse($entity->hasVersion('2.0'));
     $this->assertTrue($entity->hasLanguage('en'));
     $this->assertFalse($entity->hasLanguage('fr'));
 }