예제 #1
0
파일: linker.cnr.php 프로젝트: rhertzog/lcs
 public function isNavigable(ResourceLocator $locator)
 {
     if ($locator->hasResourceId()) {
         return false;
     } else {
         return $locator->inModule() && $locator->getModuleLabel() == 'CLCAL';
     }
 }
예제 #2
0
파일: linker.cnr.php 프로젝트: rhertzog/lcs
 public function isNavigable(ResourceLocator $locator)
 {
     if ($locator->inGroup()) {
         return !$locator->hasResourceId();
     } elseif ($locator->hasResourceId()) {
         $elems = explode('/', ltrim($locator->getResourceId(), '/'));
         return count($elems) == 1;
     } else {
         return $locator->inModule() && $locator->getModuleLabel() == 'CLFRM';
     }
 }
예제 #3
0
파일: linker.cnr.php 프로젝트: rhertzog/lcs
 public function isNavigable(ResourceLocator $locator)
 {
     if ($locator->hasResourceId()) {
         $parts = explode('/', ltrim($locator->getResourceId(), '/'));
         if (count($parts) <= 1) {
             return true;
         } else {
             return false;
         }
     } else {
         return $locator->inModule() && $locator->getModuleLabel() == 'CLWIKI';
     }
 }
예제 #4
0
파일: linker.lib.php 프로젝트: rhertzog/lcs
 public function getParent(ResourceLocator $locator)
 {
     if ($locator instanceof ExternalResourceLocator) {
         $parent = false;
     } elseif ($locator->hasResourceId()) {
         if ($navigator = $this->loadModuleNavigator($locator->getModuleLabel())) {
             $resourceId = $navigator->getParentResourceId($locator);
         } else {
             $resourceId = null;
         }
         $parent = new ClarolineResourceLocator($locator->getCourseId(), $locator->getModuleLabel(), $resourceId, $locator->getGroupId());
     } elseif ($locator->inModule()) {
         $parent = new ClarolineResourceLocator($locator->getCourseId(), null, null, $locator->getGroupId());
     } elseif ($locator->inGroup()) {
         $parent = new ClarolineResourceLocator($locator->getCourseId(), 'CLGRP', null, null);
     } else {
         $parent = false;
     }
     return $parent;
 }