Example #1
0
 function __construct()
 {
     parent::__construct();
     $mainframe = JFactory::getApplication();
     global $option;
     // Get pagination request variables
     $aparams = FSF_Settings::GetViewSettingsObj('faqs');
     $this->_enable_pages = $aparams->get('enable_pages', 1);
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', FSF_Settings::Get('faq_per_page'), 'int');
     if ($this->_enable_pages == 0) {
         $limit = 999999;
     }
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     // In case limit has been changed, adjust it
     $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
     $this->setState('limit', $limit);
     $this->setState('limitstart', $limitstart);
     $this->_curcatid = JRequest::getInt('catid');
     $this->_search = JRequest::getVar('search', '', '', 'string');
     $this->_catlist = $this->_getCatList();
     if ($this->_search != "") {
         $this->_curcattitle = JText::_("SEARCH_RESULTS");
         $this->_curcatid = -1;
         $this->_curcatimage = "/components/com_fsf/assets/images/search.png";
     } else {
         if ($this->_curcatid == "0") {
             $this->_curcattitle = JText::_("ALL_FAQS");
             $this->_curcatimage = "/components/com_fsf/assets/images/allfaqs.png";
         } else {
             foreach ($this->_catlist as $cat) {
                 if ($cat['id'] == $this->_curcatid) {
                     $this->_curcattitle = $cat['title'];
                     $this->_curcatimage = $cat['image'];
                     $this->_curcatdesc = $cat['description'];
                 }
             }
         }
     }
 }
Example #2
0
 static function AddSCEditor()
 {
     if (!FSF_Helper::$sceditor) {
         if (FSF_Settings::Get('support_sceditor')) {
             $document = JFactory::getDocument();
             $document->addScript(JURI::root() . 'components/com_fsf/assets/js/sceditor/jquery.sceditor.bbcode.js');
             $document->addScript(JURI::root() . 'components/com_fsf/assets/js/sceditor/include.sceditor.js');
             $document->addScriptDeclaration("var sceditor_emoticons_root = '" . JURI::root(true) . "/components/com_fsf/assets/';");
             $document->addScriptDeclaration("var sceditor_style_root = '" . JURI::root(true) . "/components/com_fsf/assets/js/sceditor/';");
             $document->addStyleSheet(JURI::root() . 'components/com_fsf/assets/js/sceditor/themes/default.css');
         }
         FSF_Helper::$sceditor = true;
     }
 }
Example #3
0
	<div class="fsf_spacer"></div>
	<?php 
echo FSF_Helper::PageSubTitle("PLEASE_SELECT_A_TAG");
?>

	<div class='faq_category'>
	    <div class='faq_category_image'>
			<img src='<?php 
echo JURI::root(true);
?>
/components/com_fsf/assets/images/tags-64x64.png' width='64' height='64'>
	    </div>
	    <div class='fsf_spacer contentheading' style="padding-top:6px;padding-bottom:6px;">
			<?php 
if (FSF_Settings::Get('faq_cat_prefix')) {
    ?>
			<?php 
    echo JText::_("FAQS");
    ?>
 
			<?php 
}
?>
			<?php 
echo JText::_('TAGS');
?>
		</div>
	</div>
	<div class='fsf_clear'></div>
	
Example #4
0
 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);
 }
Example #5
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     JHTML::_('behavior.modal', 'a.fsf_modal');
     //JHTML::_('behavior.mootools');
     $db = JFactory::getDBO();
     $aparams = FSF_Settings::GetViewSettingsObj('glossary');
     $this->use_letter_bar = $aparams->get('use_letter_bar', 0);
     if ($this->use_letter_bar) {
         $this->letters = array();
         if (FSF_Settings::get('glossary_all_letters')) {
             $letters = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
             foreach ($letters as $letter) {
                 $this->letters[$letter] = 0;
             }
         }
         $qry = "SELECT UPPER(SUBSTR(word,1,1)) as letter FROM #__fsf_glossary";
         $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) {
             $qry .= " WHERE " . implode(" AND ", $where);
         }
         $qry .= " GROUP BY letter ORDER BY letter";
         $db->setQuery($qry);
         $letters = $db->loadObjectList();
         foreach ($letters as $letter) {
             $this->letters[$letter->letter] = 1;
         }
         if (count($this->letters) == 0) {
             return parent::display("empty");
         }
     }
     $this->curletter = "";
     // if we are showing on a per letter basis only
     if ($this->use_letter_bar == 2) {
         $this->curletter = JRequest::getVar('letter', $this->letters[0]->letter);
     }
     $where = array();
     $where[] = "published = 1";
     $query = "SELECT * FROM #__fsf_glossary";
     if ($this->curletter) {
         $where[] = "SUBSTR(word,1,1) = '" . FSFJ3Helper::getEscaped($db, $this->curletter) . "'";
     }
     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);
     }
     $query .= " ORDER BY word";
     $db->setQuery($query);
     $this->rows = $db->loadObjectList();
     $pathway =& $mainframe->getPathway();
     if (FSF_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'glossary'))) {
         $pathway->addItem("Glossary");
     }
     if (FSF_Settings::get('glossary_use_content_plugins')) {
         // apply plugins to article body
         $dispatcher =& JDispatcher::getInstance();
         JPluginHelper::importPlugin('content');
         $art = new stdClass();
         if (FSF_Helper::Is16()) {
             //$aparams = new JParameter(null);
         } else {
             $aparams = new stdClass();
         }
         $this->params =& $mainframe->getParams('com_fsf');
         foreach ($this->rows as &$row) {
             if ($row->description) {
                 $art->text = $row->description;
                 $art->noglossary = 1;
                 if (FSF_Helper::Is16()) {
                     $results = $dispatcher->trigger('onContentPrepare', array('com_fsf.glossary', &$art, &$this->params, 0));
                 } else {
                     $results = $dispatcher->trigger('onPrepareContent', array(&$art, &$this->params, 0));
                 }
                 $row->description = $art->text;
             }
             if ($row->longdesc) {
                 $art->text = $row->longdesc;
                 $art->noglossary = 1;
                 if (FSF_Helper::Is16()) {
                     $results = $dispatcher->trigger('onContentPrepare', array('com_fsf.glossary.long', &$art, &$this->params, 0));
                 } else {
                     $results = $dispatcher->trigger('onPrepareContent', array(&$art, &$this->params, 0));
                 }
                 $row->longdesc = $art->text;
             }
         }
     }
     parent::display($tpl);
 }
Example #6
0
 static function getAdminPermissions()
 {
     if (empty(FSF_Ticket_Helper::$_permissions)) {
         $mainframe = JFactory::getApplication();
         global $option;
         $user = JFactory::getUser();
         $userid = $user->id;
         $db = JFactory::getDBO();
         $query = "SELECT * FROM #__fsf_user WHERE user_id = '" . FSFJ3Helper::getEscaped($db, $userid) . "'";
         $db->setQuery($query);
         FSF_Ticket_Helper::$_permissions = $db->loadAssoc();
         if (!FSF_Ticket_Helper::$_permissions) {
             FSF_Ticket_Helper::$_permissions['mod_kb'] = 0;
             FSF_Ticket_Helper::$_permissions['mod_test'] = 0;
             FSF_Ticket_Helper::$_permissions['support'] = 0;
             FSF_Ticket_Helper::$_permissions['seeownonly'] = 1;
             FSF_Ticket_Helper::$_permissions['autoassignexc'] = 1;
             FSF_Ticket_Helper::$_permissions['allprods'] = 1;
             FSF_Ticket_Helper::$_permissions['allcats'] = 1;
             FSF_Ticket_Helper::$_permissions['alldepts'] = 1;
             FSF_Ticket_Helper::$_permissions['artperm'] = 0;
             FSF_Ticket_Helper::$_permissions['id'] = 0;
             FSF_Ticket_Helper::$_permissions['groups'] = 0;
             FSF_Ticket_Helper::$_permissions['reports'] = 0;
             FSF_Ticket_Helper::$_permissions['settings'] = '';
         }
         FSF_Ticket_Helper::$_permissions['userid'] = $userid;
         FSF_Ticket_Helper::$_perm_only = '';
         FSF_Ticket_Helper::$_perm_prods = '';
         FSF_Ticket_Helper::$_perm_depts = '';
         FSF_Ticket_Helper::$_perm_cats = '';
         FSF_Ticket_Helper::$_permissions['perm_where'] = '';
         //
         // check for permission overrides for Joomla 1.6
         if (FSF_Settings::get('perm_article_joomla') || FSF_Settings::get('perm_mod_joomla')) {
             if (FSF_Helper::Is16()) {
                 $newart = 0;
                 $newmod = 0;
                 $user = JFactory::getUser();
                 if ($user->authorise('core.edit.own', 'com_fsf')) {
                     $newart = 1;
                 }
                 if ($user->authorise('core.edit', 'com_fsf')) {
                     $newart = 2;
                     $newmod = 1;
                 }
                 if ($user->authorise('core.edit.state', 'com_fsf')) {
                     $newart = 3;
                     $newmod = 1;
                 }
                 if (FSF_Settings::get('perm_article_joomla') && $newart > FSF_Ticket_Helper::$_permissions['artperm']) {
                     FSF_Ticket_Helper::$_permissions['artperm'] = $newart;
                 }
                 if (FSF_Settings::get('perm_mod_joomla') && $newmod > FSF_Ticket_Helper::$_permissions['mod_kb']) {
                     FSF_Ticket_Helper::$_permissions['mod_kb'] = $newmod;
                 }
                 //
             } else {
                 $newart = 0;
                 $newmod = 0;
                 $user = JFactory::getUser();
                 if ($user->authorize('com_fsf', 'create', 'content', 'own')) {
                     $newart = 1;
                 }
                 if ($user->authorize('com_fsf', 'edit', 'content', 'own')) {
                     $newart = 2;
                     $newmod = 1;
                 }
                 if ($user->authorize('com_fsf', 'publish', 'content', 'all')) {
                     $newart = 3;
                     $newmod = 1;
                 }
                 if (FSF_Settings::get('perm_article_joomla') && $newart > FSF_Ticket_Helper::$_permissions['artperm']) {
                     FSF_Ticket_Helper::$_permissions['artperm'] = $newart;
                 }
                 if (FSF_Settings::get('perm_mod_joomla') && $newmod > FSF_Ticket_Helper::$_permissions['mod_kb']) {
                     FSF_Ticket_Helper::$_permissions['mod_kb'] = $newmod;
                 }
             }
         }
     }
     return FSF_Ticket_Helper::$_permissions;
 }
Example #7
0
 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);
     }
 }
Example #8
0
 static function GetViewSettingsObj($view)
 {
     // return a view setting object that can be used in place of the getPageParameters object
     // needs info about what view we are in, and access to the view settings
     FSF_Settings::_Get_View_Settings();
     return new FSF_View_Settings($view, FSF_Settings::$fsf_view_settings);
 }
Example #9
0
 static function GetInstalledVersion()
 {
     return FSF_Settings::get('version');
 }
Example #10
0
<?php

/**
 * @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 style="clear:both;"></div>
<?php 
if (!FSF_Settings::get('hide_powered')) {
    ?>
<div align="center" style="text-align:center;padding-top:20px;">
<a href="http://www.freestyle-joomla.com/">
Powered by Freestyle FAQs
<br>
		<img style="padding-top:2px;" border="0" src="<?php 
    echo JURI::root(true);
    ?>
/components/com_fsf/assets/images/logo_small.png"><br>
	</a>
</div>
<?php 
}
Example #11
0
 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);
             }
         }
     }
 }
Example #12
0
 function listTags()
 {
     $mainframe = JFactory::getApplication();
     $aparams = FSF_Settings::GetViewSettingsObj('faqs');
     $pathway = $mainframe->getPathway();
     $pathway->addItem(JText::_("TAGS"));
     $db =& JFactory::getDBO();
     $qry = "SELECT tag FROM #__fsf_faq_tags ";
     $qry .= ' WHERE language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')';
     $qry .= "GROUP BY tag ORDER BY tag";
     $db->setQuery($qry);
     $this->tags = $db->loadObjectList();
     parent::display("tags");
 }
Example #13
0
 * @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;
?>
<script>
function ResetElement(tabid)
{
	document.getElementById('tab_' + tabid).style.display = 'none';
	document.getElementById('link_' + tabid).style.backgroundColor = '';

	document.getElementById('link_' + tabid).onmouseover = function() {
		this.style.backgroundColor='<?php 
echo FSF_Settings::get('css_hl');
?>
';
	}
	document.getElementById('link_' + tabid).onmouseout = function() {
		this.style.backgroundColor='';
	}

}
function ShowTab(tabid)
{
	ResetElement('general');
// 
// ##NOT_TEST_END##
	ResetElement('visual');
// ##NOT_TEST_START##
Example #14
0
 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);
                 }
             }
         }
     }
 }
Example #15
0
 static function Footer()
 {
     FSF_Glossary::GetGlossary();
     if (count(FSF_Glossary::$fsf_glossary) == 0) {
         return "";
     }
     $tail = "<div id='glossary_words' style='display:none;'>";
     foreach (FSF_Glossary::$fsf_glossary as $word => $tip) {
         $wordl = strtolower($word);
         // skip any entries that we havent found a match for
         if (!array_key_exists($wordl, FSF_Glossary::$all_replaced)) {
             continue;
         }
         $wordl = preg_replace("/[^a-z0-9]/", "", $wordl);
         if (FSF_Settings::get('glossary_title')) {
             $tail .= "<div id='glossary_{$wordl}'><h4>{$word}</h4><div class='fsj_gt_inner'>{$tip}</div></div>";
         } else {
             $tail .= "<div id='glossary_{$wordl}'><div class='fsj_gt_inner'>{$tip}</div></div>";
         }
     }
     $tail .= "</div>";
     return $tail;
 }
Example #16
0
	</div>
	<?php 
}
?>
</div>	

</div>
<?php 
if ($this->tmpl) {
    echo "</div>";
}
?>

<?php 
include JPATH_SITE . DS . 'components' . DS . 'com_fsf' . DS . '_powered.php';
if (FSF_Settings::get('glossary_faqs')) {
    echo FSF_Glossary::Footer();
}
?>

<?php 
if ($this->tmpl) {
    echo "</div>";
}
?>

<?php 
echo $this->tmpl ? FSF_Helper::PageStylePopupEnd() : FSF_Helper::PageStyleEnd();
?>

<script>
Example #17
0
 function __construct($total, $limitstart, $limit)
 {
     $this->skinstyle = FSF_Settings::get('skin_style');
     parent::__construct($total, $limitstart, $limit);
 }