mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Issue #2996 Admin-ui type=layout inline editing issue.
This commit is contained in:
parent
dfb0e1bd4a
commit
79fbf4273c
@ -464,7 +464,7 @@ class news_admin_ui extends e_admin_ui
|
||||
'news_end' => array('title' => LAN_END, 'type' => 'datestamp', 'data'=>'int', 'tab'=>2, 'writeParms'=>'type=datetime', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
|
||||
'news_class' => array('title' => LAN_VISIBILITY, 'type' => 'userclass', 'tab'=>2, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'batch'=>true, 'filter'=>true),
|
||||
|
||||
'news_template' => array('title' => LAN_TEMPLATE, 'type' => 'method', 'data'=>'str', 'tab'=>2, 'inline'=>true, 'writeParms'=>'', 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_template' => array('title' => LAN_TEMPLATE, 'type' => 'layouts', 'data'=>'str', 'tab'=>2, 'inline'=>true, 'writeParms'=>array('plugin'=>'news', 'id'=>'news_view', 'area'=> 'front', 'merge'=>false), 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
|
||||
'news_render_type' => array('title' => LAN_LOCATION, 'type' => 'dropdown', 'data'=>'str', 'tab'=>2, 'inline'=>true, 'readParms'=>array('type'=>'checkboxes'), 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
|
||||
|
@ -4381,32 +4381,30 @@ class e_form
|
||||
|
||||
case 'templates':
|
||||
case 'layouts':
|
||||
$pre = vartrue($parms['pre']);
|
||||
$post = vartrue($parms['post']);
|
||||
unset($parms['pre'], $parms['post']);
|
||||
if($parms)
|
||||
{
|
||||
$attributes['writeParms'] = $parms;
|
||||
}
|
||||
elseif(isset($attributes['writeParms']))
|
||||
|
||||
if(!empty($attributes['writeParms']))
|
||||
{
|
||||
if(is_string($attributes['writeParms'])) parse_str($attributes['writeParms'], $attributes['writeParms']);
|
||||
}
|
||||
$attributes['writeParms']['raw'] = true;
|
||||
$tmp = $this->renderElement($field, '', $attributes);
|
||||
|
||||
// Inline Editing. //@SecretR - please FIXME!
|
||||
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']) && !vartrue($parms['link'])) // avoid bad markup, better solution coming up
|
||||
|
||||
if(empty($attributes['noedit']) && !empty($parms['editable']) && empty($parms['link'])) // avoid bad markup, better solution coming up
|
||||
{
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
$source = str_replace('"',"'",json_encode($wparms));
|
||||
$value = "<a class='e-tip e-editable editable-click' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-type='select' data-pk='".$id."' data-url='".e_SELF."?mode=&action=inline&id={$id}&ajax_used=1' href='#'>".$value."</a>";
|
||||
$wparms = $attributes['writeParms'];
|
||||
|
||||
$location = vartrue($wparms['plugin']); // empty - core
|
||||
$ilocation = vartrue($wparms['id'], $location); // omit if same as plugin name
|
||||
$where = vartrue($wparms['area'], 'front'); //default is 'front'
|
||||
$filter = varset($wparms['filter']);
|
||||
$merge = isset($wparms['merge']) ? (bool) $wparms['merge'] : true;
|
||||
|
||||
$layouts = e107::getLayouts($location, $ilocation, $where, $filter, $merge, false);
|
||||
|
||||
$label = varset($layouts[$value], $value);
|
||||
|
||||
$value = $this->renderInline($field, $id, $attributes['title'], $value, $label, 'select', $layouts);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// $value = $pre.vartrue($tmp[$value]).$post; // FIXME "Fatal error: Only variables can be passed by reference" featurebox list page.
|
||||
|
||||
$value = vartrue($parms['pre']) . $value . vartrue($parms['post']);
|
||||
break;
|
||||
|
||||
case 'checkboxes':
|
||||
@ -5113,7 +5111,7 @@ class e_form
|
||||
{
|
||||
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
$methodParms = call_user_func_array(array($this, $meth), array($value, 'inline', $parms));
|
||||
$methodParms = call_user_func_array(array($this, $meth), array($_value, 'inline', $parms));
|
||||
|
||||
$inlineParms = (!empty($methodParms['inlineParms'])) ? $methodParms['inlineParms'] : null;
|
||||
|
||||
|
@ -214,7 +214,7 @@ class fb_main_ui extends e_admin_ui
|
||||
'fb_text' => array('title'=> FBLAN_08, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1','writeParms'=>'template=admin'),
|
||||
//DEPRECATED 'fb_mode' => array('title'=> FBLAN_12, 'type' => 'dropdown', 'data'=> 'int', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
|
||||
//DEPRECATED 'fb_rendertype' => array('title'=> FBLAN_22, 'type' => 'dropdown', 'data'=> 'int', 'width' => 'auto', 'noedit' => TRUE),
|
||||
'fb_template' => array('title'=> LAN_TEMPLATE, 'type' => 'layouts', 'data'=> 'str', 'width' => 'auto', 'writeParms' => 'plugin=featurebox', 'filter' => true, 'batch' => true), // Photo
|
||||
'fb_template' => array('title'=> LAN_TEMPLATE, 'type' => 'layouts', 'inline'=>true, 'data'=> 'str', 'width' => 'auto', 'writeParms' => 'plugin=featurebox&merge=true', 'filter' => true, 'batch' => true), // Photo
|
||||
'fb_imageurl' => array('title'=> FBLAN_27, 'type' => 'url', 'width' => 'auto','writeParms'=>'size=xxlarge'),
|
||||
'fb_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'filter' => true, 'batch' => true), // User id
|
||||
'fb_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=> 'int','width' => '5%' ),
|
||||
|
Loading…
x
Reference in New Issue
Block a user