function display($tpl = null) { $prod =& $this->get('Data'); $isNew = $prod->id < 1; $text = $isNew ? JText::_("NEW") : JText::_("EDIT"); JToolBarHelper::title(JText::_("PRODUCT") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fst_prods'); if (FST_Helper::Is16()) { JToolBarHelper::custom('translate', 'translate', 'translate', 'Translate', false); JToolBarHelper::spacer(); } JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } FSTAdminHelper::DoSubToolbar(); $this->assignRef('prod', $prod); $path = JPATH_SITE . DS . 'images' . DS . 'fst' . DS . 'products'; if (!file_exists($path)) { mkdir($path, 0777, true); } $files = JFolder::files($path, '(.png$|.jpg$|.jpeg$|.gif$)'); $sections[] = JHTML::_('select.option', '', JText::_("NO_IMAGE"), 'id', 'title'); foreach ($files as $file) { $sections[] = JHTML::_('select.option', $file, $file, 'id', 'title'); } $lists['images'] = JHTML::_('select.genericlist', $sections, 'image', 'class="inputbox" size="1" ', 'id', 'title', $prod->image); $this->assignRef('lists', $lists); parent::display($tpl); }
function &getData() { if (empty($this->_data)) { if (FST_Helper::Is16()) { $query = ' SELECT u.*, ' . 'CONCAT(m.username," (",m.name,")") as name ' . ' FROM #__fst_user as u ' . ' LEFT JOIN #__users as m ON u.user_id = m.id ' . ' WHERE u.id = ' . FSTJ3Helper::getEscaped($this->_db, $this->_id); } else { $query = ' SELECT u.*, ' . 'CONCAT(m.username," (",m.name,")") as name, ' . 'g.name as groupname ' . ' FROM #__fst_user as u ' . ' LEFT JOIN #__users as m ON u.user_id = m.id ' . ' LEFT JOIN #__core_acl_aro_groups as g ON u.group_id = g.id ' . ' WHERE u.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->mod_kb = 0; $this->_data->mod_test = 0; $this->_data->support = 0; $this->_data->user_id = 0; $this->_data->group_id = 0; $this->_data->seeownonly = 0; $this->_data->autoassignexc = 0; $this->_data->allprods = 1; $this->_data->alldepts = 1; $this->_data->allcats = 1; $this->_data->artperm = 0; $this->_data->groups = 0; $this->_data->allprods_a = 1; $this->_data->alldepts_a = 1; $this->_data->allcats_a = 1; $this->_data->assignperms = 0; $this->_data->reports = 0; $this->name = ""; } return $this->_data; }
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 . '" />'; } }
static function DoSubToolbar() { if (!FST_Helper::Is16()) { JToolBarHelper::divider(); JToolBarHelper::help("help.php?help=admin-view-" . JRequest::getVar('view'), true); return; } if (JFactory::getUser()->authorise('core.admin', 'com_fst')) { JToolBarHelper::preferences('com_fst'); } JToolBarHelper::divider(); JToolBarHelper::help("", false, "http://www.freestyle-joomla.com/comhelp/fst/admin-view-" . JRequest::getVar('view')); $vName = JRequest::getCmd('view', 'fsts'); JSubMenuHelper::addEntry(JText::_('COM_FST_OVERVIEW'), 'index.php?option=com_fst&view=fsts', $vName == 'fsts' || $vName == ""); JSubMenuHelper::addEntry(JText::_('COM_FST_SETTINGS'), 'index.php?option=com_fst&view=settings', $vName == 'settings'); JSubMenuHelper::addEntry(JText::_('COM_FST_TEMPLATES'), 'index.php?option=com_fst&view=templates', $vName == 'templates'); JSubMenuHelper::addEntry(JText::_('COM_FST_VIEW_SETTINGS'), 'index.php?option=com_fst&view=settingsview', $vName == 'settingsview'); // JSubMenuHelper::addEntry(JText::_('COM_FST_PRODUCTS'), 'index.php?option=com_fst&view=prods', $vName == 'prods'); JSubMenuHelper::addEntry(JText::_('COM_FST_MODERATION'), 'index.php?option=com_fst&view=tests', $vName == 'tests'); // JSubMenuHelper::addEntry(JText::_('COM_FST_USERS'), 'index.php?option=com_fst&view=fusers', $vName == 'fusers'); // JSubMenuHelper::addEntry(JText::_('COM_FST_EMAIL_TEMPLATES'), 'index.php?option=com_fst&view=emails', $vName == 'emails'); // ##NOT_FAQS_END## JSubMenuHelper::addEntry(JText::_('COM_FST_ADMIN'), 'index.php?option=com_fst&view=backup', $vName == 'backup'); }
function display($tpl = null) { $document = JFactory::getDocument(); if (FST_Helper::Is16()) { JHtml::_('behavior.framework'); } $mainframe = JFactory::getApplication(); JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal', 'a.fst_modal'); $user = JFactory::getUser(); $userid = $user->id; $db = JFactory::getDBO(); $query = "SELECT * FROM #__fst_user WHERE user_id = '" . FSTJ3Helper::getEscaped($db, $userid) . "'"; $db->setQuery($query); $this->_permissions = $db->loadAssoc(); $this->params =& FST_Settings::GetViewSettingsObj('test'); $this->test_show_prod_mode = $this->params->get('test_show_prod_mode', 'accordian'); $this->test_always_prod_select = $this->params->get('test_always_prod_select', '0'); $layout = JRequest::getVar('layout', ''); $this->prodid = JRequest::getVar('prodid'); if ($this->prodid == "") { $this->prodid = -1; } $this->products = $this->get('Products'); //print_p($this->products); if (count($this->products) == 0) { $this->prodid = 0; } $this->comments = new FST_Comments("test", $this->prodid); if ($this->prodid == -1) { $this->comments->opt_show_posted_message_only = 1; } $onlyprodid = JRequest::getVar('onlyprodid', 'x'); if ($onlyprodid != 'x') { $this->comments->itemid = (int) $onlyprodid; $this->comments->show_item_select = false; } echo "Hide Add : " . $this->params->get('hide_add', 0) . "<br>"; if ($this->params->get('hide_add', 0)) { $this->comments->can_add = 0; } if ($layout == "create") { $this->setupCommentsCreate(); } if ($this->comments->Process()) { return; } if ($layout == "create") { return $this->displayCreate(); } if ($this->prodid != -1) { return $this->displaySingleProduct(); } return $this->displayAllProducts(); }
function &getProducts() { $db = JFactory::getDBO(); $query = "SELECT * FROM #__fst_prod"; $where = array(); $where[] = "published = 1"; $where[] = "intest = 1"; if (FST_Helper::Is16()) { $user = JFactory::getUser(); $where[] = 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'; } if (count($where) > 0) { $query .= " WHERE " . implode(" AND ", $where); } $db->setQuery($query); $rows = $db->loadAssocList('id'); if (!is_array($rows)) { return array(); } return $rows; }
static function _GetDefaults() { global $fst_settings; if (empty($fst_settings)) { $fst_settings = array(); $fst_settings['version'] = 0; $fst_settings['fsj_username'] = ''; $fst_settings['fsj_apikey'] = ''; $fst_settings['jquery_include'] = "auto"; $fst_settings['perm_mod_joomla'] = 0; $fst_settings['perm_article_joomla'] = 0; $fst_settings['captcha_type'] = 'none'; $fst_settings['recaptcha_public'] = ''; $fst_settings['recaptcha_private'] = ''; $fst_settings['recaptcha_theme'] = 'red'; $fst_settings['comments_moderate'] = 'none'; $fst_settings['comments_hide_add'] = 1; $fst_settings['email_on_comment'] = ''; $fst_settings['comments_who_can_add'] = 'anyone'; $fst_settings['test_use_email'] = 1; $fst_settings['test_use_website'] = 1; $fst_settings['commnents_use_email'] = 1; $fst_settings['commnents_use_website'] = 1; $fst_settings['hide_powered'] = 0; $fst_settings['announce_use_content_plugins'] = 0; $fst_settings['announce_use_content_plugins_list'] = 0; $fst_settings['announce_comments_allow'] = 1; $fst_settings['announce_comments_per_page'] = 0; $fst_settings['announce_per_page'] = 10; $fst_settings['kb_rate'] = 1; $fst_settings['kb_comments'] = 1; $fst_settings['kb_view_top'] = 0; $fst_settings['kb_show_views'] = 1; $fst_settings['kb_show_recent'] = 1; $fst_settings['kb_show_recent_stats'] = 1; $fst_settings['kb_show_viewed'] = 1; $fst_settings['kb_show_viewed_stats'] = 1; $fst_settings['kb_show_rated'] = 1; $fst_settings['kb_show_rated_stats'] = 1; $fst_settings['kb_show_dates'] = 1; $fst_settings['kb_use_content_plugins'] = 0; $fst_settings['kb_show_art_related'] = 1; $fst_settings['kb_show_art_products'] = 1; $fst_settings['kb_show_art_attach'] = 1; $fst_settings['kb_contents'] = 1; $fst_settings['kb_smaller_subcat_images'] = 0; $fst_settings['kb_comments_per_page'] = 0; $fst_settings['kb_prod_per_page'] = 5; $fst_settings['kb_art_per_page'] = 10; $fst_settings['kb_print'] = 1; $fst_settings['test_moderate'] = 'none'; $fst_settings['test_email_on_submit'] = ''; $fst_settings['test_allow_no_product'] = 1; $fst_settings['test_who_can_add'] = 'anyone'; $fst_settings['test_hide_empty_prod'] = 1; $fst_settings['test_comments_per_page'] = 0; $fst_settings['skin_style'] = 0; $fst_settings['support_entire_row'] = 0; $fst_settings['support_autoassign'] = 0; $fst_settings['support_assign_open'] = 0; $fst_settings['support_assign_reply'] = 0; $fst_settings['support_user_attach'] = 1; $fst_settings['support_lock_time'] = 30; $fst_settings['support_show_msg_counts'] = 1; $fst_settings['support_reference'] = "4L-4L-4L"; $fst_settings['support_list_template'] = "classic"; $fst_settings['support_custom_register'] = ""; $fst_settings['support_no_logon'] = 0; $fst_settings['support_no_register'] = 0; $fst_settings['support_info_cols'] = 1; $fst_settings['support_actions_as_buttons'] = 0; $fst_settings['support_choose_handler'] = 'none'; $fst_settings['support_dont_check_dupe'] = 1; $fst_settings['support_admin_refresh'] = 0; $fst_settings['support_only_admin_open'] = 0; $fst_settings['support_user_reply_width'] = 56; $fst_settings['support_user_reply_width'] = 56; $fst_settings['support_admin_reply_width'] = 56; $fst_settings['support_admin_reply_height'] = 10; $fst_settings['ticket_label_width'] = 100; $fst_settings['support_next_prod_click'] = 1; $fst_settings['support_subject_size'] = 35; $fst_settings['support_subject_message_hide'] = ''; $fst_settings['support_filename'] = 0; $fst_settings['support_subject_at_top'] = 0; $fst_settings['support_tabs_allopen'] = 0; $fst_settings['support_tabs_allclosed'] = 0; $fst_settings['support_tabs_all'] = 0; $fst_settings['ticket_prod_per_page'] = 5; $fst_settings['ticket_per_page'] = 10; $fst_settings['support_restrict_prod'] = 0; $fst_settings['css_hl'] = '#f0f0f0'; $fst_settings['css_tb'] = '#ffffff'; $fst_settings['css_bo'] = '#e0e0e0'; $fst_settings['display_head'] = ''; $fst_settings['display_foot'] = ''; $fst_settings['use_joomla_page_title_setting'] = 0; $fst_settings['title_prefix'] = 1; $fst_settings['content_unpublished_color'] = '#FFF0F0'; if (FST_Helper::Is16()) { $fst_settings['display_h1'] = '<h1>$1</h1>'; $fst_settings['display_h2'] = '<h2>$1</h2>'; $fst_settings['display_h3'] = '<h3>$1</h3>'; $fst_settings['display_popup'] = '<h2>$1</h2>'; $fst_settings['display_style'] = '.fst_main tr, td { border: none; padding: 1px; }'; $fst_settings['display_popup_style'] = '.fst_popup tr, td { border: none; padding: 1px; }'; } else { $fst_settings['display_h1'] = '<div class="component-header"><div class="componentheading">$1</div></div>'; $fst_settings['display_h2'] = '<div class="fst_spacer contentheading">$1</div>'; $fst_settings['display_h3'] = '<div class="fst_admin_create">$1</div>'; $fst_settings['display_popup'] = '<div class="component-header"><div class="componentheading">$1</div></div>'; $fst_settings['display_style'] = ''; $fst_settings['display_popup_style'] = ''; } $fst_settings['support_email_on_create'] = 0; $fst_settings['support_email_handler_on_create'] = 0; $fst_settings['support_email_on_reply'] = 0; $fst_settings['support_email_handler_on_reply'] = 0; $fst_settings['support_email_handler_on_forward'] = 0; $fst_settings['support_email_on_close'] = 0; $fst_settings['support_email_all_admins'] = 0; $fst_settings['support_email_all_admins_only_unassigned'] = 0; $fst_settings['support_email_all_admins_ignore_auto'] = 0; $fst_settings['support_email_all_admins_can_view'] = 0; $fst_settings['support_user_can_close'] = 1; $fst_settings['support_user_can_reopen'] = 1; $fst_settings['support_advanced'] = 1; $fst_settings['support_allow_unreg'] = 0; $fst_settings['support_delete'] = 1; $fst_settings['support_advanced_default'] = 0; $fst_settings['support_sceditor'] = 1; $fst_settings['support_altcat'] = 0; $fst_settings['support_cronlog_keep'] = 5; $fst_settings['support_hide_priority'] = 0; $fst_settings['support_hide_handler'] = 0; $fst_settings['support_hide_users_tickets'] = 0; $fst_settings['support_hide_tags'] = 0; $fst_settings['support_email_unassigned'] = ''; $fst_settings['support_email_admincc'] = ''; $fst_settings['support_email_from_name'] = ''; $fst_settings['support_email_from_address'] = ''; $fst_settings['support_email_site_name'] = ''; $fst_settings['support_ea_check'] = 0; $fst_settings['support_ea_all'] = 0; $fst_settings['support_ea_reply'] = 0; $fst_settings['support_ea_type'] = 0; $fst_settings['support_ea_host'] = ''; $fst_settings['support_ea_port'] = ''; $fst_settings['support_ea_username'] = ''; $fst_settings['support_ea_password'] = ''; $fst_settings['support_ea_mailbox'] = ''; $fst_settings['support_user_message'] = '#c0c0ff'; $fst_settings['support_admin_message'] = '#c0ffc0'; $fst_settings['support_private_message'] = '#ffc0c0'; $fst_settings['support_basic_name'] = ''; $fst_settings['support_basic_username'] = ''; $fst_settings['support_basic_email'] = ''; $fst_settings['support_basic_messages'] = ''; $fst_settings['glossary_faqs'] = 1; $fst_settings['glossary_kb'] = 1; $fst_settings['glossary_announce'] = 1; $fst_settings['glossary_link'] = 1; $fst_settings['glossary_title'] = 0; $fst_settings['glossary_use_content_plugins'] = 0; $fst_settings['glossary_ignore'] = ''; $fst_settings['glossary_exclude'] = "a,script,pre,h1,h2,h3,h4,h5,h6"; $fst_settings['faq_popup_width'] = 650; $fst_settings['faq_popup_height'] = 375; $fst_settings['faq_popup_inner_width'] = 0; $fst_settings['faq_use_content_plugins'] = 0; $fst_settings['faq_use_content_plugins_list'] = 0; $fst_settings['faq_per_page'] = 10; $fst_settings['faq_cat_prefix'] = 1; // 1.9 comments stuff $fst_settings['comments_announce_use_custom'] = 0; $fst_settings['comments_kb_use_custom'] = 0; $fst_settings['comments_test_use_custom'] = 0; $fst_settings['comments_general_use_custom'] = 0; $fst_settings['comments_testmod_use_custom'] = 0; $fst_settings['announce_use_custom'] = 0; $fst_settings['announcemod_use_custom'] = 0; $fst_settings['announcesingle_use_custom'] = 0; // date format stuff $fst_settings['date_dt_short'] = ''; $fst_settings['date_dt_long'] = ''; $fst_settings['date_d_short'] = ''; $fst_settings['date_d_long'] = ''; $fst_settings['timezone_offset'] = 0; $fst_settings['mainmenu_moderate'] = 1; $fst_settings['mainmenu_support'] = 1; } }
static function _($url, $xhtml = true, $ssl = null) { if (FST_Helper::Is16()) { return FSTRoute::_16($url, $xhtml, $ssl); } else { return FSTRoute::_15($url, $xhtml, $ssl); } }
?> } window.addEvent('domready', function(){ if (location.hash) { ShowTab(location.hash.replace('#','')); } else { ShowTab('general'); } <?php if (FST_Helper::Is16()) { ?> jQuery('#test_date_formats').click(function (ev) { ev.preventDefault(); var url = '<?php echo FSTRoute::x("index.php?option=com_fst&view=settings&what=testdates", false); ?> '; url += '&date_dt_short=' + encodeURIComponent(jQuery('#date_dt_short').val()); url += '&date_dt_long=' + encodeURIComponent(jQuery('#date_dt_long').val()); url += '&date_d_short=' + encodeURIComponent(jQuery('#date_d_short').val()); url += '&date_d_long=' + encodeURIComponent(jQuery('#date_d_long').val()); jQuery.get(url, function (data) {
echo JText::_('THERE_ARE_NO_TESTIMONIALS_TO_DISPLAY'); ?> </div> <?php } } $this->comments->IncludeJS(); ?> <?php include JPATH_SITE . DS . 'components' . DS . 'com_fst' . DS . '_powered.php'; ?> <?php echo FST_Helper::PageStyleEnd(); $scrollf = FST_Helper::Is16() ? "start" : "scrollTo"; ?> <?php if ($this->test_show_prod_mode == "accordian") { ?> <script> window.addEvent('domready', function() { if(window.ie6) var heightValue='100%'; else var heightValue=''; var togglerName='div.accordion_toggler_'; var contentName='div.accordion_content_'; var acc_elem = null;
static function getAdminPermissions() { if (empty(FST_Ticket_Helper::$_permissions)) { $mainframe = JFactory::getApplication(); global $option; $user = JFactory::getUser(); $userid = $user->id; $db = JFactory::getDBO(); $query = "SELECT * FROM #__fst_user WHERE user_id = '" . FSTJ3Helper::getEscaped($db, $userid) . "'"; $db->setQuery($query); FST_Ticket_Helper::$_permissions = $db->loadAssoc(); if (!FST_Ticket_Helper::$_permissions) { FST_Ticket_Helper::$_permissions['mod_kb'] = 0; FST_Ticket_Helper::$_permissions['mod_test'] = 0; FST_Ticket_Helper::$_permissions['support'] = 0; FST_Ticket_Helper::$_permissions['seeownonly'] = 1; FST_Ticket_Helper::$_permissions['autoassignexc'] = 1; FST_Ticket_Helper::$_permissions['allprods'] = 1; FST_Ticket_Helper::$_permissions['allcats'] = 1; FST_Ticket_Helper::$_permissions['alldepts'] = 1; FST_Ticket_Helper::$_permissions['artperm'] = 0; FST_Ticket_Helper::$_permissions['id'] = 0; FST_Ticket_Helper::$_permissions['groups'] = 0; FST_Ticket_Helper::$_permissions['reports'] = 0; FST_Ticket_Helper::$_permissions['settings'] = ''; } FST_Ticket_Helper::$_permissions['userid'] = $userid; FST_Ticket_Helper::$_perm_only = ''; FST_Ticket_Helper::$_perm_prods = ''; FST_Ticket_Helper::$_perm_depts = ''; FST_Ticket_Helper::$_perm_cats = ''; FST_Ticket_Helper::$_permissions['perm_where'] = ''; // // check for permission overrides for Joomla 1.6 if (FST_Settings::get('perm_article_joomla') || FST_Settings::get('perm_mod_joomla')) { if (FST_Helper::Is16()) { $newart = 0; $newmod = 0; $user = JFactory::getUser(); if ($user->authorise('core.edit.own', 'com_fst')) { $newart = 1; } if ($user->authorise('core.edit', 'com_fst')) { $newart = 2; $newmod = 1; } if ($user->authorise('core.edit.state', 'com_fst')) { $newart = 3; $newmod = 1; } if (FST_Settings::get('perm_article_joomla') && $newart > FST_Ticket_Helper::$_permissions['artperm']) { FST_Ticket_Helper::$_permissions['artperm'] = $newart; } if (FST_Settings::get('perm_mod_joomla') && $newmod > FST_Ticket_Helper::$_permissions['mod_kb']) { FST_Ticket_Helper::$_permissions['mod_kb'] = $newmod; } // } else { $newart = 0; $newmod = 0; $user = JFactory::getUser(); if ($user->authorize('com_fst', 'create', 'content', 'own')) { $newart = 1; } if ($user->authorize('com_fst', 'edit', 'content', 'own')) { $newart = 2; $newmod = 1; } if ($user->authorize('com_fst', 'publish', 'content', 'all')) { $newart = 3; $newmod = 1; } if (FST_Settings::get('perm_article_joomla') && $newart > FST_Ticket_Helper::$_permissions['artperm']) { FST_Ticket_Helper::$_permissions['artperm'] = $newart; } if (FST_Settings::get('perm_mod_joomla') && $newmod > FST_Ticket_Helper::$_permissions['mod_kb']) { FST_Ticket_Helper::$_permissions['mod_kb'] = $newmod; } } } } return FST_Ticket_Helper::$_permissions; }
function Misc() { $log = ""; if (FST_Helper::Is16()) { // update #__updates table to have longer version field $qry = "ALTER TABLE #__updates CHANGE version version VARCHAR( 20 ) DEFAULT NULL"; $db = JFactory::getDBO(); $db->setQuery($qry); $db->Query(); } return $log; }