1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

FAQs GUI Tweaks

This commit is contained in:
Cameron
2013-03-10 03:47:48 -07:00
parent a8c2640ec1
commit 2d363f185c
2 changed files with 15 additions and 7 deletions

View File

@@ -76,10 +76,12 @@ class plugin_faqs_list_controller extends eControllerFront
$sc = e107::getScBatch('faqs', true);
$text = $tp->parseTemplate($FAQ_START, true);
$sc->counter = 1;
while ($rw = $sql->db_Fetch())
{
$sc->setVars($rw);
if($rw['faq_info_order'] != $prevcat)
{
if($prevcat !='')
@@ -93,7 +95,7 @@ class plugin_faqs_list_controller extends eControllerFront
$text .= $tp->parseTemplate($FAQ_LISTALL['item'], true);
$prevcat = $rw['faq_info_order'];
$sc->counter++;
}
$text .= $tp->parseTemplate($FAQ_LISTALL['end'], true);
$text .= $tp->parseTemplate($FAQ_END, true);

View File

@@ -23,7 +23,14 @@ if (!defined('e107_INIT')) { exit; }
class faqs_shortcodes extends e_shortcode
{
// var $var;
public $counter = 1;
// Simply FAQ count when needed.
function sc_faq_counter($parm='')
{
return $this->counter;
}
function sc_faq_question($parm='')
{
@@ -32,12 +39,12 @@ class faqs_shortcodes extends e_shortcode
if($parm == 'expand')
{
$id = "faq_".$this->var['faq_id'];
$text = "<a class='e-expandit faq-question' href='#{$id}'>".$tp->toHtml($this->var['faq_question'])."</a>
$text = "<a class='e-expandit faq-question' href='#{$id}'>".$tp->toHtml($this->var['faq_question'],true)."</a>
<div id='{$id}' class='e-hideme faq-answer faq_answer'>".$tp->toHTML($this->var['faq_answer'],TRUE)."</div>";
}
else
{
$text = $tp->toHtml($this->var['faq_question']);
$text = $tp->toHtml($this->var['faq_question'],true);
}
return $text;
}
@@ -50,8 +57,7 @@ class faqs_shortcodes extends e_shortcode
function sc_faq_answer()
{
$tp = e107::getParser();
return "<div class='faq-answer'>".$tp -> toHtml($this->var['faq_answer'])."</div>";
return e107::getParser()->toHtml($this->var['faq_answer'],true);
}
function sc_faq_edit()