diff --git a/e107_plugins/faqs/admin_config.php b/e107_plugins/faqs/admin_config.php index f806cccb6..597dfd664 100644 --- a/e107_plugins/faqs/admin_config.php +++ b/e107_plugins/faqs/admin_config.php @@ -222,6 +222,8 @@ class faq_main_ui extends e_admin_ui 'add_faq' => array('title'=> LANA_FAQ_PREF_1, 'type'=>'userclass' ), 'submit_question' => array('title'=> LANA_FAQ_PREF_2, 'type'=>'userclass' ), 'submit_question_limit' => array('title'=> "'Ask a Question' limit per user", 'type'=>'number', 'data'=>'int', 'help'=>'0 = no limit'), + 'submit_question_acknowledgement' => array('title'=> "Submitted Questions Acknowledgement", 'type'=>'textarea', 'help'=>'Leave blank to use default' ), + 'classic_look' => array('title'=> LANA_FAQ_PREF_3, 'type'=>'boolean' ), 'list_type' => array('title'=> "List Type", 'type'=>'dropdown', 'writeParms'=>array('ul'=>'Unordered List', 'ol'=>'Ordered List') ), 'page_title' => array('title'=> "Page Title", 'type'=>'text', 'help'=>'Leave blank to use default' ), diff --git a/e107_plugins/faqs/faqs.php b/e107_plugins/faqs/faqs.php index b6d8eee34..a5ea3d9f2 100644 --- a/e107_plugins/faqs/faqs.php +++ b/e107_plugins/faqs/faqs.php @@ -229,7 +229,8 @@ class faq if($sql->insert('faqs',$insert)) { - e107::getMessage()->addSuccess('Thank you. Your question has been saved and will be answered as soon as possible.'); + $message = !empty($this->pref['submit_question_acknowledgement']) ? e107::getParser()->toHtml($this->pref['submit_question_acknowledgement'],true, 'BODY') : 'Thank you. Your question has been saved and will be answered as soon as possible.'; //TODO LAN + e107::getMessage()->addSuccess($message); } } @@ -264,8 +265,15 @@ class faq $ret['title'] = FAQLAN_FAQ; $ret['text'] = $text; - $ret['caption'] = varset($template['caption']) ? $tp->parseTemplate($template['caption'], true, $this->sc) : LAN_PLUGIN_FAQS_FRONT_NAME; - + + if (!empty($this->pref['page_title'])) + { + $ret['caption'] = e107::getParser()->toHtml($this->pref['page_title'], true, 'TITLE'); + } + else + { + $ret['caption'] = varset($template['caption']) ? $tp->parseTemplate($template['caption'], true, $this->sc) : LAN_PLUGIN_FAQS_FRONT_NAME; + } return $ret; diff --git a/e107_plugins/faqs/faqs_shortcodes.php b/e107_plugins/faqs/faqs_shortcodes.php index a58a9e402..4ea2c8695 100644 --- a/e107_plugins/faqs/faqs_shortcodes.php +++ b/e107_plugins/faqs/faqs_shortcodes.php @@ -45,7 +45,7 @@ class faqs_shortcodes extends e_shortcode $faqNew = ($this->var['faq_datestamp'] > $newDate) ? " faq-new" : ""; - if($param == 'expand') + if($param == 'expand' && !empty($this->var['faq_answer'])) { $tags = ''; if(vartrue($params['tags']) && $this->var['faq_tags']) @@ -53,14 +53,17 @@ class faqs_shortcodes extends e_shortcode $tags = "
".LAN_FAQS_TAGS.": ".$this->sc_faq_tags()."
"; } $id = "faq_".$this->var['faq_id']; + + + $text = "".$tp->toHTML($this->var['faq_question'],true,'TITLE')."
".$tp->toHTML($this->var['faq_answer'],true,'BODY').$tags."
- "; + "; } else { - $text = $tp->toHTML($this->var['faq_question'],true, 'TITLE'); + $text = $tp->toHTML($this->var['faq_question'],true, 'BODY'); } return $text; } @@ -169,6 +172,13 @@ class faqs_shortcodes extends e_shortcode return e107::getUrl()->create('faqs/list/all', array('category' => $this->var['faq_info_id'])); } + + function sc_faq_datestamp($parm) + { + $type = vartrue($parm, 'relative'); + return e107::getParser()->toDate($this->var['faq_datestamp'], $type); + } + function sc_faq_caption() { @@ -206,17 +216,29 @@ class faqs_shortcodes extends e_shortcode return ""; } - function sc_faq_submit_question() + function sc_faq_submit_question($parms) { $faqpref = e107::pref('faqs'); + if(!empty($parms['expand'])) + { + $hide = 'e-hideme'; + $button = "Ask a Question"; + } + else + { + $hide = ""; + $button = ""; + } + if (check_class($faqpref['submit_question'])) { $frm = e107::getForm(); - $text = "Ask a Question -
"; + $text = $button; + + $text .= "
"; $text .= $frm->open('faq-ask-question','post'); diff --git a/e107_plugins/faqs/templates/faqs_template.php b/e107_plugins/faqs/templates/faqs_template.php index 8c14f160a..c4d329527 100644 --- a/e107_plugins/faqs/templates/faqs_template.php +++ b/e107_plugins/faqs/templates/faqs_template.php @@ -9,7 +9,7 @@ */ $FAQS_TEMPLATE['start'] = " -
{FAQ_SUBMIT_QUESTION} +
{FAQ_SUBMIT_QUESTION: expand=1} {FAQ_SUBMIT_QUESTION_LIST} ";