Beispiel #1
0
 /**
  * @return template object
  * @since 1.10
  * @todo write a CategoryBrowserView class (implementing Display)
  */
 public function getTemplate()
 {
     $currentCategory = $this->getCurrentCategorySettings();
     $categoryList = $this->getSubCategoryList();
     $navigationUrl = new Url($_SERVER['PHP_SELF'] . '#categoryContent');
     /*
      * Build url param list
      * @todo find a better way to do that
      */
     if (isset($_REQUEST['cmd'])) {
         $navigationUrl->addParam('cmd', $_REQUEST['cmd']);
     }
     if (isset($_REQUEST['fromAdmin'])) {
         $navigationUrl->addParam('fromAdmin', $_REQUEST['fromAdmin']);
     }
     if (isset($_REQUEST['uidToEdit'])) {
         $navigationUrl->addParam('uidToEdit', $_REQUEST['uidToEdit']);
     }
     if (isset($_REQUEST['asTeacher'])) {
         $navigationUrl->addParam('asTeacher', $_REQUEST['asTeacher']);
     }
     $courseTreeView = CourseTreeNodeViewFactory::getCategoryCourseTreeView($this->categoryId, $this->userId);
     $courseTreeView->setViewOptions($this->viewOptions);
     $template = new CoreTemplate('categorybrowser.tpl.php');
     $template->assign('currentCategory', $currentCategory);
     $template->assign('categoryBrowser', $this);
     $template->assign('categoryList', $categoryList);
     $template->assign('courseTreeView', $courseTreeView);
     $template->assign('navigationUrl', $navigationUrl->toUrl());
     return $template;
 }