mirror of
https://github.com/e107inc/e107.git
synced 2025-07-28 02:10:46 +02:00
Added Experimental Inline editing for news items.
This commit is contained in:
@@ -376,10 +376,30 @@ class news {
|
||||
|
||||
$wrapperKey = (!empty($param['template_key'])) ? 'news/'.$param['template_key'].'/item' : 'news/view/item';
|
||||
|
||||
$editable = array(
|
||||
'table' => 'news',
|
||||
'pid' => 'news_id',
|
||||
'vars' => 'news_item',
|
||||
'perms' => '0',
|
||||
'shortcodes' => array(
|
||||
'newstitle' => array('field'=>'news_title', 'type'=>'text', 'container'=>'span'),
|
||||
'newsmetadiz' => array('field'=>'news_meta_description','type'=>'text', 'container'=>'div'),
|
||||
'newsbody' => array('field'=>'news_body', 'type'=>'html', 'container'=>'div'),
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
// Aliases
|
||||
$editable['shortcodes']['newstitlelink'] = $editable['shortcodes']['newstitle'];
|
||||
$editable['shortcodes']['news_title'] = $editable['shortcodes']['newstitle'];
|
||||
$editable['shortcodes']['news_body'] = $editable['shortcodes']['newsbody'];
|
||||
|
||||
|
||||
$sc = e107::getScBatch('news')
|
||||
->wrapper($wrapperKey)
|
||||
->setScVar('news_item', $news)
|
||||
->setScVar('param', $param);
|
||||
->setScVar('param', $param)
|
||||
->editable($editable);
|
||||
|
||||
|
||||
$text = e107::getParser()->parseTemplate($NEWS_PARSE, true, $sc);
|
||||
|
@@ -327,3 +327,6 @@ optgroup.level-5 { padding-left:4em }
|
||||
img.e-emoticon { vertical-align:middle; border:0; width:24px }
|
||||
|
||||
.e-editable-front:hover { background-color:#FCF8E3 }
|
||||
.e-editable-front a:hover { background-color:#FCF8E3 }
|
||||
#uiAlert { z-index: 10001 }
|
||||
#uiAlert .alert { z-index:10000; box-shadow:1px 4px 5px rgba(0,0,0,0.4) }
|
@@ -89,10 +89,11 @@ class e107InlineEdit
|
||||
$ret['msg'] = "Saved"; // LAN_UPDATED; or LAN_SAVED
|
||||
$ret['status'] = 'ok';
|
||||
}
|
||||
else
|
||||
else //FIXME only display error when query fails..
|
||||
{
|
||||
$ret['msg'] = "Saving Failed"; // LAN_UPDATED_FAILED;
|
||||
$ret['status'] = 'error';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user