Пример #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 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();
 }
Пример #3
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";
 }
Пример #4
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";
 }
Пример #5
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));
 }
Пример #6
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;
 }
?>
<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>	
_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>	
Пример #9
0
        }
        ?>
	<?php 
    }
    ?>
	
	<?php 
    FSS_Helper::HelpText("support_user_view_end_details");
    ?>

<?php 
}
?>

<?php 
if (FSS_Settings::get("messages_at_top") == 0 || FSS_Settings::get("messages_at_top") == 2) {
    include $this->snippet(JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'ticket' . DS . 'snippet' . DS . '_messages_cont.php');
}
?>


<?php 
if (count($this->attach) > 0) {
    ?>

	<?php 
    echo FSS_Helper::PageSubTitle("ATTACHEMNTS");
    ?>

	<?php 
    FSS_Helper::HelpText("support_user_view_attach_header");
Пример #10
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');
            ?>
Пример #11
0
 function VerifyDisk()
 {
     $db = JFactory::getDBO();
     $qry = "SELECT * FROM #__fss_ticket_attach";
     $db->setQuery($qry);
     $this->files = $db->loadObjectList("diskfile");
     $count = 0;
     foreach ($this->files as &$file) {
         if (file_exists(JPATH_SITE . DS . FSS_Settings::get('attach_location') . DS . 'support' . DS . $file->diskfile)) {
             $ticket = new SupportTicket();
             $ticket->load($file->ticket_ticket_id);
             $destpath = JPATH_SITE . DS . FSS_Settings::get('attach_location') . DS . 'support' . DS;
             $destname = FSS_File_Helper::makeAttachFilename("support", $file->filename, $file->added, $ticket, $file->user_id);
             if (rename($destpath . $file->diskfile, $destpath . $destname)) {
                 $qry = "UPDATE #__fss_ticket_attach SET diskfile = '" . $db->escape($destname) . "' WHERE id = " . $file->id;
                 $db->setQuery($qry);
                 $db->Query();
                 $count++;
             }
         }
     }
     JFactory::getApplication()->redirect("index.php?option=com_fss&view=attachclean", "{$count} files verified.", "message");
 }
Пример #12
0
<?php 
if (count($this->products) > 0) {
    ?>
	<?php 
    foreach ($this->products as &$product) {
        ?>
		
		<?php 
        if (!array_key_exists("id", $product)) {
            continue;
        }
        ?>
		
		<?php 
        if ($this->comments->GetCountOnly($product['id']) == 0 && FSS_Settings::get('test_hide_empty_prod')) {
            continue;
        }
        ?>
		
		<?php 
        include "components/com_fss/views/test/snippet/_prod.php";
        ?>

	<?php 
    }
}
?>

<?php 
if ($testcount == 0) {
Пример #13
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;
 }
Пример #14
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";
 }
Пример #15
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>
Пример #16
0
**/
defined('_JEXEC') or die;
?>
		
		<div class="control-group">
			<label class="control-label"><?php 
echo JText::_("COMMENT");
?>
</label>
			<div class="controls">
				<?php 
echo SupportCanned::CannedDropdown("body2");
?>
			</div>
		</div>

		<p>
			<textarea style='width:95%;height:<?php 
echo (int) (FSS_Settings::get('support_admin_reply_height') * 15 + 80);
?>
px' name='body2' id='body2' class="sceditor" rows='<?php 
echo (int) FSS_Settings::get('support_admin_reply_height');
?>
' cols='<?php 
echo (int) FSS_Settings::get('support_admin_reply_width');
?>
'></textarea>
		</p>

		<input name="hidefromuser" value="1" type="hidden" />
	
Пример #17
0
<div id="messagereply" style="display: none;">
	<?php 
include $this->snippet(JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'ticket' . DS . 'snippet' . DS . '_reply.php');
?>
</div>

<div id="messagepleasewait" style="display: none;clear: both" class="alert alert-info">
	<?php 
echo JText::_('PLEASE_WAIT');
?>
</div>

<?php 
FSS_Helper::HelpText("support_user_view_mes_buttons");
?>

<div id="ticket_messages">
	<?php 
include $this->snippet(JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'ticket' . DS . 'snippet' . DS . '_messages.php');
?>
</div>

<?php 
FSS_Helper::HelpText("support_user_view_mes_footer");
?>

<?php 
if (FSS_Settings::get('glossary_support')) {
    echo FSS_Glossary::Footer();
}
Пример #18
0
</option>
				<optgroup label="<?php 
    echo JText::_('NEW_STATUS_');
    ?>
">
					<?php 
    $status_list = SupportHelper::getStatuss();
    foreach ($status_list as $status) {
        echo "<option value='{$status->id}' style='color: {$status->color};'>{$status->title}</option>";
    }
    ?>
						
				</optgroup>
					
				<?php 
    if (FSS_Settings::get('support_delete')) {
        ?>
					<optgroup label="<?php 
        echo JText::_('DELETE_TICKET');
        ?>
:">
						<option value='delete' style='color: red;'><?php 
        echo JText::_('DELETE_TICKET');
        ?>
</option>
					</optgroup>
				<?php 
    }
    ?>
			</select>
		</div>
Пример #19
0
 static function _($url, $xhtml = false, $ssl = null, $d = false)
 {
     // skip any external urls
     if (strpos($url, "option") !== false && strpos($url, "option=com_fss") === false) {
         return JRoute::_($url, $xhtml, $ssl);
     }
     global $FSSRoute_debug;
     global $FSSRoute_menus;
     global $FSSRoute_access;
     self::$d = $d;
     // get any menu items for fss
     FSS_Helper::GetRouteMenus();
     // Get the router
     $router = JFactory::getApplication()->getRouter();
     // if the url dont start with index.php, we need to add the exisitng url to what we want
     if (substr($url, 0, 9) != "index.php") {
         //echo "Making FUll URL: $url<br>";
         $url = self::_fullURL($router, $url);
         //echo "Resut : $url<br>";
     }
     $uri = new JURI($url);
     // work out is we are in an Itemid already, if so, set it as the best match
     if ($uri->hasVar('Itemid')) {
         $bestmatch = $uri->getVar('Itemid');
     } else {
         $bestmatch = '';
     }
     $bestcount = 0;
     $uriquery = $uri->toString(array('query'));
     $urivars = FSSRoute::SplitURL($uriquery);
     $sourcevars = FSSRoute::SplitURL($url);
     // check through the menu item for the current url, and add any items to the new url that are missing
     if ($bestmatch && array_key_exists($bestmatch, $FSSRoute_menus)) {
         foreach ($FSSRoute_menus[$bestmatch] as $key => $value) {
             if (!array_key_exists($key, $urivars) && !array_key_exists($key, $sourcevars)) {
                 $urivars[$key] = $value;
             }
         }
     }
     $current_access = 0;
     if (array_key_exists(FSS_Input::getInt('Itemid'), $FSSRoute_access)) {
         $current_access = $FSSRoute_access[FSS_Input::getInt('Itemid')];
     }
     if ($d) {
         echo "Incoming Link : {$url}<br>";
         echo "Cur Item ID : " . FSS_Input::getInt('Itemid') . "<br>";
         //print_p($FSSRoute_menus);
     }
     foreach ($FSSRoute_menus as $id => $vars) {
         if ($d) {
             echo "{$id} => <Br>";
             print_p($vars);
         }
         // need to check if the access level is the same
         if ($current_access && array_key_exists($id, $FSSRoute_access) && $FSSRoute_access[$id] != $current_access) {
             if ($d) {
                 echo "No Access<br>";
             }
             continue;
         }
         $count = FSSRoute::MatchVars($urivars, $vars);
         if (FSS_Input::getInt('Itemid') == $id && $count > 0) {
             if ($d) {
                 echo "Current ItemId: increase count<br>";
             }
             $count++;
         }
         if ($d) {
             echo "Count: {$count}<br>";
         }
         if ($count > $bestcount) {
             if ($d) {
                 echo "New best match - {$id}<br>";
             }
             $bestcount = $count;
             $bestmatch = $id;
         }
     }
     if ($bestcount == 0 && array_key_exists('view', $sourcevars) && substr($sourcevars['view'], 0, 6) == "admin_") {
         foreach ($FSSRoute_menus as $id => $item) {
             // need to check if the access level is the same
             if ($current_access && array_key_exists($id, $FSSRoute_access) && $FSSRoute_access[$id] != $current_access) {
                 continue;
             }
             if ($item['view'] == "admin") {
                 $bestcount = 1;
                 $bestmatch = $id;
             }
         }
     }
     // no match found, try to fallback on the main support menu id
     if ($bestcount == 0) {
         foreach ($FSSRoute_menus as $id => $item) {
             // need to check if the access level is the same
             if ($current_access && array_key_exists($id, $FSSRoute_access) && $FSSRoute_access[$id] != $current_access) {
                 continue;
             }
             if ($item['view'] == "main") {
                 $bestcount = 1;
                 $bestmatch = $id;
             }
         }
     }
     if ($bestcount == 0) {
         // still no match found, use any fss menu
         if (count($FSSRoute_menus) > 0) {
             foreach ($FSSRoute_menus as $id => $item) {
                 // need to check if the access level is the same
                 if ($current_access && array_key_exists($id, $FSSRoute_access) && $FSSRoute_access[$id] != $current_access) {
                     continue;
                 }
                 $bestcount = 1;
                 $bestmatch = $id;
                 break;
             }
         }
     }
     if ($d) {
         echo "Best Found : {$bestcount}, {$bestmatch}<br>";
     }
     // sticky menu items
     if (FSS_Settings::get('sticky_menus_type')) {
         $cur_item_id = FSS_Input::GetInt("Itemid");
         if ($cur_item_id > 0) {
             $sticky_ids = explode(";", FSS_Settings::get('sticky_menus'));
             if (FSS_Settings::get('sticky_menus_type') == 1 && in_array($cur_item_id, $sticky_ids) || FSS_Settings::get('sticky_menus_type') == 2 && !in_array($cur_item_id, $sticky_ids)) {
                 $bestcount = 0;
                 $uri->setVar('Itemid', $cur_item_id);
             }
         }
     }
     if ($bestcount > 0) {
         $uri->setVar('Itemid', $bestmatch);
         // we need to remove parameters that are in the main url as well as the sub one
         // wait till 2.2 for this change as it may break stuff
     }
     if ($d) {
         echo "Using : " . $uri->toString(array('path', 'query', 'fragment')) . "<br>";
     }
     return JRoute::_($uri->toString(array('path', 'query', 'fragment')), $xhtml, $ssl);
 }
Пример #20
0
function sigsRefresh()
{
	jQuery('#signature_container').html("<?php 
echo JText::_('PLEASE_WAIT');
?>
");
	var url = '<?php 
echo JRoute::_('index.php?option=com_fss&view=admin_support&tmpl=component&layout=signature&task=signature.dropdown', false);
?>
';
	jQuery('#signature_container').load(url);
}

<?php 
if (FSS_Settings::get('time_tracking') == "auto") {
    ?>
// auto time tracking
jQuery(document).ready(function () {
	setInterval("increaseTime();", 60 * 1000);
});

function increaseTime()
{
	var mins = parseInt(jQuery('#timetaken_mins').val());
	mins++;
	
	if (mins < 60)
	{
		jQuery('#timetaken_mins').val(mins);
	} else {
Пример #21
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>
Пример #22
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>
Пример #23
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();
Пример #24
0
**/
defined('_JEXEC') or die;
?>

<li id='prod_cont_<?php 
echo $product['id'];
?>
' 
	class="media pointer highlight product" 
	onclick="setCheckedValue(document.forms['prodselect'].elements['prodid'],'<?php 
echo $product['id'];
?>
');"
	>
	<div class="pull-left" <?php 
if (FSS_Settings::get('support_next_prod_click') == 1) {
    echo "style='display:none'";
}
?>
>
		<label for="prodid_<?php 
echo $product['id'];
?>
">
			<input type="radio" name="prodid" id="prodid_<?php 
echo $product['id'];
?>
" value="<?php 
echo $product['id'];
?>
" ></input>
Пример #25
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)) {
    ?>
Пример #26
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];
 }
Пример #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
 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);
 }
Пример #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
    /**
     * 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));
    }