| 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 core_contentbank/bankcontent/toolbar_dropdown
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 |     Example context (json):
 | 
        
           |  |  | 21 |         {
 | 
        
           |  |  | 22 |             "name": "Add",
 | 
        
           |  |  | 23 |             "dropdown": true,
 | 
        
           |  |  | 24 |             "link": "http://something/contentbank/edit.php?contextid=1",
 | 
        
           |  |  | 25 |             "contenttypes": [
 | 
        
           |  |  | 26 |                 {
 | 
        
           |  |  | 27 |                     "name": "h5p",
 | 
        
           |  |  | 28 |                     "baseurl": "http://something/contentbank/edit.php?contextid=1&plugin=h5p",
 | 
        
           |  |  | 29 |                     "types": [
 | 
        
           |  |  | 30 |                         {
 | 
        
           |  |  | 31 |                             "typename": "H5P Interactive Content"
 | 
        
           |  |  | 32 |                         },
 | 
        
           |  |  | 33 |                         {
 | 
        
           |  |  | 34 |                             "typename": "Accordion",
 | 
        
           |  |  | 35 |                             "typeeditorparams": "library=Accordion-1.4",
 | 
        
           |  |  | 36 |                             "typeicon": "http://something/pluginfile.php/1/core_h5p/libraries/13/H5P.Accordion-1.4/icon.svg"
 | 
        
           |  |  | 37 |                         }
 | 
        
           |  |  | 38 |                     ]
 | 
        
           |  |  | 39 |                 }
 | 
        
           |  |  | 40 |             ]
 | 
        
           |  |  | 41 |         }
 | 
        
           |  |  | 42 |   | 
        
           |  |  | 43 | }}
 | 
        
           |  |  | 44 | <div class="mr-1" role="group">
 | 
        
           | 1441 | ariadna | 45 |     <button type="button" class="btn btn-primary dropdown-toggle h-100" data-bs-toggle="dropdown" data-action="{{name}}-content"
 | 
        
           | 1 | efrain | 46 |             aria-haspopup="true" aria-expanded="false" {{^contenttypes}}title="{{#str}}nocontenttypes, core_contentbank{{/str}}"
 | 
        
           |  |  | 47 |             disabled{{/contenttypes}}>
 | 
        
           |  |  | 48 |         <span class="mr-2">
 | 
        
           |  |  | 49 |         <svg width="22" height="22" fill="none" viewBox="0 0 24 24">
 | 
        
           |  |  | 50 |             <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.75 12C4.75 7.99594 7.99594 4.75 12 4.75V4.75C16.0041 4.75 19.25 7.99594 19.25 12V12C19.25 16.0041 16.0041 19.25 12 19.25V19.25C7.99594 19.25 4.75 16.0041 4.75 12V12Z"></path>
 | 
        
           |  |  | 51 |             <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8.75003V15.25"></path>
 | 
        
           |  |  | 52 |             <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.25 12L8.75 12"></path>
 | 
        
           |  |  | 53 |         </svg>
 | 
        
           |  |  | 54 |         </span>
 | 
        
           |  |  | 55 |         {{#name}} {{name}} {{/name}}
 | 
        
           |  |  | 56 |     </button>
 | 
        
           |  |  | 57 |     <div class="dropdown-menu dropdown-scrollable dropdown-menu-right">
 | 
        
           |  |  | 58 |         {{#contenttypes}}
 | 
        
           |  |  | 59 |             {{#types}}
 | 
        
           |  |  | 60 |                 {{^typeeditorparams}}
 | 
        
           |  |  | 61 |                     <h6 class="dropdown-header">{{ typename }}</h6>
 | 
        
           |  |  | 62 |                 {{/typeeditorparams}}
 | 
        
           |  |  | 63 |                 {{#typeeditorparams}}
 | 
        
           |  |  | 64 |                     <a class="dropdown-item icon-size-4" href="{{{ baseurl }}}&{{{ typeeditorparams }}}">
 | 
        
           |  |  | 65 |                         {{#typeicon}}
 | 
        
           |  |  | 66 |                             <img alt="" class="icon" src="{{{ typeicon }}}">
 | 
        
           |  |  | 67 |                         {{/typeicon}}
 | 
        
           |  |  | 68 |                         {{^typeicon}}
 | 
        
           |  |  | 69 |                             {{#pix}} b/h5p_library, core {{/pix}}
 | 
        
           |  |  | 70 |                         {{/typeicon}} {{ typename }}
 | 
        
           |  |  | 71 |                     </a>
 | 
        
           |  |  | 72 |                 {{/typeeditorparams}}
 | 
        
           |  |  | 73 |             {{/types}}
 | 
        
           |  |  | 74 |         {{/contenttypes}}
 | 
        
           |  |  | 75 |     </div>
 | 
        
           |  |  | 76 | </div>
 |