function FSF_GetFeaturedText($ispub) { if (FSFJ3Helper::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>"; } } elseif (FSF_Helper::Is16()) { 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>'; } } else { $img = 'publish_g.png'; $alt = JText::_("Featured_FAQ"); if ($ispub == 0) { $img = 'publish_x.png'; $alt = JText::_("Unfeatured_FAQ"); } return '<img src="images/' . $img . '" width="16" height="16" border="0" alt="' . $alt . '" />'; } }
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', 'FSF_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_fsf&view=glossary&letter=' . $letter . '#' . $anchor; $item->route = $item->url; $item->state = $item->published; $item->access = 1; // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. if (FSFJ3Helper::IsJ3()) { $this->indexer->index($item); } else { FinderIndexer::index($item); } }
static function loadResultArray(&$db) { if (FSFJ3Helper::IsJ3()) { return $db->loadColumn(0); } else { return $db->loadResultArray(); } }
public 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', 'FSF_FINDER_FAQ'); $item->url = 'index.php?option=com_fsf&view=faq&faqid=' . $item->getElement('id'); $item->route = $item->url; $item->state = $item->getElement('pub'); $item->access = 1; // Get content extras. FinderIndexerHelper::getContentExtras($item); // Index the item. if (FSFJ3Helper::IsJ3()) { $this->indexer->index($item); } else { FinderIndexer::index($item); } }
static function CurDate() { if (FSF_Helper::Is16()) { $myTimezone = FSF_Helper::getTimezone(); $myDate = null; $date = new JDate($myDate, $myTimezone); $formatted = $date->format('Y-m-d H:i:s', false, false); return $formatted; } else { $myTimezone = FSF_Helper::getTimezone(); $date = null; $date = new JDate($date, $myTimezone); if (FSFJ3Helper::IsJ3()) { return $date->toSql(); } else { return $date->toMySQL(); } } }
function ValidateMenus() { $log = ""; if (FSFJ3Helper::IsJ3()) { } elseif ($this->DBIs16()) { // 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_fsf' AND menutype = 'main'"); $component = $db->loadObjectList(); $componentid = $component[0]->id; $componentid16 = $component[0]->component_id; if (file_exists(JPATH_COMPONENT . DS . 'fsf.xml')) { //echo "<pre>"; $order = 1; $xml = simplexml_load_file(JPATH_COMPONENT . DS . 'fsf.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(); } } else { // find base item $db = JFactory::getDBO(); $db->setQuery("SELECT * FROM #__components WHERE link = 'option=com_fsf' AND parent = 0"); $component = $db->loadObjectList(); $componentid = $component[0]->id; if (file_exists(JPATH_COMPONENT . DS . 'fsf.xml')) { //echo "<pre>"; $order = 1; $xml = simplexml_load_file(JPATH_COMPONENT . DS . 'fsf.xml'); foreach ($xml->administration->submenu->menu as $item) { $name = (string) $item; //$log .= $name."\n"; $arr = $item->attributes(); $link = $arr['link']; //$log .= $link."\n"; $db->setQuery("SELECT * FROM #__components WHERE admin_menu_link = '{$link}'"); $componentitem = $db->loadObject(); if (!$componentitem) { // item missing, create it //echo "MISSING<br>"; $qry = "INSERT INTO #__components (name, parent, admin_menu_link, admin_menu_alt, `option`, ordering, admin_menu_img, iscore, enabled) VALUES ("; $qry .= " '{$name}', {$componentid}, '{$link}', '{$name}', 'com_fsf', {$order}, 'images/blank.png', 0, 1)"; $db->setQuery($qry); $db->Query(); $log .= "Adding menu item {$name}<Br>"; } else { //print_r($componentitem); $qry = "UPDATE #__components SET name = '{$name}', ordering = {$order} WHERE id = " . $componentitem->id; //$log .= $qry."<br>"; $db->setQuery($qry); $db->Query(); } $order++; } //echo "</pre>"; $log .= "Base component id : {$componentid}<br>" . $log; } } if ($log == "") { $log = "All admin menu items are ok<br>"; } return $log; }
</th> <th class="title" width="8%" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'Featured', 'featured', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th> <th width="1%" nowrap="nowrap"> <?php echo JHTML::_('grid.sort', 'Published', 'published', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th> <?php FSFAdminHelper::LA_Header($this); ?> <th width="<?php echo FSFJ3Helper::IsJ3() ? '130px' : '8%'; ?> "> <?php echo JHTML::_('grid.sort', 'Order', 'ordering', @$this->lists['order_Dir'], @$this->lists['order']); ?> <?php if ($ordering) { echo JHTML::_('grid.order', $this->data); } ?> </th> </tr> </thead> <?php $k = 0;