1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 21:21:54 +02:00

FAQ inline editing on categories.

This commit is contained in:
Cameron 2013-02-23 04:19:36 -08:00
parent dc42c53d76
commit deb3059bfa

@ -172,13 +172,13 @@ class faq_main_ui extends e_admin_ui
'faq_id' => array('title'=> LAN_ID, 'type' => 'int', 'width' =>'5%', 'forced'=> TRUE),
'faq_question' => array('title'=> "Question", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'required'=>TRUE, 'readParms'=>'editable=1'),
'faq_answer' => array('title'=> "Answer", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'),
'faq_parent' => array('title'=> "Category", 'type' => 'method', 'data'=> 'int','width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
'faq_parent' => array('title'=> LAN_CATEGORY, 'type' => 'dropdown', 'data'=> 'int', 'inline'=>true,'width' => '10%', 'filter'=>TRUE, 'batch'=>TRUE),
'faq_comment' => array('title'=> "Comment", 'type' => 'userclass', 'data' => 'int', 'width' => 'auto', 'inline'=> true), // User id
'faq_datestamp' => array('title'=> "Datestamp", 'type' => 'datestamp', 'data'=> 'int','width' => 'auto', 'noedit' => false,'writeParms'=>'auto=1'),
'faq_datestamp' => array('title'=> LAN_DATE, 'type' => 'datestamp', 'data'=> 'int','width' => 'auto', 'noedit' => false,'writeParms'=>'auto=1'),
'faq_author' => array('title'=> LAN_USER, 'type' => 'user', 'data'=> 'int', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'currentInit=1', 'filter' => true, 'batch' => true, 'nolist' => true ), // Photo
'u.user_name' => array('title'=> "User name", 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User name
'u.user_loginname' => array('title'=> "User login", 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User login name
'faq_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center','nolist' => false, 'noedit'=>false, 'readParms'=>'editable=1'),
'faq_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center','nolist' => false, 'noedit'=>false, 'readParms'=>'editable=1'),
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1')
);
@ -191,9 +191,23 @@ class faq_main_ui extends e_admin_ui
'submit_question' => array('title'=> 'Allow submitting of Questions by:', 'type'=>'userclass'),
'classic_look' => array('title'=> 'Use Classic Layout', 'type'=>'boolean')
);
protected $categories = array();
public function init()
{
$sql = e107::getDb();
if($sql->select('faqs_info'))
{
while ($row = $sql->fetch())
{
$this->categories[$row['faq_info_id']] = $row['faq_info_title'];
}
}
$this->fields['faq_parent']['writeParms'] = $this->categories;
}
@ -203,7 +217,7 @@ class faq_main_ui extends e_admin_ui
* FAQ categories
* @var array
*/
protected $categories = null;
/**
* Get FAQ Category data
@ -212,6 +226,7 @@ class faq_main_ui extends e_admin_ui
* @param mixed $default [optional] default value if not found (default 'n/a')
* @return array
*/
/*
function getFaqCategory($id = false, $default = 'n/a')
{
@ -236,6 +251,7 @@ class faq_main_ui extends e_admin_ui
}
return vartrue($this->categories[$id], $default);
}
*/
}