[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/search/templates/ -> result.mustache (source)

   1  {{!
   2      This file is part of Moodle - http://moodle.org/
   3  
   4      Moodle is free software: you can redistribute it and/or modify
   5      it under the terms of the GNU General Public License as published by
   6      the Free Software Foundation, either version 3 of the License, or
   7      (at your option) any later version.
   8  
   9      Moodle is distributed in the hope that it will be useful,
  10      but WITHOUT ANY WARRANTY; without even the implied warranty of
  11      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12      GNU General Public License for more details.
  13  
  14      You should have received a copy of the GNU General Public License
  15      along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  }}
  17  {{!
  18      @template core_search/result
  19  
  20      Template which shows a search result.
  21  
  22      Classes required for JS:
  23      * none
  24  
  25      Data attributes required for JS:
  26      * none
  27  
  28      Context variables required for this template:
  29      * courseurl
  30      * coursefullname
  31      * title
  32      * docurl
  33      * contexturl
  34  
  35      Optional context variables for this template:
  36      * content
  37      * userurl
  38      * userfullname
  39      * description1
  40      * description2
  41      * filename
  42      * multiplefiles
  43      * filenames
  44  
  45      Example context (json):
  46      {
  47          "courseurl": "https://example.com/course/view.php?id=2",
  48          "coursefullname": "Example course",
  49          "title": "Example title",
  50          "docurl": "https://example.com/mod/example/view.php?id=4",
  51          "content": "I am content",
  52          "contexturl": "https://example.com/mod/example/view.php?id=2"
  53          "userurl": "https://example.com/user/profile.php?id=3",
  54          "userfullname": "Example User Full Name",
  55          "multiplefiles": true,
  56          "filenames":
  57          {
  58              "file1.txt",
  59              "file2.txt"
  60          }
  61      }
  62  }}
  63  <div class="result">
  64      <h4 class="result-title">
  65          <a href="{{{docurl}}}">{{{title}}}</a>
  66      </h4>
  67      {{#content}}
  68          <div class="result-content">{{{content}}}</div>
  69      {{/content}}
  70      {{#description1}}
  71          <div class="result-content">{{{description1}}}</div>
  72      {{/description1}}
  73      {{#description2}}
  74          <div class="result-content">{{{description2}}}</div>
  75      {{/description2}}
  76      {{#filename}}
  77          <div class="result-content-filename">
  78              {{#str}}matchingfile, search, {{{filename}}}{{/str}}
  79          </div>
  80      {{/filename}}
  81      {{#multiplefiles}}
  82          <div class="result-content-filenames">
  83              {{#str}}matchingfiles, search{{/str}}<br>
  84              <ul class="list">
  85              {{#filenames}}
  86                  <li><span class="filename">{{.}}</span></li>
  87              {{/filenames}}
  88              </ul>
  89          </div>
  90      {{/multiplefiles}}
  91      <div class="result-context-info">
  92          <a href="{{{contexturl}}}">{{#str}}viewresultincontext, search{{/str}}</a> -
  93          <a href="{{{courseurl}}}">{{#str}}incourse, search, {{{coursefullname}}}{{/str}}</a>
  94          {{#userfullname}}
  95              - <a href="{{{userurl}}}">{{#str}}byname, moodle, {{{userfullname}}}{{/str}}</a>
  96          {{/userfullname}}
  97      </div>
  98  </div>


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1