Пример #1
0
 function displayUnRegistered()
 {
     if (FSS_Settings::get('support_no_admin_for_user_open')) {
         JFactory::getApplication()->redirect("index.php?option=com_fss&view=admin_support");
     }
     $this->_display("unregistered");
 }
Пример #2
0
 function __construct()
 {
     parent::__construct();
     $mainframe = JFactory::getApplication();
     global $option;
     $aparams = FSS_Settings::GetViewSettingsObj('kb');
     $this->_enable_prod_pages = $aparams->get('main_prod_pages', 0);
     if ($this->_enable_prod_pages == 1) {
         $limit = $mainframe->getUserStateFromRequest('global.list.limit_prod', 'limit', FSS_Settings::Get('kb_prod_per_page'), 'int');
         $limitstart = FSS_Input::getInt('limitstart');
         // In case limit has been changed, adjust it
         $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
         $this->setState('limit_prod', $limit);
         $this->setState('limitstart', $limitstart);
     }
     $this->_enable_art_pages = $aparams->get('cat_art_pages', 0);
     if ($this->_enable_art_pages == 1) {
         $limit = $mainframe->getUserStateFromRequest('global.list.limit_art', 'limit', FSS_Settings::Get('kb_art_per_page'), 'int');
         $limitstart = FSS_Input::getInt('limitstart');
         // In case limit has been changed, adjust it
         $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
         $this->setState('limit_art', $limit);
         $this->setState('limitstart', $limitstart);
     }
     //$aparams = new stdClass();
 }
Пример #3
0
 public function onContentPrepare($context, &$row, &$params, $page = 0)
 {
     if (is_object($row)) {
         if (property_exists($row, "id")) {
             $context .= "." . $row->id;
         }
     } else {
         if (is_array($row)) {
             if (array_key_exists("id", $row)) {
                 $context .= "." . $row['id'];
             }
         }
     }
     FSS_Glossary::$context = $context;
     $ignore = FSS_Settings::Get('glossary_ignore');
     $option = FSS_Input::getCmd('option');
     if (trim($ignore) != "") {
         $ignore = explode("\n", $ignore);
         foreach ($ignore as $ign) {
             $ign = trim($ign);
             if ($ign == "") {
                 continue;
             }
             if (stripos($context, $ign) !== FALSE) {
                 return true;
             }
             if ($option) {
                 if (stripos($option, $ign) !== FALSE) {
                     return true;
                 }
             }
         }
     }
     // skip plugin on freestyle components
     if (strpos($context, "_fss") > 0) {
         return true;
     }
     // Don't run this plugin when the content is being indexed
     if (strpos($context, 'finder.indexer') > 0) {
         return true;
     }
     if (is_object($row)) {
         if (!empty($row->noglossary)) {
             // skip glossary plugin on fss content
             return true;
         }
         //$row->text .= "\n\n\n<div style='display:none;' id='fss_glossary_context'>$context</div>\n\n\n";
         return $this->_glossary($row->text, $params);
     } else {
         if (is_array($row)) {
             //$row['text'] .= "\n\n\n<div style='display:none;' id='fss_glossary_context'>$context</div>\n\n\n";
             return $this->_glossary($row['text'], $params);
         }
     }
     //$row .= "<div style='display:none;' id='fss_glossary_context'>$context</div>";
     return $this->_glossary($row, $params);
 }
Пример #4
0
 function resend_password()
 {
     $this->loadTicket();
     FSS_Settings::set('support_email_on_create', 1);
     FSS_EMail::User_Create_Unreg($this->ticket, $this->ticket->title, JText::_('RESENDING_TICKET_PASSWORD'));
     $link = FSSRoute::_("index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=" . $this->ticket->id, false);
     JFactory::getApplication()->redirect($link, JText::_("PASSWORD_FOR_TICKET_HAS_BEEN_RESENT_TO_THE_USER"));
     return false;
 }
Пример #5
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("\nvar fss_settings_url = '" . JRoute::_('index.php?option=com_fss&view=settings', false) . "';\n");
     $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/settings.js');
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSSRoute::_('index.php?option=com_fss&view=fsss', false);
         $mainframe->redirect($link);
         return;
     }
     $settings = FSS_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;
             }
             $qry = "REPLACE INTO #__fss_settings_view (setting, value) VALUES ('";
             $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
             $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
             $db->setQuery($qry);
             $db->Query();
         }
         $link = 'index.php?option=com_fss&view=settingsview#' . $this->tab;
         if (JRequest::getVar('task') == "save") {
             $link = 'index.php?option=com_fss';
         }
         $mainframe = JFactory::getApplication();
         $mainframe->redirect($link, JText::_("View_Settings_Saved"));
         exit;
     } else {
         $document = JFactory::getDocument();
         $document->addStyleSheet(JURI::root() . 'administrator/components/com_fss/assets/css/js_color_picker_v2.css');
         $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/color_functions.js');
         $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/js_color_picker_v2.js');
         $this->settings = $settings;
         JToolBarHelper::title(JText::_("FREESTYLE_SUPPORT_PORTAL") . ' - ' . JText::_("VIEW_SETTINGS"), 'fss_viewsettings');
         JToolBarHelper::apply();
         JToolBarHelper::save();
         JToolBarHelper::cancel('cancellist');
         FSSAdminHelper::DoSubToolbar();
         parent::display($tpl);
     }
 }
Пример #6
0
 function __construct()
 {
     parent::__construct();
     $mainframe = JFactory::getApplication();
     global $option;
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', FSS_Settings::Get('announce_per_page'), 'int');
     $limitstart = FSS_Input::getInt('limitstart', 0);
     // In case limit has been changed, adjust it
     $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
     $this->setState('limit', $limit);
     $this->setState('limitstart', $limitstart);
 }
Пример #7
0
 function SaveLog()
 {
     $db = JFactory::getDBO();
     $class = get_class($this);
     $class = str_ireplace("FSSCron", "", $class);
     $now = FSS_Helper::CurDate();
     $qry = "INSERT INTO #__fss_cron_log (cron, `when`, log) VALUES ('" . FSSJ3Helper::getEscaped($db, $class) . "', '{$now}', '" . FSSJ3Helper::getEscaped($db, $this->_log) . "')";
     $db->SetQuery($qry);
     $db->Query();
     //echo $qry."<br>";
     $qry = "DELETE FROM #__fss_cron_log WHERE `when` < DATE_SUB('{$now}', INTERVAL " . (int) FSS_Settings::get('support_cronlog_keep') . " DAY)";
     $db->SetQuery($qry);
     $db->Query();
 }
Пример #8
0
 function display($tpl = null)
 {
     $fileid = FSS_Input::getInt('fileid');
     $key = FSS_Input::getCmd('key');
     $decoded = FSS_Helper::decrypt(FSS_Helper::base64url_decode($key), FSS_Helper::getEncKey("file"));
     if ($fileid != $decoded) {
         exit;
     }
     $db = JFactory::getDBO();
     $sql = "SELECT * FROM #__fss_ticket_attach WHERE id = " . $fileid;
     $db->setQuery($sql);
     $attach = $db->loadObject();
     $image = in_array(strtolower(pathinfo($attach->filename, PATHINFO_EXTENSION)), array('jpg', 'jpeg', 'png', 'gif'));
     $image_file = JPATH_SITE . DS . FSS_Settings::get('attach_location') . DS . "support" . DS . $attach->diskfile;
     require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'files.php';
     FSS_File_Helper::OutputImage($image_file, pathinfo($attach->filename, PATHINFO_EXTENSION));
 }
Пример #9
0
 function __construct($parent)
 {
     $this->comments = $parent;
     $this->comments->use_comments = FSS_Settings::get('announce_comments_allow');
     $this->comments->opt_display = 1;
     $this->short_thanks = 1;
     $this->email_title = "An Announcement comment";
     $this->email_article_type = JText::_('ANNOUNCEMENT');
     $this->description = JText::_('ANNOUNCEMENT');
     $this->descriptions = JText::_('ANNOUNCEMENTS');
     $this->long_desc = JText::_('COMMENTS_ANNOUNCEMENTS');
     $this->article_link = "index.php?option=com_fss&view=announce&announceid={id}";
     $this->table = "#__fss_announce";
     $this->has_published = 1;
     $this->field_title = "title";
     $this->field_id = "id";
 }
Пример #10
0
 function __construct($parent)
 {
     $this->comments = $parent;
     $this->comments->use_comments = FSS_Settings::get('kb_comments');
     $this->comments->opt_display = 1;
     $this->short_thanks = 1;
     $this->email_title = "A Knowledge Base Article comment";
     $this->email_article_type = JText::_('Article');
     $this->description = JText::_('KNOWLEDGE_BASE_ARTICLE');
     $this->descriptions = JText::_('KNOWLEDGE_BASE');
     $this->long_desc = JText::_('COMMENTS_KNOWLEDGE_BASE_ARTICLE');
     $this->article_link = "index.php?option=com_fss&view=kb&kbartid={id}";
     $this->table = "#__fss_kb_art";
     $this->has_published = 1;
     $this->field_title = "title";
     $this->field_id = "id";
 }
Пример #11
0
 function __construct()
 {
     parent::__construct();
     $mainframe = JFactory::getApplication();
     global $option;
     // Get pagination request variables
     $aparams = FSS_Settings::GetViewSettingsObj('faqs');
     $this->_enable_pages = $aparams->get('enable_pages', 1);
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', FSS_Settings::Get('faq_per_page'), 'int');
     if ($this->_enable_pages == 0) {
         $limit = 999999;
     }
     $limitstart = FSS_Input::getInt('limitstart', 0);
     // 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 = FSS_Input::getInt('catid', '');
     $this->_search = FSS_Input::getString('search', '');
     $this->_catlist = $this->_getCatList();
     if ($this->_search != "") {
         $this->_curcattitle = JText::_("SEARCH_RESULTS");
         $this->_curcatid = -1;
         $this->_curcatimage = "/components/com_fss/assets/images/search.png";
     } else {
         if ($this->_curcatid == "0") {
             $this->_curcattitle = JText::_("ALL_FAQS");
             $this->_curcatimage = "/components/com_fss/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'];
                 }
             }
         }
     }
 }
Пример #12
0
 function ValidateCaptcha($setting = 'captcha_type', $direct = '')
 {
     $usecaptcha = FSS_Settings::get($setting);
     if ($direct != "") {
         $usecaptcha = $direct;
     }
     if ($usecaptcha == "") {
         return true;
     }
     if ($usecaptcha == "fsj") {
         if ($_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'])) {
             return true;
         }
         return false;
     }
     if ($usecaptcha == "recaptcha") {
         if (!class_exists("ReCaptcha\\ReCaptcha")) {
             require JPATH_ROOT . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'third' . DS . 'ReCaptcha' . DS . 'ReCaptcha.php';
             require JPATH_ROOT . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'third' . DS . 'ReCaptcha' . DS . 'RequestMethod.php';
             require JPATH_ROOT . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'third' . DS . 'ReCaptcha' . DS . 'RequestParameters.php';
             require JPATH_ROOT . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'third' . DS . 'ReCaptcha' . DS . 'Response.php';
             require JPATH_ROOT . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'third' . DS . 'ReCaptcha' . DS . 'RequestMethod' . DS . 'Post.php';
         }
         $secret = FSS_Settings::get('recaptcha_private');
         if (!$secret) {
             $secret = "12345";
         }
         $recaptcha = new \ReCaptcha\ReCaptcha($secret);
         $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
         if ($resp->isSuccess()) {
             return true;
         } else {
             return false;
         }
     }
     return true;
 }
Пример #13
0
 function Admin_ForwardHandler($ticket, $params)
 {
     $handler_msg = $params['handler_message'];
     $user_msg = $params['user_message'];
     if (FSS_Settings::Get('support_email_send_empty_handler')) {
         if (!$user_msg) {
             $user_msg = JText::_("THIS_TICKET_HAS_BEEN_FORWARDED_TO_ANOTHER_HANDLER");
         }
         // translation message missing, provide english version just in case
         if (!$user_msg || $user_msg == "THIS_TICKET_HAS_BEEN_FORWARDED_TO_ANOTHER_HANDLER") {
             $user_msg = 'This ticket has been forwarded to another handler';
         }
     }
     if ($handler_msg) {
         FSS_EMail::Admin_Forward($ticket, $params['subject'], $handler_msg, $params['files']);
     } else {
         if ($user_msg) {
             FSS_EMail::Admin_Forward($ticket, $params['subject'], $user_msg, $params['files']);
         }
     }
     if ($user_msg) {
         FSS_EMail::Admin_Reply($ticket, $params['subject'], $user_msg, $params['files']);
     }
 }
Пример #14
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("\nvar fss_settings_url = '" . JRoute::_('index.php?option=com_fss&view=settings', false) . "';\n");
     $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/settings.js');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSSRoute::_('index.php?option=com_fss&view=fsss', false);
         $mainframe->redirect($link);
         return;
     }
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     $settings = FSS_Settings::GetAllSettings();
     $db = JFactory::getDBO();
     if ($what == "testref") {
         return $this->TestRef();
     } else {
         if ($what == "save") {
             $large = FSS_Settings::GetLargeList();
             $templates = FSS_Settings::GetTemplateList();
             $intpltable = FSS_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 #__fss_templates (template, tpltype, value) VALUES ('custom', 1, '" . FSSJ3Helper::getEscaped($db, $head) . "')";
             $db->setQuery($qry);
             $db->Query();
             $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('custom', 0, '" . FSSJ3Helper::getEscaped($db, $row) . "')";
             $db->setQuery($qry);
             $db->Query();
             unset($_POST['support_list_head']);
             unset($_POST['support_list_row']);
             $head = JRequest::getVar('support_user_head', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $row = JRequest::getVar('support_user_row', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('usercustom', 1, '" . FSSJ3Helper::getEscaped($db, $head) . "')";
             $db->setQuery($qry);
             $db->Query();
             $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('usercustom', 0, '" . FSSJ3Helper::getEscaped($db, $row) . "')";
             $db->setQuery($qry);
             $db->Query();
             unset($_POST['support_user_head']);
             unset($_POST['support_user_row']);
             // save templates
             $intpltable = FSS_Settings::StoreInTemplateTable();
             foreach ($intpltable as $template) {
                 $value = JRequest::getVar($template, '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('" . FSSJ3Helper::getEscaped($db, $template) . "', 2, '" . FSSJ3Helper::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 #__fss_settings_big (setting, value) VALUES ('";
                 $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
                 //echo $qry."<br>";
                 $db->setQuery($qry);
                 $db->Query();
                 $qry = "DELETE FROM #__fss_settings WHERE setting = '" . FSSJ3Helper::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 #__fss_settings (setting, value) VALUES ('";
                 $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
                 $db->setQuery($qry);
                 $db->Query();
                 //echo $qry."<br>";
             }
             //exit;
             $link = 'index.php?option=com_fss&view=templates#' . $this->tab;
             if (JRequest::getVar('task') == "save") {
                 $link = 'index.php?option=com_fss';
             }
             $mainframe = JFactory::getApplication();
             $mainframe->redirect($link, JText::_("Settings_Saved"));
             exit;
         } else {
             if ($what == "customtemplate") {
                 $this->CustomTemplate();
                 exit;
             } else {
                 // load other templates
                 $intpltable = FSS_Settings::StoreInTemplateTable();
                 $tpls = array();
                 foreach ($intpltable as $template) {
                     $settings[$template] = '';
                     $settings[$template . '_default'] = '';
                     $tpls[] = FSSJ3Helper::getEscaped($db, $template);
                 }
                 $tpllist = "'" . implode("', '", $tpls) . "'";
                 $qry = "SELECT * FROM #__fss_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 #__fss_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 #__fss_templates WHERE template = 'usercustom'";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         if ($row['tpltype'] == 1) {
                             $settings['support_user_head'] = $row['value'];
                         } else {
                             if ($row['tpltype'] == 0) {
                                 $settings['support_user_row'] = $row['value'];
                             }
                         }
                     }
                 } else {
                     $settings['support_user_head'] = '';
                     $settings['support_user_row'] = '';
                 }
                 $qry = "SELECT * FROM #__fss_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_fss/assets/css/js_color_picker_v2.css');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/color_functions.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/js_color_picker_v2.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/codemirror.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/css/css.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/javascript/javascript.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/xml/xml.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/htmlmixed/htmlmixed.js');
                 $document->addStyleSheet(JURI::root() . 'administrator/components/com_fss/assets/css/codemirror/codemirror.css');
                 $this->settings = $settings;
                 JToolBarHelper::title(JText::_("FREESTYLE_SUPPORT_PORTAL") . ' - ' . JText::_("TEMPLATES"), 'fss_templates');
                 JToolBarHelper::apply();
                 JToolBarHelper::save();
                 JToolBarHelper::cancel('cancellist');
                 FSSAdminHelper::DoSubToolbar();
                 parent::display($tpl);
             }
         }
     }
 }
Пример #15
0
" style='cursor: pointer;'>
			<a href="<?php 
echo FSSRoute::_('index.php?option=com_fss&view=faq&faqid=' . $faq['id']);
?>
" onclick='return false;'><?php 
echo $faq['question'];
?>
</a>
		</h5>
				
		<div class="collapse" id="faq_<?php 
echo $cat['id'] . "_" . $faq['id'];
?>
">
			<?php 
if (FSS_Settings::get('glossary_faqs')) {
    echo FSS_Glossary::ReplaceGlossary($faq['answer']);
    if ($faq['fullanswer']) {
        echo FSS_Glossary::ReplaceGlossary($faq['fullanswer']);
    }
} else {
    echo $faq['answer'];
    if ($faq['fullanswer']) {
        echo $faq['fullanswer'];
    }
}
?>
					
			<?php 
if (array_key_exists($faq['id'], $this->tags)) {
    ?>
Пример #16
0
 static function getAttachFormatRegex()
 {
     if (substr(FSS_Input::GetCmd('view'), 0, 5) == "admin") {
         $formats = trim(FSS_Settings::get('support_attach_types_admins'));
     } else {
         $formats = trim(FSS_Settings::get('support_attach_types'));
     }
     if (substr($formats, 0, 1) == "/") {
         return $formats;
     }
     $parsed = array();
     if ($formats != "") {
         $formats = explode(",", $formats);
         foreach ($formats as $fm) {
             $fm = trim($fm);
             if (!$fm) {
                 continue;
             }
             $parsed[] = $fm;
         }
     }
     if (count($parsed) > 0) {
         return "/.(" . implode("|", $parsed) . ")\$/i";
     }
     return "null";
 }
Пример #17
0
 static function Footer()
 {
     FSS_Glossary::GetGlossary();
     if (count(FSS_Glossary::$glossary) == 0) {
         return "";
     }
     $tail = "<div id='glossary_words' style='display:none;'>";
     $temp = "";
     $count = 0;
     foreach (FSS_Glossary::$glossary as $data) {
         if (empty($data->inuse) || !$data->inuse) {
             continue;
         }
         //if (!empty($data->is_clone) && $data->is_clone)
         //	continue;
         $count++;
         $footer = "";
         if ($data->longdesc && FSS_Settings::get('glossary_show_read_more')) {
             $footer = "<p class='right fss_glossary_read_more' style='text-align: right'>" . JText::_(FSS_Settings::get('glossary_read_more_text')) . "</p>";
         }
         if (FSS_Settings::get('glossary_title')) {
             $tail .= "<div id='glossary_" . $data->ref . "'><h4>" . $data->linkword . "</h4><div class='fsj_gt_inner'>" . $data->description . " {$footer}</div></div>";
         } else {
             $tail .= "<div id='glossary_" . $data->ref . "'><div class='fsj_gt_inner'>" . $data->description . " {$footer}</div></div>";
         }
     }
     $tail .= "</div>";
     if (!$count) {
         return "";
     }
     return $tail;
 }
Пример #18
0
 static function forUser(&$parser, $ticket, $custom_fields = null)
 {
     $parser->Clear();
     if ($ticket) {
         // overwrite status of ticket when combined
         $statuss = SupportHelper::getStatuss(false);
         FSS_Translate_Helper::Tr($statuss);
         $cur_status = $statuss[$ticket->ticket_status_id];
         if ($cur_status->combine_with > 0) {
             $new_status = $statuss[$cur_status->combine_with];
             $ticket->color = $new_status->color;
             $ticket->status = $new_status->title;
             if ($new_status->userdisp) {
                 $ticket->status = $new_status->userdisp;
             }
             $ticket->ticket_status_id = $new_status->id;
         } else {
             if ($cur_status->userdisp) {
                 $ticket->status = $cur_status->userdisp;
             }
         }
     }
     self::core($parser, $ticket, $custom_fields);
     if ($ticket) {
         // TODO TODO TODO :
         //$title = $ticket->getTitle();
         $title = self::parseTitle($ticket->title, $ticket->id);
         //$title = $ticket->title;
         $parser->SetVar('link', FSSRoute::_('index.php?option=com_fss&view=ticket&layout=view&ticketid=' . $ticket->id));
         $parser->SetVar('subject', "<a href='" . FSSRoute::_('index.php?option=com_fss&view=ticket&layout=view&ticketid=' . $ticket->id) . "'>" . $title . "</a>");
         $parser->SetVar('subject_text', $title);
         $style = "";
         //$trhl = " onmouseover='highlightticket({$ticket->id})' onmouseout='unhighlightticket({$ticket->id})' ";
         $trhl = " ";
         // no longer highlighting tickets!
         if (FSS_Settings::get('support_entire_row')) {
             $style .= "cursor: pointer;";
             $trhl .= " onclick='window.location=\"" . FSSRoute::_('index.php?option=com_fss&view=ticket&layout=view&ticketid=' . $ticket->id) . "\"' ";
         }
         $trhl .= " style='{$style}' ";
         $parser->SetVar('trhl', $trhl);
         $parser->SetVar('class', static::$rowclass . " ticket_{$ticket->id}");
         if (static::$rowclass == "odd") {
             static::$rowclass = "even";
         } else {
             static::$rowclass = "odd";
         }
     }
     $parser->SetVar("hidehandler", FSS_Settings::get('support_hide_handler') > 0);
     $parser->SetVar("multiuser", $parser->multiuser);
 }
Пример #19
0
if (FSS_Settings::Get('support_sceditor')) {
    ?>
		jQuery('#' + id).sceditor('instance').insert(bbcode);	
	<?php 
} else {
    ?>
		jQuery('#' + id).val(jQuery('#' + id).val() + bbcode);
	<?php 
}
?>
}

function insertLink(url, title, id)
{
	<?php 
if (FSS_Settings::Get('support_sceditor')) {
    ?>
		var bbcode = "[url=" + url + "]" + title + "[/url]";
		jQuery('#' + id).sceditor('instance').insert(bbcode);
	<?php 
} else {
    ?>
		jQuery('#' + id).val(jQuery('#' + id).val() + url);
	<?php 
}
?>
	fss_modal_hide();
}

function cannedRefresh()
{
_cont faq_<?php 
echo $faq['id'];
?>
_cont"">
	<div class="pull-right">
		<?php 
echo $this->content->EditPanel($faq);
?>
	</div>
	<div class="media-body">
		<h5 class="media-heading">
			<a href='<?php 
echo FSSRoute::_('index.php?option=com_fss&view=faq&tmpl=component&window=1&faqid=' . $faq['id']);
?>
' 
					onclick="window.open(jQuery(this).attr('href'),'','width=<?php 
echo FSS_Settings::get('faq_popup_width');
?>
,height=<?php 
echo FSS_Settings::get('faq_popup_height');
?>
');return false;"
					>
				<?php 
echo $faq['question'];
?>
			</a>
		</h5>		
	</div>
</div>	
?>
<div class="media faq_faq faq_<?php 
echo $cat['id'] . "_" . $faq['id'];
?>
_cont faq_<?php 
echo $faq['id'];
?>
_cont"">
	<div class="pull-right">
		<?php 
echo $this->content->EditPanel($faq);
?>
	</div>
	<div class="media-body">
		<h5 class="media-heading">
			<a class="show_modal_iframe" href='<?php 
echo FSSRoute::_('index.php?option=com_fss&view=faq&tmpl=component&faqid=' . $faq['id']);
?>
' data_modal_width="<?php 
echo FSS_Settings::get('faq_popup_width');
?>
">
				<?php 
echo $faq['question'];
?>
			</a>
		</h5>
			
	</div>
</div>	
Пример #22
0
		var textareawidth = jQuery('#message_' + edit_id).parent().width();
		var textareaheight = jQuery('#message_' + edit_id).parent().height();
		
		if (!edit_time)
		{
		
			edit_orig_title = jQuery('#subject_' + edit_id).text();
		
			var html = "<span class='input-append'>";
			html += "<input type='text' class='input-xlarge' name='input_title_" + edit_id + "' id='input_title_" + edit_id + "'>";
			html += "<button onclick='SaveEdit();' class='fssTip btn btn-success' title='Save Changes'><i class='icon-save'></i> Save</button>";
			html += "<button onclick='CancelEdit();' class='fssTip btn btn-danger' title='Cancel Edit'><i class='icon-cancel'></i> Cancel</button>";
			html += "</span>";

			<?php 
if (FSS_Settings::get('allow_edit_no_audit')) {
    ?>
			html += "<span style='font-size: 85%;font-weight: normal;position: absolute;'>";
			html += "<input type='checkbox' name='no_audit' id='no_audit' style='margin-left: 6px;margin-top: 0px;' /> <?php 
    echo JText::_('NO_LOG');
    ?>
</span>";
			<?php 
}
?>

			html += "<button onclick='DeleteMessage();' class='fssTip btn btn-warning pull-right' title='Delete Message' style='margin-right: 4px;'><i class='icon-delete'></i></button>";
				
			jQuery('#subject_' + edit_id).html(html);
		
			jQuery('#subject_' + edit_id + ' .fssTip').fss_tooltip();
Пример #23
0
        ?>
	<div class="center margin-small">
			<a class="btn btn-default" href="<?php 
        echo FSSRoute::_('index.php?option=com_fss&view=ticket&layout=open');
        ?>
"><?php 
        echo JText::_('OPEN_NEW_TICKET');
        ?>
</a>
		</div>
	<?php 
    }
    ?>

	<?php 
    if (($params->get('tickets_open_ticket_reg') || $params->get('tickets_open_ticket_unreg')) && !FSS_Settings::get('support_no_admin_for_user_open')) {
        ?>
		<div>
			<?php 
        echo JText::_("CREATE_TICKET_FOR");
        ?>
:
		</div>

		<div>
			<?php 
        if ($params->get('tickets_open_ticket_reg')) {
            ?>
				<a class="btn btn-default btn-small margin-small" href="<?php 
            echo FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=new&type=registered');
            ?>
Пример #24
0
    /**
     * Gets an array of the default BBCodes
     * @return array
     */
    public static function default_bbcodes()
    {
        return array(new BBCode('b', '<strong>%content%</strong>'), new BBCode('i', '<em>%content%</em>'), new BBCode('strong', '<strong>%content%</strong>'), new BBCode('em', '<em>%content%</em>'), new BBCode('u', '<span style="text-decoration: underline">%content%</span>'), new BBCode('s', '<span style="text-decoration: line-through">%content%</span>'), new BBCode('blink', '<span style="text-decoration: blink">%content%</span>'), new BBCode('sub', '<sub>%content%</sub>'), new BBCode('sup', '<sup>%content%</sup>'), new BBCode('ins', '<ins>%content%</ins>'), new BBCode('del', '<del>%content%</del>'), new BBCode('ltr', '%content%'), new BBCode('right', '<div style="text-align: right">%content%</div>', BBCode::BLOCK_TAG), new BBCode('left', '<div style="text-align: left">%content%</div>', BBCode::BLOCK_TAG), new BBCode('center', '<div style="text-align: center">%content%</div>', BBCode::BLOCK_TAG), new BBCode('justify', '<div style="text-align: justify">%content%</div>', BBCode::BLOCK_TAG), new BBCode('note', ''), new BBCode('hidden', ''), new BBCode('abbr', function ($content, $attribs) {
            return '<abbr title="' . $attribs['default'] . '">' . $content . '</abbr>';
        }), new BBCode('acronym', function ($content, $attribs) {
            return '<acronym title="' . $attribs['default'] . '">' . $content . '</acronym>';
        }), new BBCode('icq', '<a href="http://www.icq.com/people/about_me.php?uin=%content%">
				<img  src="http://status.icq.com/online.gif?icq=%content%&amp;img=5"> %content%</a>', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('skype', '<a href="skype:jovisa737590?call">
				<img src="http://mystatus.skype.com/bigclassic/%content%" style="border: none;" width="182"
				height="44" alt="My status" /></a>', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('bing', '<a href="http://www.bing.com/search?q=%content%">%content%</a>', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('google', '<a href="http://www.google.com/search?q=%content%">%content%</a>', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('wikipedia', '<a href="http://www.wikipedia.org/wiki/%content%">%content%</a>', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('youtube', function ($content, $attribs) {
            if (substr($content, 0, 23) === 'http://www.youtube.com/') {
                $uri = $content;
            } else {
                $uri = 'http://www.youtube.com/v/' . $content;
            }
            return '<iframe width="480" height="390" src="' . $uri . '" frameborder="0"></iframe>';
        }, BBCode::BLOCK_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('vimeo', function ($content, $attribs) {
            if (substr($content, 0, 24) === 'http://player.vimeo.com/') {
                $uri = $content;
            } else {
                if (substr($content, 0, 17) === 'http://vimeo.com/' || substr($content, 0, 21) === 'http://www.vimeo.com/' && preg_match("/http:\\/\\/(?:www\\.)?vimeo\\.com\\/([0-9]{4,10})/", $content, $matches)) {
                    preg_match("/http:\\/\\/(?:www\\.)?vimeo\\.com\\/([0-9]{4,10})/", $content, $matches);
                    $uri = 'http://player.vimeo.com/video/' . $matches[1] . '?title=0&amp;byline=0&amp;portrait=0';
                } else {
                    $uri = 'http://player.vimeo.com/video/' . $content . '?title=0&amp;byline=0&amp;portrait=0';
                }
            }
            return '<iframe src="' . $uri . '" width="400" height="225" frameborder="0"></iframe>';
        }, BBCode::BLOCK_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('flash', function ($content, $attribs) {
            $width = 640;
            $height = 385;
            if (substr($content, 0, 4) !== 'http') {
                $content = $node->root()->get_base_uri() . $content;
            }
            if (isset($attribs['width']) && is_numeric($attribs['width'])) {
                $width = $attribs['width'];
            }
            if (isset($attribs['height']) && is_numeric($attribs['height'])) {
                $height = $attribs['height'];
            }
            // for [flash=200,100] format
            if (!empty($attribs['default'])) {
                list($w, $h) = explode(',', $attribs['default']);
                if ($w > 20 && is_numeric($w)) {
                    $width = $w;
                }
                if ($h > 20 && is_numeric($h)) {
                    $height = $h;
                }
            }
            return '<object width="' . $width . '" height="' . $height . '">
						<param name="movie" value="' . $content . '"></param>
						<embed src="' . $content . '"
							type="application/x-shockwave-flash"
							width="' . $width . '" height="' . $height . '">
						</embed>
					</object>';
        }, BBCode::BLOCK_TAG), new BBCode('paypal', function ($content, $attribs) {
            $content = urlencode($content);
            return '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=' . $content . '&lc=US&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest">
				<img src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"/></a>';
        }, BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('pastebin', function ($content, $attribs) {
            if (!preg_match("/^[a-zA-Z0-9]\$/", $content)) {
                preg_match("#http://pastebin.com/([a-zA-Z0-9]+)#", $content, $matches);
                $content = '';
                if (isset($matches[1])) {
                    $content = $matches[1];
                }
            }
            return '<script src="http://pastebin.com/embed_js.php?i=' . $content . '"></script>';
        }, BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('gist', function ($content, $attribs) {
            if ($content != (string) intval($content)) {
                preg_match("#https://gist.github.com/([0-9]+)#", $content, $matches);
                $content = '';
                if (isset($matches[1])) {
                    $content = $matches[1];
                }
            } else {
                $content = intval($content);
            }
            return '<script src="http://gist.github.com/' . $content . '.js"></script>';
        }, BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('twitter', '<a href="https://twitter.com/%content%"
				class="twitter-follow-button" data-show-count="false">Follow @%content%</a>
				<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('tweets', "<script src=\"http://widgets.twimg.com/j/2/widget.js\"></script>\n\t\t\t\t<script>\n\t\t\t\tnew TWTR.Widget({\n\t\t\t\t\tversion: 2,\n\t\t\t\t\ttype: 'profile',\n\t\t\t\t\trpp: 3,\n\t\t\t\t\tinterval: 6000,\n\t\t\t\t\twidth: 400,\n\t\t\t\t\theight: 150,\n\t\t\t\t\ttheme: {\n\t\t\t\t\t\tshell: {\n\t\t\t\t\t\t\tbackground: '#333333',\n\t\t\t\t\t\t\tcolor: '#ffffff'\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttweets: {\n\t\t\t\t\t\t\tbackground: '#000000',\n\t\t\t\t\t\t\tcolor: '#ffffff',\n\t\t\t\t\t\t\tlinks: '#4aed05'\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tfeatures: {\n\t\t\t\t\t\tscrollbar: false,\n\t\t\t\t\t\tloop: false,\n\t\t\t\t\t\tlive: false,\n\t\t\t\t\t\thashtags: true,\n\t\t\t\t\t\ttimestamp: true,\n\t\t\t\t\t\tavatars: false,\n\t\t\t\t\t\tbehavior: 'all'\n\t\t\t\t\t}\n\t\t\t\t}).render().setUser('%content%').start();\n\t\t\t\t</script>", BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('googlemaps', '<iframe src="http://maps.google.com/maps?q=%content%&amp;output=embed"
				scrolling="no" width="100%" height="350" frameborder="0"></iframe>', BBCode::BLOCK_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('pdf', '<iframe src="http://docs.google.com/gview?url=%content%&amp;embedded=true"
				width="100%" height="500" frameborder="0"></iframe>', BBCode::BLOCK_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('scribd', function ($content, $attribs) {
            if (!isset($attribs['id']) || !($attribs['id'] = intval($attribs['id'])) > 1) {
                return 'Invalid scribd ID.';
            }
            if (!isset($attribs['key'])) {
                return 'Missing scribd key.';
            }
            return '<iframe src="http://www.scribd.com/embeds/' . $attribs['id'] . '/content?start_page=1&view_mode=list&access_key=' . $attribs['key'] . '"
					data-auto-height="true" data-aspect-ratio="1" scrolling="no" width="100%"
					height="500" frameborder="0"></iframe>
					<script type="text/javascript">(function() {
						var scribd = document.createElement("script");
						scribd.type = "text/javascript";
						scribd.async = true;
						scribd.src = "http://www.scribd.com/javascripts/embed_code/inject.js";
						var s = document.getElementsByTagName("script")[0];
						s.parentNode.insertBefore(scribd, s);
					})();</script>';
        }, BBCode::BLOCK_TAG, true, array(), array(), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('spoiler', '<div class="spoiler" style="margin:5px 15px 15px 15px">
				<div style="margin:0 0 2px 0; font-weight:bold;">Spoiler:
					<input type="button" value="Show"
						onclick="if (this.value == \'Show\')
							{
								this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'block\';
								this.value = \'Hide\';
							} else {
								this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\';
								this.value = \'Show\';
							}" />
				</div>
				<div style="margin:0; padding:6px; border:1px inset;">
					<div style="display: none;">
						%content%
					</div>
				</div>
			</div>'), new BBCode('tt', '<span style="font-family: monospace">%content%</span>'), new BBCode('pre', function ($content, $attribs, $node) {
            $content = '';
            foreach ($node->children() as $child) {
                $content .= $child->get_html(false);
            }
            return "<pre>{$content}</pre>";
        }, BBCode::BLOCK_TAG), new BBCode('code', '<code>%content%</code>', BBCode::BLOCK_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_EMOTICON), new BBCode('php', function ($content, $attribs, $node) {
            ob_start();
            highlight_string($node->get_text());
            $content = ob_get_contents();
            ob_end_clean();
            return "<code class=\"php\">{$content}</code>";
        }, BBCode::BLOCK_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_EMOTICON), new BBCode('quote', function ($content, $attribs, $node) {
            $cite = '';
            if (!empty($attribs['default'])) {
                $cite = "<cite>{$attribs['default']}:</cite>";
            }
            if ($node->find_parent_by_tag('quote') !== null) {
                return "</p><blockquote><p>{$cite}{$content}</p></blockquote><p>";
            }
            return "<blockquote><p>{$cite}{$content}</p></blockquote>";
        }, BBCode::BLOCK_TAG), new BBCode('font', function ($content, $attribs) {
            // Font can have letters, spaces, quotes, - and commas
            if (!isset($attribs['default']) || !preg_match("/^([A-Za-z\\'\",\\- ]+)\$/", $attribs['default'])) {
                $attribs['default'] = 'Arial';
            }
            return '<span style="font-family: ' . $attribs['default'] . '">' . $content . '</span>';
        }), new BBCode('size', function ($content, $attribs) {
            $size = 'xx-small';
            /*
            Font tag sizes 1-7 should be:
            1 = xx-small
            2 = small
            3 = medium
            4 = large
            5 = x-large
            6 = xx-large
            7 = ?? in chrome it's 48px
            */
            if (!isset($attribs['default'])) {
                $size = 'xx-small';
            } else {
                if ($attribs['default'] == 1) {
                    $size = 'x-small';
                } else {
                    if ($attribs['default'] == 2) {
                        $size = 'small';
                    } else {
                        if ($attribs['default'] == 3) {
                            $size = 'medium';
                        } else {
                            if ($attribs['default'] == 4) {
                                $size = 'large';
                            } else {
                                if ($attribs['default'] == 5) {
                                    $size = 'x-large';
                                } else {
                                    if ($attribs['default'] == 6) {
                                        $size = 'xx-large';
                                    } else {
                                        if ($attribs['default'] == 7) {
                                            $size = '48px';
                                        } else {
                                            if ($attribs['default'][strlen($attribs['default']) - 1] === '%' && is_numeric(substr($attribs['default'], 0, -1))) {
                                                $size = $attribs['default'];
                                            } else {
                                                if (!is_numeric($attribs['default'])) {
                                                    $attribs['default'] = 13;
                                                }
                                                if ($attribs['default'] < 6) {
                                                    $attribs['default'] = 6;
                                                }
                                                if ($attribs['default'] > 48) {
                                                    $attribs['default'] = 48;
                                                }
                                                $size = $attribs['default'] . 'px';
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return '<span style="font-size: ' . $size . '">' . $content . '</span>';
        }), new BBCode('color', function ($content, $attribs) {
            // colour must be either a hex #xxx/#xxxxxx or a word with no spaces red/blue/ect.
            if (!isset($attribs['default']) || !preg_match("/^(#[a-fA-F0-9]{3,6}|[A-Za-z]+)\$/", $attribs['default'])) {
                $attribs['default'] = '#000';
            }
            return '<span style="color: ' . $attribs['default'] . '">' . $content . '</span>';
        }), new BBCode('list', function ($content, $attribs) {
            $style = 'circle';
            $type = 'ul';
            switch ($attribs['default']) {
                case 'd':
                    $style = 'disc';
                    $type = 'ul';
                    break;
                case 's':
                    $style = 'square';
                    $type = 'ul';
                    break;
                case '1':
                    $style = 'decimal';
                    $type = 'ol';
                    break;
                case 'a':
                    $style = 'lower-alpha';
                    $type = 'ol';
                    break;
                case 'A':
                    $style = 'upper-alpha';
                    $type = 'ol';
                    break;
                case 'i':
                    $style = 'lower-roman';
                    $type = 'ol';
                    break;
                case 'I':
                    $style = 'upper-roman';
                    $type = 'ol';
                    break;
            }
            return "<{$type} style=\"list-style: {$style}\">{$content}</{$type}>";
        }, BBCode::BLOCK_TAG, false, array(), array('*', 'li', 'ul', 'li', 'ol', 'list')), new BBCode('ul', '<ul>%content%</ul>', BBCode::BLOCK_TAG), new BBCode('ol', '<ol>%content%</ol>', BBCode::BLOCK_TAG), new BBCode('li', '<li>%content%</li>'), new BBCode('*', '<li>%content%</li>', BBCode::BLOCK_TAG, false, array('*', 'li', 'ul', 'li', 'ol', '/list')), new BBCode('table', '<table>%content%</table>', BBCode::BLOCK_TAG, false, array(), array('table', 'th', 'h', 'tr', 'row', 'r', 'td', 'col', 'c')), new BBCode('th', '<th>%content%</th>'), new BBCode('h', '<th>%content%</th>'), new BBCode('tr', '<tr>%content%</tr>', BBCode::BLOCK_TAG, false, array(), array('table', 'th', 'h', 'tr', 'row', 'r', 'td', 'col', 'c')), new BBCode('row', '<tr>%content%</tr>', BBCode::BLOCK_TAG, false, array(), array('table', 'th', 'h', 'tr', 'row', 'r', 'td', 'col', 'c')), new BBCode('r', '<tr>%content%</tr>', BBCode::BLOCK_TAG, false, array(), array('table', 'th', 'h', 'tr', 'row', 'r', 'td', 'col', 'c')), new BBCode('td', '<td>%content%</td>'), new BBCode('col', '<td>%content%</td>'), new BBCode('c', '<td>%content%</td>'), new BBCode('notag', '%content%', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('nobbc', '%content%', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('noparse', '%content%', BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('h1', '<h1>%content%</h1>'), new BBCode('h2', '<h2>%content%</h2>'), new BBCode('h3', '<h3>%content%</h3>'), new BBCode('h4', '<h4>%content%</h4>'), new BBCode('h5', '<h5>%content%</h5>'), new BBCode('h6', '<h6>%content%</h6>'), new BBCode('h7', '<h7>%content%</h7>'), new BBCode('big', '<span style="font-size: large">%content%</span>'), new BBCode('small', '<span style="font-size: x-small">%content%</span>'), new BBCode('br', '<br />', BBCode::INLINE_TAG, true), new BBCode('sp', '&nbsp;', BBCode::INLINE_TAG, true), new BBCode('hr', '<hr />', BBCode::INLINE_TAG, true), new BBCode('quoted', '<div class="quoted_text_cont"><span class="quoted_text_show small muted">' . \JText::_("FSS_SHOW_QUOTED_TEXT") . '</span><div class="quoted_text">%content%</div></div>'), new BBCode('anchor', function ($content, $attribs, $node) {
            if (empty($attribs['default'])) {
                $attribs['default'] = $content;
                // remove the content for [anchor]test[/anchor]
                // usage as test is the anchor
                $content = '';
            }
            $attribs['default'] = preg_replace('/[^a-zA-Z0-9_\\-]+/', '', $attribs['default']);
            return "<a name=\"{$attribs['default']}\">{$content}</a>";
        }), new BBCode('goto', function ($content, $attribs, $node) {
            if (empty($attribs['default'])) {
                $attribs['default'] = $content;
            }
            $attribs['default'] = preg_replace('/[^a-zA-Z0-9_\\-#]+/', '', $attribs['default']);
            return "<a href=\"#{$attribs['default']}\">{$content}</a>";
        }), new BBCode('jumpto', function ($content, $attribs, $node) {
            if (empty($attribs['default'])) {
                $attribs['default'] = $content;
            }
            $attribs['default'] = preg_replace('/[^a-zA-Z0-9_\\-#]+/', '', $attribs['default']);
            return "<a href=\"#{$attribs['default']}\">{$content}</a>";
        }), new BBCode('img', function ($content, $attribs, $node) {
            $attrs = '';
            // for when default attrib is used for width x height
            if (isset($attribs['default']) && preg_match("/[0-9]+[Xx\\*][0-9]+/", $attribs['default'])) {
                list($attribs['width'], $attribs['height']) = explode('x', $attribs['default']);
                $attribs['default'] = '';
            } else {
                if (isset($attribs['default']) && is_numeric($attribs['default'])) {
                    $attribs['width'] = $attribs['height'] = $attribs['default'];
                    $attribs['default'] = '';
                }
            }
            $is_inline = false;
            // add alt tag if is one
            if (isset($attribs['default']) && !empty($attribs['default'])) {
                $attrs .= " alt=\"{$attribs['default']}\"";
            } else {
                if (isset($attribs['alt'])) {
                    $attrs .= " alt=\"{$attribs['alt']}\"";
                } else {
                    if (strtolower(substr($content, 0, 10)) == "data:image") {
                        $is_inline = true;
                    } else {
                        $attrs .= " alt=\"{$content}\"";
                    }
                }
            }
            $attrs .= " class=\"show_modal_image support_image\" ";
            // width and height can only be numeric, anything else should be ignored to prevent XSS
            if (isset($attribs['width']) && is_numeric($attribs['width'])) {
                $attrs .= " width=\"{$attribs['width']}\"";
            }
            if (isset($attribs['height']) && is_numeric($attribs['height'])) {
                $attrs .= " height=\"{$attribs['height']}\"";
            }
            // add http:// to www starting urls
            if (strpos($content, 'www') === 0) {
                $content = 'http://' . $content;
            } else {
                if (substr($content, 0, 4) !== 'http' && substr($content, 0, 3) !== 'ftp' && !$is_inline) {
                    if (substr($content, 0, 1) != "/") {
                        $content = $node->root()->get_base_uri() . $content;
                    }
                }
            }
            return "<img{$attrs} src=\"{$content}\" />";
        }, BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('email', function ($content, $attribs, $node) {
            if (empty($attribs['default'])) {
                $attribs['default'] = $content;
            }
            if ($content) {
                $content = preg_replace('/\\[.*?\\]/', '', $content);
            }
            $attribs['default'] = preg_replace('/\\[.*?\\]/', '', $attribs['default']);
            return "<a href=\"mailto:{$attribs['default']}\">{$content}</a>";
        }, BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL), new BBCode('url', function ($content, $attribs, $node) {
            if (empty($attribs['default'])) {
                $attribs['default'] = $content;
            }
            // add http:// to www starting urls
            if (strpos($attribs['default'], 'www') === 0) {
                $attribs['default'] = 'http://' . $attribs['default'];
            } else {
                if (substr($attribs['default'], 0, 4) !== 'http' && substr($attribs['default'], 0, 3) !== 'ftp') {
                    $attribs['default'] = $node->root()->get_base_uri() . $attribs['default'];
                }
            }
            $target = \FSS_Settings::get('ticket_link_target') ? '_blank' : '';
            return "<a href=\"{$attribs['default']}\" target='{$target}'>{$content}</a>";
        }, BBCode::INLINE_TAG, false, array(), array('text_node'), BBCode::AUTO_DETECT_EXCLUDE_ALL));
    }
Пример #25
0
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die;
?>
<div class="form-horizontal form-condensed">
				
				<div class="control-group  ">
				<label class="control-label">Combo Test</label>
				<div class="controls">
					<select name="custom_8" id="custom_8">
<option value="">Please Select...</option>
<option value="Tree">Tree</option>
<option value="Car">Car</option>
<option value="Shopping">Shopping</option>
<option value="News">News</option>
</select><span class="help-inline"></span>				</div>
			</div>
				
			</div>
			
<textarea name='body' id='body' class='sceditor' rows='<?php 
echo (int) FSS_Settings::get('support_user_reply_height');
?>
' cols='<?php 
echo (int) FSS_Settings::get('support_user_reply_width');
?>
' style='width:95%;height:<?php 
echo (int) (FSS_Settings::get('support_user_reply_height') * 15 + 80);
?>
px'></textarea>
Пример #26
0
    // include JPATH_SITE.DS.'components'.DS.'com_fss'.DS.'tmpl'.DS.'attach.php';
    ?>
	<?php 
}
?>
	
	<input type="hidden" name="ticketid" value="<?php 
echo (int) $this->ticket['id'];
?>
" />
	<button class="btn btn-primary" id='addcomment'><i class="icon-redo"></i> <?php 
echo JText::_("POST_REPLY");
?>
</button>
	<?php 
if (FSS_Settings::get('support_user_can_close') && FSS_Settings::get('support_user_show_close_reply')) {
    ?>
		<input type="hidden" id="should_close" name="should_close" value="" />
		<button class="btn btn-default" id='replyclose'><i class="icon-ban-circle"></i> <?php 
    echo JText::_("REPLY_AND_CLOSE");
    ?>
</button>
	<?php 
}
?>
	<button class="btn btn-default" id='replycancel'><i class="icon-cancel"></i> <?php 
echo JText::_("CANCEL");
?>
</button>
</form>
<iframe name="form_results" id="form_results" style="display: none;"></iframe>
Пример #27
0
        if ($field['adminhide']) {
            continue;
        }
        if ($field['grouping'] != $grouping) {
            if ($open) {
                FSS_Table::TableClose();
            }
            echo FSS_Helper::PageSubTitle($field['grouping']);
            FSS_Table::TableOpen();
            $open = true;
            $grouping = $field['grouping'];
        }
        FSS_Table::ColStart("tr_cf" . $field['id'] . " tr_cf_" . $field['alias']);
        ?>
		<th width='<?php 
        echo FSS_Settings::get('ticket_label_width');
        ?>
'><?php 
        echo FSSCF::FieldHeader($field);
        ?>
</th>
			<td>
			<?php 
        if ($this->can_ChangeTicket() && $this->CanEditField($field) && $this->can_EditFields()) {
            ?>
				<a class='pull-right show_modal_iframe padding-left-small' href="<?php 
            echo FSSRoute::_("&tmpl=component&layout=field&editfield=" . $field['id']);
            ?>
">
					<i class="icon-edit fssTip" title="<?php 
            echo JText::_("EDIT_FIELD");
Пример #28
0
	</table>

	<div id="glyph-test">
		<i class="icon-arrow-up"></i>
	</div>

	<p id="text-col-success" class="text-success">Etiam porta sem malesuada magna mollis euismod.</p>
	<p id="text-col-warning" class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p>

	<form class="form-horizontal">
	</form>

	
</div>

<script>
if (top.location != location) {
	//top.location.href = document.location.href ;
}

<?php 
if (!FSS_Settings::get('hide_warnings')) {
    ?>
	if (top.location == location)
	{
		jQuery('.fss_main').first().prepend("<div class='alert alert-error'><h4>Freestyle Support Portal Error: Frame Breakout issue detected</h4>Your template has a setting enabled that is causing iframes to be redirected to the main window. You will need to disable this for Freestyle Support Portal to work correctly as it uses iframes extensively.</div>");
	}
<?php 
}
?>
</script>
Пример #29
0
        continue;
    }
    if ($counts[$status->id] < 1) {
        continue;
    }
    echo "<li>" . $status->title . ": <b>" . $counts[$status->id] . "</b> - <a href='" . FSSRoute::_('index.php?option=com_fss&view=admin_support&tickets=' . $status->id) . "'>" . JText::_("VIEW_NOW") . "</a></li>";
}
foreach (SupportSource::getOverview_ListItems() as $item) {
    echo "<li>" . $item->name . ": <b>" . $item->count . "</b> - <a href='" . FSSRoute::_($item->link) . "'>" . JText::_("VIEW_NOW") . "</a></li>";
}
?>

</ul>

<?php 
if (!FSS_Settings::get('support_no_admin_for_user_open')) {
    ?>
 
<div class="form-horizontal form-condensed">
	<div class="control-group">
		<label class="control-label"><?php 
    echo JText::_("CREATE_TICKET_FOR");
    ?>
</label>
		<div class="controls">
			<a class="btn btn-default btn-small" href="<?php 
    echo FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=new&type=registered');
    ?>
"><?php 
    echo JText::_("REGISTERED_USER");
    ?>
Пример #30
0
 static function getHandlers($explicit = false, $use_out_of_office = true)
 {
     // HOW! - There has to be a better way that this!
     $key = 0;
     if ($explicit) {
         $key = 1;
     }
     if ($use_out_of_office) {
         $key += 2;
     }
     if (empty(self::$all_handlers)) {
         self::$all_handlers = array();
     }
     if (!array_key_exists($key, self::$all_handlers)) {
         if ($use_out_of_office) {
             $users = self::usersWithPerm("support_admin", "fss.handler", $explicit);
             self::$all_handlers[$key] = array();
             foreach ($users as $user) {
                 if (!empty($user->settings) && !empty($user->settings->out_of_office) && $user->settings->out_of_office) {
                     continue;
                 }
                 self::$all_handlers[$key][] = $user;
             }
         } else {
             self::$all_handlers[$key] = self::usersWithPerm("support_admin", "fss.handler", $explicit);
         }
     }
     if (FSS_Settings::get('support_hide_super_users')) {
         foreach (self::$all_handlers[$key] as $user_id => $user) {
             $user = JFactory::getUser($user->id);
             if ($user->get('isRoot')) {
                 unset(self::$all_handlers[$key][$user_id]);
             }
         }
     }
     return self::$all_handlers[$key];
 }