本文整理汇总了PHP中nnParameters::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP nnParameters::getInstance方法的具体用法?PHP nnParameters::getInstance怎么用?PHP nnParameters::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nnParameters
的用法示例。
在下文中一共展示了nnParameters::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInput
protected function getInput()
{
if (!nnFrameworkFunctions::extensionInstalled('mijoshop')) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
}
$this->params = $this->element->attributes();
$this->db = JFactory::getDBO();
$group = $this->get('group', 'categories');
$tables = $this->db->getTableList();
if (!in_array($this->db->getPrefix() . 'mijoshop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
}
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
$this->max_list_count = $params->max_list_count;
if (!class_exists('MijoShop')) {
require_once JPATH_ROOT . '/components/com_mijoshop/mijoshop/mijoshop.php';
}
$this->store_id = (int) MijoShop::get('opencart')->get('config')->get('config_store_id');
$this->language_id = (int) MijoShop::get('opencart')->get('config')->get('config_language_id');
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$options = $this->{'get' . $group}();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
switch ($group) {
case 'categories':
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
default:
return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
}
}
示例2: getInput
protected function getInput()
{
if (!nnFrameworkFunctions::extensionInstalled('virtuemart')) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
}
$this->params = $this->element->attributes();
$this->db = JFactory::getDBO();
$group = $this->get('group', 'categories');
$tables = $this->db->getTableList();
if (!in_array($this->db->getPrefix() . 'virtuemart_' . $group, $tables)) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
}
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
$this->max_list_count = $params->max_list_count;
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$options = $this->{'get' . $group}();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
if ($group == 'categories') {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
$size = $size ? 'style="width:' . $size . 'px"' : '';
$attr = $size;
$attr .= $multiple ? ' multiple="multiple"' : '';
return JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
}
示例3: getHelper
/**
* Create the helper object
*
* @return object The plugins helper object
*/
private function getHelper()
{
// Already initialized, so return
if ($this->_init) {
return $this->_helper;
}
$this->_init = true;
if (!$this->isFrameworkEnabled()) {
return false;
}
if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_snippets/models/list.php')) {
return;
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
if (nnProtect::isAdmin()) {
return false;
}
if (nnProtect::isProtectedPage($this->_alias, 1)) {
return false;
}
// Load component parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$params = nnParameters::getInstance()->getComponentParams($this->_name);
require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php';
$this->_helper = nnFrameworkHelper::getPluginHelper($this, $params);
return $this->_helper;
}
示例4: modCacheCleaner
function modCacheCleaner()
{
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = nnParameters::getInstance();
$this->params = $parameters->getPluginParams('cachecleaner');
}
示例5: __construct
public function __construct($form = null)
{
$this->db = JFactory::getDBO();
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
$this->max_list_count = $params->max_list_count;
}
示例6: getInput
protected function getInput()
{
if (!nnFrameworkFunctions::extensionInstalled('zoo')) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_ZOO')) . '</fieldset>';
}
$this->params = $this->element->attributes();
$this->db = JFactory::getDBO();
$group = $this->get('group', 'categories');
$tables = $this->db->getTableList();
if (!in_array($this->db->getPrefix() . 'zoo_' . ($group == 'applications' ? 'application' : 'category'), $tables)) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_ZOO')) . '</fieldset>';
}
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
$this->max_list_count = $params->max_list_count;
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$options = $this->{'get' . $group}();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
switch ($group) {
case 'categories':
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
default:
return nnHtml::selectlistsimple($options, $this->name, $this->value, $this->id, $size, $multiple);
}
}
示例7: __construct
/**
* Constructor.
*
* @param array An optional associative array of configuration settings.
*
* @see JController
*/
public function __construct()
{
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$this->parameters = nnParameters::getInstance();
$this->_config = $this->parameters->getComponentParams('snippets');
parent::__construct();
}
示例8: getConfig
/**
* Function that gets the config settings
*
* @return Object
*/
protected function getConfig()
{
if (!isset($this->config)) {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = nnParameters::getInstance();
$this->config = $parameters->getComponentParams('advancedmodules');
}
return $this->config;
}
示例9: __construct
/**
* Constructor.
*
* @param array An optional associative array of configuration settings.
*
* @see JController
*/
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array('id', 'a.id', 'name', 'a.name', 'alias', 'a.alias', 'description', 'a.description', 'ordering', 'a.ordering', 'published', 'a.published');
}
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$this->parameters = nnParameters::getInstance();
parent::__construct($config);
}
示例10: onAfterRoute
public function onAfterRoute()
{
$this->_pass = 0;
jimport('joomla.filesystem.file');
if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
// return if page should be protected
if (nnProtect::isProtectedPage('', 1)) {
return;
}
}
// load the admin language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_' . $this->_type . '_' . $this->_name);
// return if NoNumber Framework plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
if (JFactory::getApplication()->isAdmin() && JFactory::getApplication()->input->get('option') != 'com_login') {
$msg = JText::_('SRC_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('SRC_EXTENSION_CAN_NOT_FUNCTION', JText::_('SOURCERER'));
$mq = JFactory::getApplication()->getMessageQueue();
foreach ($mq as $m) {
if ($m['message'] == $msg) {
$msg = '';
break;
}
}
if ($msg) {
JFactory::getApplication()->enqueueMessage($msg, 'error');
}
}
return;
}
if (JFile::exists(JPATH_PLUGINS . '/system/nnframework/helpers/protect.php')) {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
// return if current page is an admin page
if (nnProtect::isAdmin()) {
return;
}
} else {
if (JFactory::getApplication()->isAdmin()) {
return;
}
}
// load the site language file
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
nnFrameworkFunctions::loadLanguage('plg_' . $this->_type . '_' . $this->_name, JPATH_SITE);
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams($this->_name);
// Include the Helper
require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php';
$class = get_class($this) . 'Helper';
$this->_helper = new $class($params);
$this->_pass = 1;
}
示例11: display
/**
* Display the view
*
*/
public function display($tpl = null)
{
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$this->parameters = nnParameters::getInstance();
$this->form = $this->get('Form');
$this->item = $this->_models['item']->getItem(null, 1);
$this->state = $this->get('State');
$this->config = $this->parameters->getComponentParams('snippets', $this->state->params);
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
示例12: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$this->db = JFactory::getDbo();
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
$this->max_list_count = $params->max_list_count;
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$group = $this->get('group', 'categories');
$options = $this->{'get' . $group}();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例13: getHelper
/**
* Create the helper object
*
* @return object The plugins helper object
*/
private function getHelper()
{
// Already initialized, so return
if ($this->_init) {
return $this->_helper;
}
$this->_init = true;
if (!$this->isFrameworkEnabled()) {
return false;
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/protect.php';
if (!nnProtect::isSystemPluginInstalled($this->_alias)) {
return false;
}
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams($this->_name);
require_once JPATH_PLUGINS . '/system/nnframework/helpers/helper.php';
$this->_helper = nnFrameworkHelper::getPluginHelper($this, $params);
return $this->_helper;
}
示例14: getInput
protected function getInput()
{
if (!nnFrameworkFunctions::extensionInstalled('akeebasubs')) {
return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_AKEEBASUBS')) . '</label></fieldset>';
}
$this->params = $this->element->attributes();
$this->db = JFactory::getDBO();
$group = $this->get('group', 'categories');
$tables = $this->db->getTableList();
if (!in_array($this->db->getPrefix() . 'akeebasubs_' . $group, $tables)) {
return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_AKEEBASUBS')) . '</label></fieldset>';
}
$parameters = nnParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
$this->max_list_count = $params->max_list_count;
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$options = $this->{'get' . $group}();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例15: isCategoryList
static function isCategoryList($context)
{
$hash = md5('isCategoryList_' . $context);
if (nnCache::has($hash)) {
return nnCache::get($hash);
}
// Return false if it is not a category page
if ($context != 'com_content.category' || JFactory::getApplication()->input->get('view') != 'category') {
return false;
}
// Return false if it is not a list layout
if (JFactory::getApplication()->input->get('layout') && JFactory::getApplication()->input->get('layout') != 'list') {
return false;
}
// Return true if it IS a list layout
if (JFactory::getApplication()->input->get('layout') == 'list') {
return true;
}
// Layout is empty, so check if default layout is list (default)
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = nnParameters::getInstance();
$parameters = $parameters->getComponentParams('content');
return nnCache::set($hash, $parameters->category_layout == '_:default');
}