예제 #1
0
 function _buildQuery()
 {
     $db =& JFactory::getDBO();
     $query = ' SELECT  id, word, description, published, access, language FROM #__fsf_glossary ';
     $where = array();
     if ($this->lists['search']) {
         $where[] = '(LOWER( word ) LIKE ' . $db->Quote('%' . FSFJ3Helper::getEscaped($db, $this->lists['search'], true) . '%', false) . ')';
     }
     if ($this->lists['order'] == 'word') {
         $order = ' ORDER BY word ' . $this->lists['order_Dir'];
     } else {
         $order = ' ORDER BY ' . $this->lists['order'] . ' ' . $this->lists['order_Dir'] . ', word';
     }
     if ($this->lists['ispublished'] > -1) {
         $where[] = 'published = ' . $this->lists['ispublished'];
     }
     if (FSFAdminHelper::Is16()) {
         FSFAdminHelper::LA_GetFilterState();
         if (FSFAdminHelper::$filter_lang) {
             $where[] = "language = '" . FSFJ3Helper::getEscaped($db, FSFAdminHelper::$filter_lang) . "'";
         }
         if (FSFAdminHelper::$filter_access) {
             $where[] = "access = '" . FSFJ3Helper::getEscaped($db, FSFAdminHelper::$filter_access) . "'";
         }
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $query .= $where . $order;
     return $query;
 }
예제 #2
0
 function display($tpl = null)
 {
     $faqcat =& $this->get('Data');
     $isNew = $faqcat->id < 1;
     $text = $isNew ? JText::_("NEW") : JText::_("EDIT");
     JToolBarHelper::title(JText::_("FAQ_CATEGORY") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fsf_categories');
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     FSFAdminHelper::DoSubToolbar();
     $path = JPATH_SITE . DS . 'images' . DS . 'fsf' . DS . 'faqcats';
     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', $faqcat->image);
     $this->assignRef('lists', $lists);
     $this->assignRef('faqcat', $faqcat);
     parent::display($tpl);
 }
예제 #3
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_("FAQ_MANAGER"), 'fsf_faqs');
     JToolBarHelper::custom('autosort', 'autosort', 'autosort', 'Auto Sort', false);
     JToolBarHelper::divider();
     JToolBarHelper::deleteList();
     JToolBarHelper::editList();
     JToolBarHelper::addNew();
     JToolBarHelper::cancel('cancellist');
     FSFAdminHelper::DoSubToolbar();
     $lists = $this->get('Lists');
     $this->assignRef('data', $this->get('Data'));
     $this->assignRef('pagination', $this->get('Pagination'));
     $query = 'SELECT id, title FROM #__fsf_faq_cat ORDER BY ordering';
     $db =& JFactory::getDBO();
     $categories[] = JHTML::_('select.option', '0', JText::_("SELECT_CATEGORY"), 'id', 'title');
     $db->setQuery($query);
     $categories = array_merge($categories, $db->loadObjectList());
     $lists['cats'] = JHTML::_('select.genericlist', $categories, 'faq_cat_id', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'id', 'title', $lists['faq_cat_id']);
     $categories = array();
     $categories[] = JHTML::_('select.option', '-1', JText::_("IS_PUBLISHED"), 'id', 'title');
     $categories[] = JHTML::_('select.option', '1', JText::_("PUBLISHED"), 'id', 'title');
     $categories[] = JHTML::_('select.option', '0', JText::_("UNPUBLISHED"), 'id', 'title');
     $lists['published'] = JHTML::_('select.genericlist', $categories, 'ispublished', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'id', 'title', $lists['ispublished']);
     $this->assignRef('lists', $lists);
     parent::display($tpl);
 }
예제 #4
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $glossary =& $this->get('Data');
     $isNew = $glossary->id < 1;
     $text = $isNew ? JText::_("NEW") : JText::_("EDIT");
     JToolBarHelper::title(JText::_("GLOSSARY_ITEM") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fsf_glossary');
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     FSFAdminHelper::DoSubToolbar();
     $this->assignRef('glossary', $glossary);
     parent::display($tpl);
 }
예제 #5
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_("FAQ_CATEGORIES"), 'fsf_categories');
     JToolBarHelper::deleteList();
     JToolBarHelper::editList();
     JToolBarHelper::addNew();
     JToolBarHelper::cancel('cancellist');
     FSFAdminHelper::DoSubToolbar();
     $this->assignRef('lists', $this->get('Lists'));
     $this->assignRef('data', $this->get('Data'));
     $this->assignRef('pagination', $this->get('Pagination'));
     $categories = array();
     $categories[] = JHTML::_('select.option', '-1', JText::_("IS_PUBLISHED"), 'id', 'title');
     $categories[] = JHTML::_('select.option', '1', JText::_("PUBLISHED"), 'id', 'title');
     $categories[] = JHTML::_('select.option', '0', JText::_("UNPUBLISHED"), 'id', 'title');
     $this->lists['published'] = JHTML::_('select.genericlist', $categories, 'ispublished', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'id', 'title', $this->lists['ispublished']);
     parent::display($tpl);
 }
예제 #6
0
 function SaveAPI()
 {
     $username = JRequest::getVar('username');
     $apikey = JRequest::getVar('apikey');
     $db =& JFactory::getDBO();
     $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('fsj_username','" . FSFJ3Helper::getEscaped($db, $username) . "')";
     $db->setQuery($qry);
     $db->Query();
     $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('fsj_apikey','" . FSFJ3Helper::getEscaped($db, $apikey) . "')";
     $db->setQuery($qry);
     $db->Query();
     // update url links
     if (FSFAdminHelper::Is16()) {
         $updater = new FSFUpdater();
         $updater->SortAPIKey($username, $apikey);
     }
     $mainframe = JFactory::getApplication();
     $link = FSFRoute::x('index.php?option=com_fsf&view=backup', false);
     $mainframe->redirect($link);
 }
예제 #7
0
파일: faqs.php 프로젝트: sansandeep143/av
 function _buildQuery()
 {
     $db =& JFactory::getDBO();
     $query = ' SELECT f.id as id, question, answer, f.ordering as ordering, f.published as published, c.title as title, f.featured, f.access, f.language FROM #__fsf_faq_faq as f LEFT JOIN #__fsf_faq_cat as c ';
     $query .= ' ON f.faq_cat_id = c.id ';
     $where = array();
     if ($this->lists['search']) {
         $where[] = '(LOWER( question ) LIKE ' . $db->Quote('%' . FSFJ3Helper::getEscaped($db, $this->lists['search'], true) . '%', false) . ')';
     }
     if ($this->lists['order'] == "fsf_filter_access") {
         $this->lists['order'] = "f.access";
     }
     if ($this->lists['order'] == "fsf_filter_language") {
         $this->lists['order'] = "f.language";
     }
     if ($this->lists['order'] == 'f.ordering') {
         $order = ' ORDER BY f.ordering ' . $this->lists['order_Dir'];
     } else {
         $order = ' ORDER BY ' . $this->lists['order'] . ' ' . $this->lists['order_Dir'] . ', f.ordering';
     }
     if ($this->lists['faq_cat_id'] > 0) {
         $where[] = 'faq_cat_id = ' . $this->lists['faq_cat_id'];
     }
     if ($this->lists['ispublished'] > -1) {
         $where[] = 'f.published = ' . $this->lists['ispublished'];
     }
     if (FSFAdminHelper::Is16()) {
         FSFAdminHelper::LA_GetFilterState();
         if (FSFAdminHelper::$filter_lang) {
             $where[] = "f.language = '" . FSFJ3Helper::getEscaped($db, FSFAdminHelper::$filter_lang) . "'";
         }
         if (FSFAdminHelper::$filter_access) {
             $where[] = "f.access = '" . FSFJ3Helper::getEscaped($db, FSFAdminHelper::$filter_access) . "'";
         }
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $query .= $where . $order;
     return $query;
 }
예제 #8
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $faq =& $this->get('Data');
     $isNew = $faq->id < 1;
     $text = $isNew ? JText::_("NEW") : JText::_("EDIT");
     JToolBarHelper::title(JText::_("FAQ") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fsf_faqs');
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     FSFAdminHelper::DoSubToolbar();
     $this->assignRef('faq', $faq);
     $query = 'SELECT id, title' . ' FROM #__fsf_faq_cat' . ' ORDER BY ordering';
     $db =& JFactory::getDBO();
     $db->setQuery($query);
     $sections = $db->loadObjectList();
     if (count($sections) < 1) {
         $link = FSFRoute::x('index.php?option=com_fsf&view=faqs', false);
         $mainframe->redirect($link, "You must create a FAQ category first");
         return;
     }
     if ($faq->id > 0) {
         $qry = "SELECT * FROM #__fsf_faq_tags WHERE faq_id = " . FSFJ3Helper::getEscaped($db, $faq->id) . " ORDER BY tag";
         $db->setQuery($qry);
         $this->tags = $db->loadObjectList();
     } else {
         $this->tags = array();
     }
     $lists['catid'] = JHTML::_('select.genericlist', $sections, 'faq_cat_id', 'class="inputbox" size="1" ', 'id', 'title', intval($faq->faq_cat_id));
     $this->assignRef('lists', $lists);
     parent::display($tpl);
 }
예제 #9
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSFRoute::x('index.php?option=com_fsf&view=fsfs', false);
         $mainframe->redirect($link);
         return;
     }
     $settings = FSF_Settings::GetAllViewSettings();
     // CHANGE
     $db =& JFactory::getDBO();
     if ($what == "save") {
         $data = JRequest::get('POST', JREQUEST_ALLOWRAW);
         foreach ($data as $setting => $value) {
             if (array_key_exists($setting, $settings)) {
                 $settings[$setting] = $value;
             }
         }
         foreach ($settings as $setting => $value) {
             if (!array_key_exists($setting, $data)) {
                 $settings[$setting] = 0;
                 $value = 0;
             }
             // skip any setting that is in the templates list
             if (array_key_exists($setting, $templates)) {
                 continue;
             }
             if (array_key_exists($setting, $large)) {
                 continue;
             }
             $qry = "REPLACE INTO #__fsf_settings_view (setting, value) VALUES ('";
             $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','";
             $qry .= FSFJ3Helper::getEscaped($db, $value) . "')";
             $db->setQuery($qry);
             $db->Query();
             //echo $qry."<br>";
         }
         $link = 'index.php?option=com_fsf&view=settingsview#' . $this->tab;
         if (JRequest::getVar('task') == "save") {
             $link = 'index.php?option=com_fsf';
         }
         //exit;
         $mainframe = JFactory::getApplication();
         $mainframe->redirect($link, JText::_("View_Settings_Saved"));
         exit;
     } else {
         $document = JFactory::getDocument();
         $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/js_color_picker_v2.css');
         $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/color_functions.js');
         $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/js_color_picker_v2.js');
         $this->assignRef('settings', $settings);
         JToolBarHelper::title(JText::_("FREESTYLE_FAQS") . ' - ' . JText::_("VIEW_SETTINGS"), 'fsf_viewsettings');
         JToolBarHelper::apply();
         JToolBarHelper::save();
         JToolBarHelper::cancel('cancellist');
         FSFAdminHelper::DoSubToolbar();
         parent::display($tpl);
     }
 }
예제 #10
0
    ?>
<iframe id="frame_help" height="600" width="100%" frameborder="0" border="0"></iframe>
<?php 
    echo $pane->endPanel();
    echo $pane->endPane();
}
?>

		</td>	
	</tr>
</table>

<script>
jQuery(document).ready(function () {
	jQuery('#frame_version').attr('src',"http://freestyle-joomla.com/latestversion-fsf?ver=<?php 
echo FSFAdminHelper::GetVersion();
?>
");
	jQuery('#frame_version').load(function() 
    {
        jQuery('#please_wait').remove();
    });

	jQuery('.fsf_main_item').mouseenter(function () {
		jQuery(this).css('background-color', '<?php 
echo FSF_Settings::get('css_hl');
?>
');
	});
	jQuery('.fsf_main_item').mouseleave(function () {
		jQuery(this).css('background-color' ,'transparent');
예제 #11
0
 function UpdateVersion($path)
 {
     $version = FSFAdminHelper::GetVersion($path);
     $db = JFactory::getDBO();
     $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('version', '{$version}')";
     $db->SetQuery($qry);
     $db->Query();
     //echo $qry."<br>";
     $log = "Updating version to {$version}\n";
     return $log;
 }
예제 #12
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSFRoute::x('index.php?option=com_fsf&view=fsfs', false);
         $mainframe->redirect($link);
         return;
     }
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     $settings = FSF_Settings::GetAllSettings();
     $db =& JFactory::getDBO();
     if ($what == "testref") {
         return $this->TestRef();
     } else {
         if ($what == "save") {
             $large = FSF_Settings::GetLargeList();
             $templates = FSF_Settings::GetTemplateList();
             $intpltable = FSF_Settings::StoreInTemplateTable();
             // save support custom setting
             $head = JRequest::getVar('support_list_head', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $row = JRequest::getVar('support_list_row', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $qry = "REPLACE INTO #__fsf_templates (template, tpltype, value) VALUES ('custom', 1, '" . FSFJ3Helper::getEscaped($db, $head) . "')";
             $db->setQuery($qry);
             $db->Query();
             $qry = "REPLACE INTO #__fsf_templates (template, tpltype, value) VALUES ('custom', 0, '" . FSFJ3Helper::getEscaped($db, $row) . "')";
             $db->setQuery($qry);
             $db->Query();
             unset($_POST['support_list_head']);
             unset($_POST['support_list_row']);
             // save templates
             $intpltable = FSF_Settings::StoreInTemplateTable();
             foreach ($intpltable as $template) {
                 $value = JRequest::getVar($template, '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $qry = "REPLACE INTO #__fsf_templates (template, tpltype, value) VALUES ('" . FSFJ3Helper::getEscaped($db, $template) . "', 2, '" . FSFJ3Helper::getEscaped($db, $value) . "')";
                 $db->setQuery($qry);
                 $db->Query();
             }
             // large settings
             foreach ($large as $setting) {
                 if (!array_key_exists($setting, $templates)) {
                     continue;
                 }
                 $value = JRequest::getVar($setting, '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $qry = "REPLACE INTO #__fsf_settings_big (setting, value) VALUES ('";
                 $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSFJ3Helper::getEscaped($db, $value) . "')";
                 //echo $qry."<br>";
                 $db->setQuery($qry);
                 $db->Query();
                 $qry = "DELETE FROM #__fsf_settings WHERE setting = '" . FSFJ3Helper::getEscaped($db, $setting) . "'";
                 //echo $qry."<br>";
                 $db->setQuery($qry);
                 $db->Query();
                 unset($_POST[$setting]);
             }
             $data = JRequest::get('POST', JREQUEST_ALLOWRAW);
             foreach ($data as $setting => $value) {
                 if (array_key_exists($setting, $settings)) {
                     $settings[$setting] = $value;
                 }
             }
             foreach ($settings as $setting => $value) {
                 if (!array_key_exists($setting, $data)) {
                     $settings[$setting] = 0;
                     $value = 0;
                 }
                 if (!array_key_exists($setting, $templates)) {
                     continue;
                 }
                 if (array_key_exists($setting, $large)) {
                     continue;
                 }
                 $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('";
                 $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSFJ3Helper::getEscaped($db, $value) . "')";
                 $db->setQuery($qry);
                 $db->Query();
                 //echo $qry."<br>";
             }
             //exit;
             $link = 'index.php?option=com_fsf&view=templates#' . $this->tab;
             if (JRequest::getVar('task') == "save") {
                 $link = 'index.php?option=com_fsf';
             }
             $mainframe = JFactory::getApplication();
             $mainframe->redirect($link, JText::_("Settings_Saved"));
             exit;
         } else {
             if ($what == "customtemplate") {
                 $this->CustomTemplate();
                 exit;
             } else {
                 // load other templates
                 $intpltable = FSF_Settings::StoreInTemplateTable();
                 $tpls = array();
                 foreach ($intpltable as $template) {
                     $settings[$template] = '';
                     $settings[$template . '_default'] = '';
                     $tpls[] = FSFJ3Helper::getEscaped($db, $template);
                 }
                 $tpllist = "'" . implode("', '", $tpls) . "'";
                 $qry = "SELECT * FROM #__fsf_templates WHERE template IN ({$tpllist})";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         if ($row['tpltype'] == 2) {
                             $settings[$row['template']] = $row['value'];
                         } else {
                             if ($row['tpltype'] == 3) {
                                 $settings[$row['template'] . '_default'] = $row['value'];
                             }
                         }
                     }
                 }
                 // load ticket template stuff
                 $qry = "SELECT * FROM #__fsf_templates WHERE template = 'custom'";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         if ($row['tpltype'] == 1) {
                             $settings['support_list_head'] = $row['value'];
                         } else {
                             if ($row['tpltype'] == 0) {
                                 $settings['support_list_row'] = $row['value'];
                             }
                         }
                     }
                 } else {
                     $settings['support_list_head'] = '';
                     $settings['support_list_row'] = '';
                 }
                 $qry = "SELECT * FROM #__fsf_templates WHERE tpltype = 2";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         $settings[$row['template']] = $row['value'];
                     }
                 }
                 $document = JFactory::getDocument();
                 $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/js_color_picker_v2.css');
                 $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/color_functions.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/js_color_picker_v2.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/codemirror.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/css/css.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/javascript/javascript.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/xml/xml.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/codemirror/modes/htmlmixed/htmlmixed.js');
                 $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/codemirror/codemirror.css');
                 $this->assignRef('settings', $settings);
                 JToolBarHelper::title(JText::_("FREESTYLE_FAQS") . ' - ' . JText::_("TEMPLATES"), 'fsf_templates');
                 JToolBarHelper::apply();
                 JToolBarHelper::save();
                 JToolBarHelper::cancel('cancellist');
                 FSFAdminHelper::DoSubToolbar();
                 parent::display($tpl);
             }
         }
     }
 }
예제 #13
0
</td>
<td align="center">
				<a href="javascript:void(0);" class="jgrid btn btn-micro" onclick="return listItemTask('cb<?php 
    echo $i;
    ?>
','<?php 
    echo $row->published ? 'unpublish' : 'publish';
    ?>
')">
					<?php 
    echo $published;
    ?>
				</a>
			</td>
			<?php 
    FSFAdminHelper::LA_Row($row);
    ?>
		</tr>
        <?php 
    $k = 1 - $k;
}
?>
	<tfoot>
		<tr>
			<td colspan="9"><?php 
echo $this->pagination->getListFooter();
?>
</td>
		</tr>
	</tfoot>
예제 #14
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSFRoute::x('index.php?option=com_fsf&view=fsfs', false);
         $mainframe->redirect($link);
         return;
     }
     $settings = FSF_Settings::GetAllSettings();
     $db =& JFactory::getDBO();
     if ($what == "testref") {
         return $this->TestRef();
     } else {
         if ($what == "testdates") {
             return $this->testdates();
         } else {
             if ($what == "save") {
                 //
                 $large = FSF_Settings::GetLargeList();
                 $templates = FSF_Settings::GetTemplateList();
                 // save any large settings that arent in the templates list
                 foreach ($large as $setting) {
                     // skip any setting that is in the templates list
                     if (array_key_exists($setting, $templates)) {
                         continue;
                     }
                     //
                     $value = JRequest::getVar($setting, '', 'post', 'string', JREQUEST_ALLOWRAW);
                     $qry = "REPLACE INTO #__fsf_settings_big (setting, value) VALUES ('";
                     $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','";
                     $qry .= FSFJ3Helper::getEscaped($db, $value) . "')";
                     $db->setQuery($qry);
                     $db->Query();
                     $qry = "DELETE FROM #__fsf_settings WHERE setting = '" . FSFJ3Helper::getEscaped($db, $setting) . "'";
                     $db->setQuery($qry);
                     $db->Query();
                     unset($_POST[$setting]);
                 }
                 $data = JRequest::get('POST', JREQUEST_ALLOWRAW);
                 foreach ($data as $setting => $value) {
                     if (array_key_exists($setting, $settings)) {
                         $settings[$setting] = $value;
                     }
                 }
                 foreach ($settings as $setting => $value) {
                     if (!array_key_exists($setting, $data)) {
                         $settings[$setting] = 0;
                         $value = 0;
                     }
                     // skip any setting that is in the templates list
                     if (array_key_exists($setting, $templates)) {
                         continue;
                     }
                     if (array_key_exists($setting, $large)) {
                         continue;
                     }
                     $qry = "REPLACE INTO #__fsf_settings (setting, value) VALUES ('";
                     $qry .= FSFJ3Helper::getEscaped($db, $setting) . "','";
                     $qry .= FSFJ3Helper::getEscaped($db, $value) . "')";
                     $db->setQuery($qry);
                     $db->Query();
                     //echo $qry."<br>";
                 }
                 $link = 'index.php?option=com_fsf&view=settings#' . $this->tab;
                 if (JRequest::getVar('task') == "save") {
                     $link = 'index.php?option=com_fsf';
                 }
                 //exit;
                 $mainframe = JFactory::getApplication();
                 $mainframe->redirect($link, JText::_("Settings_Saved"));
                 exit;
             } else {
                 if ($what == "customtemplate") {
                     $this->CustomTemplate();
                     exit;
                 } else {
                     $qry = "SELECT * FROM #__fsf_templates WHERE template = 'custom'";
                     $db->setQuery($qry);
                     $rows = $db->loadAssocList();
                     if (count($rows) > 0) {
                         foreach ($rows as $row) {
                             if ($row['tpltype']) {
                                 $settings['support_list_head'] = $row['value'];
                             } else {
                                 $settings['support_list_row'] = $row['value'];
                             }
                         }
                     } else {
                         $settings['support_list_head'] = '';
                         $settings['support_list_row'] = '';
                     }
                     //
                     $document = JFactory::getDocument();
                     $document->addStyleSheet(JURI::root() . 'administrator/components/com_fsf/assets/css/js_color_picker_v2.css');
                     $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/color_functions.js');
                     $document->addScript(JURI::root() . 'administrator/components/com_fsf/assets/js/js_color_picker_v2.js');
                     $this->assignRef('settings', $settings);
                     JToolBarHelper::title(JText::_("FREESTYLE_FAQS") . ' - ' . JText::_("SETTINGS"), 'fsf_settings');
                     JToolBarHelper::apply();
                     JToolBarHelper::save();
                     JToolBarHelper::cancel('cancellist');
                     FSFAdminHelper::DoSubToolbar();
                     parent::display($tpl);
                 }
             }
         }
     }
 }
예제 #15
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('FREESTYLE_FAQS'), 'fsf.png');
     FSFAdminHelper::DoSubToolbar();
     parent::display($tpl);
 }
예제 #16
0
파일: faqs.php 프로젝트: sansandeep143/av
 function __construct()
 {
     $this->id = "faqs";
     $this->descs = JText::_("FAQS");
     $this->has_ordering = 1;
     $this->table = "#__fsf_faq_faq";
     $this->fields = array();
     $field = new FSF_Content_Field("question", JText::_("QUESTION"), "long");
     $field->link = 1;
     $field->search = 1;
     $this->AddField($field);
     $field = new FSF_Content_Field("faq_cat_id", JText::_("CATEGORY"), "lookup");
     $field->lookup_table = "#__fsf_faq_cat";
     $field->lookup_required = 1;
     $field->lookup_id = "id";
     $field->lookup_order = "title";
     $field->lookup_title = "title";
     $field->lookup_select_msg = JText::_("PLEASE_SELECT_A_CATEGORY");
     $this->AddField($field);
     $field = new FSF_Content_Field("answer", JText::_("ANSWER"), "text");
     $field->search = 1;
     $field->more = "fullanswer";
     $this->AddField($field);
     $field = new FSF_Content_Field("featured", JText::_("Featured"), "checkbox");
     $field->required = false;
     $this->AddField($field);
     $field = new FSF_Content_Field("tags", JText::_("Tags"), "tags");
     $field->tags_table = "#__fsf_faq_tags";
     $field->tags_key = "faq_id";
     $field->required = 0;
     $this->AddField($field);
     if (FSFAdminHelper::Is16()) {
         if (empty(FSFAdminHelper::$langs)) {
             FSFAdminHelper::LoadLanguages();
             FSFAdminHelper::LoadAccessLevels();
         }
         $filter_langs = array();
         $filter_access = array();
         $field = new FSF_Content_Field("language", JText::_("LANGUAGE"), "lookup", "lang_art");
         $field->lookup_required = 1;
         $field->lookup_id = "id";
         $field->lookup_title = "title";
         foreach (FSFAdminHelper::$langs as $lang) {
             $filter_langs[$lang->value] = $lang->text;
             $field->lookup_extra[$lang->value] = $lang->text;
         }
         $this->AddField($field);
         $field = new FSF_Content_Field("access", JText::_("Access"), "lookup");
         $field->lookup_required = 1;
         $field->lookup_id = "id";
         $field->lookup_title = "title";
         foreach (FSFAdminHelper::$access_levels as $lang) {
             $filter_access[$lang->value] = $lang->text;
             $field->lookup_extra[$lang->value] = $lang->text;
         }
         $this->AddField($field);
     }
     $this->list = array();
     $this->list[] = "question";
     $this->list[] = "faq_cat_id";
     $this->list[] = "featured";
     if (FSFAdminHelper::Is16()) {
         $this->list[] = "language";
         $this->list[] = "access";
     }
     $this->edit = array();
     $this->edit[] = "faq_cat_id";
     $this->edit[] = "question";
     $this->edit[] = "featured";
     if (FSFAdminHelper::Is16()) {
         $this->edit[] = "language";
         $this->edit[] = "access";
     }
     $this->edit[] = "answer";
     $this->edit[] = "tags";
     $this->order = "ordering DESC";
     $this->link = "index.php?option=com_fsf&view=faq&faqid=%ID%";
     $filter = new FSF_Content_Filter("faq_cat_id", "id", "title", "#__fsf_faq_cat", "title", "CATEGORY");
     $this->AddFilter($filter);
     if (FSFAdminHelper::Is16()) {
         $filter = new FSF_Content_Filter("language", "id", "title", "", "", "SELECT_LANGUAGE", "lang_filter", $filter_langs);
         $this->AddFilter($filter);
         $filter = new FSF_Content_Filter("access", "id", "title", "", "", "SELECT_ACCESS", "", $filter_access);
         $this->AddFilter($filter);
     }
 }
예제 #17
0
파일: form.php 프로젝트: sansandeep143/av
				<label for="word">
					<?php 
echo JText::_("WORD");
?>
:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="word" id="word" size="32" maxlength="250" value="<?php 
echo JViewLegacy::escape($this->glossary->word);
?>
" />
			</td>
		</tr>
		<?php 
FSFAdminHelper::LA_Form($this->glossary);
?>
		<tr>
			<td width="135" align="right" class="key">
				<label for="description">
					<?php 
echo JText::_("DESCRIPTION");
?>
:
				</label>
			</td>
			<td>
				<?php 
echo $editor->display('description', htmlspecialchars($this->glossary->description, ENT_COMPAT, 'UTF-8'), '550', '400', '60', '20', array('pagebreak'));
?>
            </td>
예제 #18
0
    static function LA_Form($item, $nolangs = false)
    {
        if (FSFAdminHelper::Is16()) {
            ?>
			<tr>
				<td width="135" align="right" class="key">
					<label for="title">
						<?php 
            echo JText::_("JFIELD_ACCESS_LABEL");
            ?>
:
					</label>
				</td>
				<td>
					<?php 
            echo FSFAdminHelper::GetAccessForm($item->access);
            ?>
				</td>
			</tr>
			
			<?php 
            if (!$nolangs) {
                ?>

				<tr>
					<td width="135" align="right" class="key">
						<label for="title">
							<?php 
                echo JText::_("JFIELD_LANGUAGE_LABEL");
                ?>
:
						</label>
					</td>
					<td>
						<?php 
                echo FSFAdminHelper::GetLanguagesForm($item->language);
                ?>
					</td>
				</tr>
				
			<?php 
            }
        }
    }
예제 #19
0
파일: form.php 프로젝트: sansandeep143/av
			<td width="135" align="right" class="key">
				<label for="question">
					<?php 
echo JText::_("CATEGORY");
?>
:
				</label>
			</td>
			<td>
				<?php 
echo $this->lists['catid'];
?>
			</td>
		</tr>		
		<?php 
FSFAdminHelper::LA_Form($this->faq);
?>
		<tr>
			<td width="135" align="right" class="key">
				<label for="question">
					<?php 
echo JText::_("QUESTION");
?>
:
				</label>
			</td>
			<td>
				<textarea name="question" id="question" cols="80" rows="4" style="width:544px;"><?php 
echo JViewLegacy::escape($this->faq->question);
?>
</textarea>
예제 #20
0
파일: fsf.php 프로젝트: sansandeep143/av
        require_once $path;
    } else {
        $controller = '';
    }
}
if (!function_exists("print_p")) {
    function print_p($var)
    {
        echo "<pre>";
        print_r($var);
        echo "</pre>";
    }
}
// do version check
$ver_inst = FSFAdminHelper::GetInstalledVersion();
$ver_files = FSFAdminHelper::GetVersion();
if (FSF_Helper::Is16()) {
    if (!JFactory::getUser()->authorise('core.manage', 'com_fsf')) {
        return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
    }
}
// if bad version display warning message
if ($ver_files != $ver_inst) {
    $task = JRequest::getVar('task');
    $view = JRequest::getVar('view');
    if ($task != "update" || $view != "backup") {
        JError::raiseWarning(100, JText::sprintf('INCORRECT_VERSION', FSFRoute::x('index.php?option=com_fsf&view=backup&task=update')));
    }
    if ($view != "" && $view != "backup") {
        JRequest::setVar('view', '');
    }