SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/advanced_search_form.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2015 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 3 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17. use Sprout\Helpers\Admin;
  18. use Sprout\Helpers\Constants;
  19. use Sprout\Helpers\Enc;
  20. use Sprout\Helpers\Form;
  21. use Sprout\Helpers\Needs;
  22. use Sprout\Helpers\Tags;
  23.  
  24.  
  25. Form::setData($_GET);
  26. Needs::fileGroup('tags_ui');
  27. ?>
  28.  
  29. <script type="text/javascript">
  30. var table = '';
  31. </script>
  32.  
  33.  
  34. <form action="SITE/advanced_search" method="get">
  35.  
  36. <?php Form::nextFieldDetails('Find', false); ?>
  37. <?= Form::checkboxSet('type', [], $avail_types); ?>
  38.  
  39. <?php Form::nextFieldDetails('Terms', false); ?>
  40. <?= Form::text('q'); ?>
  41.  
  42. <?= Form::multiradio('q_type', [], Constants::$search_modifiers); ?>
  43.  
  44. <?php Form::nextFieldDetails('Tags', false); ?>
  45. <?= Form::text('tag', ['id' => 'tags-text', 'autocomplete' => 'off']); ?>
  46. <p class="tags-suggest">
  47. <?php
  48. $suggestions = Tags::suggestTags();
  49. foreach ($suggestions as $tag) {
  50. if (strpos($_GET['tag'], $tag) === false) {
  51. echo " <a href=\"#\">", Enc::html($tag), "</a>";
  52. } else {
  53. echo " <a href=\"#\" class=\"selected\">", Enc::html($tag), "</a>";
  54. }
  55. }
  56. ?>
  57. </p>
  58.  
  59. <?= Form::multiradio('tag_type', [], Constants::$search_modifiers); ?>
  60.  
  61. <?php Form::setDropdownTop('Any date'); ?>
  62. <?php Form::nextFieldDetails('Last modified', false); ?>
  63. <?= Form::dropdown('date', [], Constants::$relative_dates); ?>
  64.  
  65.  
  66. <div class="submit-bar">
  67. <button type="submit" class="button submit">Search</button>
  68. </div>
  69.  
  70. </form>
  71.