コード例 #1
0
ファイル: view.html.php プロジェクト: sansandeep143/av
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $option = JRequest::getVar('option');
     if ($option == "com_fst") {
         $link = FSFRoute::_('index.php?option=com_fsf&view=test', false);
     } else {
         if ($option == "com_fsf") {
             $link = FSFRoute::_('index.php?option=com_fsf&view=faq', false);
         } else {
             $link = FSFRoute::_('index.php?option=com_fsf&view=main', false);
         }
     }
     $mainframe->redirect($link);
 }
コード例 #2
0
ファイル: default.php プロジェクト: sansandeep143/av
			<span class="letter-present">
				<?php 
            if ($this->use_letter_bar == 2) {
                ?>
					<a href='<?php 
                echo FSFRoute::_('index.php?option=com_fsf&view=glossary&letter=' . strtolower($letter));
                ?>
'>&nbsp;<?php 
                echo $letter;
                ?>
&nbsp;</a>
				<?php 
            } else {
                ?>
					<a href='<?php 
                echo FSFRoute::_('index.php?option=com_fsf&view=glossary#letter_' . strtolower($letter));
                ?>
'>&nbsp;<?php 
                echo $letter;
                ?>
&nbsp;</a>
				<?php 
            }
            ?>
			</span>
		<?php 
        }
        ?>
	<?php 
    }
    ?>
コード例 #3
0
ファイル: default.php プロジェクト: sansandeep143/av
			</div>
		</div>
	<?php 
    }
    ?>
	
<?php 
} elseif ($mode == "popup") {
    ?>
	<?php 
    foreach ($data as $row) {
        ?>
	<div class='fsf_mod_faqs_cont'>
	<div class='fsf_mod_faqs_title'>
				<a href='#' onclick='TINY.box.show({iframe:"<?php 
        echo FSFRoute::_('index.php?option=com_fsf&view=faq&tmpl=component&faqid=' . $row->id);
        ?>
", width:630,height:440});return false;'>
					<?php 
        echo $row->question;
        ?>
				</a>
			</div>
		</div>
	<?php 
    }
    ?>

<?php 
} elseif ($mode == "accordion") {
    ?>
コード例 #4
0
ファイル: default_tags.php プロジェクト: sansandeep143/av
			<?php 
echo JText::_('TAGS');
?>
		</div>
	</div>
	<div class='fsf_clear'></div>
	
	<div class='fsf_faqs' id='fsf_faqs'>
	<?php 
if (count($this->tags)) {
    foreach ($this->tags as $tag) {
        ?>
		<div class='fsf_faq fsf_faq_tag'>
			<div class="fsf_faq_question">
				<a class='fsf_highlight' href='<?php 
        echo FSFRoute::_('index.php?option=com_fsf&view=faq&tag=' . urlencode($tag->tag) . '&Itemid=' . JRequest::getVar('Itemid'));
        ?>
'>
					<?php 
        echo $tag->tag;
        ?>
				</a>
			</div>
		</div>	
	<?php 
    }
}
?>
	<?php 
if (count($this->tags) == 0) {
    ?>
コード例 #5
0
ファイル: parser.php プロジェクト: sansandeep143/av
 function ParserPopulateTicket(&$parser, $row)
 {
     $parser->Clear();
     if ($row) {
         $parser->SetVar('ref', $row['reference']);
         $parser->SetVar('subject', "<a href='" . FSFRoute::_('index.php?option=com_fsf&view=admin&layout=support&ticketid=' . $row['id']) . "'>" . $row['title'] . "</a>");
         $parser->SetVar("status", "<span style='color:" . $row['color'] . ";'>" . $row['status'] . "</span>");
         if ($row['user_id'] == 0) {
             $name = $row['unregname'] . " (" . JText::_("UNREG") . ")";
         } else {
             $name = $row['name'];
         }
         $parser->SetVar("name", $name);
         $parser->SetVar("lastactivity", FSF_Helper::Date($row['lastupdate'], FSF_DATETIME_SHORT));
         $parser->SetVar("opened", FSF_Helper::Date($row['opened'], FSF_DATETIME_SHORT));
         $parser->SetVar("closed", FSF_Helper::Date($row['closed'], FSF_DATETIME_SHORT));
         $parser->SetVar("department", $row['department']);
         $parser->SetVar("category", $row['category']);
         $parser->SetVar("product", $row['product']);
         $parser->SetVar("priority", "<span style='color:" . $row['pricolor'] . ";'>" . $row['priority'] . "</span>");
         $groups = implode(", ", $row['groups']);
         $parser->SetVar('groups', $groups);
         $parser->SetVar('deletebutton', 'deletebutton');
         $parser->SetVar('archivebutton', 'archivebutton');
         if (array_key_exists("custom", $row)) {
             $allcustom = array();
             if (count($row['custom']) > 0) {
                 foreach ($row['custom'] as $id => $value) {
                     if (array_key_exists($id, $this->customfields)) {
                         $field = $this->customfields[$id];
                         if ($field['type'] == "plugin") {
                             $aparams = FSFCF::GetValues($field);
                             if (array_key_exists("plugin", $aparams) && array_key_exists("plugindata", $aparams)) {
                                 $plugin = FSFCF::get_plugin($aparams['plugin']);
                                 $value = $plugin->Display($value, $aparams['plugindata'], array('ticketid' => $row['id'], 'userid' => $row['user_id'], 'ticket' => $row), $field['id']);
                             }
                         }
                         $text = "<span class='fsf_support_fieldname'>" . $this->customfields[$id]['description'] . "</span>";
                         if ($this->customfields[$id]['type'] == "checkbox") {
                             if ($value == "on") {
                                 $value = JText::_("Yes");
                             } else {
                                 $value = JText::_("No");
                             }
                         }
                         $parser->SetVar("custom" . $id, $value);
                         $parser->SetVar("custom_" . $id, $value);
                         $allcustom[] = $text . ": " . $value;
                     }
                 }
             }
             //echo "All custom : " . implode(", ",$allcustom) . "<br>";
             $parser->SetVar("custom", implode(", ", $allcustom));
         }
         if ($row['assigned'] == '') {
             $parser->SetVar('handlername', JText::_("UNASSIGNED"));
         } else {
             $parser->SetVar('handlername', $row['assigned']);
         }
         $parser->SetVar('username', $row['username']);
         $parser->SetVar('email', $row['useremail']);
         $parser->SetVar('handlerusername', $row['handlerusername']);
         $parser->SetVar('handleremail', $row['handleremail']);
         $icons = "";
         if (FSF_Settings::get('support_show_msg_counts')) {
             $icons .= "<span>";
             $icons .= "<span style='font-weight:normal;top:-2px;position:relative;padding-right:2px;'>" . $row['msgcount']['total'] . "</span><span style='font-weight:normal;top:-2px;position:relative;padding-right:2px;'>x</span><img src='" . JURI::root(true) . "/components/com_fsf/assets/images/messages.png'>";
             $icons .= "</span>";
         }
         $cotime = $this->db_time - strtotime($row['checked_out_time']);
         if ($cotime < FSF_Settings::get('support_lock_time') && $row['checked_out'] != $this->userid && $row['checked_out'] > 0) {
             $html = "<div class='fsf_user_tt'>" . $row['co_user']->name . " (" . $row['co_user']->email . ")</div>";
             $icons .= "<img class='fsj_tip' src='" . JURI::root(true) . "/components/com_fsf/assets/images/lock.png' title=\"" . JText::_('TICKET_LOCKED') . "::" . $html . "\">";
         } else {
             $icons .= "<img src='" . JURI::root(true) . "/components/com_fsf/assets/images/blank_16.png'>";
         }
         if (!FSF_Settings::get('support_hide_tags')) {
             if (isset($row['tags'])) {
                 $html = "";
                 foreach ($row['tags'] as $tag) {
                     $html .= "<div class='fsf_tag_tt'>" . $tag['tag'] . "</div>";
                 }
                 $icons .= "<img class='fsj_tip' src='" . JURI::root(true) . "/components/com_fsf/assets/images/tag.png' title=\"" . JText::_('TICKET_TAGS') . "::" . $html . "\">";
             } else {
                 $icons .= "<img src='" . JURI::root(true) . "/components/com_fsf/assets/images/blank_16.png'>";
             }
         }
         if (isset($row['attach'])) {
             $html = "<table class='fsf_attach_tt'>";
             foreach ($row['attach'] as $attach) {
                 $html .= "<tr style='border:0px;'><td nowrap style='border:0px;'>" . $attach['filename'] . "&nbsp;</td><td nowrap style='border:0px;'>&nbsp;" . FSF_Helper::display_filesize($attach['size']) . "</td></tr>";
             }
             $html .= "<table>";
             $icons .= "<img class='fsj_tip' src='" . JURI::root(true) . "/components/com_fsf/assets/images/attach.png' title=\"" . JText::_('TICKET_ATTACHMENTS') . "::" . $html . "\">";
         } else {
             $icons .= "<img src='" . JURI::root(true) . "/components/com_fsf/assets/images/blank_16.png'>";
         }
         $parser->SetVar('icons', $icons);
         $delete = "<a href='" . FSFRoute::x('index.php?option=com_fsf&view=admin&layout=support&tickets=' . JRequest::getVar('tickets') . '&delete=' . $row['id']) . "'>";
         $delete .= "<img src='" . JURI::root(true) . "/components/com_fsf/assets/images/delete_ticket.png'>";
         $delete .= JText::_("DELETE") . "</a>";
         $archive = "<a href='" . FSFRoute::x('index.php?option=com_fsf&view=admin&layout=support&tickets=' . JRequest::getVar('tickets') . '&archive=' . $row['id']) . "'>";
         $archive .= "<img src='" . JURI::root(true) . "/components/com_fsf/assets/images/archive_ticket.png'>";
         $archive .= JText::_("ARCHIVE") . "</a>";
         $parser->SetVar('archivebutton', $archive);
         $parser->SetVar('deletebutton', $delete);
         // TODO: trhl
         /*id='ticket_<?php echo $ticket['id'];?>'
         		onmouseover="$('ticket_<?php echo $ticket['id'];?>').style.background = '<?php echo FSF_Settings::get('css_hl'); ?>';$('ticket_<?php echo $ticket['id'];?>_2').style.background = '<?php echo FSF_Settings::get('css_hl'); ?>';"
         		onmouseout="$('ticket_<?php echo $ticket['id'];?>').style.background = '';$('ticket_<?php echo $ticket['id'];?>_2').style.background = '';"*/
         $this->_permissions = FSF_Ticket_Helper::getAdminPermissions();
         $type = "unassigned";
         if ($row['admin_id'] == $this->_permissions['id']) {
             $type = "mine";
         } else {
             if ($row['admin_id'] > 0) {
                 $type = "other";
             }
         }
         $style = "";
         if (array_key_exists($row['ticket_pri_id'], $this->priorities)) {
             $pri = $this->priorities[$row['ticket_pri_id']];
             if ($pri['backcolor']) {
                 $style .= "background-color: {$pri['backcolor']};";
             }
         }
         $handler_highlight = "ticket_type_{$type}";
         $parser->SetVar('handler_highlight', $handler_highlight);
         $trhl = " class='ticket_{$row['id']} ' onmouseover='highlightticket({$row['id']})' onmouseout='unhighlightticket({$row['id']})' ";
         if (FSF_Settings::get('support_entire_row')) {
             $style .= "cursor: pointer;";
             $trhl .= " onclick='window.location=\"" . FSFRoute::x('&limitstart=&ticketid=' . $row['id']) . "\"' ";
         }
         $trhl .= " style='{$style}' ";
         $parser->SetVar('trhl', $trhl);
     }
     $parser->SetVar("showassigned", $this->showassigned);
     $parser->SetVar("hidehandler", FSF_Settings::get('support_hide_handler'));
     $parser->SetVar("candelete", FSF_Settings::get('support_delete'));
     $parser->SetVar("view", $this->ticket_view);
 }
コード例 #6
0
ファイル: glossary.php プロジェクト: sansandeep143/av
 static function ReplaceGlossary($text)
 {
     FSF_Glossary::GetGlossary();
     if (count(FSF_Glossary::$fsf_glossary) == 0) {
         return $text;
     }
     // build a rough list of terms in the document in question. This means less stuff for the preg to check later on
     FSF_Glossary::$inuse = array();
     foreach (FSF_Glossary::$fsf_glossary as $word => $tip) {
         if (stripos($text, $word) !== FALSE) {
             // build an object containing the data about the word we have possibly in the doc
             $o = new stdClass();
             $word = strtolower($word);
             $o->word = $word;
             $o->regex = "/\\b({$word})\\b/i";
             $o->href = "#";
             $anc = FSF_Glossary::MakeAnchor($word);
             if (FSF_Settings::get('glossary_link')) {
                 $o->href = FSFRoute::_('index.php?option=com_fsf&view=glossary&letter=' . strtolower(substr($word, 0, 1)) . '#' . $anc);
             }
             $o->class = "fsj_tip fsf_glossary_word";
             FSF_Glossary::$inuse[] = $o;
         }
     }
     // setup empty dom object
     libxml_use_internal_errors(TRUE);
     $dom = new DOMDocument('1.0', 'UTF-8');
     FSF_Glossary::$cdom =& $dom;
     $dom->substituteEntities = false;
     $dom->recover = true;
     $dom->strictErrorChecking = false;
     $dom->resolveExternals = false;
     //$text = str_replace("&","&amp;", $text);
     // load the xml file. Add padding tags as the dom adds crap to the start of the output
     $dom->loadHTML('<?xml version="1.0" encoding="UTF-8"?><meta http-equiv="content-type" content="text/html; charset=utf-8"><xxxglossaryxxx>' . $text . "</xxxglossaryxxx>");
     // get list of html tags to ignore
     $tag_ignore = FSF_Settings::get('glossary_exclude');
     $tag_ignore = explode(",", $tag_ignore);
     $tags = array();
     $tags[] = "a";
     foreach ($tag_ignore as $tag) {
         $tag = trim($tag);
         if (!$tag) {
             continue;
         }
         $tags[] = $tag;
     }
     // replace all glossary terms
     FSF_Glossary::preg_replace_dom($dom->documentElement, $tags);
     // get resultant html
     $result = $dom->saveHTML();
     //$result = str_replace("&amp;","&", $result);
     // use padding added earlier to remove appended content
     $pos1 = strpos($result, "<xxxglossaryxxx>") + 16;
     $pos2 = strrpos($result, "</xxxglossaryxxx>");
     $result = substr($result, $pos1, $pos2 - $pos1);
     return $result;
 }
コード例 #7
0
ファイル: content.php プロジェクト: sansandeep143/av
    function EditPanel($item, $changeclass = true)
    {
        $this->Init();
        $this->changeclass = $changeclass;
        if ($this->permission['artperm'] > 1 || $this->permission['artperm'] == 1 && $item['author'] == $this->userid) {
            echo "<div class='fsf_content_edit_article'>";
            echo "<a href='" . FSFRoute::_("index.php?option=com_fsf&view=admin&layout=content&type={$this->id}&what=edit&id={$item['id']}&option=com_fsf&return=1") . "' class='fsj_tip' title='" . JText::_('EDIT_ARTICLE') . "'><img src='" . JURI::root(true) . "/components/com_fsf/assets/images/edit.png' alt='Edit' /></a>";
            if ($item['published']) {
                $tip = JText::_("CONTENT_PUB_TIP");
            } else {
                $tip = JText::_('CONTENT_UNPUB_TIP');
            }
            if ($this->permission['artperm'] > 2) {
                ?>
					<a href="#" id="publish_<?php 
                echo $item['id'];
                ?>
" class="fsf_publish_button fsj_tip" state="<?php 
                echo $item['published'];
                ?>
" title="<?php 
                echo $tip;
                ?>
">
						<?php 
                echo FSF_Helper::GetPublishedText($item['published'], true);
                ?>
					</a>
				<?php 
            } else {
                ?>
					<?php 
                echo str_replace("_16.png", "_g_16.png", FSF_Helper::GetPublishedText($item['published']));
                ?>
				<?php 
            }
            echo "</div>";
        }
    }
コード例 #8
0
ファイル: kbcats.php プロジェクト: sansandeep143/av
/**
 * @package Freestyle Joomla
 * @author Freestyle Joomla
 * @copyright (C) 2013 Freestyle Joomla
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die;
?>
<div class="faq_mod_category_cont">
<?php 
foreach ($rows as $cat) {
    ?>

<?php 
    $link = FSFRoute::_('index.php?option=com_fsf&view=kb&catid=' . $cat['id'] . '&prodid=' . $prodid);
    ?>
<div class='faq_mod_category' style='cursor: pointer;'>
	<?php 
    if ($params->get('show_images') && $cat['image']) {
        ?>
	<div class='faq_mod_category_image'>
	    <a href='<?php 
        echo $link;
        ?>
'><img src='<?php 
        echo JURI::root(true);
        ?>
/images/fsf/kbcats/<?php 
        echo $cat['image'];
        ?>
コード例 #9
0
ファイル: view.html.php プロジェクト: sansandeep143/av
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->addScript(JURI::root() . 'components/com_fsf/assets/js/accordion.js');
     require_once JPATH_SITE . DS . 'components' . DS . 'com_fsf' . DS . 'helper' . DS . 'content' . DS . 'faqs.php';
     $this->content = new FSF_ContentEdit_FAQs();
     $this->content->Init();
     $model = $this->getModel();
     $model->content = $this->content;
     $mainframe = JFactory::getApplication();
     $faqid = JRequest::getVar('faqid', 0, '', 'int');
     $aparams = FSF_Settings::GetViewSettingsObj('faqs');
     JHTML::_('behavior.tooltip');
     JHTML::_('behavior.modal', 'a.fsf_modal');
     JHTML::_('behavior.framework', true);
     if ($faqid > 0) {
         $tmpl = JRequest::getVar('tmpl');
         $this->assignRef('tmpl', $tmpl);
         $this->setLayout("faq");
         $faq = $this->get("Faq");
         $this->assignRef('faq', $faq);
         if (!$this->faq) {
             return JError::raiseWarning(404, JText::_('FAQ NOT FOUND'));
         }
         $pathway = $mainframe->getPathway();
         if (FSF_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'faq'))) {
             $pathway->addItem(JText::_('FREQUENTLY_ASKED_QUESTIONS'), FSFRoute::x('index.php?option=com_fsf&view=faq'));
         }
         $pathway->addItem($faq['title'], FSFRoute::x('&limitstart=&layout=&faqid=&catid=' . $faq['faq_cat_id']));
         $pathway->addItem($faq['question']);
         if (FSF_Settings::get('faq_use_content_plugins')) {
             // apply plugins to article body
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $art = new stdClass();
             $art->text = $faq['answer'];
             $art->noglossary = 1;
             $this->params = $mainframe->getParams('com_fsf');
             if (FSF_Helper::Is16()) {
                 $results = $dispatcher->trigger('onContentPrepare', array('com_fsf.faq', &$art, &$this->params, 0));
             } else {
                 $results = $dispatcher->trigger('onPrepareContent', array(&$art, &$this->params, 0));
             }
             $faq['answer'] = $art->text;
         }
         // load tags
         $db =& JFactory::getDBO();
         $qry = "SELECT * FROM #__fsf_faq_tags WHERE faq_id IN (" . FSFJ3Helper::getEscaped($db, $faqid) . ") GROUP BY tag ORDER BY tag";
         $db->setQuery($qry);
         $rows = $db->loadObjectList();
         $this->tags = array();
         foreach ($rows as &$row) {
             $id = $row->faq_id;
             $this->tags[] = "<a href='" . FSFRoute::_('index.php?option=com_fsf&view=faq&tag=' . urlencode($row->tag) . '&Itemid=' . JRequest::getVar('Itemid')) . "'>{$row->tag}</a>";
         }
         //$document = JFactory::getDocument();
         //$document->setTitle(JText::_("FAQS") . ' - ' . $faq['title']);
         parent::display();
         return;
     }
     $pathway = $mainframe->getPathway();
     if (FSF_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'faq'))) {
         $pathway->addItem(JText::_('FREQUENTLY_ASKED_QUESTIONS'), FSFRoute::x('index.php?option=com_fsf&view=faq'));
     }
     $always_show_cats = $aparams->get('always_show_cats', 0);
     $always_show_faqs = $aparams->get('always_show_faqs', 0);
     $hide_allfaqs = $aparams->get('hide_allfaqs', 0);
     $show_featured = $aparams->get('show_featured', 0);
     $hide_tags = $aparams->get('hide_tags', 0);
     $hide_search = $aparams->get('hide_search', 0);
     $view_mode = $aparams->get('view_mode', 'questionwithpopup');
     $view_mode_cat = $aparams->get('view_mode_cat', 'list');
     $view_mode_incat = $aparams->get('view_mode_incat', 'list');
     $enable_pages = $aparams->get('enable_pages', 1);
     $num_cat_colums = $aparams->get('num_cat_colums', 1);
     if ($num_cat_colums < 1 && !$num_cat_colums) {
         $num_cat_colums = 1;
     }
     if ($view_mode_cat != "list") {
         $num_cat_colums = 1;
     }
     $catlist = $this->get("CatList");
     $this->assignRef('catlist', $catlist);
     $search = $this->get("Search");
     $this->assignRef('search', $search);
     $curcattitle = $this->get("CurCatTitle");
     $this->assignRef('curcattitle', $curcattitle);
     $curcatimage = $this->get("CurCatImage");
     $this->assignRef('curcatimage', $curcatimage);
     $curcatdesc = $this->get("CurCatDesc");
     $this->assignRef('curcatdesc', $curcatdesc);
     $curcatid = $this->get("CurCatID");
     // Get data from the model
     if ($curcatid == -4) {
         return $this->listTags();
     }
     if ($curcatid == -5) {
         $curcattitle = "Featured FAQs";
         $curcatimage = "/components/com_fsf/assets/images/featured.png";
     }
     $pagination = $this->get('Pagination');
     $model = $this->getModel();
     $search = $model->_search;
     if ($search || $curcatid > 0 || JRequest::getVar('catid') != "" || JRequest::getVar('tag') != "") {
         $view_mode_cat = "";
     }
     if ($view_mode_cat == "inline" || $view_mode_cat == "accordian") {
         $alldata = $this->get("AllData");
         if (FSF_Settings::get('faq_use_content_plugins_list')) {
             // apply plugins to article body
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $art = new stdClass();
             foreach ($alldata as &$item) {
                 $art->text = $item['answer'];
                 $art->noglossary = 1;
                 $this->params = $mainframe->getParams('com_fsf');
                 if (FSF_Helper::Is16()) {
                     $results = $dispatcher->trigger('onContentPrepare', array('com_fsf.faq', &$art, &$this->params, 0));
                 } else {
                     $results = $dispatcher->trigger('onPrepareContent', array(&$art, &$this->params, 0));
                 }
                 $item['answer'] = $art->text;
             }
         }
         foreach ($catlist as &$cat) {
             $catid = $cat['id'];
             foreach ($alldata as &$faq) {
                 if ($faq['faq_cat_id'] == $catid) {
                     $cat['faqs'][] =& $faq;
                 }
             }
         }
         // inline mode, so if we have featured faqs listed, load the data for those
         $this->featured_faqs = $this->get('FeaturedFaqs');
     } else {
         $items = $this->get('Data');
         if (FSF_Settings::get('faq_use_content_plugins_list')) {
             // apply plugins to article body
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('content');
             $art = new stdClass();
             foreach ($items as &$item) {
                 $art->text = $item['answer'];
                 $art->noglossary = 1;
                 $this->params = $mainframe->getParams('com_fsf');
                 if (FSF_Helper::Is16()) {
                     $results = $dispatcher->trigger('onContentPrepare', array('com_fsf.faq', &$art, &$this->params, 0));
                 } else {
                     $results = $dispatcher->trigger('onPrepareContent', array(&$art, &$this->params, 0));
                 }
                 $item['answer'] = $art->text;
             }
         }
     }
     // push data into the template
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $showfaqs = true;
     $showcats = true;
     if (JRequest::getVar('tag') != "") {
         // got tag selected
         $showfaqs = true;
         $showcats = false;
         $curcatid = -2;
         $pathway = $mainframe->getPathway();
         $pathway->addItem(JText::_("TAGS"), FSFRoute::_('index.php?option=com_fsf&view=faq&catid=-4&Itemid=' . JRequest::getVar('Itemid')));
         $pathway->addItem(JRequest::getVar('tag'));
         $curcattitle = JRequest::getVar('tag');
         // do we have a category specified???
     } else {
         if (JRequest::getVar('catid', '') == '' && JRequest::getVar('search', '') == '') {
             // no cat specified
             if (!$always_show_faqs) {
                 $showfaqs = false;
                 $curcatid = -2;
             } else {
                 $pathway = $mainframe->getPathway();
                 $pathway->addItem($curcattitle);
             }
         } else {
             // got a cat specced
             $pathway = $mainframe->getPathway();
             $pathway->addItem($curcattitle);
             if (!$always_show_cats) {
                 $showcats = false;
             }
         }
     }
     // load tags
     $faqids = array();
     if ($this->items && is_array($this->items)) {
         foreach ($this->items as &$item) {
             $faqids[] = FSFJ3Helper::getEscaped($db, $item['id']);
         }
     }
     $db = JFactory::getDBO();
     $this->tags = array();
     if (count($faqids) > 0) {
         $qry = "SELECT * FROM #__fsf_faq_tags WHERE faq_id IN (" . implode(", ", $faqids) . ") GROUP BY tag ORDER BY tag";
         $db->setQuery($qry);
         $rows = $db->loadObjectList();
         foreach ($rows as &$row) {
             $id = $row->faq_id;
             if (!array_key_exists($id, $this->tags)) {
                 $this->tags[$id] = array();
             }
             $this->tags[$id][] = "<a href='" . FSFRoute::_('index.php?option=com_fsf&view=faq&tag=' . urlencode($row->tag) . '&Itemid=' . JRequest::getVar('Itemid')) . "'>{$row->tag}</a>";
         }
     }
     // hide tags if none have been set
     $qry = "SELECT count(*) as cnt FROM #__fsf_faq_tags";
     $db->setQuery($qry);
     $row = $db->loadObject();
     if ($row->cnt == 0) {
         $hide_tags = true;
     }
     $this->assign('curcatid', $curcatid);
     $this->assign('showcats', $showcats);
     $this->assign('showfaqs', $showfaqs);
     $this->assign('hide_allfaqs', $hide_allfaqs);
     $this->assign('show_featured', $show_featured);
     $this->assign('hide_tags', $hide_tags);
     $this->assign('hide_search', $hide_search);
     $this->assign('view_mode', $view_mode);
     $this->assign('num_cat_colums', $num_cat_colums);
     $this->assign('view_mode_cat', $view_mode_cat);
     $this->assign('view_mode_incat', $view_mode_incat);
     $this->assign('enable_pages', $enable_pages);
     parent::display($tpl);
 }
コード例 #10
0
ファイル: faqcat.php プロジェクト: sansandeep143/av
/**
 * @package Freestyle Joomla
 * @author Freestyle Joomla
 * @copyright (C) 2013 Freestyle Joomla
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die;
?>
<div class="faq_mod_category_cont">
<?php 
foreach ($rows as $cat) {
    ?>

<?php 
    $link = FSFRoute::_('index.php?option=com_fsf&view=faq&catid=' . $cat['id']);
    ?>
<div class='faq_mod_category' style='cursor: pointer;'>
	<?php 
    if ($params->get('show_images') && $cat['image']) {
        ?>
	<div class='faq_mod_category_image'>
	    <a href='<?php 
        echo $link;
        ?>
'><img src='<?php 
        echo JURI::root(true);
        ?>
/images/fsf/faqcats/<?php 
        echo $cat['image'];
        ?>