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:
@@ -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}&action=inline&id={$id}&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}&action=inline&id={$id}&ajax_used=1' href='#'>".$value."</a>";
|
||||
}
|
||||
|
||||
$value = vartrue($parms['pre']).$value.vartrue($parms['post']);
|
||||
|
Reference in New Issue
Block a user