/**
  * Get the title of this module.
  *
  * @return string
  */
 public function getTitle()
 {
     if (!$this->title) {
         $this->title = DocumentationHelper::clean_page_name($this->key);
     }
     return $this->title;
 }
 public function getTitleFromFolder()
 {
     $folder = $this->getPath();
     $entity = $this->getEntity()->getPath();
     $folder = str_replace('index.md', '', $folder);
     // if it's the root of the entity then we want to use the entity name
     // otherwise we'll get 'En' for the entity folder
     if ($folder == $entity) {
         return $this->getEntity()->getTitle();
     } else {
         $path = explode(DIRECTORY_SEPARATOR, trim($folder, DIRECTORY_SEPARATOR));
         $folderName = array_pop($path);
     }
     return DocumentationHelper::clean_page_name($folderName);
 }
 public function testCleanName()
 {
     $this->assertEquals("File path", DocumentationHelper::clean_page_name('00_file-path.md'));
 }
 /**
  * Generate an {@link ArrayList} of the pages to the given page.
  *
  * @param DocumentationPage
  * @param DocumentationEntityLanguage
  *
  * @return ArrayList
  */
 public function generateBreadcrumbs($record, $base)
 {
     $output = new ArrayList();
     $parts = explode('/', trim($record->getRelativeLink(), '/'));
     // Add the base link.
     $output->push(new ArrayData(array('Link' => $base->Link(), 'Title' => $base->Title)));
     $progress = $base->Link();
     foreach ($parts as $part) {
         if ($part) {
             $progress = Controller::join_links($progress, $part, '/');
             $output->push(new ArrayData(array('Link' => $progress, 'Title' => DocumentationHelper::clean_page_name($part))));
         }
     }
     return $output;
 }