side.html.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * The side view file of traincourse module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2022 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Mengyi Liu <liumengyi@easycorp.ltd>
  8. * @package traincourse
  9. * @version $Id: side.html.php 4029 2022-02-10 10:50:41Z $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php $coursePairs = $this->traincourse->getPairs();?>
  14. <div class="side-col" style="width: 300px" data-min-width="300">
  15. <div class="cell" id='course'>
  16. <ul data-name="docsTree" data-ride="tree" data-initial-state="preserve" class="tree no-margin">
  17. <?php foreach($coursePairs as $id => $courseName):?>
  18. <?php
  19. if($this->app->moduleName == 'traincourse' and $this->app->methodName == 'editChapter')//Finish task: http://vision.5upm.com/task-view-570.html
  20. {
  21. $activeClass = '';
  22. if($id != $courseID) continue;
  23. }
  24. else
  25. {
  26. $activeClass = $id == $courseID ? 'active' : '';
  27. }
  28. ?>
  29. <li <?php echo "class='$activeClass'";?>>
  30. <?php echo html::a($this->createLink('traincourse', 'manageChapter', "courseID=$id"), "<i class='icon icon-folder-o'></i> " . $courseName, "class='text-ellipsis' title='{$courseName}'");?>
  31. <ul>
  32. <?php $serials = $this->traincourse->computeSN($id);?>
  33. <?php $nodeList = $this->traincourse->getCourseStructure($id);?>
  34. <?php foreach($nodeList as $nodeInfo):?>
  35. <?php $serial = $nodeInfo->type != 'course' ? $serials[$nodeInfo->id] : '';?>
  36. <?php if($nodeInfo->parent != 0) continue;?>
  37. <?php $activeClass = (isset($chapter->id) && $chapter->id == $nodeInfo->id) ? 'active' : '';?>
  38. <li <?php echo "class='open $activeClass'";?>>
  39. <?php if($this->methodName == 'editchapter'):?>
  40. <?php echo "<span class='item'>{$serial} " . html::a(helper::createLink('traincourse', 'editChapter', "chapterID=$nodeInfo->id"), $nodeInfo->name) . '</span>';?>
  41. <?php elseif($nodeInfo->type == 'chapter'):?>
  42. <?php echo "<span class='item'>{$serial} {$nodeInfo->name}</span>";?>
  43. <?php elseif($nodeInfo->type == 'video'):?>
  44. <?php echo "<span class='item'>{$serial} " . html::a(helper::createLink('traincourse', 'view', "chapterID=$nodeInfo->id"), $nodeInfo->name) . '</span>';?>
  45. <?php endif;?>
  46. <?php if(!empty($nodeInfo->children)) $this->traincourse->getFrontCatalog($nodeInfo->children, $serials, isset($chapter->id) ? $chapter->id : 0);?>
  47. </li>
  48. <?php endforeach;?>
  49. </ul>
  50. </li>
  51. <?php endforeach;?>
  52. </ul>
  53. </div>
  54. </div>