/themes/simplified-desktop/users/browse.tmpl.php

https://github.com/harriswong/ATutor · PHP · 163 lines · 132 code · 31 blank · 0 comment · 32 complexity · e4f844e2171165a41067ea37534dfa0d MD5 · raw file

  1. <?php require(AT_INCLUDE_PATH.'header.inc.php'); ?>
  2. <?php if ($this->mobile_device_type == IPAD_DEVICE): ?><!-- smartphone theme only -->
  3. <div class="column-login">
  4. <div class="input-form">
  5. <div id="hide-show-container" >
  6. <h3><a id="results-hide-show-link" class="content-expand" href="javascript:void(0);" role="search" aria-live="assertive" tabindex="1" ><?php echo $this->num_results; echo " courses found."?></a></h3>
  7. </div>
  8. <div id="results-display">
  9. <fieldset class="group_form"><legend class="group_form"><?php echo "Filter by:"; ?></legend>
  10. <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  11. <div class="row">
  12. <fieldset><legend><?php echo _AT('access'); ?></legend>
  13. <input type="radio" name="access" value="private" id="s1" <?php if ($_GET['access'] == 'private') { echo 'checked="checked"'; } ?> /><label for="s1"><?php echo _AT('private'); ?></label>
  14. <input type="radio" name="access" value="protected" id="s2" <?php if ($_GET['access'] == 'protected') { echo 'checked="checked"'; } ?> /><label for="s2"><?php echo _AT('protected'); ?></label>
  15. <input type="radio" name="access" value="public" id="s3" <?php if ($_GET['access'] == 'public') { echo 'checked="checked"'; } ?> /><label for="s3"><?php echo _AT('public'); ?></label>
  16. <input type="radio" name="access" value="" id="s" <?php if ($_GET['access'] == '') { echo 'checked="checked"'; } ?> /><label for="s"><?php echo _AT('all'); ?></label>
  17. </fieldset>
  18. </div>
  19. <?php if ($this->has_categories): ?>
  20. <div class="row">
  21. <label for="category"><?php echo _AT('category'); ?></label><br/>
  22. <select name="category" id="category">
  23. <option value="-1">- - - <?php echo _AT('cats_all'); ?> - - -</option>
  24. <option value="0" <?php if ($_GET['category'] == 0) { echo 'selected="selected"'; } ?>>- - - <?php echo _AT('cats_uncategorized'); ?> - - -</option>
  25. <?php echo $this->categories_select; ?>
  26. </select>
  27. </div>
  28. <?php endif; ?>
  29. <div class="row">
  30. <label for="search"><?php echo _AT('search'); ?> (<?php echo _AT('title').', '._AT('description'); ?>)</label><br />
  31. <input type="text" name="search" id="search" size="30" value="<?php echo htmlspecialchars($_GET['search']); ?>" />
  32. <br/>
  33. <fieldset><legend><?php echo _AT('search_match'); ?>:</legend>
  34. <input type="radio" name="include" value="all" id="match_all" <?php echo $this->checked_include_all; ?> /><label for="match_all"><?php echo _AT('search_all_words'); ?></label>
  35. <input type="radio" name="include" value="one" id="match_one" <?php echo $this->checked_include_one; ?> /><label for="match_one"><?php echo _AT('search_any_word'); ?></label>
  36. </fieldset>
  37. </div>
  38. <div class="row buttons">
  39. <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>"/>
  40. <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>"/>
  41. </div>
  42. </form>
  43. </fieldset>
  44. </div>
  45. </div>
  46. </div>
  47. <div>
  48. <?php if (is_array($this->courses_rows)){ ?>
  49. <?php foreach ($this->courses_rows as $row){ ?>
  50. <?php $counter++; ?>
  51. <ul class="fl-list-menu fl-list-thumbnails">
  52. <li>
  53. <h3 class="browse-courses"><a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><?php echo htmlentities($row['title'], ENT_QUOTES, 'UTF-8'); ?></a></h3>
  54. <?php if ($row['description']): ?>
  55. <span class="fl-link-summary" title="<?php echo htmlentities($row['description']);?>"><?php echo substr(nl2br(htmlentities($row['description'], ENT_QUOTES, 'UTF-8')),0,150);
  56. if(strlen($row['description']) > 150){
  57. echo "...";
  58. }
  59. ?>&nbsp;</span>
  60. <?php else: ?>
  61. <span class="fl-link-summary" title="<?php echo htmlentities($row['description']);?>">&nbsp;</span>
  62. <?php endif; ?>
  63. </li>
  64. </ul>
  65. <?php } // end foreach ?>
  66. <?php } // end if ?>
  67. </div>
  68. <?php endif; ?>
  69. <?php if ($this->mobile_device_type != IPAD_DEVICE): ?><!-- smartphone theme only -->
  70. <div class="column-login">
  71. <div class="input-form">
  72. <fieldset class="group_form"><legend class="group_form"><?php echo _AT('filter'); ?></legend>
  73. <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  74. <div class="row">
  75. <h3><?php echo _AT('results_found', $this->num_results); ?></h3>
  76. </div>
  77. <div class="row">
  78. <?php echo _AT('access'); ?><br />
  79. <input type="radio" name="access" value="private" id="s1" <?php if ($_GET['access'] == 'private') { echo 'checked="checked"'; } ?> /><label for="s1"><?php echo _AT('private'); ?></label>
  80. <input type="radio" name="access" value="protected" id="s2" <?php if ($_GET['access'] == 'protected') { echo 'checked="checked"'; } ?> /><label for="s2"><?php echo _AT('protected'); ?></label>
  81. <input type="radio" name="access" value="public" id="s3" <?php if ($_GET['access'] == 'public') { echo 'checked="checked"'; } ?> /><label for="s3"><?php echo _AT('public'); ?></label>
  82. <input type="radio" name="access" value="" id="s" <?php if ($_GET['access'] == '') { echo 'checked="checked"'; } ?> /><label for="s"><?php echo _AT('all'); ?></label>
  83. </div>
  84. <?php if ($this->has_categories): ?>
  85. <div class="row">
  86. <label for="category"><?php echo _AT('category'); ?></label><br/>
  87. <select name="category" id="category">
  88. <option value="-1">- - - <?php echo _AT('cats_all'); ?> - - -</option>
  89. <option value="0" <?php if ($_GET['category'] == 0) { echo 'selected="selected"'; } ?>>- - - <?php echo _AT('cats_uncategorized'); ?> - - -</option>
  90. <?php echo $this->categories_select; ?>
  91. </select>
  92. </div>
  93. <?php endif; ?>
  94. <div class="row">
  95. <label for="search"><?php echo _AT('search'); ?> (<?php echo _AT('title').', '._AT('description'); ?>)</label><br />
  96. <input type="text" name="search" id="search" size="30" value="<?php echo htmlspecialchars($_GET['search']); ?>" />
  97. <br/>
  98. <?php echo _AT('search_match'); ?>:
  99. <input type="radio" name="include" value="all" id="match_all" <?php echo $this->checked_include_all; ?> /><label for="match_all"><?php echo _AT('search_all_words'); ?></label>
  100. <input type="radio" name="include" value="one" id="match_one" <?php echo $this->checked_include_one; ?> /><label for="match_one"><?php echo _AT('search_any_word'); ?></label>
  101. </div>
  102. <div class="row buttons">
  103. <input type="submit" name="filter" value="<?php echo _AT('filter'); ?>"/>
  104. <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>"/>
  105. </div>
  106. </form>
  107. </fieldset>
  108. </div>
  109. </div>
  110. <div>
  111. <?php if (is_array($this->courses_rows)){ ?>
  112. <?php foreach ($this->courses_rows as $row){ ?>
  113. <?php $counter++; ?>
  114. <ul class="fl-list-menu fl-list-thumbnails">
  115. <li>
  116. <h3 class="browse-courses"><a href="<?php echo url_rewrite('bounce.php?course='.$row['course_id'], true); ?>"><?php echo htmlentities($row['title'], ENT_QUOTES, 'UTF-8'); ?></a></h3>
  117. <?php if ($row['description']): ?>
  118. <span class="fl-link-summary" title="<?php echo htmlentities($row['description']);?>"><?php echo substr(nl2br(htmlentities($row['description'], ENT_QUOTES, 'UTF-8')),0,150);
  119. if(strlen($row['description']) > 150){
  120. echo "...";
  121. }
  122. ?>&nbsp;</span>
  123. <?php else: ?>
  124. <span class="fl-link-summary" title="<?php echo htmlentities($row['description']);?>">&nbsp;</span>
  125. <?php endif; ?>
  126. </li>
  127. </ul>
  128. <?php } // end foreach ?>
  129. <?php } // end if ?>
  130. </div>
  131. <?php endif; ?>
  132. <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>