コード例 #1
0
 /**
  * Get all the versions loaded into the module. If the project is only displaying from 
  * the filesystem then they are loaded under the 'Current' namespace.
  *
  * @todo Only show 'core' versions (2.3, 2.4) versions of the modules are going
  *		to spam this
  *
  * @param String $module name of module to limit it to eg sapphire
  * @return DataObjectSet
  */
 function getVersions($module = false)
 {
     $versions = DocumentationService::get_registered_versions($module);
     $output = new DataObjectSet();
     foreach ($versions as $key => $version) {
         // work out the link to this version of the documentation.
         //
         // @todo Keep the user on their given page rather than redirecting to module.
         // @todo Get links working
         $linkingMode = $this->Version == $version ? 'current' : 'link';
         if (!$version) {
             $version = 'Current';
         }
         $major = in_array($version, DocumentationService::get_major_versions()) ? true : false;
         $output->push(new ArrayData(array('Title' => $version, 'Link' => $_SERVER['REQUEST_URI'], 'LinkingMode' => $linkingMode, 'MajorRelease' => $major)));
     }
     return $output;
 }