1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-15 11:04:18 +02:00

Issue #2000 Enable news category to determine news category default template. Admin area completed. Frontend still to come.

This commit is contained in:
Cameron
2017-09-28 09:35:56 -07:00
parent a8a49f5aad
commit 229f0486aa
3 changed files with 27 additions and 3 deletions

View File

@@ -123,6 +123,8 @@ class news_cat_ui extends e_admin_ui
protected $batchExport = true;
protected $sortField = 'category_order';
protected $listOrder = "category_order ASC";
protected $tabs = array(LAN_GENERAL, LAN_ADVANCED);
protected $fields = array(
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
@@ -133,8 +135,9 @@ class news_cat_ui extends e_admin_ui
'category_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE, 'writeParms'=>array('size'=>'xxlarge')),
'category_meta_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
'category_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'readonly'=>FALSE, 'writeParms'=>array('size'=>'xxlarge', 'sef'=>'category_name')), // Display name
'category_manager' => array('title'=> LAN_MANAGER,'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
'category_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),
'category_manager' => array('title'=> LAN_MANAGER,'type' => 'userclass', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
'category_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'tab'=>1, 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),
'category_template' => array('title'=> LAN_TEMPLATE, 'type' => 'layouts', 'tab'=>1, 'width'=>'auto', 'thclass' => 'right', 'class'=> 'right', 'writeParms' => 'plugin=news&id=news&merge=0','help'=>'Template to use as the default view' ),
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center', 'sort' => true)
);
@@ -189,11 +192,17 @@ class news_cat_ui extends e_admin_ui
}
$sef = e107::getParser()->toDB($new_data['category_sef']);
if(e107::getDb()->count('news_category', '(*)', "category_sef='{$sef}' AND category_id!=".intval($id)))
/* $message = "Error: sef: ".$sef." id: ".$id."\n";
$message .= print_r($new_data,true);
file_put_contents(e_LOG.'uiAjaxResponseInline.log', $message."\n\n", FILE_APPEND);*/
if(e107::getDb()->count('news_category', '(*)', "category_sef='{$sef}' AND category_id !=".intval($id)))
{
e107::getMessage()->addError(LAN_NEWS_65);
return false;
}
return $new_data;
}