function &getData() { if (empty($this->_data)) { $query = ' SELECT * FROM #__fss_comments ' . ' WHERE id = ' . FSSJ3Helper::getEscaped($this->_db, $this->_id); $this->_db->setQuery($query); $this->_data = $this->_db->loadObject(); } if (!$this->_data) { $this->_data = new stdClass(); $this->_data->id = 0; $this->_data->ident = 5; // ##NOT_TEST_START## $this->_data->ident = 0; // ##NOT_TEST_END## $this->_data->itemid = 0; $this->_data->body = null; $this->_data->email = null; $this->_data->name = null; $this->_data->website = null; $this->_data->published = 1; $current_date = new JDate(); if (FSSJ3Helper::IsJ3()) { $mySQL_conform_date = $current_date->toSql(); } else { $mySQL_conform_date = $current_date->toMySQL(); } $this->_data->created = $mySQL_conform_date; } return $this->_data; }
static function loadResultArray(&$db) { if (FSSJ3Helper::IsJ3()) { return $db->loadColumn(0); } else { return $db->loadResultArray(); } }
function check() { // make published by default and get a new order no if (!$this->id) { if ($this->created == "") { $current_date = new JDate(); if (FSSJ3Helper::IsJ3()) { $mySQL_conform_date = $current_date->toSql(); } else { $mySQL_conform_date = $current_date->toMySQL(); } $this->set('created', $mySQL_conform_date); } } return true; }
function FSS_GetFeaturedText($ispub) { if (FSSJ3Helper::IsJ3()) { if ($ispub) { return "<i class='icon-star'></i>"; //return '<span class="state publish"><span class="text"><i class="icon-publish"></i>'.JText::_('Published').'</span></span>'; } else { return "<i class='icon-star-empty'></i>"; } } else { if (!$ispub) { return '<img src="templates/bluestork/images/admin/disabled.png" alt="' . JText::_('Featured_FAQ') . '">'; //return '<span class="state featured"><span class="text">'.JText::_('Featured').'</span></span>'; } else { return '<img src="templates/bluestork/images/admin/featured.png" alt="' . JText::_('Unfeatured_FAQ') . '">'; //return '<span class="state unfeatured"><span class="text">'.JText::_('Unfeatured').'</span></span>'; } } }
protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled if (JComponentHelper::isEnabled($this->extension) == false) { return; } $item->body = FinderIndexerHelper::prepareContent($item->getElement('body')); $item->summary = FinderIndexerHelper::prepareContent($item->getElement('body')); $item->addTaxonomy('Type', 'FSS_FINDER_KB_ARTICLE'); $item->url = 'index.php?option=com_fss&view=kb&kbartid=' . $item->getElement('id'); $item->route = $item->url; $item->state = $item->getElement('pub'); // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. if (FSSJ3Helper::IsJ3()) { $this->indexer->index($item); } else { FinderIndexer::index($item); } }
protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled if (JComponentHelper::isEnabled($this->extension) == false) { return; } $item->body = FinderIndexerHelper::prepareContent($item->getElement('body')); $item->summary = FinderIndexerHelper::prepareContent($item->getElement('body')); $item->addTaxonomy('Type', 'FSS_FINDER_GLOSSARY'); $word = $item->title; $anchor = strtolower(preg_replace("/[^A-Za-z0-9]/", '-', $word)); $letter = strtolower(substr($word, 0, 1)); $item->url = 'index.php?option=com_fss&view=glossary&letter=' . $letter . '#' . $anchor; $item->route = $item->url; $item->state = $item->published; // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. if (FSSJ3Helper::IsJ3()) { $this->indexer->index($item); } else { FinderIndexer::index($item); } }
static function getSiteName() { $config = JFactory::getConfig(); if (FSSJ3Helper::IsJ3()) { $sitename = $config->get('sitename'); } else { $sitename = $config->getValue('sitename'); } if (FSS_Settings::get('support_email_site_name') != "") { $sitename = FSS_Settings::get('support_email_site_name'); } return $sitename; }
?> <?php } ?> </td> </tr> <?php $k = 1 - $k; } ?> </table> </div> <?php if (FSSJ3Helper::IsJ3()) { ?> <div class='pull-right'> <?php echo $this->pagination->getLimitBox(); ?> </div> <?php } echo $this->pagination->getListFooter(); ?> <input type="hidden" name="option" value="com_fss" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="controller" value="ticketgroup" />
static function Get_Sender() { $config = JFactory::getConfig(); if (FSSJ3Helper::IsJ3()) { $address = $config->get('config.mailfrom'); $name = $config->get('config.fromname'); } else { $address = $config->getValue('config.mailfrom'); $name = $config->getValue('config.fromname'); } if (trim(FSS_Settings::get('support_email_from_name')) != "") { $name = trim(FSS_Settings::get('support_email_from_name')); } if (trim(FSS_Settings::get('support_email_from_address')) != "") { $address = trim(FSS_Settings::get('support_email_from_address')); } return array($address, $name); }
function ValidateMenus() { $log = ""; if (FSSJ3Helper::IsJ3()) { } else { // no need at moment, as no added items for a 1.6 install $db = JFactory::getDBO(); $db->setQuery("SELECT * FROM #__menu WHERE link = 'index.php?option=com_fss' AND menutype = 'main'"); $component = $db->loadObjectList(); $componentid = $component[0]->id; $componentid16 = $component[0]->component_id; if (file_exists(JPATH_COMPONENT . DS . 'fss.xml')) { //echo "<pre>"; $order = 1; $xml = simplexml_load_file(JPATH_COMPONENT . DS . 'fss.xml'); foreach ($xml->administration->submenu->menu as $item) { $name = (string) $item; //echo $name."<br>"; $arr = $item->attributes(); $link = $arr['link']; //echo $link."<br>"; $alias = strtolower(str_replace("_", "", $name)); $qry = "SELECT * FROM #__menu WHERE link = 'index.php?{$link}' AND menutype = 'main'"; //echo $qry."<br>"; $db->setQuery($qry); $componentitem = $db->loadObject(); if (!$componentitem) { //echo "Missing<br>"; // item missing, create it $qry = "INSERT INTO #__menu (menutype, title, alias, path, link, type, parent_id, level, component_id, ordering, img, client_id) VALUES ("; $qry .= " 'main', '{$name}', '{$alias}', 'freestylesupportportal/{$alias}', 'index.php?{$link}', 'component', {$componentid}, 2, {$componentid16}, {$order}, 'images/blank.png', 1)"; $db->setQuery($qry); $db->Query(); $log .= "Adding menu item {$name}<Br>"; } else { //print_r($componentitem); $qry = "UPDATE #__menu SET title = '{$name}', ordering = {$order} WHERE id = " . $componentitem->id; //echo $qry."<br>"; $db->setQuery($qry); $db->Query(); } $order++; } //echo "</pre>"; jimport('joomla.database.table.menu'); require JPATH_SITE . DS . "libraries" . DS . "joomla" . DS . "database" . DS . "table" . DS . "menu.php"; $table = new JTableMenu($db); $table->rebuild(); } } if ($log == "") { $log = "All admin menu items are ok<br>"; } return $log; }
function ValidateFromAddress() { $from = "{$this->from[0]->mailbox}@{$this->from[0]->host}"; $config = JFactory::getConfig(); if (FSSJ3Helper::IsJ3()) { $address = $config->get('config.mailfrom'); } else { $address = $config->getValue('config.mailfrom'); } if ($from == $address) { // if we dont have allow_joomla set, skip this email addy! if ($this->params['allow_joomla'] != 1) { $this->Log("From address is Joomla mail from address"); return false; } } if (FSS_Settings::get('support_email_from_address') != "") { $address = FSS_Settings::get('support_email_from_address'); } if ($from == $address) { $this->Log("From address is Freestyle Support mail from address"); return false; } if (trim($this->params['ignoreaddress']) != "") { $toaddys = explode("\n", $this->params['ignoreaddress']); $check = array(); foreach ($toaddys as $toaddy) { $toaddy = strtolower(trim($toaddy)); if ($toaddy == "") { continue; } $check[$toaddy] = 1; } if (count($check) > 0) { $found = false; foreach ($check as $addy => $temp) { if ($from == $addy) { $found = true; } } if ($found) { //echo "From address found - ignoring<br>"; return false; } } } return true; }
<?php /** * @package Freestyle Joomla * @author Freestyle Joomla * @copyright (C) 2013 Freestyle Joomla * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ defined('_JEXEC') or die; if (!FSSJ3Helper::IsJ3() || FSS_Settings::get('support_attach_use_old_system')) { ?> <?php for ($i = 1; $i < 10; $i++) { ?> <div id="file_<?php echo $i; ?> " <?php if ($i > 1) { ?> style='display:none;' <?php } ?> > <input type="file" size="60" id="filedata_<?php echo $i;
function ValidateFromAddress() { $from = "{$this->headers->from[0]->mailbox}@{$this->headers->from[0]->host}"; $config = JFactory::getConfig(); if (FSSJ3Helper::IsJ3()) { $address = $config->get('config.mailfrom'); } else { $address = $config->getValue('config.mailfrom'); } if ($from == $address) { // if we dont have allow_joomla set, skip this email addy! if ($this->params['allow_joomla'] != 1) { $this->Log("From address is Joomla mail from address"); return false; } } if (FSS_Settings::get('support_email_from_address') != "") { $address = FSS_Settings::get('support_email_from_address'); } if ($from == $address) { if ($this->params['allow_joomla'] != 1) { $this->Log("From address is Freestyle Support mail from address"); return false; } } if (trim($this->params['ignoreaddress']) != "") { $toaddys = explode("\n", strtolower($this->params['ignoreaddress'])); $check = array(); foreach ($toaddys as $toaddy) { $toaddy = strtolower(trim($toaddy)); if ($toaddy == "") { continue; } $check[$toaddy] = 1; } $from_l = strtolower($from); if (count($check) > 0) { $found = false; $matched = null; foreach ($check as $addy => $temp) { $addy_o = $addy; if (substr($addy, 0, 1) == "*") { $addy = substr($addy, 1); $end = substr($from_l, strlen($from_l) - strlen($addy)); if ($end == $addy) { $found = true; } } else { if (substr($addy, strlen($addy) - 1, 1) == "*") { $addy = substr($addy, 0, strlen($addy) - 1); $begin = substr($from_l, 0, strlen($addy)); if ($begin == $addy) { $found = true; } } else { if ($from_l == $addy) { $found = true; } } } if ($found && !$matched) { $matched = $addy_o; } } if ($found) { $this->Log("From address matched '{$matched}'"); return false; } } } return true; }