2009-11-09 12:57:34 +00:00
< ? php
/*
2013-03-07 14:56:37 +02:00
* e107 website system
*
* Copyright ( C ) 2008 - 2009 e107 Inc ( e107 . org )
* Released under the terms and conditions of the
* GNU General Public License ( http :// www . gnu . org / licenses / gpl . txt )
*
*/
/**
*
* @ package e107
* @ subpackage faqs
* @ author e107inc
*
* FAQ plugin admin UI
*/
2012-05-23 08:29:57 +00:00
2013-03-07 14:56:37 +02:00
require_once ( " ../../class2.php " );
2012-05-23 08:29:57 +00:00
2016-04-07 11:51:14 -07:00
e107 :: lan ( 'faqs' , 'admin' , true );
2009-11-09 12:57:34 +00:00
class faq_admin extends e_admin_dispatcher
{
protected $modes = array (
'main' => array (
'controller' => 'faq_main_ui' ,
'path' => null ,
'ui' => 'faq_admin_form_ui' ,
'uipath' => null
),
'cat' => array (
'controller' => 'faq_cat_ui' ,
'path' => null ,
2009-11-12 16:55:50 +00:00
'ui' => 'faq_cat_form_ui' ,
2009-11-09 12:57:34 +00:00
'uipath' => null
)
);
protected $adminMenu = array (
2013-03-09 15:24:32 -08:00
'main/list' => array ( 'caption' => LAN_MANAGE , 'perm' => 'P' ),
2013-03-10 22:07:06 -07:00
'main/create' => array ( 'caption' => LAN_CREATE_ITEM , 'perm' => 'P' ),
2015-05-28 09:47:28 -07:00
'main/pending' => array ( 'caption' => " Unanswered " , 'perm' => 'P' , 'uri' => " admin_config.php?mode=main&action=list&filter=pending " ),
2015-03-31 06:26:06 -07:00
2013-03-10 22:07:06 -07:00
'cat/list' => array ( 'caption' => LAN_CATEGORIES , 'perm' => 'P' ),
'cat/create' => array ( 'caption' => LAN_CREATE_CATEGORY , 'perm' => 'P' ),
2009-11-09 12:57:34 +00:00
'main/prefs' => array ( 'caption' => LAN_PREFS , 'perm' => '0' ),
// 'main/custom' => array('caption'=> 'Custom Page', 'perm' => '0')
);
2015-06-06 13:17:58 -07:00
protected $perm = array (
2015-06-07 18:15:23 -07:00
// 'main/prefs' => '0'
2015-06-06 13:17:58 -07:00
);
2009-11-09 12:57:34 +00:00
protected $adminMenuAliases = array (
'main/edit' => 'main/list'
);
protected $menuTitle = 'FAQs' ;
2015-03-31 06:26:06 -07:00
//
2015-04-08 10:35:59 -07:00
function init ()
{
if ( ! empty ( $_GET [ 'filter' ]))
{
$action = $_GET [ 'filter' ];
$this -> adminMenu [ 'main/' . $action ][ 'selected' ] = true ;
}
2015-06-06 14:25:40 -07:00
$pref = e107 :: pref ( 'faqs' );
$this -> access = array (
'main/create' => varset ( $pref [ 'admin_faq_create' ], e_UC_ADMIN ),
'main/edit' => varset ( $pref [ 'admin_faq_edit' ], e_UC_ADMIN ),
'main/delete' => varset ( $pref [ 'admin_faq_delete' ], e_UC_ADMIN ),
2016-03-24 10:30:53 -07:00
'cat/list' => check_class ( $pref [ 'admin_cat_create' ]) || check_class ( $pref [ 'admin_cat_edit' ]) ? e_UC_ADMIN : e_UC_MAINADMIN ,
2015-06-06 14:25:40 -07:00
'cat/create' => varset ( $pref [ 'admin_cat_create' ], e_UC_ADMIN ),
'cat/edit' => varset ( $pref [ 'admin_cat_edit' ], e_UC_ADMIN ),
'cat/delete' => varset ( $pref [ 'admin_cat_delete' ], e_UC_ADMIN ),
);
2015-06-07 18:15:23 -07:00
2015-04-08 10:35:59 -07:00
}
2009-11-09 12:57:34 +00:00
}
class faq_cat_ui extends e_admin_ui
{
2013-03-07 14:56:37 +02:00
protected $pluginTitle = LAN_PLUGIN_FAQS_NAME ;
2009-11-09 12:57:34 +00:00
protected $pluginName = 'plugin' ;
2015-06-06 13:17:58 -07:00
2009-11-09 12:57:34 +00:00
protected $table = " faqs_info " ;
protected $pid = " faq_info_id " ;
2012-05-23 08:29:57 +00:00
protected $perPage = 5 ; //no limit
protected $listOrder = 'faq_info_order ASC' ;
2013-02-22 14:37:17 +02:00
protected $sortField = 'faq_info_order' ;
2009-11-09 12:57:34 +00:00
protected $fields = array (
2009-11-12 16:55:50 +00:00
'checkboxes' => array ( 'title' => '' , 'type' => null , 'width' => '5%' , 'forced' => TRUE , 'thclass' => 'center' , 'class' => 'center' ),
2013-07-12 09:07:56 -07:00
'faq_info_icon' => array ( 'title' => LAN_ICON , 'type' => 'icon' , 'width' => '5%' , 'thclass' => 'left' , 'writeParms' => 'glyphs=1' ),
2009-11-12 16:55:50 +00:00
'faq_info_id' => array ( 'title' => LAN_ID , 'type' => 'number' , 'width' => '5%' , 'forced' => TRUE ),
2013-02-06 10:22:45 -08:00
'faq_info_title' => array ( 'title' => LAN_TITLE , 'type' => 'text' , 'width' => 'auto' , 'thclass' => 'left' , 'readParms' => 'editable=1' ),
2009-11-12 16:55:50 +00:00
'faq_info_about' => array ( 'title' => LAN_DESCRIPTION , 'type' => 'bbarea' , 'width' => '30%' , 'readParms' => 'expand=...&truncate=50&bb=1' ), // Display name
2013-02-23 05:17:03 -08:00
'faq_info_parent' => array ( 'title' => LAN_CATEGORY , 'type' => 'dropdown' , 'width' => '5%' , 'writeParms' => '' ),
2013-02-20 22:06:39 -08:00
'faq_info_class' => array ( 'title' => LAN_VISIBILITY , 'type' => 'userclass' , 'width' => 'auto' , 'data' => 'int' , 'inline' => true ),
2013-04-01 15:12:15 +03:00
'faq_info_metad' => array ( 'title' => LANA_FAQ_METAD , 'type' => 'text' , 'width' => 'auto' , 'thclass' => 'left' , 'readParms' => 'editable=1' ),
2015-01-28 02:29:26 -08:00
'faq_info_metak' => array ( 'title' => LANA_FAQ_METAK , 'type' => 'tags' , 'width' => 'auto' , 'thclass' => 'left' , 'readParms' => 'editable=1' ),
'faq_info_sef' => array ( 'title' => LAN_SEFURL , 'type' => 'text' , 'width' => 'auto' , 'thclass' => 'left' , 'inline' => true , 'writeParms' => 'size=xxlarge' ),
2013-04-01 15:12:15 +03:00
'faq_info_order' => array ( 'title' => LAN_ORDER , 'type' => 'number' , 'width' => '5%' , 'thclass' => 'left' ),
2015-06-06 14:25:40 -07:00
'options' => array ( 'title' => LAN_OPTIONS , 'type' => null , 'width' => '10%' , 'forced' => TRUE , 'thclass' => 'center last' , 'class' => 'center' , 'readParms' => array ( 'sort' => 1 ))
2009-11-09 12:57:34 +00:00
);
2012-05-23 08:29:57 +00:00
2013-02-23 05:17:03 -08:00
protected $categories = array ();
2012-05-23 08:29:57 +00:00
public function init ()
{
2013-02-23 05:17:03 -08:00
$sql = e107 :: getDb ();
$this -> categories [ 0 ] = " (Root) " ;
if ( $sql -> select ( 'faqs_info' , '*' , 'faq_info_parent = 0 ORDER BY faq_info_title ASC' ))
{
while ( $row = $sql -> fetch ())
{
$this -> categories [ $row [ 'faq_info_id' ]] = $row [ 'faq_info_title' ];
}
}
$this -> fields [ 'faq_info_parent' ][ 'writeParms' ] = $this -> categories ;
2013-02-21 17:39:40 -08:00
/*
2012-05-23 08:29:57 +00:00
if ( e_AJAX_REQUEST ) // ajax link sorting.
{
$sql = e107 :: getDb ();
$c = 0 ;
if ( isset ( $_POST [ 'all' ]))
{
foreach ( $_POST [ 'all' ] as $id )
{
$sql -> db_Update ( " faqs_info " , " faq_info_order = " . intval ( $c ) . " WHERE faq_info_id = " . intval ( $id ));
$c ++ ;
}
}
2009-11-12 16:55:50 +00:00
2012-05-23 08:29:57 +00:00
exit ;
}
2013-02-21 17:39:40 -08:00
*/
2012-05-23 08:29:57 +00:00
}
2009-11-12 16:55:50 +00:00
/**
* Get FAQ Category data
2009-11-17 14:16:47 +00:00
*
2009-11-12 16:55:50 +00:00
* @ param integer $id [ optional ] get category title , false - return whole array
2009-11-17 14:16:47 +00:00
* @ param mixed $default [ optional ] default value if not found ( default 'n/a' )
2009-11-12 16:55:50 +00:00
* @ return
*/
function getFaqCategoryTree ( $id = false , $default = 'n/a' )
{
// TODO get faq category tree
}
2009-11-09 12:57:34 +00:00
}
2009-11-12 16:55:50 +00:00
class faq_cat_form_ui extends e_admin_form_ui
{
public function faq_info_parent ( $curVal , $mode )
{
// TODO - catlist combo without current cat ID in write mode, parents only for batch/filter
// Get UI instance
$controller = $this -> getController ();
switch ( $mode )
{
case 'read' :
return e107 :: getParser () -> toHTML ( $controller -> getFaqCategoryTree ( $curVal ), false , 'TITLE' );
break ;
case 'write' :
return $this -> selectbox ( 'faq_info_parent' , $controller -> getFaqCategoryTree (), $curVal );
break ;
case 'filter' :
case 'batch' :
return $controller -> getFaqCategoryTree ();
break ;
}
}
}
2009-11-09 12:57:34 +00:00
class faq_main_ui extends e_admin_ui
{
2015-06-06 13:17:58 -07:00
2009-11-09 12:57:34 +00:00
protected $pluginTitle = 'FAQs' ;
protected $pluginName = 'faqs' ;
2015-06-06 13:17:58 -07:00
protected $eventName = 'faqs' ;
2009-11-09 12:57:34 +00:00
protected $table = " faqs " ;
2009-11-11 20:57:34 +00:00
// without any Order or Limit.
2012-12-10 18:40:44 -08:00
//FIXME JOIN should occur automatically. We have all the data necessary to build the query.
// ie. faq_author is a 'user' field.
protected $listQry = " SELECT f.*, u.* FROM #faqs AS f LEFT JOIN #user AS u ON f.faq_author = u.user_id " ; // Should not be necessary.
2009-11-09 12:57:34 +00:00
2012-05-23 08:29:57 +00:00
protected $editQry = " SELECT * FROM #faqs WHERE faq_id = { ID} " ;
2009-11-09 12:57:34 +00:00
2012-05-23 08:29:57 +00:00
protected $pid = " faq_id " ;
2015-04-15 15:35:42 -07:00
protected $perPage = 10 ;
2012-05-23 08:29:57 +00:00
protected $batchDelete = true ;
2013-02-06 10:22:45 -08:00
protected $batchCopy = true ;
2012-05-23 08:29:57 +00:00
protected $listOrder = 'faq_order ASC' ;
2013-02-06 17:03:00 +02:00
protected $sortField = 'faq_order' ;
2013-09-07 16:38:37 +03:00
protected $tabs = array ( 'FAQs' , " Details " ); // Simpler method than 'fieldsets'. Allows for easy moving of fields between tabs and works as required by 'news' and 'custom pages'.
2009-11-09 12:57:34 +00:00
//TODO - finish 'user' type, set 'data' to all editable fields, set 'noedit' for all non-editable fields
protected $fields = array (
2015-04-15 12:27:31 -07:00
'checkboxes' => array ( 'title' => '' , 'type' => null , 'width' => '5%' , 'forced' => TRUE , 'thclass' => 'center' , 'class' => 'center' ),
'faq_id' => array ( 'title' => LAN_ID , 'tab' => 0 , 'type' => null , 'width' => '5%' , 'forced' => TRUE ),
2015-04-15 15:35:42 -07:00
'faq_question' => array ( 'title' => LANA_FAQ_QUESTION , 'tab' => 0 , 'type' => 'text' , 'width' => 'auto' , 'thclass' => 'left first' , 'required' => TRUE , 'readParms' => 'editable=1' , 'writeParms' => 'maxlength=1000&size=block-level' ),
2013-03-07 14:56:37 +02:00
'faq_answer' => array ( 'title' => LANA_FAQ_ANSWER , 'tab' => 0 , 'type' => 'bbarea' , 'width' => '30%' , 'readParms' => 'expand=1&truncate=50&bb=1' ),
2015-04-15 12:27:31 -07:00
'faq_parent' => array ( 'title' => LAN_CATEGORY , 'tab' => 0 , 'type' => 'dropdown' , 'data' => 'int' , 'inline' => true , 'width' => '10%' , 'filter' => TRUE , 'batch' => TRUE ),
2013-03-15 17:15:29 +02:00
2015-04-15 12:27:31 -07:00
'faq_tags' => array ( 'title' => LANA_FAQ_TAGS , 'tab' => 1 , 'type' => 'tags' , 'data' => 'str' , 'width' => 'auto' , 'inline' => true , 'help' => LANA_FAQ_TAGS_HELP ), // User id
'faq_comment' => array ( 'title' => LANA_FAQ_COMMENT , 'tab' => 1 , 'type' => 'userclass' , 'data' => 'int' , 'width' => 'auto' , 'inline' => true ), // User id
2013-03-15 17:15:29 +02:00
2015-05-28 09:47:28 -07:00
'faq_datestamp' => array ( 'title' => LAN_DATE , 'tab' => 1 , 'type' => 'datestamp' , 'data' => 'int' , 'width' => 'auto' , 'noedit' => false , 'writeParms' => 'type=datetime&auto=1' ),
2015-04-15 12:27:31 -07:00
'faq_author' => array ( 'title' => LAN_USER , 'tab' => 1 , 'type' => 'user' , 'data' => 'int' , 'width' => 'auto' , 'thclass' => 'center' , 'class' => 'center' , 'writeParms' => 'currentInit=1' , 'filter' => true , 'batch' => true , 'nolist' => true ), // Photo
'faq_author_ip' => array ( 'title' => LAN_IP , 'tab' => 1 , 'type' => 'ip' , 'readonly' => 2 , 'data' => 'str' , 'width' => 'auto' , 'thclass' => 'center' , 'class' => 'center' , 'writeParms' => 'currentInit=1' , 'filter' => true , 'batch' => true , 'nolist' => true ), // Photo
2015-03-31 06:26:06 -07:00
'u.user_name' => array ( 'title' => LANA_FAQ_UNAME , 'tab' => 1 , 'type' => 'user' , 'width' => 'auto' , 'noedit' => true , 'readParms' => 'idField=faq_author&link=1' ), // User name
2013-03-07 14:56:37 +02:00
'u.user_loginname' => array ( 'title' => LANA_FAQ_ULOGINNAME , 'tab' => 1 , 'type' => 'user' , 'width' => 'auto' , 'noedit' => true , 'readParms' => 'idField=faq_author&link=1' ), // User login name
2015-04-15 12:27:31 -07:00
'faq_order' => array ( 'title' => LAN_ORDER , 'tab' => 1 , 'type' => 'number' , 'data' => 'int' , 'width' => '5%' , 'thclass' => 'center' , 'nolist' => false , 'noedit' => false , 'readParms' => 'editable=1' ),
2015-06-06 14:25:40 -07:00
'options' => array ( 'title' => LAN_OPTIONS , 'type' => null , 'forced' => TRUE , 'width' => '10%' , 'thclass' => 'center last' , 'class' => 'center' , 'readParms' => array ( 'sort' => 1 )),
2015-05-11 14:07:11 -07:00
'pending' => array ( 'title' => 'internal' , 'type' => 'hidden' , 'data' => false , 'writeParms' => array ()),
2009-11-09 12:57:34 +00:00
);
2012-05-23 08:29:57 +00:00
protected $fieldpref = array ( 'checkboxes' , 'faq_question' , 'faq_answer' , 'faq_parent' , 'faq_datestamp' , 'options' );
2015-06-06 14:25:40 -07:00
protected $preftabs = array ( " General " , LAN_ADMIN );
2009-11-09 12:57:34 +00:00
// optional, if $pluginName == 'core', core prefs will be used, else e107::getPluginConfig($pluginName);
protected $prefs = array (
2015-06-06 14:25:40 -07:00
'add_faq' => array ( 'title' => LANA_FAQ_PREF_1 , 'tab' => 0 , 'type' => 'userclass' ),
'submit_question' => array ( 'title' => LANA_FAQ_PREF_2 , 'tab' => 0 , 'type' => 'userclass' ),
'submit_question_limit' => array ( 'title' => " 'Ask a Question' limit per user " , 'tab' => 0 , 'type' => 'number' , 'data' => 'int' , 'help' => '0 = no limit' ),
2015-06-08 00:45:21 -07:00
'submit_question_language' => array ( 'title' => " 'Ask a Question' limited to " , 'tab' => 0 , 'type' => 'dropdown' ),
2015-05-29 17:14:09 -07:00
'submit_question_acknowledgement' => array ( 'title' => " Submitted Questions Acknowledgement " , 'type' => 'textarea' , 'help' => 'Leave blank to use default' ),
2015-06-06 14:25:40 -07:00
'classic_look' => array ( 'title' => LANA_FAQ_PREF_3 , 'tab' => 0 , 'type' => 'boolean' ),
'list_type' => array ( 'title' => " List Type " , 'tab' => 0 , 'type' => 'dropdown' , 'writeParms' => array ( 'ul' => 'Unordered List' , 'ol' => 'Ordered List' ) ),
2015-06-07 18:15:23 -07:00
'page_title' => array ( 'title' => " Page Title " , 'tab' => 0 , 'type' => 'text' , 'multilan' => true , 'help' => 'Leave blank to use default' ),
2015-06-06 14:25:40 -07:00
'new' => array ( 'title' => " 'New' FAQs are no more than " , 'tab' => 0 , 'type' => 'number' , 'writeParms' => 'size=mini&default=0&post=days old' , 'help' => 'Leave blank to use default' ),
2015-06-07 18:15:23 -07:00
'display_total' => array ( 'title' => " Display FAQ total " , 'tab' => 0 , 'type' => 'boolean' , 'data' => 'int' ),
'display_datestamp' => array ( 'title' => " Display Datestamp " , 'tab' => 0 , 'type' => 'boolean' , 'data' => 'int' ),
'display_social' => array ( 'title' => " Display Social buttons " , 'tab' => 0 , 'type' => 'boolean' , 'data' => 'int' ),
2015-06-06 14:25:40 -07:00
'orderby' => array ( 'title' => LAN_ORDER , 'tab' => 0 , 'type' => 'dropdown' , 'writeParms' => array ( 'faq_order-ASC' => " Specified Order " , 'faq_id-ASC' => 'ID ASC' , 'faq_id-DESC' => 'ID DESC' , 'faq_datestamp-ASC' => 'Date ASC' , 'faq_datestamp-DESC' => 'Date DESC' )),
'admin_faq_create' => array ( 'title' => " Create FAQ " , 'tab' => 1 , 'type' => 'userclass' , 'writeParms' => 'default=254&classlist=main,admin,classes,no-excludes' ),
'admin_faq_edit' => array ( 'title' => " Edit FAQ " , 'tab' => 1 , 'type' => 'userclass' , 'writeParms' => 'default=254&classlist=main,admin,classes,no-excludes' ),
'admin_faq_delete' => array ( 'title' => " Delete FAQ " , 'tab' => 1 , 'type' => 'userclass' , 'writeParms' => 'default=254&classlist=main,admin,classes,no-excludes' ),
'admin_cat_create' => array ( 'title' => " Create Category " , 'tab' => 1 , 'type' => 'userclass' , 'writeParms' => 'default=254&classlist=main,admin,classes,no-excludes' ),
'admin_cat_edit' => array ( 'title' => " Edit Category " , 'tab' => 1 , 'type' => 'userclass' , 'writeParms' => 'default=254&classlist=main,admin,classes,no-excludes' ),
'admin_cat_delete' => array ( 'title' => " Delete category " , 'tab' => 1 , 'type' => 'userclass' , 'writeParms' => 'default=254&classlist=main,admin,classes,no-excludes' ),
);
2013-02-23 04:19:36 -08:00
protected $categories = array ();
2012-05-23 08:29:57 +00:00
public function init ()
{
2015-06-08 00:45:21 -07:00
$this -> prefs [ 'submit_question_language' ][ 'writeParms' ] = array ( 0 => 'English' , 1 => 'All Languages' );
2015-06-06 14:25:40 -07:00
2013-02-23 04:19:36 -08:00
$sql = e107 :: getDb ();
if ( $sql -> select ( 'faqs_info' ))
{
while ( $row = $sql -> fetch ())
{
$this -> categories [ $row [ 'faq_info_id' ]] = $row [ 'faq_info_title' ];
}
}
2015-06-06 14:25:40 -07:00
$faqOrder = e107 :: pref ( 'faqs' , 'orderby' );
if ( ! empty ( $faqOrder ))
{
list ( $sortField , $sortASC ) = explode ( " - " , $faqOrder );
$this -> listOrder = $sortField . " " . $sortASC ;
if ( $sortField != 'faq_order' )
{
$this -> fields [ 'options' ][ 'readParms' ][ 'sort' ] = 0 ;
}
}
2013-02-23 04:19:36 -08:00
$this -> fields [ 'faq_parent' ][ 'writeParms' ] = $this -> categories ;
2015-05-11 14:07:11 -07:00
//$this->fields['pending']['writeParms']['show'] = 1;
$this -> fields [ 'pending' ][ 'writeParms' ][ 'value' ] = ( $_GET [ 'filter' ] == 'pending' ) ? 1 : 0 ;
if ( ! empty ( $_GET [ 'filter' ])) // hide re-ordering when looking at 'unanswered' list and sort by datestamp.
{
2015-05-28 09:47:28 -07:00
$this -> listQry .= " WHERE f.faq_parent = 0 " ;
2015-05-11 14:07:11 -07:00
$this -> listOrder = " faq_datestamp ASC " ;
$this -> fields [ 'options' ][ 'readParms' ] = '' ;
$this -> sortField = false ;
}
2015-05-28 09:47:28 -07:00
else
{
$this -> listQry .= " WHERE f.faq_parent != 0 " ;
}
2015-05-11 14:07:11 -07:00
2012-05-23 08:29:57 +00:00
}
2016-04-11 18:39:19 -07:00
public function beforeCreate ( $new_data , $old_data )
2009-11-09 12:57:34 +00:00
{
2013-03-20 16:10:35 +02:00
// trim spaces
if ( ! empty ( $new_data [ 'faq_tags' ]))
2009-11-09 12:57:34 +00:00
{
2013-03-20 16:10:35 +02:00
$new_data [ 'faq_tags' ] = implode ( ',' , array_map ( 'trim' , explode ( ',' , $new_data [ 'faq_tags' ])));
2009-11-09 12:57:34 +00:00
}
2013-03-20 16:10:35 +02:00
2015-04-02 12:34:32 -07:00
$new_data [ 'faq_order' ] = 0 ;
2013-03-20 16:10:35 +02:00
return $new_data ;
}
public function beforeUpdate ( $new_data , $old_data , $id )
{
// trim spaces
if ( ! empty ( $new_data [ 'faq_tags' ]))
2009-11-09 12:57:34 +00:00
{
2013-03-20 16:10:35 +02:00
$new_data [ 'faq_tags' ] = implode ( ',' , array_map ( 'trim' , explode ( ',' , $new_data [ 'faq_tags' ])));
2009-11-09 12:57:34 +00:00
}
2013-03-20 16:10:35 +02:00
2015-05-11 14:07:11 -07:00
// e107::getMessage()->addInfo(print_a($new_data, true));
if ( ! empty ( $new_data [ 'pending' ]))
{
$new_data [ 'faq_datestamp' ] = time ();
}
2013-03-20 16:10:35 +02:00
return $new_data ;
2009-11-10 19:13:07 +00:00
}
}
2009-11-09 12:57:34 +00:00
2009-11-10 19:13:07 +00:00
class faq_admin_form_ui extends e_admin_form_ui
{
/**
* faq_parent field method
*
* @ param integer $curVal
* @ param string $mode
* @ return mixed
*/
function faq_parent ( $curVal , $mode )
{
// Get UI instance
$controller = $this -> getController ();
switch ( $mode )
{
case 'read' :
return e107 :: getParser () -> toHTML ( $controller -> getFaqCategory ( $curVal ), false , 'TITLE' );
break ;
case 'write' :
2015-05-11 14:07:11 -07:00
return $this -> selectbox ( 'faq_parent' , $controller -> getFaqCategory (), $curVal ) . $this -> hidden ( 'pending' , $pending );
2009-11-10 19:13:07 +00:00
break ;
case 'filter' :
case 'batch' :
return $controller -> getFaqCategory ();
break ;
2009-11-09 12:57:34 +00:00
}
}
}
new faq_admin ();
require_once ( e_ADMIN . " auth.php " );
e107 :: getAdminUI () -> runPage ();
require_once ( e_ADMIN . " footer.php " );
exit ;