mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-70721-master' of git://github.com/rezaies/moodle
This commit is contained in:
commit
dc0e7a45df
@ -48,6 +48,6 @@
|
||||
</div>
|
||||
<input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control text-ltr" {{#readonly}}disabled{{/readonly}}>
|
||||
{{#haspreviewconfig}}
|
||||
<input type="button" id="{{id}}_preview" value={{#quote}}{{#str}}preview{{/str}}{{/quote}} class="admin_colourpicker_preview">
|
||||
<input type="button" id="{{id}}_preview" value="{{#cleanstr}}preview{{/cleanstr}}" class="admin_colourpicker_preview">
|
||||
{{/haspreviewconfig}}
|
||||
</div>
|
||||
|
@ -134,9 +134,9 @@
|
||||
{{# str }}somefieldsrequired, form, <i class="icon fa fa-exclamation-circle text-danger fa-fw" title="{{# str }} required {{/ str }}" ></i>{{/ str }}
|
||||
<hr>
|
||||
|
||||
<input type="submit" class="btn btn-primary" name="submit" value={{#quote}}{{#str}} next {{/str}}{{/quote}}>
|
||||
<input type="submit" class="btn btn-primary" name="submit" value="{{#cleanstr}} next {{/cleanstr}}">
|
||||
{{#cancancel}}
|
||||
<input type="submit" class="btn btn-secondary" name="cancel" value={{#quote}}{{#str}} cancel {{/str}}{{/quote}}>
|
||||
<input type="submit" class="btn btn-secondary" name="cancel" value="{{#cleanstr}} cancel {{/cleanstr}}">
|
||||
{{/cancancel}}
|
||||
</form>
|
||||
|
||||
|
@ -57,8 +57,8 @@
|
||||
<div class="event-name-container flex-grow-1 text-truncate line-height-3">
|
||||
<h6 class="event-name text-truncate mb-0">
|
||||
<a href="{{url}}"
|
||||
title={{#quote}}{{{name}}}{{/quote}}
|
||||
aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{activityname}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'>
|
||||
title="{{name}}"
|
||||
aria-label='{{#cleanstr}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{activityname}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/cleanstr}}'>
|
||||
{{{activityname}}}</a>
|
||||
{{#overdue}}<span class="badge badge-pill badge-danger ml-1">{{#str}} overdue, block_timeline {{/str}}</span>{{/overdue}}
|
||||
</h6>
|
||||
|
@ -74,7 +74,6 @@ class activity_navigation implements renderable, templatable {
|
||||
$attributes = [
|
||||
'class' => 'btn btn-link',
|
||||
'id' => 'prev-activity-link',
|
||||
'title' => $linkname,
|
||||
];
|
||||
$this->prevlink = new \action_link($linkurl, $OUTPUT->larrow() . ' ' . $linkname, null, $attributes);
|
||||
}
|
||||
@ -90,7 +89,6 @@ class activity_navigation implements renderable, templatable {
|
||||
$attributes = [
|
||||
'class' => 'btn btn-link',
|
||||
'id' => 'next-activity-link',
|
||||
'title' => $linkname,
|
||||
];
|
||||
$this->nextlink = new \action_link($linkurl, $linkname . ' ' . $OUTPUT->rarrow(), null, $attributes);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@
|
||||
data-itemid="{{instanceid}}"
|
||||
data-cost="{{cost}}"
|
||||
data-successurl="{{successurl}}"
|
||||
data-description={{# quote }}{{description}}{{/ quote }}
|
||||
data-description="{{description}}"
|
||||
>
|
||||
{{# str }} sendpaymentbutton, enrol_fee {{/ str }}
|
||||
</button>
|
||||
|
@ -49,7 +49,7 @@
|
||||
{{#rows}}
|
||||
<div>
|
||||
<label style="display: inline-block; width: 5em"
|
||||
{{#id}}for={{#quote}}{{{id}}}-{{{uniqid}}}{{/quote}}{{/id}} {{#hidelabel}}
|
||||
{{#id}}for="{{id}}-{{uniqid}}"{{/id}} {{#hidelabel}}
|
||||
class="accesshide"{{/hidelabel}}>{{label}}</label>
|
||||
<div style="display: inline-block">{{> core/copy_box }}</div>
|
||||
</div>
|
||||
|
@ -47,8 +47,8 @@
|
||||
{{/params}}
|
||||
<input type="button" class="btn btn-secondary selectortrigger"
|
||||
id="{{id}}"
|
||||
title={{#quote}}{{tooltip}}{{/quote}}
|
||||
value={{#quote}}{{label}}{{/quote}}
|
||||
title="{{tooltip}}"
|
||||
value="{{label}}"
|
||||
{{#disabled}}disabled{{/disabled}}>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,4 +25,4 @@
|
||||
"value": "Save"
|
||||
}
|
||||
}}
|
||||
<input type="{{type}}" value={{#quote}}{{value}}{{/quote}} class="btn btn-secondary">
|
||||
<input type="{{type}}" value="{{value}}" class="btn btn-secondary">
|
||||
|
@ -51,7 +51,7 @@
|
||||
{{{table}}}
|
||||
<div id="gradetreesubmit">
|
||||
{{#showsave}}
|
||||
<input class="advanced btn btn-primary" type="submit" value={{#quote}}{{#str}}savechanges{{/str}}{{/quote}}>
|
||||
<input class="advanced btn btn-primary" type="submit" value="{{#cleanstr}}savechanges{{/cleanstr}}">
|
||||
{{/showsave}}
|
||||
{{#showbulkmove}}
|
||||
<div class="form-inline mt-3">
|
||||
|
2
lib/amd/build/templates.min.js
vendored
2
lib/amd/build/templates.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -572,6 +572,25 @@ function(
|
||||
return '[[_s' + index + ']]';
|
||||
};
|
||||
|
||||
/**
|
||||
* String helper to render {{#cleanstr}}abd component { a : 'fish'}{{/cleanstr}}
|
||||
* into a get_string following by an HTML escape.
|
||||
*
|
||||
* @method cleanStringHelper
|
||||
* @private
|
||||
* @param {object} context The current mustache context.
|
||||
* @param {string} sectionText The text to parse the arguments from.
|
||||
* @param {function} helper Used to render subsections of the text.
|
||||
* @return {string}
|
||||
*/
|
||||
Renderer.prototype.cleanStringHelper = function(context, sectionText, helper) {
|
||||
var str = this.stringHelper(context, sectionText, helper);
|
||||
|
||||
// We're going to use [[_cx]] format for clean strings, where x is a number.
|
||||
// Hence, replacing 's' with 'c' in the placeholder that stringHelper returns.
|
||||
return str.replace('s', 'c');
|
||||
};
|
||||
|
||||
/**
|
||||
* Quote helper used to wrap content in quotes, and escape all quotes present in the content.
|
||||
*
|
||||
@ -718,6 +737,7 @@ function(
|
||||
this.requiredJS = [];
|
||||
context.uniqid = (uniqInstances++);
|
||||
context.str = this.addHelperFunction(this.stringHelper, context);
|
||||
context.cleanstr = this.addHelperFunction(this.cleanStringHelper, context);
|
||||
context.pix = this.addHelperFunction(this.pixHelper, context);
|
||||
context.js = this.addHelperFunction(this.jsHelper, context);
|
||||
context.quote = this.addHelperFunction(this.quoteHelper, context);
|
||||
@ -761,13 +781,14 @@ function(
|
||||
* @return {String} The treated content.
|
||||
*/
|
||||
Renderer.prototype.treatStringsInContent = function(content, strings) {
|
||||
var pattern = /\[\[_s\d+\]\]/,
|
||||
var pattern = /\[\[_(s|c)\d+\]\]/,
|
||||
treated,
|
||||
index,
|
||||
strIndex,
|
||||
walker,
|
||||
char,
|
||||
strFinal;
|
||||
strFinal,
|
||||
isClean;
|
||||
|
||||
do {
|
||||
treated = '';
|
||||
@ -777,8 +798,9 @@ function(
|
||||
// Copy the part prior to the placeholder to the treated string.
|
||||
treated += content.substring(0, index);
|
||||
content = content.substr(index);
|
||||
isClean = content[3] == 'c';
|
||||
strIndex = '';
|
||||
walker = 4; // 4 is the length of '[[_s'.
|
||||
walker = 4; // 4 is the length of either '[[_s' or '[[_c'.
|
||||
|
||||
// Walk the characters to manually extract the index of the string from the placeholder.
|
||||
char = content.substr(walker, 1);
|
||||
@ -791,11 +813,15 @@ function(
|
||||
// Get the string, add it to the treated result, and remove the placeholder from the content to treat.
|
||||
strFinal = strings[parseInt(strIndex, 10)];
|
||||
if (typeof strFinal === 'undefined') {
|
||||
Log.debug('Could not find string for pattern [[_s' + strIndex + ']].');
|
||||
Log.debug('Could not find string for pattern [[_' + (isClean ? 'c' : 's') + strIndex + ']].');
|
||||
strFinal = '';
|
||||
}
|
||||
if (isClean) {
|
||||
strFinal = mustache.escape(strFinal);
|
||||
}
|
||||
treated += strFinal;
|
||||
content = content.substr(6 + strIndex.length); // 6 is the length of the placeholder without the index: '[[_s]]'.
|
||||
content = content.substr(6 + strIndex.length); // 6 is the length of the placeholder without the index.
|
||||
// That's either '[[_s]]' or '[[_c]]'.
|
||||
|
||||
// Find the next placeholder.
|
||||
index = content.search(pattern);
|
||||
|
68
lib/classes/output/mustache_clean_string_helper.php
Normal file
68
lib/classes/output/mustache_clean_string_helper.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Mustache helper to load strings from string_manager and perform HTML escaping on them.
|
||||
*
|
||||
* @package core
|
||||
* @category output
|
||||
* @copyright 2021 Shamim Rezaie <shamim@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core\output;
|
||||
|
||||
use Mustache_LambdaHelper;
|
||||
|
||||
/**
|
||||
* This class will load language strings in a template.
|
||||
*
|
||||
* @copyright 2021 Shamim Rezaie <shamim@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @since 4.0
|
||||
*/
|
||||
class mustache_clean_string_helper {
|
||||
|
||||
/** @var mustache_string_helper A string helper instance that is being used internally for fetching strings */
|
||||
private $stringhelper;
|
||||
|
||||
/**
|
||||
* Create new instance of mustache clean string helper.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->stringhelper = new \core\output\mustache_string_helper();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a lang string from a template and get it from get_string.
|
||||
*
|
||||
* Some examples for calling this from a template are:
|
||||
*
|
||||
* {{#cleanstr}}activity{{/cleanstr}}
|
||||
* {{#cleanstr}}actionchoice, core, {{#str}}delete{{/str}}{{/cleanstr}} (Together with the str helper)
|
||||
* {{#cleanstr}}addinganewto, core, {"what":"This", "to":"That"}{{/cleanstr}} (Complex $a)
|
||||
*
|
||||
* The args are comma separated and only the first is required.
|
||||
* The last is a $a argument for get string. For complex data here, use JSON.
|
||||
*
|
||||
* @param string $text The text to parse for arguments.
|
||||
* @param Mustache_LambdaHelper $helper Used to render nested mustache variables.
|
||||
* @return string
|
||||
*/
|
||||
public function cleanstr($text, Mustache_LambdaHelper $helper) {
|
||||
return s($this->stringhelper->str($text, $helper));
|
||||
}
|
||||
}
|
@ -105,6 +105,7 @@ class renderer_base {
|
||||
|
||||
$loader = new \core\output\mustache_filesystem_loader();
|
||||
$stringhelper = new \core\output\mustache_string_helper();
|
||||
$cleanstringhelper = new \core\output\mustache_clean_string_helper();
|
||||
$quotehelper = new \core\output\mustache_quote_helper();
|
||||
$jshelper = new \core\output\mustache_javascript_helper($this->page);
|
||||
$pixhelper = new \core\output\mustache_pix_helper($this);
|
||||
@ -116,6 +117,7 @@ class renderer_base {
|
||||
|
||||
$helpers = array('config' => $safeconfig,
|
||||
'str' => array($stringhelper, 'str'),
|
||||
'cleanstr' => array($cleanstringhelper, 'cleanstr'),
|
||||
'quote' => array($quotehelper, 'quote'),
|
||||
'js' => array($jshelper, 'help'),
|
||||
'pix' => array($pixhelper, 'pix'),
|
||||
|
@ -52,11 +52,11 @@
|
||||
}
|
||||
}}
|
||||
{{^disabled}}
|
||||
<a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{{text}}}</a>
|
||||
<a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{{text}}}</a>
|
||||
{{#hasactions}}
|
||||
{{> core/actions }}
|
||||
{{/hasactions}}
|
||||
{{/disabled}}
|
||||
{{#disabled}}
|
||||
<span class="currentlink {{classes}}" {{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{{text}}}</span>
|
||||
<span class="currentlink {{classes}}" {{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{#icon}}{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}{{/icon}}{{text}}</span>
|
||||
{{/disabled}}
|
||||
|
@ -27,7 +27,7 @@
|
||||
}
|
||||
}}
|
||||
{{^disabled}}
|
||||
<a href="{{url}}" class="{{$actionmenulinkclasses}}aabtn {{classes}}{{/actionmenulinkclasses}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>
|
||||
<a href="{{url}}" class="{{$actionmenulinkclasses}}aabtn {{classes}}{{/actionmenulinkclasses}}" {{#attributes}}{{name}}="{{value}}" {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>
|
||||
{{#icon}}
|
||||
{{#pix}}{{key}}, {{component}}, {{title}}{{/pix}}
|
||||
{{/icon}}
|
||||
|
@ -26,7 +26,7 @@
|
||||
data-block="{{type}}"
|
||||
data-instance-id="{{blockinstanceid}}"
|
||||
{{#arialabel}}
|
||||
aria-label={{#quote}}{{{arialabel}}}{{/quote}}
|
||||
aria-label="{{arialabel}}"
|
||||
{{/arialabel}}
|
||||
{{^arialabel}}
|
||||
{{#title}}
|
||||
|
@ -68,8 +68,8 @@
|
||||
</div>
|
||||
|
||||
<div class="submitbuttons">
|
||||
<input type="submit" name="submitbutton" class="submitbutton btn btn-primary" value={{#quote}}{{#str}}add{{/str}}{{/quote}}>
|
||||
<input type="submit" name="addcancel" class="addcancel btn btn-secondary" value={{#quote}}{{#str}}cancel{{/str}}{{/quote}}>
|
||||
<input type="submit" name="submitbutton" class="submitbutton btn btn-primary" value="{{#cleanstr}}add{{/cleanstr}}">
|
||||
<input type="submit" name="addcancel" class="addcancel btn btn-secondary" value="{{#cleanstr}}cancel{{/cleanstr}}">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
@ -31,7 +31,7 @@
|
||||
Example context (json):
|
||||
{ "text": "Copyable text"}
|
||||
}}
|
||||
<input type="text" class="copy_box" value="{{{ text }}}" readonly="readonly" size="48" {{#id}}id={{#quote}}{{{id}}}-{{{uniqid}}}{{/quote}}{{/id}}/>
|
||||
<input type="text" class="copy_box" value="{{{ text }}}" readonly="readonly" size="48" {{#id}}id="{{id}}-{{uniqid}}"{{/id}}/>
|
||||
{{# js }}
|
||||
require(['jquery'], function($) {
|
||||
$('.copy_box').on('click', function() {
|
||||
|
@ -137,15 +137,15 @@
|
||||
<input type="text" name="username" id="username" {{!
|
||||
!}}class="form-control" {{!
|
||||
!}}value="{{username}}" {{!
|
||||
!}}placeholder={{#quote}}{{^canloginbyemail}}{{#str}}username{{/str}}{{/canloginbyemail}}{{!
|
||||
!}}{{#canloginbyemail}}{{#str}}usernameemail{{/str}}{{/canloginbyemail}}{{/quote}} {{!
|
||||
!}}placeholder="{{^canloginbyemail}}{{#cleanstr}}username{{/cleanstr}}{{/canloginbyemail}}{{!
|
||||
!}}{{#canloginbyemail}}{{#cleanstr}}usernameemail{{/cleanstr}}{{/canloginbyemail}}" {{!
|
||||
!}}autocomplete="username">
|
||||
</div>
|
||||
<div class="login-form-password form-group">
|
||||
<label for="password" class="sr-only">{{#str}} password {{/str}}</label>
|
||||
<input type="password" name="password" id="password" value="" {{!
|
||||
!}}class="form-control" {{!
|
||||
!}}placeholder={{#quote}}{{#str}}password{{/str}}{{/quote}} {{!
|
||||
!}}placeholder="{{#cleanstr}}password{{/cleanstr}}" {{!
|
||||
!}}autocomplete="current-password">
|
||||
</div>
|
||||
{{#rememberusername}}
|
||||
|
@ -48,7 +48,7 @@
|
||||
{{$header}}
|
||||
<h5 id="{{uniqid}}-modal-title" class="modal-title" data-region="title">{{$title}}{{title}}{{/title}}</h5>
|
||||
{{/header}}
|
||||
<button type="button" class="close" data-action="hide" aria-label={{#quote}}{{#str}}closebuttontitle{{/str}}{{/quote}}>
|
||||
<button type="button" class="close" data-action="hide" aria-label="{{#cleanstr}}closebuttontitle{{/cleanstr}}">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -58,9 +58,9 @@
|
||||
{{/params}}
|
||||
<button type="submit" class="btn {{#primary}}btn-primary{{/primary}}{{^primary}}btn-secondary{{/primary}}"
|
||||
id="{{id}}"
|
||||
title={{#quote}}{{tooltip}}{{/quote}}
|
||||
title="{{tooltip}}"
|
||||
{{#disabled}}disabled{{/disabled}}
|
||||
{{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{label}}</button>
|
||||
{{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{label}}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{#hasactions}}
|
||||
|
56
lib/tests/output/mustache_clean_string_helper_test.php
Normal file
56
lib/tests/output/mustache_clean_string_helper_test.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace core\output;
|
||||
|
||||
/**
|
||||
* Unit tests for the mustache_clean_string_helper class.
|
||||
*
|
||||
* @package core
|
||||
* @category test
|
||||
* @copyright 2021 Shamim Rezaie <shamim@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @coversDefaultClass mustache_clean_string_helper
|
||||
*/
|
||||
class mustache_clean_string_helper_test extends \basic_testcase {
|
||||
|
||||
/**
|
||||
* Test the get_lang_menu
|
||||
*
|
||||
* @covers ::cleanstr
|
||||
*/
|
||||
function test_cleanstr() {
|
||||
$engine = new \Mustache_Engine();
|
||||
$context = new \Mustache_Context();
|
||||
$lambdahelper = new \Mustache_LambdaHelper($engine, $context);
|
||||
|
||||
$cleanstringhelper = new mustache_clean_string_helper();
|
||||
|
||||
// Simple string.
|
||||
$this->assertEquals('Log in', $cleanstringhelper->cleanstr('login, core', $lambdahelper));
|
||||
|
||||
// Quotes in string.
|
||||
$this->assertEquals('Today's logs', $cleanstringhelper->cleanstr('todaylogs, core', $lambdahelper));
|
||||
|
||||
// Quotes in string with parameter.
|
||||
$this->assertEquals('After "test"', $cleanstringhelper->cleanstr('movecontentafter, core, test', $lambdahelper));
|
||||
|
||||
// Quotes in parameter.
|
||||
$this->assertEquals('Add a new "'&', $cleanstringhelper->cleanstr('addnew, core, "\'&', $lambdahelper));
|
||||
}
|
||||
}
|
@ -127,6 +127,7 @@ completely removed from Moodle core too.
|
||||
interactions define sort parameters (see the respective docblocks for full details and examples):
|
||||
-get_safe_orderby() - where a single sort parameter is required.
|
||||
-get_safe_orderby_multiple() - where multiple sort parameters are required.
|
||||
* Added the cleanstr mustache template helper to clean strings after loading them from language packs.
|
||||
|
||||
=== 3.11.4 ===
|
||||
* A new option dontforcesvgdownload has been added to the $options parameter of the send_file() function.
|
||||
|
@ -38,7 +38,7 @@
|
||||
<div id="message-drawer-{{uniqid}}" class="message-app" data-region="message-drawer" role="region">
|
||||
<div class="closewidget text-right pr-2">
|
||||
<a class="text-dark btn-link" data-action="closedrawer" href="#"
|
||||
title="{{#str}} closebuttontitle {{/str}}" aria-label="{{#str}} closebuttontitle {{/str}}"
|
||||
title="{{#cleanstr}} closebuttontitle {{/cleanstr}}" aria-label="{{#cleanstr}} closebuttontitle {{/cleanstr}}"
|
||||
>
|
||||
{{#pix}} i/window_close, core {{/pix}}
|
||||
</a>
|
||||
|
@ -40,45 +40,45 @@
|
||||
<div class="mb-2 custom-control custom-checkbox hidden" data-region="delete-messages-for-all-users-toggle-container">
|
||||
<input type="checkbox" class="custom-control-input" id="delete-messages-for-all-users" data-region="delete-messages-for-all-users-toggle">
|
||||
<label class="custom-control-label text-muted" for="delete-messages-for-all-users">
|
||||
{{#str}} deleteforeveryone, core_message {{/str}}
|
||||
{{#cleanstr}} deleteforeveryone, core_message {{/cleanstr}}
|
||||
</label>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="confirm-block">
|
||||
<span data-region="dialogue-button-text">{{#str}} blockuserconfirmbutton, core_message {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} blockuserconfirmbutton, core_message {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="confirm-unblock">
|
||||
<span data-region="dialogue-button-text">{{#str}} unblock, core_message {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} unblock, core_message {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="confirm-remove-contact">
|
||||
<span data-region="dialogue-button-text">{{#str}} remove, core {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} remove, core {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="confirm-add-contact">
|
||||
<span data-region="dialogue-button-text">{{#str}} add, core {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} add, core {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="confirm-delete-selected-messages">
|
||||
<span data-region="dialogue-button-text">{{#str}} delete, core {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} delete, core {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="confirm-delete-conversation">
|
||||
<span data-region="dialogue-button-text">{{#str}} delete, core {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} delete, core {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="request-add-contact">
|
||||
<span data-region="dialogue-button-text">{{#str}} sendcontactrequest, core_message {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} sendcontactrequest, core_message {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block hidden" data-action="accept-contact-request">
|
||||
<span data-region="dialogue-button-text">{{#str}} acceptandaddcontact, core_message {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} acceptandaddcontact, core_message {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary btn-block hidden" data-action="decline-contact-request">
|
||||
<span data-region="dialogue-button-text">{{#str}} decline, core_message {{/str}}</span>
|
||||
<span data-region="dialogue-button-text">{{#cleanstr}} decline, core_message {{/cleanstr}}</span>
|
||||
<span class="hidden" data-region="loading-icon-container">{{> core/loading }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-block" data-action="okay-confirm">{{#str}} ok, core {{/str}}</button>
|
||||
<button type="button" class="btn btn-secondary btn-block" data-action="cancel-confirm">{{#str}} cancel, core {{/str}}</button>
|
||||
<button type="button" class="btn btn-primary btn-block" data-action="okay-confirm">{{#cleanstr}} ok, core {{/cleanstr}}</button>
|
||||
<button type="button" class="btn btn-secondary btn-block" data-action="cancel-confirm">{{#cleanstr}} cancel, core {{/cleanstr}}</button>
|
||||
</div>
|
||||
|
@ -55,7 +55,7 @@
|
||||
{{/params}}
|
||||
<button type="submit" class="btn {{#primary}}btn-primary{{/primary}}{{^primary}}btn-outline-primary{{/primary}}"
|
||||
id="{{id}}"
|
||||
title={{#quote}}{{tooltip}}{{/quote}}
|
||||
title="{{tooltip}}"
|
||||
{{#disabled}}disabled{{/disabled}}
|
||||
{{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{{label}}}</button>
|
||||
{{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{{label}}}</button>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user