Example #1
0
function FST_GetFeaturedText($ispub)
{
    if (FSTJ3Helper::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 (FST_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 . '" />';
    }
}
Example #2
0
 function &getData()
 {
     if (empty($this->_data)) {
         $query = ' SELECT * FROM #__fst_comments ' . '  WHERE id = ' . FSTJ3Helper::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;
         //
         $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 (FSTJ3Helper::IsJ3()) {
             $mySQL_conform_date = $current_date->toSql();
         } else {
             $mySQL_conform_date = $current_date->toMySQL();
         }
         $this->_data->created = $mySQL_conform_date;
     }
     return $this->_data;
 }
Example #3
0
 static function loadResultArray(&$db)
 {
     if (FSTJ3Helper::IsJ3()) {
         return $db->loadColumn(0);
     } else {
         return $db->loadResultArray();
     }
 }
Example #4
0
 function check()
 {
     // make published by default and get a new order no
     if (!$this->id) {
         if ($this->created == "") {
             $current_date = new JDate();
             if (FSTJ3Helper::IsJ3()) {
                 $mySQL_conform_date = $current_date->toSql();
             } else {
                 $mySQL_conform_date = $current_date->toMySQL();
             }
             $this->set('created', $mySQL_conform_date);
         }
     }
     return true;
 }
Example #5
0
 static function CurDate()
 {
     if (FST_Helper::Is16()) {
         $myTimezone = FST_Helper::getTimezone();
         $myDate = null;
         $date = new JDate($myDate, $myTimezone);
         $formatted = $date->format('Y-m-d H:i:s', false, false);
         return $formatted;
     } else {
         $myTimezone = FST_Helper::getTimezone();
         $date = null;
         $date = new JDate($date, $myTimezone);
         if (FSTJ3Helper::IsJ3()) {
             return $date->toSql();
         } else {
             return $date->toMySQL();
         }
     }
 }
Example #6
0
	
	var togglerName='div.accordion_toggler_';
	var contentName='div.accordion_content_';
	
	var acc_elem = null;
	var acc_toggle = null;
	
	var counter=1;	
	var toggler=$$(togglerName+counter);
	var content=$$(contentName+counter);
	
	while(toggler.length>0)
	{
		// Accordion anwenden
<?php 
    if (FSTJ3Helper::IsJ3()) {
        ?>
		new Fx.Accordion(toggler, content, {
<?php 
    } else {
        ?>
		new Accordion(toggler, content, {
<?php 
    }
    ?>
		opacity: false,
		alwaysHide: true,
		display: -1,
		onActive: function(toggler, content) {
				acc_elem = content;
				acc_toggle = toggler;
Example #7
0
 function ValidateMenus()
 {
     $log = "";
     if (FSTJ3Helper::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_fst' AND menutype = 'main'");
         $component = $db->loadObjectList();
         $componentid = $component[0]->id;
         $componentid16 = $component[0]->component_id;
         if (file_exists(JPATH_COMPONENT . DS . 'fst.xml')) {
             //echo "<pre>";
             $order = 1;
             $xml = simplexml_load_file(JPATH_COMPONENT . DS . 'fst.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_fst' AND parent = 0");
         $component = $db->loadObjectList();
         $componentid = $component[0]->id;
         if (file_exists(JPATH_COMPONENT . DS . 'fst.xml')) {
             //echo "<pre>";
             $order = 1;
             $xml = simplexml_load_file(JPATH_COMPONENT . DS . 'fst.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_fst', {$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;
 }
Example #8
0
            <th>
                <?php 
echo JHTML::_('grid.sort', 'Image', 'image', @$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 
FSTAdminHelper::LA_Header($this, true);
?>
             <th width="<?php 
echo FSTJ3Helper::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;
Example #9
0
 static function &ParseTemplate($template, &$ticket, $subject, $body, $ishtml)
 {
     $handler = FST_EMail::GetHandler($ticket['admin_id']);
     $custrec = FST_EMail::GetUser($ticket['user_id']);
     $subject = trim(str_ireplace("re:", "", $subject));
     $vars[] = FST_EMail::BuildVar('subject', $subject);
     /*if ($ishtml)
     		{
     			$body = str_replace("\n","<br />\n",$body);	
     		}*/
     $body = FST_Helper::ParseBBCode($body);
     $vars[] = FST_EMail::BuildVar('body', $body);
     $vars[] = FST_EMail::BuildVar('reference', $ticket['reference']);
     $vars[] = FST_EMail::BuildVar('password', $ticket['password']);
     if ($ticket['user_id'] == 0) {
         $vars[] = FST_EMail::BuildVar('user_name', $ticket['unregname']);
         $vars[] = FST_EMail::BuildVar('user_username', JText::_("UNREGISTERED"));
         $vars[] = FST_EMail::BuildVar('user_email', $ticket['email']);
     } else {
         $vars[] = FST_EMail::BuildVar('user_name', $custrec['name']);
         $vars[] = FST_EMail::BuildVar('user_username', $custrec['username']);
         $vars[] = FST_EMail::BuildVar('user_email', $custrec['email']);
     }
     $vars[] = FST_EMail::BuildVar('handler_name', $handler['name']);
     $vars[] = FST_EMail::BuildVar('handler_username', $handler['username']);
     $vars[] = FST_EMail::BuildVar('handler_email', $handler['email']);
     $vars[] = FST_EMail::BuildVar('ticket_id', $ticket['id']);
     $vars[] = FST_EMail::BuildVar('status', FST_EMail::GetStatus($ticket['ticket_status_id']));
     $vars[] = FST_EMail::BuildVar('priority', FST_EMail::GetPriority($ticket['ticket_pri_id']));
     $vars[] = FST_EMail::BuildVar('category', FST_EMail::GetCategory($ticket['ticket_cat_id']));
     $vars[] = FST_EMail::BuildVar('department', FST_EMail::GetDepartment($ticket['ticket_dept_id']));
     $vars[] = FST_EMail::BuildVar('product', FST_EMail::GetProduct($ticket['prod_id']));
     if (strpos($template['body'], "{messagehistory}") > 0) {
         //echo "Get message history<br>";
         $messages = FST_EMail::GetMessageHist($ticket['id']);
         // need to load in the messagerow template and parse it
         $text = FST_EMail::ParseMessageRows($messages, $ishtml);
         $vars[] = FST_EMail::BuildVar('messagehistory', $text);
         //print_p($messages);
     }
     $uri = JURI::getInstance();
     $baseUrl = $uri->toString(array('scheme', 'host', 'port'));
     $vars[] = FST_EMail::BuildVar('ticket_link', $baseUrl . FSTRoute::_('index.php?option=com_fst&view=ticket&ticketid=' . $ticket['id'], false));
     $vars[] = FST_EMail::BuildVar('admin_link', $baseUrl . FSTRoute::_('index.php?option=com_fst&view=admin&layout=support&ticketid=' . $ticket['id'], false));
     $config = JFactory::getConfig();
     if (FSTJ3Helper::IsJ3()) {
         $sitename = $config->get('sitename');
     } else {
         $sitename = $config->getValue('sitename');
     }
     if (FST_Settings::get('support_email_site_name') != "") {
         $sitename = FST_Settings::get('support_email_site_name');
     }
     $vars[] = FST_EMail::BuildVar('websitetitle', $sitename);
     // need to add the tickets custom fields to the output here
     $fields = FSTCF::GetAllCustomFields(true);
     $values = FSTCF::GetTicketValues($ticket['id'], $ticket);
     foreach ($fields as $fid => &$field) {
         $name = "custom_" . $fid;
         $value = "";
         if (array_key_exists($fid, $values)) {
             $value = $values[$fid]['value'];
         }
         //echo "$name -> $value<br>";
         $fieldvalues = array();
         $fieldvalues[0]['field_id'] = $fid;
         $fieldvalues[0]['value'] = $value;
         // only do area output processing if we are in html mode
         if ($field['type'] != "area" || $ishtml) {
             $value = FSTCF::FieldOutput($field, $fieldvalues, '');
         }
         $vars[] = FST_EMail::BuildVar($name, $value);
     }
     $email['subject'] = FST_EMail::ParseText($template['subject'], $vars);
     $email['body'] = FST_EMail::ParseText($template['body'], $vars);
     //print_p($vars);
     //print_p($email);
     if ($template['ishtml']) {
         //$email['subject'] = str_replace("\n","<br />\n",$email['subject']);
         $email['body'] = FST_EMail::MaxLineLength($email['body']);
     } else {
         // strip bbcode out of subject or parse it to html depending on template type
         $email['body'] = str_replace("<br />", "\n", $email['body']);
         $email['body'] = html_entity_decode($email['body']);
         $email['body'] = preg_replace_callback("/(&#[0-9]+;)/", array($this, "email_decode_utf8"), $email['body']);
         $email['body'] = strip_tags($email['body']);
     }
     return $email;
 }