mirror of
https://github.com/processwire/processwire.git
synced 2025-08-20 21:42:23 +02:00
Various minor updates
This commit is contained in:
@@ -1753,7 +1753,8 @@ class Page extends WireData implements \Countable, WireMatchable {
|
||||
/**
|
||||
* Same as getMarkup() except returned value is plain text
|
||||
*
|
||||
* Returned value is entity encoded, unless $entities argument is false.
|
||||
* If no `$entities` argument is provided, returned value is entity encoded when output formatting
|
||||
* is on, and not entity encoded when output formatting is off.
|
||||
*
|
||||
* #pw-advanced
|
||||
*
|
||||
@@ -1769,12 +1770,12 @@ class Page extends WireData implements \Countable, WireMatchable {
|
||||
$length = strlen($value);
|
||||
if(!$length) return '';
|
||||
$options = array(
|
||||
'entities' => (is_null($entities) ? $this->outputFormatting() : (bool) $entities)
|
||||
'entities' => ($entities === null ? $this->outputFormatting() : (bool) $entities)
|
||||
);
|
||||
if($oneLine) {
|
||||
$value = $this->wire('sanitizer')->markupToLine($value, $options);
|
||||
$value = $this->wire()->sanitizer->markupToLine($value, $options);
|
||||
} else {
|
||||
$value = $this->wire('sanitizer')->markupToText($value, $options);
|
||||
$value = $this->wire()->sanitizer->markupToText($value, $options);
|
||||
}
|
||||
// if stripping tags from non-empty value made it empty, just indicate that it was markup and length
|
||||
if(!strlen(trim($value))) $value = "markup($length)";
|
||||
|
@@ -1566,7 +1566,7 @@ class Sanitizer extends Wire {
|
||||
}
|
||||
|
||||
// remove entities
|
||||
$value = $this->wire('sanitizer')->unentities($value);
|
||||
$value = $this->unentities($value);
|
||||
|
||||
if(strpos($value, '<') !== false) {
|
||||
// tag replacements before strip_tags()
|
||||
|
@@ -389,8 +389,8 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList {
|
||||
|
||||
$wrap = $this->wire('modules')->get('InputfieldFieldset');
|
||||
$wrap->addClass('InputfieldRepeaterItem InputfieldNoFocus');
|
||||
$wrap->entityEncodeLabel = false;
|
||||
if(!$isPost) {
|
||||
$wrap->entityEncodeLabel = false;
|
||||
$wrap->label =
|
||||
"<span class='InputfieldRepeaterItemLabel'>" .
|
||||
$this->entityEncode($this->renderRepeaterLabel($label, ++$cnt, $page)) .
|
||||
|
@@ -314,7 +314,9 @@ class LanguageSupport extends WireData implements Module, ConfigurableModule {
|
||||
|
||||
/** @var Inputfield $inputfield */
|
||||
$inputfield = $event->object;
|
||||
$user = $this->wire('user');
|
||||
if(!$inputfield->useLanguages) return;
|
||||
|
||||
$user = $this->wire()->user;
|
||||
$userLanguage = $user->language;
|
||||
if(!$userLanguage) return;
|
||||
|
||||
@@ -619,6 +621,9 @@ class LanguageSupport extends WireData implements Module, ConfigurableModule {
|
||||
}
|
||||
$inputfield->set('value' . $language->id, $languageValue);
|
||||
}
|
||||
|
||||
// following this hookInputfieldBeforeRender() completes the process after
|
||||
// Fieldgroup::getPageInputfields() which sets the value attribute of Inputfields
|
||||
}
|
||||
|
||||
$event->return = $inputfield;
|
||||
|
Reference in New Issue
Block a user