mirror of
https://github.com/e107inc/e107.git
synced 2025-07-28 02:10:46 +02:00
Possible fix for issue #2351.
This commit is contained in:
@@ -3871,8 +3871,8 @@ class e_form
|
|||||||
$jsonArray[$k] = str_replace("'", "`", $v);
|
$jsonArray[$k] = str_replace("'", "`", $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$source = str_replace('"',"'",json_encode($jsonArray, JSON_FORCE_OBJECT)); // SecretR - force object, fix number of bugs
|
|
||||||
|
|
||||||
|
$source = e107::getParser()->toJSON($jsonArray);
|
||||||
|
|
||||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||||
|
|
||||||
@@ -3892,7 +3892,7 @@ class e_form
|
|||||||
unset( $options['title']);
|
unset( $options['title']);
|
||||||
|
|
||||||
$text = "<a class='e-tip e-editable editable-click ".$class."' data-name='".$dbField."' ";
|
$text = "<a class='e-tip e-editable editable-click ".$class."' data-name='".$dbField."' ";
|
||||||
$text .= (is_array($array)) ? "data-source=\"".$source."\" " : "";
|
$text .= (is_array($array)) ? "data-source='".$source."' " : "";
|
||||||
$text .= " title=\"".$title."\" data-type='".$type."' data-inputclass='x-editable-".$this->name2id($dbField)." ".$class."' data-value=\"{$curVal}\" href='#' ";
|
$text .= " title=\"".$title."\" data-type='".$type."' data-inputclass='x-editable-".$this->name2id($dbField)." ".$class."' data-value=\"{$curVal}\" href='#' ";
|
||||||
|
|
||||||
if(!empty($options))
|
if(!empty($options))
|
||||||
|
@@ -177,7 +177,35 @@ $(document).ready(function()
|
|||||||
|
|
||||||
|
|
||||||
$('div.e-container').editable({
|
$('div.e-container').editable({
|
||||||
selector: '.e-editable'
|
selector: '.e-editable',
|
||||||
|
display: function (value, sourceData)
|
||||||
|
{
|
||||||
|
// HTML entities decoding... fix for:
|
||||||
|
// @see https://github.com/e107inc/e107/issues/2351
|
||||||
|
$.each(sourceData, function (index, element)
|
||||||
|
{
|
||||||
|
element.text = $("<div/>").html(element.text).text();
|
||||||
|
sourceData[index] = element;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Display checklist as comma-separated values.
|
||||||
|
var html = [];
|
||||||
|
var checked = $.fn.editableutils.itemsByValue(value, sourceData);
|
||||||
|
|
||||||
|
if(checked.length)
|
||||||
|
{
|
||||||
|
$.each(checked, function (i, v)
|
||||||
|
{
|
||||||
|
html.push($.fn.editableutils.escape(v.text));
|
||||||
|
});
|
||||||
|
|
||||||
|
$(this).html(html.join(', '));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$(this).empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// $('.e-editable').editable();
|
// $('.e-editable').editable();
|
||||||
|
Reference in New Issue
Block a user