1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-17 03:54:09 +02:00

Inline editing of keywords enabled on admin newspost. Fixes empty space between tags in database (causing issues with 'related' SQL queries).

This commit is contained in:
Cameron
2015-06-09 15:46:45 -07:00
parent 6be9ee6504
commit ff896c52a0
4 changed files with 22 additions and 8 deletions

View File

@@ -2748,6 +2748,8 @@ class e_form
{
return;
}
$tags = str_replace(', ',',', $tags); //BC Fix, all tags should be comma separated without spaces ie. one,two NOT one, two
if(!varset($parm['limit']))
{
@@ -3245,18 +3247,26 @@ class e_form
if(empty($value))
{
$value = '-';
$emptyValue = "data-value=''";
$setValue = "data-value=''";
}
else
{
$emptyValue = "";
$setValue = "";
if($attributes['type'] == 'tags' && !empty($value))
{
$setValue = "data-value='".$value."'";
$value = str_replace(",", ", ", $value); // add spaces so it wraps, but don't change the actual values.
}
}
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']) && !vartrue($parms['link'])) // avoid bad markup, better solution coming up
{
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
$value = "<a class='e-tip e-editable editable-click' data-emptytext='-' data-name='".$field."' title=\"".LAN_EDIT." ".$attributes['title']."\" data-type='text' data-pk='".$id."' ".$emptyValue." data-url='".e_SELF."?mode={$mode}&amp;action=inline&amp;id={$id}&amp;ajax_used=1' href='#'>".$value."</a>";
$value = "<a class='e-tip e-editable editable-click' data-emptytext='-' data-name='".$field."' title=\"".LAN_EDIT." ".$attributes['title']."\" data-type='text' data-pk='".$id."' ".$setValue." data-url='".e_SELF."?mode={$mode}&amp;action=inline&amp;id={$id}&amp;ajax_used=1' href='#'>".$value."</a>";
}
$value = vartrue($parms['pre']).$value.vartrue($parms['post']);