1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 10:20:45 +02:00

Allow for pre/post options on inline editable elements.

This commit is contained in:
Cameron
2016-06-24 14:36:24 -07:00
parent b719a1031a
commit bf36104fe9

View File

@@ -3454,9 +3454,11 @@ class e_form
} }
$title = varset($options['title'] , (LAN_EDIT." ".$fieldName)); $title = varset($options['title'] , (LAN_EDIT." ".$fieldName));
$class = varset($options['class'] ,'');
unset( $options['title']); unset( $options['title']);
$text = "<a class='e-tip e-editable editable-click' 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)."' data-value=\"{$curVal}\" href='#' "; $text .= " title=\"".$title."\" data-type='".$type."' data-inputclass='x-editable-".$this->name2id($dbField)."' data-value=\"{$curVal}\" href='#' ";
@@ -4314,6 +4316,7 @@ class e_form
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], '')); $mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
$methodParms = call_user_func_array(array($this, $method), array($value, 'inline', $parms)); $methodParms = call_user_func_array(array($this, $method), array($value, 'inline', $parms));
$inlineParms = (!empty($methodParms['inlineParms'])) ? $methodParms['inlineParms'] : null;
if(!empty($methodParms['inlineType'])) if(!empty($methodParms['inlineType']))
{ {
@@ -4321,6 +4324,8 @@ class e_form
$methodParms = (!empty($methodParms['inlineData'])) ? $methodParms['inlineData'] : null; $methodParms = (!empty($methodParms['inlineData'])) ? $methodParms['inlineData'] : null;
} }
if(is_string($attributes['inline'])) // text, textarea, select, checklist. if(is_string($attributes['inline'])) // text, textarea, select, checklist.
{ {
switch ($attributes['inline']) switch ($attributes['inline'])
@@ -4342,18 +4347,16 @@ class e_form
default: default:
$xtype = 'text'; $xtype = 'text';
$methodParms = null; $methodParms = null;
break; break;
} }
} }
if(!empty($xtype)) if(!empty($xtype))
{ {
$value = $this->renderInline($field, $id, $attributes['title'], $_value, $value, $xtype, $methodParms); $value = varset($inlineParms['pre'],'').$this->renderInline($field, $id, $attributes['title'], $_value, $value, $xtype, $methodParms,$inlineParms).varset($inlineParms['post'],'');
} }
} }
break; break;