mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
FAQs GUI Tweaks
This commit is contained in:
@@ -76,6 +76,8 @@ class plugin_faqs_list_controller extends eControllerFront
|
|||||||
$sc = e107::getScBatch('faqs', true);
|
$sc = e107::getScBatch('faqs', true);
|
||||||
|
|
||||||
$text = $tp->parseTemplate($FAQ_START, true);
|
$text = $tp->parseTemplate($FAQ_START, true);
|
||||||
|
|
||||||
|
$sc->counter = 1;
|
||||||
while ($rw = $sql->db_Fetch())
|
while ($rw = $sql->db_Fetch())
|
||||||
{
|
{
|
||||||
$sc->setVars($rw);
|
$sc->setVars($rw);
|
||||||
@@ -93,7 +95,7 @@ class plugin_faqs_list_controller extends eControllerFront
|
|||||||
|
|
||||||
$text .= $tp->parseTemplate($FAQ_LISTALL['item'], true);
|
$text .= $tp->parseTemplate($FAQ_LISTALL['item'], true);
|
||||||
$prevcat = $rw['faq_info_order'];
|
$prevcat = $rw['faq_info_order'];
|
||||||
|
$sc->counter++;
|
||||||
}
|
}
|
||||||
$text .= $tp->parseTemplate($FAQ_LISTALL['end'], true);
|
$text .= $tp->parseTemplate($FAQ_LISTALL['end'], true);
|
||||||
$text .= $tp->parseTemplate($FAQ_END, true);
|
$text .= $tp->parseTemplate($FAQ_END, true);
|
||||||
|
@@ -23,7 +23,14 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
|
|
||||||
class faqs_shortcodes extends e_shortcode
|
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='')
|
function sc_faq_question($parm='')
|
||||||
{
|
{
|
||||||
@@ -32,12 +39,12 @@ class faqs_shortcodes extends e_shortcode
|
|||||||
if($parm == 'expand')
|
if($parm == 'expand')
|
||||||
{
|
{
|
||||||
$id = "faq_".$this->var['faq_id'];
|
$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>";
|
<div id='{$id}' class='e-hideme faq-answer faq_answer'>".$tp->toHTML($this->var['faq_answer'],TRUE)."</div>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text = $tp->toHtml($this->var['faq_question']);
|
$text = $tp->toHtml($this->var['faq_question'],true);
|
||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
@@ -50,8 +57,7 @@ class faqs_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_faq_answer()
|
function sc_faq_answer()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
return e107::getParser()->toHtml($this->var['faq_answer'],true);
|
||||||
return "<div class='faq-answer'>".$tp -> toHtml($this->var['faq_answer'])."</div>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_faq_edit()
|
function sc_faq_edit()
|
||||||
|
Reference in New Issue
Block a user