本文整理汇总了PHP中JSNConfigHelper::get方法的典型用法代码示例。如果您正苦于以下问题:PHP JSNConfigHelper::get方法的具体用法?PHP JSNConfigHelper::get怎么用?PHP JSNConfigHelper::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSNConfigHelper
的用法示例。
在下文中一共展示了JSNConfigHelper::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display method
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
// Get config parameters
$config = JSNConfigHelper::get();
// Set the toolbar
JToolbarHelper::title(JText::_('JSN_EASYSLIDER_CONFIGURATION_SETTING'));
// Add toolbar menu
JSNEasySliderHelper::addToolbarMenu();
// Set the submenu
JSNEasySliderHelper::addSubmenu('maintenance');
// Get messages
$msgs = '';
if (!$config->get('disable_all_messages')) {
$msgs = JSNUtilsMessage::getList('CONFIGURATION');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
}
// Assign variables for rendering
$this->msgs = $msgs;
if (!empty($_GET['g']) && $_GET['g'] == 'data') {
echo JSNHtmlAsset::loadScript('jsn/data', array('language' => array('JSN_EXTFW_GENERAL_CLOSE' => JText::_('JSN_EXTFW_GENERAL_CLOSE'))), true);
}
// Add assets
JSNEasySliderHelper::addAssets();
$this->_addAssets();
// Display the template
parent::display($tpl);
}
示例2: display
/**
* Method for display page.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return void
*/
public function display($cachable = false, $urlparams = false)
{
// Get config parameters
if (class_exists('JSNConfigHelper')) {
$config = JSNConfigHelper::get();
// Check if JSN Mobilize is configured correctly
if ($config->get('link_mobile') == 'm.domain.tld' or $config->get('link_tablet') == 'tablet.domain.tld') {
// Get application object
$app = JFactory::getApplication();
// Set message
$app->enqueueMessage(JText::_('JSN_MOBILIZE_CONFIG_LINKS'));
// Mark required parameters
JRequest::setVar('required', array('link_mobile', 'link_tablet'));
// Set config view
JRequest::setVar('view', 'config');
} else {
// Set edit view
JRequest::setVar('view', JRequest::getCmd('view', 'profiles'));
}
} else {
// Set edit view
JRequest::setVar('view', JRequest::getCmd('view', 'profiles'));
}
// Call parent method
parent::display($cachable, $urlparams);
}
示例3: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a JError object.
*/
function display($tpl = null)
{
// Get config parameters
$this->_document = JFactory::getDocument();
$this->_config = JSNConfigHelper::get();
// Initialize toolbar
JSNMobilizeHelper::initToolbar('JSN_MOBILIZE_PAGE_CONFIGURATION_TITLE', 'mobilize-config', false);
// Get messages
$msgs = '';
if (!$this->_config->get('disable_all_messages')) {
$msgs = JSNUtilsMessage::getList('CONFIGURATION');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
}
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
// Load the submenu.
$input = JFactory::getApplication()->input;
JSNMobilizeHelper::addSubmenu($input->get('view', 'configuration'));
if (!empty($_GET['g']) && $_GET['g'] == 'data') {
echo JSNHtmlAsset::loadScript('jsn/data', array('language' => array('JSN_EXTFW_GENERAL_CLOSE' => JText::_('JSN_EXTFW_GENERAL_CLOSE'))), true);
}
// Load assets
JSNMobilizeHelper::loadAssets();
// Display the template
parent::display($tpl);
}
示例4: createFileThumbnail
function createFileThumbnail($fileOriginal, $fileThumbnail)
{
$objJSNISGD2 = new JSNISGD2();
$crop = 0;
$maxThubnailSize = 240;
if (class_exists('JSNConfigHelper')) {
$objConfig = JSNConfigHelper::get('com_imageshow');
$maxThubnailSize = (int) $objConfig->max_thumbnail_size;
}
$fileResize = array("width" => $maxThubnailSize, "height" => $maxThubnailSize);
if (JFile::exists($fileOriginal)) {
if (!JFile::exists($fileThumbnail)) {
list($width, $height) = getimagesize($fileOriginal);
if ($width > $fileResize['width'] || $height > $fileResize['height']) {
$imageMagic = $objJSNISGD2->resizeImage($fileOriginal, $fileThumbnail, $fileResize['width'], $fileResize['height'], $crop);
} else {
$imageMagic = $objJSNISGD2->resizeImage($fileOriginal, $fileThumbnail, $width, $height, $crop);
}
if ($imageMagic) {
return true;
} else {
return false;
}
}
} else {
return false;
}
return true;
}
示例5: getSearchCoverages
/**
* Return array of search coverage
*/
public static function getSearchCoverages()
{
$config = JSNConfigHelper::get('com_poweradmin');
$searchCoveragesOrder = json_decode($config->search_coverage);
$coverages = array();
if (count($searchCoveragesOrder) > 0) {
$configCoverages = json_decode($config->search_coverage);
$configCoveragesOrder = explode(",", $config->search_coverage_order);
if (count($configCoveragesOrder) > 0) {
foreach ($configCoveragesOrder as $_cov) {
if (in_array($_cov, $configCoverages)) {
array_push($coverages, $_cov);
}
}
} else {
$coverages = $configCoverages;
}
} else {
$coverages = array('articles', 'categories', 'components', 'modules', 'plugins', 'menus', 'templates', 'users');
include_once JPATH_ROOT . '/administrator/components/com_poweradmin/helpers/extensions.php';
$installedComponents = self::getInstalledComponents();
$supportedList = JSNPaExtensionsHelper::getSupportedExtList();
if (count($supportedList)) {
foreach ($supportedList as $extName => $value) {
if (in_array($extName, $installedComponents)) {
$coverages[] = $value->coverage;
}
}
}
}
return $coverages;
}
示例6: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a JError object.
*
* @see fetch()
* @since 11.1
*/
public function display($tpl = null)
{
// Get input object
$input = JFactory::getApplication()->input;
$this->isPrint = $input->getString('print', 'false');
$this->_form = $this->get('Form');
$this->_item = $this->get('Item');
$this->_infoForm = $this->get('InfoForm');
$dataContentForm = $this->get('FormPages');
$this->nextAndPreviousForm = $this->get('NextAndPreviousForm');
$this->_formPages = $dataContentForm;
$this->_document = JFactory::getDocument();
$this->_document->addScriptDeclaration("var dataId = {$this->_item->submission_id}");
$this->_dataSubmission = $this->get('DataSubmission');
$this->_dataFields = $this->get('DataFields');
$config = JSNConfigHelper::get();
// Get messages
$msgs = '';
if (!$config->get('disable_all_messages')) {
$msgs = JSNUtilsMessage::getList('SUBMISSION');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
}
// Hide main menu
$input->set('hidemainmenu', true);
// Initialize toolbar
$this->initToolbar();
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
// Display the template
parent::display($tpl);
// Load assets
JSNUniformHelper::addAssets();
$this->addAssets();
}
示例7: __construct
public function __construct($config = array())
{
parent::__construct($config);
$this->_app = JFactory::getApplication();
$this->_input = $this->_app->input;
$this->_config = JSNConfigHelper::get();
}
示例8: changeExtStatus
public function changeExtStatus()
{
include_once JPATH_ROOT . '/administrator/components/com_pagebuilder/helpers/extensions.php';
$status = (int) JRequest::getInt('status');
$idName = str_ireplace(JSN_PAGEBUILDER_EXT_IDENTIFIED_NAME_PREFIX, "", JRequest::getVar('identified_name'));
$config = JSNConfigHelper::get('pagebuilder');
if (isset($config->extension_support) && (string) $config->extension_support != '') {
$extension_support = @json_decode($config->extension_support);
} else {
$extension_support = array();
}
// When disable status, update to configuration page
if ($status == 0) {
$extensionName = 'com_' . $idName;
if (($valueRemove = array_search($extensionName, $extension_support)) !== false) {
unset($extension_support[$valueRemove]);
}
$db = JFactory::getDbo();
$query = $db->getQuery();
$query->clear();
$query->update('#__jsn_pagebuilder_config');
$query->set('value =' . $db->quote(json_encode($extension_support)));
$query->where('name =' . $db->quote('extension_support'));
$db->setQuery($query);
$db->query();
}
if (JSNPagebuilderHelpersExtensions::enableExt($idName, 'jsnpagebuilder', $status)) {
exit('success');
}
}
示例9: display
/**
* Display method
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
$objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
$objJSNXML = JSNISFactory::getObj('classes.jsn_is_readxmldetails');
$objJSNMsg = JSNISFactory::getObj('classes.jsn_is_message');
// Get config parameters
$config = JSNConfigHelper::get();
$this->_document = JFactory::getDocument();
JHtmlBehavior::framework();
// Set the toolbar
JToolBarHelper::title(JText::_('JSN_IMAGESHOW') . ': ' . JText::_('HELP_HELP_AND_SUPPORT'), 'help');
$shortEdition = '';
$xml = array();
// Get messages
$msgs = '';
$msgs = $objJSNMsg->getList('HELP_AND_SUPPORT');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
$xml = $objJSNXML->parserXMLDetails();
$shortEdition = $objJSNUtils->getShortEdition();
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
$this->assignRef('xml', $xml);
$this->assignRef('shortEdition', $shortEdition);
$this->_addAssets();
$this->addToolbar();
// Display the template
parent::display($tpl);
}
示例10: display
/**
* Display method
*
* @return void
*/
function display($tpl = null)
{
// Get config parameters
$config = JSNConfigHelper::get('com_poweradmin');
$this->_document = JFactory::getDocument();
// Set the toolbar
JToolBarHelper::title(JText::_('JSN_POWERADMIN_CONFIGURATION_TITLE'), 'maintenance');
$this->_addAssets();
// Display the template
parent::display($tpl);
}
示例11: display
/**
* Display method
*
* @return void
*/
function display($tpl = null)
{
// Get config parameters
$config = JSNConfigHelper::get();
$this->_document = JFactory::getDocument();
JToolBarHelper::title(JText::_('JSN_PAGEBUILDER_ABOUT'), 'about');
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
// Display the template
parent::display($tpl);
}
示例12: display
/**
* Method for display page.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return void
*/
public function display($cachable = false, $urlparams = false)
{
// Get config parameters
$config = JSNConfigHelper::get();
// Check if JSN Mobilize is configured correctly
if ($config->get('link_mobile') == 'm.domain.tld' or $config->get('link_tablet') == 'tablet.domain.tld') {
// Redirect to configuration page
return JFactory::getApplication()->redirect(JRoute::_('index.php?option=' . JFactory::getApplication()->input->getCmd('option')));
} else {
// Call parent method
parent::display($cachable, $urlparams);
}
}
示例13: getInput
protected function getInput()
{
jimport('administrator.components.com_pagebuilder.helpers.pagebuilder');
$config = JSNConfigHelper::get('com_pagebuilder');
$extSupports = JSNPagebuilderHelpersPagebuilder::getExtensionSupports();
if (count(@$config->extension_support_order)) {
$extSupportOrder = explode(",", $config->extension_support_order);
// Add new if it not exist in database
if (count($extSupports)) {
foreach ($extSupports as $support) {
if (!in_array($support, $extSupportOrder)) {
array_push($extSupportOrder, $support);
}
}
}
} else {
$extSupportOrder = $extSupports;
}
if ((string) $this->value != '') {
$selectedExtension = json_decode($this->value);
} else {
$selectedExtension = JSNPagebuilderHelpersPagebuilder::getExtensionSupports(false);
}
$html[] = '<ul class="sortable">';
foreach ($extSupportOrder as $support) {
if ($support) {
if (strpos($support, JSN_PAGEBUILDER_3RD_EXTENSION_STRING) != false && !count(JPluginHelper::getPlugin('pagebuilder', str_replace(JSN_PAGEBUILDER_3RD_EXTENSION_STRING . '-', '', $support)))) {
continue;
} else {
$checked = in_array($support, $selectedExtension) ? 'checked' : '';
/*if($config->extension_support == null){
$checked = '';
}*/
$html[] = '<li class="item" id="' . $support . '">
<ins class="sortable-handle"></ins>
<label class="checkbox">
<input type="checkbox" name="' . $this->name . '" value="' . $support . '" ' . $checked . '/>
' . JText::_('JSN_PAGEBUILDER_SUPPORT_' . str_ireplace(JSN_PAGEBUILDER_3RD_EXTENSION_STRING . '-', '', strtoupper($support))) . '
</label>
<div class="clearbreak"></div>
</li>';
}
}
}
$html[] = '</ul>';
$html[] = '<input type="hidden" value="' . implode(',', $extSupportOrder) . '" id="params_extension_support_order" name="jsnconfig[extension_support_order]" />';
return implode($html);
}
示例14: getInput
protected function getInput()
{
JSNFactory::localimport('helpers.poweradmin');
$config = JSNConfigHelper::get('com_poweradmin');
$searchCoverages = PoweradminHelper::getSearchCoverages();
if (isset($config->search_coverage_order)) {
$searchCoveragesOrder = explode(",", $config->search_coverage_order);
// Add new coverage if it did not
// exist in database
if (count($searchCoverages)) {
foreach ($searchCoverages as $coverage) {
if (!in_array($coverage, $searchCoveragesOrder)) {
array_push($searchCoveragesOrder, $coverage);
}
}
}
} else {
$searchCoveragesOrder = $searchCoverages;
}
// $selectedCoverages = $this->item->get('search_coverage', $searchCoverages);
if ($this->value) {
$selectedCoverages = json_decode($this->value);
} else {
$selectedCoverages = PoweradminHelper::getSearchCoverages(false);
}
$html[] = '<ul class="sortable">';
foreach ($searchCoveragesOrder as $coverage) {
if ($coverage) {
if (strpos($coverage, JSN_3RD_EXTENSION_STRING) !== false && !count(JPluginHelper::getPlugin('jsnpoweradmin', str_replace(JSN_3RD_EXTENSION_STRING . '-', '', $coverage)))) {
continue;
} else {
$checked = in_array($coverage, $selectedCoverages) ? 'checked' : '';
$html[] = '<li class="item" id="' . $coverage . '">
<ins class="sortable-handle"></ins>
<label class="checkbox">
<input type="checkbox" name="' . $this->name . '" value="' . $coverage . '" ' . $checked . ' />
' . JText::_('JSN_POWERADMIN_COVERAGE_' . str_ireplace(JSN_3RD_EXTENSION_STRING . '-', '', strtoupper($coverage))) . '
</label>
<div class="clearbreak"></div>
</li>';
}
}
}
$html[] = '</ul>';
$html[] = '<input type="hidden" value="' . implode(',', $searchCoveragesOrder) . '" id="params_search_coverage_order" name="jsnconfig[search_coverage_order]" />';
return implode($html);
}
示例15: display
/**
* Display method
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
// Get config parameters
$config = JSNConfigHelper::get();
$this->_document = JFactory::getDocument();
JHtmlBehavior::framework();
// Set the toolbar
JToolBarHelper::title(JText::_('JSN_IMAGESHOW') . ': ' . JText::_('MAINTENANCE_CONFIGURATION_AND_MAINTENANCE'), 'maintenance');
// Get messages
$msgs = '';
if (!$config->get('disable_all_messages')) {
$msgs = JSNUtilsMessage::getList('CONFIGURATION_AND_MAINTENANCE');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
}
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
$this->_addAssets();
$this->addToolbar();
// Type of screen
$type = JRequest::getWord('type', 'backup');
$themeName = JRequest::getWord('theme_name');
$sourceType = JRequest::getString('source_type');
switch ($type) {
case 'themeparameters':
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $themeName . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('theme_config');
break;
case 'profileparameters':
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('source_config');
break;
case 'editprofile':
$sourceID = JRequest::getInt('external_source_id');
$countShowlist = JRequest::getInt('count_showlist');
$imageSource = JSNISFactory::getSource($sourceType, 'external');
$imageSource->_source['sourceTable']->load($sourceID);
$this->assignRef('sourceInfo', $imageSource->_source['sourceTable']);
$this->assignRef('countShowlist', $countShowlist);
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . 'source' . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('edit_source_profile');
break;
default:
// Display the template
parent::display($tpl);
break;
}
}