function Item($title, $link, $icon, $help) { ?> <div class="fsf_main_item fsj_tip" title="<?php echo JText::_($help); ?> "> <div class="fsf_main_icon"> <a href="<?php echo FSFRoute::x($link); ?> "> <img src="<?php echo JURI::root(true); ?> /administrator/components/com_fsf/assets/images/<?php echo $icon; ?> -48x48.png" width="48" height="48"> </a> </div> <div class="fsf_main_text"> <a href="<?php echo FSFRoute::x($link); ?> "> <?php echo JText::_($title); ?> </a> </div> </div> <?php }
function _buildDataObject() { if (empty($this->_viewall)) { $this->_viewall = false; } // Initialize variables $data = new stdClass(); $data->all = new JPaginationObject(JText::_("VIEW_ALL")); if (!$this->_viewall) { $data->all->base = '0'; $data->all->link = FSFRoute::x("&start="); } // Set the start and previous data objects $data->start = new JPaginationObject(JText::_("START")); $data->previous = new JPaginationObject(JText::_("PREV")); if ($this->get('pages.current') > 1) { $page = ($this->get('pages.current') - 2) * $this->limit; $page = $page == 0 ? '' : $page; //set the empty for removal from route $data->start->base = '0'; $data->start->link = "javascript:ChangePage(0);"; $data->previous->base = $page; $data->previous->link = "javascript:ChangePage({$page});"; } // Set the next and end data objects $data->next = new JPaginationObject(JText::_("NEXT")); $data->end = new JPaginationObject(JText::_("END")); if ($this->get('pages.current') < $this->get('pages.total')) { $next = $this->get('pages.current') * $this->limit; $end = ($this->get('pages.total') - 1) * $this->limit; $data->next->base = $next; $data->next->link = "javascript:ChangePage({$next});"; $data->end->base = $end; $data->end->link = "javascript:ChangePage({$end});"; } $data->pages = array(); $stop = $this->get('pages.stop'); for ($i = $this->get('pages.start'); $i <= $stop; $i++) { $offset = ($i - 1) * $this->limit; $offset = $offset == 0 ? '' : $offset; //set the empty for removal from route $data->pages[$i] = new JPaginationObject($i); if ($i != $this->get('pages.current') || $this->_viewall) { $data->pages[$i]->base = $offset; $data->pages[$i]->link = "javascript:ChangePage({$offset});"; } } return $data; }
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); }
function SaveAPI() { $username = JRequest::getVar('username'); $apikey = JRequest::getVar('apikey'); $db =& JFactory::getDBO(); $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('fsj_username','" . FSFJ3Helper::getEscaped($db, $username) . "')"; $db->setQuery($qry); $db->Query(); $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('fsj_apikey','" . FSFJ3Helper::getEscaped($db, $apikey) . "')"; $db->setQuery($qry); $db->Query(); // update url links if (FSFAdminHelper::Is16()) { $updater = new FSFUpdater(); $updater->SortAPIKey($username, $apikey); } $mainframe = JFactory::getApplication(); $link = FSFRoute::x('index.php?option=com_fsf&view=backup', false); $mainframe->redirect($link); }
function display($tpl = null) { $mainframe = JFactory::getApplication(); $faq =& $this->get('Data'); $isNew = $faq->id < 1; $text = $isNew ? JText::_("NEW") : JText::_("EDIT"); JToolBarHelper::title(JText::_("FAQ") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fsf_faqs'); JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } FSFAdminHelper::DoSubToolbar(); $this->assignRef('faq', $faq); $query = 'SELECT id, title' . ' FROM #__fsf_faq_cat' . ' ORDER BY ordering'; $db =& JFactory::getDBO(); $db->setQuery($query); $sections = $db->loadObjectList(); if (count($sections) < 1) { $link = FSFRoute::x('index.php?option=com_fsf&view=faqs', false); $mainframe->redirect($link, "You must create a FAQ category first"); return; } if ($faq->id > 0) { $qry = "SELECT * FROM #__fsf_faq_tags WHERE faq_id = " . FSFJ3Helper::getEscaped($db, $faq->id) . " ORDER BY tag"; $db->setQuery($qry); $this->tags = $db->loadObjectList(); } else { $this->tags = array(); } $lists['catid'] = JHTML::_('select.genericlist', $sections, 'faq_cat_id', 'class="inputbox" size="1" ', 'id', 'title', intval($faq->faq_cat_id)); $this->assignRef('lists', $lists); parent::display($tpl); }
/** * @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']; ?>
<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)); ?> '> <?php echo $letter; ?> </a> <?php } else { ?> <a href='<?php echo FSFRoute::_('index.php?option=com_fsf&view=glossary#letter_' . strtolower($letter)); ?> '> <?php echo $letter; ?> </a> <?php } ?> </span> <?php } ?> <?php } ?>
<?php } elseif ($this->view_mode_cat == "accordian") { ?> <A class="fsf_highlight" href="#" onclick='return false;'><?php echo $cat['title']; ?> </a> <?php } else { ?> <A class="fsf_highlight" href='<?php echo FSFRoute::x('&limitstart=&catid=' . $cat['id']); ?> '><?php echo $cat['title']; ?> </a> <?php } ?> <?php if ($cat['id'] == $this->curcatid) { ?> </b><?php }
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'] . " </td><td nowrap style='border:0px;'> " . 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); }
function display($tpl = null) { JHTML::_('behavior.modal'); if (JRequest::getVar('task') == "cancellist") { $mainframe = JFactory::getApplication(); $link = FSFRoute::x('index.php?option=com_fsf&view=fsfs', false); $mainframe->redirect($link); return; } $what = JRequest::getString('what', ''); $this->tab = JRequest::getVar('tab'); $settings = FSF_Settings::GetAllSettings(); $db =& JFactory::getDBO(); if ($what == "testref") { return $this->TestRef(); } else { if ($what == "save") { $large = FSF_Settings::GetLargeList(); $templates = FSF_Settings::GetTemplateList(); $intpltable = FSF_Settings::StoreInTemplateTable(); // save support custom setting $head = JRequest::getVar('support_list_head', '', 'post', 'string', JREQUEST_ALLOWRAW); $row = JRequest::getVar('support_list_row', '', 'post', 'string', JREQUEST_ALLOWRAW); $qry = "REPLACE INTO #__fsf_templates (template, tpltype, value) VALUES ('custom', 1, '" . FSFJ3Helper::getEscaped($db, $head) . "')"; $db->setQuery($qry); $db->Query(); $qry = "REPLACE INTO #__fsf_templates (template, tpltype, value) VALUES ('custom', 0, '" . FSFJ3Helper::getEscaped($db, $row) . "')"; $db->setQuery($qry); $db->Query(); unset($_POST['support_list_head']); unset($_POST['support_list_row']); // save templates $intpltable = FSF_Settings::StoreInTemplateTable(); foreach ($intpltable as $template) { $value = JRequest::getVar($template, '', 'post', 'string', JREQUEST_ALLOWRAW); $qry = "REPLACE INTO #__fsf_templates (template, tpltype, value) VALUES ('" . FSFJ3Helper::getEscaped($db, $template) . "', 2, '" . FSFJ3Helper::getEscaped($db, $value) . "')"; $db->setQuery($qry); $db->Query(); } // large settings foreach ($large as $setting) { if (!array_key_exists($setting, $templates)) { continue; } $value = JRequest::getVar($setting, '', 'post', 'string', JREQUEST_ALLOWRAW); $qry = "REPLACE INTO #__fsf_settings_big (setting, value) VALUES ('"; $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','"; $qry .= FSFJ3Helper::getEscaped($db, $value) . "')"; //echo $qry."<br>"; $db->setQuery($qry); $db->Query(); $qry = "DELETE FROM #__fsf_settings WHERE setting = '" . FSFJ3Helper::getEscaped($db, $setting) . "'"; //echo $qry."<br>"; $db->setQuery($qry); $db->Query(); unset($_POST[$setting]); } $data = JRequest::get('POST', JREQUEST_ALLOWRAW); foreach ($data as $setting => $value) { if (array_key_exists($setting, $settings)) { $settings[$setting] = $value; } } foreach ($settings as $setting => $value) { if (!array_key_exists($setting, $data)) { $settings[$setting] = 0; $value = 0; } if (!array_key_exists($setting, $templates)) { continue; } if (array_key_exists($setting, $large)) { continue; } $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('"; $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','"; $qry .= FSFJ3Helper::getEscaped($db, $value) . "')"; $db->setQuery($qry); $db->Query(); //echo $qry."<br>"; } //exit; $link = 'index.php?option=com_fsf&view=templates#' . $this->tab; if (JRequest::getVar('task') == "save") { $link = 'index.php?option=com_fsf'; } $mainframe = JFactory::getApplication(); $mainframe->redirect($link, JText::_("Settings_Saved")); exit; } else { if ($what == "customtemplate") { $this->CustomTemplate(); exit; } else { // load other templates $intpltable = FSF_Settings::StoreInTemplateTable(); $tpls = array(); foreach ($intpltable as $template) { $settings[$template] = ''; $settings[$template . '_default'] = ''; $tpls[] = FSFJ3Helper::getEscaped($db, $template); } $tpllist = "'" . implode("', '", $tpls) . "'"; $qry = "SELECT * FROM #__fsf_templates WHERE template IN ({$tpllist})"; $db->setQuery($qry); $rows = $db->loadAssocList(); if (count($rows) > 0) { foreach ($rows as $row) { if ($row['tpltype'] == 2) { $settings[$row['template']] = $row['value']; } else { if ($row['tpltype'] == 3) { $settings[$row['template'] . '_default'] = $row['value']; } } } } // load ticket template stuff $qry = "SELECT * FROM #__fsf_templates WHERE template = 'custom'"; $db->setQuery($qry); $rows = $db->loadAssocList(); if (count($rows) > 0) { foreach ($rows as $row) { if ($row['tpltype'] == 1) { $settings['support_list_head'] = $row['value']; } else { if ($row['tpltype'] == 0) { $settings['support_list_row'] = $row['value']; } } } } else { $settings['support_list_head'] = ''; $settings['support_list_row'] = ''; } $qry = "SELECT * FROM #__fsf_templates WHERE tpltype = 2"; $db->setQuery($qry); $rows = $db->loadAssocList(); if (count($rows) > 0) { foreach ($rows as $row) { $settings[$row['template']] = $row['value']; } } $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/js_color_picker_v2.css'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/color_functions.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/js_color_picker_v2.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/codemirror.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/css/css.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/javascript/javascript.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/xml/xml.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/htmlmixed/htmlmixed.js'); $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/codemirror/codemirror.css'); $this->assignRef('settings', $settings); JToolBarHelper::title(JText::_("FREESTYLE_FAQS") . ' - ' . JText::_("TEMPLATES"), 'fsf_templates'); JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel('cancellist'); FSFAdminHelper::DoSubToolbar(); parent::display($tpl); } } } }
/** * @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']; ?>
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); }
{ ShowTab(location.hash.replace('#','')); } else { ShowTab('general'); } <?php if (FSF_Helper::Is16()) { ?> jQuery('#test_date_formats').click(function (ev) { ev.preventDefault(); var url = '<?php echo FSFRoute::x("index.php?option=com_fsf&view=settings&what=testdates", false); ?> '; url += '&date_dt_short=' + encodeURIComponent(jQuery('#date_dt_short').val()); url += '&date_dt_long=' + encodeURIComponent(jQuery('#date_dt_long').val()); url += '&date_d_short=' + encodeURIComponent(jQuery('#date_d_short').val()); url += '&date_d_long=' + encodeURIComponent(jQuery('#date_d_long').val()); jQuery.get(url, function (data) { var result = jQuery.parseJSON(data); jQuery('#test_date_dt_short').html("<?php echo JText::_('DATE_TEST_RESULT'); ?> " + ": " + result.date_dt_short); jQuery('#test_date_dt_long').html("<?php
if (FSFAdminHelper::IsFAQs()) { ?> <h3>If you like Freestyle FAQs please vote or review us at the <a href='http://extensions.joomla.org/extensions/directory-a-documentation/faq/11910' target="_blank">Joomla extensions directory</a></h3> <?php } elseif (FSFAdminHelper::IsTests()) { ?> <h3>If you like Freestyle Testimonials please vote or review us at the <a href='http://extensions.joomla.org/extensions/contacts-and-feedback/testimonials-a-suggestions/11911' target="_blank">Joomla extensions directory</a></h3> <?php } else { ?> <h3>If you like Freestyle FAQs, please vote or review us at the <a href='http://extensions.joomla.org/extensions/clients-a-communities/help-desk/11912' target="_blank">Joomla extensions directory</a></h3> <?php } echo "<h4>Currently Installed Verison : <b>{$ver_files}</b></h4>"; if ($ver_files != $ver_inst) { echo "<h4>" . JText::sprintf('INCORRECT_VERSION', FSFRoute::x('index.php?option=com_fsf&view=backup&task=update')) . "</h4>"; } ?> <div id="please_wait">Please wait while fetching latest version information...</div> <iframe id="frame_version" height="300" width="100%" frameborder="0" border="0"></iframe> <?php echo $pane->endPanel(); $title = "Announcements"; echo $pane->startPanel($title, 'cpanel-panel-' . $title); ?> <iframe id="frame_announce" height="600" width="100%" frameborder="0" border="0"></iframe> <?php echo $pane->endPanel(); $title = "Help"; echo $pane->startPanel($title, 'cpanel-panel-' . $title);
<h1><?php echo JText::_("RESTORE_DATABASE"); ?> </h1> <div style="color:red; font-size:150%"><?php echo JText::_("PLEASE_NOTE_THE_WILL_OVERWRITE_AND_EXISTING_DATA_FOR_FREESTYLE_FAQS"); ?> </div> <?php // ?> <form action="<?php echo FSFRoute::x("index.php?option=com_fsf&view=backup&task=restore"); ?> " method="post" name="adminForm2" id="adminForm2" enctype="multipart/form-data"></::> <input type="file" id="filedata" name="filedata" /><input type="submit" name="Restore" value="<?php echo JText::_("RESTORE"); ?> "> </form> <form action="index.php" method="post" name="adminForm" id="adminForm"> <input type="hidden" name="option" value="com_fsf" /> <input type="hidden" name="task" id="task" value="" /> <input type="hidden" name="view" value="backup" /> </form> <?php }
<?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) { ?>
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>"; } }
if (count($this->items) == 0) { ?> <div class="fsf_no_results"><?php echo JText::_("NO_FAQS_MATCH_YOUR_SEARCH_CRITERIA"); ?> </div> <?php } ?> </div> <?php if ($this->enable_pages) { ?> <form id="adminForm" action="<?php echo FSFRoute::x('index.php?option=com_fsf&view=faq&catid=' . $this->curcatid); ?> " method="post" name="adminForm"> <input type='hidden' name='catid' value='<?php echo $this->curcatid; ?> ' /> <input type='hidden' name='enable_pages' value='<?php echo $this->enable_pages; ?> ' /> <input type='hidden' name='view_mode' value='<?php echo $this->view_mode; ?> ' /> <?php
</div> </div> <?php } elseif ($this->view_mode == 'questionwithpopup') { ?> <div class='fsf_faq'> <div class="fsf_faq_question <?php echo $unpubclass; ?> "> <?php echo $this->content->EditPanel($faq); ?> <a class="fsf_modal fsf_highlight" href='<?php echo FSFRoute::x('&tmpl=component&faqid=' . $faq['id']); ?> ' rel="{handler: 'iframe', size: {x: <?php echo FSF_Settings::get('faq_popup_width'); ?> , y: <?php echo FSF_Settings::get('faq_popup_height'); ?> }}"> <?php echo $faq['question']; ?> </a> </div> </div> <?php
static function _($url, $xhtml = true, $ssl = null) { if (FSF_Helper::Is16()) { return FSFRoute::_16($url, $xhtml, $ssl); } else { return FSFRoute::_15($url, $xhtml, $ssl); } }
function display($tpl = null) { JHTML::_('behavior.modal'); $what = JRequest::getString('what', ''); $this->tab = JRequest::getVar('tab'); if (JRequest::getVar('task') == "cancellist") { $mainframe = JFactory::getApplication(); $link = FSFRoute::x('index.php?option=com_fsf&view=fsfs', false); $mainframe->redirect($link); return; } $settings = FSF_Settings::GetAllViewSettings(); // CHANGE $db =& JFactory::getDBO(); if ($what == "save") { $data = JRequest::get('POST', JREQUEST_ALLOWRAW); foreach ($data as $setting => $value) { if (array_key_exists($setting, $settings)) { $settings[$setting] = $value; } } foreach ($settings as $setting => $value) { if (!array_key_exists($setting, $data)) { $settings[$setting] = 0; $value = 0; } // skip any setting that is in the templates list if (array_key_exists($setting, $templates)) { continue; } if (array_key_exists($setting, $large)) { continue; } $qry = "REPLACE INTO #__fsf_settings_view (setting, value) VALUES ('"; $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','"; $qry .= FSFJ3Helper::getEscaped($db, $value) . "')"; $db->setQuery($qry); $db->Query(); //echo $qry."<br>"; } $link = 'index.php?option=com_fsf&view=settingsview#' . $this->tab; if (JRequest::getVar('task') == "save") { $link = 'index.php?option=com_fsf'; } //exit; $mainframe = JFactory::getApplication(); $mainframe->redirect($link, JText::_("View_Settings_Saved")); exit; } else { $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/js_color_picker_v2.css'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/color_functions.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/js_color_picker_v2.js'); $this->assignRef('settings', $settings); JToolBarHelper::title(JText::_("FREESTYLE_FAQS") . ' - ' . JText::_("VIEW_SETTINGS"), 'fsf_viewsettings'); JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel('cancellist'); FSFAdminHelper::DoSubToolbar(); parent::display($tpl); } }
function display($tpl = null) { JHTML::_('behavior.modal'); $what = JRequest::getString('what', ''); $this->tab = JRequest::getVar('tab'); if (JRequest::getVar('task') == "cancellist") { $mainframe = JFactory::getApplication(); $link = FSFRoute::x('index.php?option=com_fsf&view=fsfs', false); $mainframe->redirect($link); return; } $settings = FSF_Settings::GetAllSettings(); $db =& JFactory::getDBO(); if ($what == "testref") { return $this->TestRef(); } else { if ($what == "testdates") { return $this->testdates(); } else { if ($what == "save") { // $large = FSF_Settings::GetLargeList(); $templates = FSF_Settings::GetTemplateList(); // save any large settings that arent in the templates list foreach ($large as $setting) { // skip any setting that is in the templates list if (array_key_exists($setting, $templates)) { continue; } // $value = JRequest::getVar($setting, '', 'post', 'string', JREQUEST_ALLOWRAW); $qry = "REPLACE INTO #__fsf_settings_big (setting, value) VALUES ('"; $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','"; $qry .= FSFJ3Helper::getEscaped($db, $value) . "')"; $db->setQuery($qry); $db->Query(); $qry = "DELETE FROM #__fsf_settings WHERE setting = '" . FSFJ3Helper::getEscaped($db, $setting) . "'"; $db->setQuery($qry); $db->Query(); unset($_POST[$setting]); } $data = JRequest::get('POST', JREQUEST_ALLOWRAW); foreach ($data as $setting => $value) { if (array_key_exists($setting, $settings)) { $settings[$setting] = $value; } } foreach ($settings as $setting => $value) { if (!array_key_exists($setting, $data)) { $settings[$setting] = 0; $value = 0; } // skip any setting that is in the templates list if (array_key_exists($setting, $templates)) { continue; } if (array_key_exists($setting, $large)) { continue; } $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('"; $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','"; $qry .= FSFJ3Helper::getEscaped($db, $value) . "')"; $db->setQuery($qry); $db->Query(); //echo $qry."<br>"; } $link = 'index.php?option=com_fsf&view=settings#' . $this->tab; if (JRequest::getVar('task') == "save") { $link = 'index.php?option=com_fsf'; } //exit; $mainframe = JFactory::getApplication(); $mainframe->redirect($link, JText::_("Settings_Saved")); exit; } else { if ($what == "customtemplate") { $this->CustomTemplate(); exit; } else { $qry = "SELECT * FROM #__fsf_templates WHERE template = 'custom'"; $db->setQuery($qry); $rows = $db->loadAssocList(); if (count($rows) > 0) { foreach ($rows as $row) { if ($row['tpltype']) { $settings['support_list_head'] = $row['value']; } else { $settings['support_list_row'] = $row['value']; } } } else { $settings['support_list_head'] = ''; $settings['support_list_row'] = ''; } // $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/js_color_picker_v2.css'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/color_functions.js'); $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/js_color_picker_v2.js'); $this->assignRef('settings', $settings); JToolBarHelper::title(JText::_("FREESTYLE_FAQS") . ' - ' . JText::_("SETTINGS"), 'fsf_settings'); JToolBarHelper::apply(); JToolBarHelper::save(); JToolBarHelper::cancel('cancellist'); FSFAdminHelper::DoSubToolbar(); parent::display($tpl); } } } } }
<th width="1%" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'Published', 'published', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th> <?php FSFAdminHelper::LA_Header($this); ?> </tr> </thead> <?php $k = 0; for ($i = 0, $n = count($this->data); $i < $n; $i++) { $row =& $this->data[$i]; $checked = JHTML::_('grid.id', $i, $row->id); $link = FSFRoute::x('index.php?option=com_fsf&controller=glossary&task=edit&cid[]=' . $row->id); $published = FSF_GetPublishedText($row->published); ?> <tr class="<?php echo "row{$k}"; ?> "> <td> <?php echo $row->id; ?> </td> <td> <?php echo $checked; ?>
</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") { ?>
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("&","&", $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("&","&", $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; }
/** * @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; // Include the syndicate functions only once if (!defined("DS")) { define('DS', DIRECTORY_SEPARATOR); } if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_fsf' . DS . 'helper' . DS . 'helper.php')) { require_once JPATH_SITE . DS . 'components' . DS . 'com_fsf' . DS . 'helper' . DS . 'j3helper.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_fsf' . DS . 'helper' . DS . 'helper.php'; $css = FSFRoute::x("index.php?option=com_fsf&view=css&layout=default"); $document = JFactory::getDocument(); $document->addStyleSheet($css); $listtype = $params->get('listtype'); $db = JFactory::getDBO(); if ($listtype == 'faqcat') { $query = "SELECT * FROM #__fsf_faq_cat"; $where = array(); $where[] = " published = 1 "; if (FSF_Helper::Is16()) { $where[] = 'language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')'; $user = JFactory::getUser(); $where[] = 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'; } if (count($where) > 0) { $query .= " WHERE " . implode(" AND ", $where);
} } // do version check $ver_inst = FSFAdminHelper::GetInstalledVersion(); $ver_files = FSFAdminHelper::GetVersion(); if (FSF_Helper::Is16()) { if (!JFactory::getUser()->authorise('core.manage', 'com_fsf')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } } // if bad version display warning message if ($ver_files != $ver_inst) { $task = JRequest::getVar('task'); $view = JRequest::getVar('view'); if ($task != "update" || $view != "backup") { JError::raiseWarning(100, JText::sprintf('INCORRECT_VERSION', FSFRoute::x('index.php?option=com_fsf&view=backup&task=update'))); } if ($view != "" && $view != "backup") { JRequest::setVar('view', ''); } } // if bad version and controller is not fsfs dont display // Create the controller $controllername = $controller; $classname = 'FsfsController' . $controller; $controller = new $classname(); $css = JRoute::_(JURI::root() . "index.php?option=com_fsf&view=css"); $document = JFactory::getDocument(); $document->addStyleSheet($css); $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/main.css'); $document->addStyleSheet(JURI::root() . 'components/com_fsf/assets/css/popup.css');