| 1 | 
           efrain | 
           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 tool_lp/competency_path
  | 
        
        
            | 
            | 
           19 | 
              | 
        
        
            | 
            | 
           20 | 
               Competency path template.
  | 
        
        
            | 
            | 
           21 | 
              | 
        
        
            | 
            | 
           22 | 
               Classes required for JS:
  | 
        
        
            | 
            | 
           23 | 
               * competencydialogue
  | 
        
        
            | 
            | 
           24 | 
              | 
        
        
            | 
            | 
           25 | 
               Context variables required for this template:
  | 
        
        
            | 
            | 
           26 | 
               * framework - The competency framework
  | 
        
        
            | 
            | 
           27 | 
                 * id - competency id
  | 
        
        
            | 
            | 
           28 | 
                 * name - competency idnumber
  | 
        
        
            | 
            | 
           29 | 
              | 
        
        
            | 
            | 
           30 | 
               * ancestors - array of nodes
  | 
        
        
            | 
            | 
           31 | 
                 * id - competency id
  | 
        
        
            | 
            | 
           32 | 
                 * name - competency idnumber
  | 
        
        
            | 
            | 
           33 | 
                 * first - true if node is in first position
  | 
        
        
            | 
            | 
           34 | 
                 * last - true if node is in last position
  | 
        
        
            | 
            | 
           35 | 
              | 
        
        
            | 
            | 
           36 | 
               * pluginbaseurl - base url of plugin tool_lp
  | 
        
        
            | 
            | 
           37 | 
              | 
        
        
            | 
            | 
           38 | 
               Example context (json):
  | 
        
        
            | 
            | 
           39 | 
               {
  | 
        
        
            | 
            | 
           40 | 
                   "framework": {
  | 
        
        
            | 
            | 
           41 | 
                       "id": "1",
  | 
        
        
            | 
            | 
           42 | 
                       "name": "Framework"
  | 
        
        
            | 
            | 
           43 | 
                   },
  | 
        
        
            | 
            | 
           44 | 
                   "ancestors": [
  | 
        
        
            | 
            | 
           45 | 
                       {
  | 
        
        
            | 
            | 
           46 | 
                           "id": "1",
  | 
        
        
            | 
            | 
           47 | 
                           "name": "C1"
  | 
        
        
            | 
            | 
           48 | 
                       },
  | 
        
        
            | 
            | 
           49 | 
                       {
  | 
        
        
            | 
            | 
           50 | 
                           "id": "1",
  | 
        
        
            | 
            | 
           51 | 
                           "name": "C2",
  | 
        
        
            | 
            | 
           52 | 
                           "last": true
  | 
        
        
            | 
            | 
           53 | 
                       }
  | 
        
        
            | 
            | 
           54 | 
                   ]
  | 
        
        
            | 
            | 
           55 | 
               }
  | 
        
        
            | 
            | 
           56 | 
           }}
  | 
        
        
            | 
            | 
           57 | 
           <nav id="competency-path-{{uniqid}}">
  | 
        
        
            | 
            | 
           58 | 
               <small>
  | 
        
        
            | 
            | 
           59 | 
                   {{#showlinks}}
  | 
        
        
            | 
            | 
           60 | 
                   <a href="{{pluginbaseurl}}/competencies.php?competencyframeworkid={{framework.id}}&pagecontextid={{pagecontextid}}" >
  | 
        
        
            | 
            | 
           61 | 
                       {{{framework.name}}}
  | 
        
        
            | 
            | 
           62 | 
                   </a>
  | 
        
        
            | 
            | 
           63 | 
                   {{/showlinks}}
  | 
        
        
            | 
            | 
           64 | 
                   {{^showlinks}}
  | 
        
        
            | 
            | 
           65 | 
                   {{{framework.name}}}
  | 
        
        
            | 
            | 
           66 | 
                   {{/showlinks}}
  | 
        
        
            | 
            | 
           67 | 
                   /
  | 
        
        
            | 
            | 
           68 | 
                   {{#ancestors}}
  | 
        
        
            | 
            | 
           69 | 
                       {{#showlinks}}
  | 
        
        
            | 
            | 
           70 | 
                       <a href="{{pluginbaseurl}}/competencies.php?competencyid={{id}}">
  | 
        
        
            | 
            | 
           71 | 
                           {{{name}}}
  | 
        
        
            | 
            | 
           72 | 
                       </a>
  | 
        
        
            | 
            | 
           73 | 
                       {{/showlinks}}
  | 
        
        
            | 
            | 
           74 | 
                       {{^showlinks}}
  | 
        
        
            | 
            | 
           75 | 
                           {{{name}}}
  | 
        
        
            | 
            | 
           76 | 
                       {{/showlinks}}
  | 
        
        
            | 
            | 
           77 | 
                       {{^last}}<span> / </span>{{/last}}
  | 
        
        
            | 
            | 
           78 | 
                   {{/ancestors}}
  | 
        
        
            | 
            | 
           79 | 
               </small>
  | 
        
        
            | 
            | 
           80 | 
           </nav>
  | 
        
        
            | 
            | 
           81 | 
           {{#js}}
  | 
        
        
            | 
            | 
           82 | 
           require(['tool_lp/competencydialogue'], function(Compdialogue) {
  | 
        
        
            | 
            | 
           83 | 
               Compdialogue.init();
  | 
        
        
            | 
            | 
           84 | 
           });
  | 
        
        
            | 
            | 
           85 | 
           {{/js}}
  |