本文整理汇总了PHP中NNParameters类的典型用法代码示例。如果您正苦于以下问题:PHP NNParameters类的具体用法?PHP NNParameters怎么用?PHP NNParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NNParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
$attr = '';
$attr .= ' size="' . (int) $size . '"';
$attr .= $multiple ? ' multiple="multiple"' : '';
return JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
}
示例2: getInput
protected function getInput()
{
if (!NNFrameworkFunctions::extensionInstalled('mijoshop')) {
return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
}
$this->params = $this->element->attributes();
$group = $this->def('group', 'categories');
$this->db = JFactory::getDBO();
$tables = $this->db->getTableList();
if (!in_array($this->db->getPrefix() . 'mijoshop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_MIJOSHOP')) . '</fieldset>';
}
$this->params = $this->element->attributes();
$parameters = NNParameters::getInstance();
$params = $parameters->getPluginParams('nnframework');
$this->max_list_count = $params->max_list_count;
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->def('size');
$multiple = $this->def('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);
} else {
$attr = '';
$attr .= ' size="' . (int) $size . '"';
$attr .= $multiple ? ' multiple="multiple"' : '';
return JHtml::_('select.genericlist', $options, $this->name . '[]', trim($attr), 'value', 'text', $this->value, $this->id);
}
}
示例3: __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;
}
示例4: getInput
protected function getInput()
{
if (!NNFrameworkFunctions::extensionInstalled('hikashop')) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</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() . 'hikashop_' . ($group == 'products' ? 'product' : 'category'), $tables)) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</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);
}
}
示例5: modCacheCleaner
function modCacheCleaner()
{
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = NNParameters::getInstance();
$this->params = $parameters->getPluginParams('cachecleaner');
}
示例6: onDisplay
/**
* Display the button
*
* @return array A two element array of ( imageName, textToInsert )
*/
function onDisplay($name)
{
jimport('joomla.filesystem.file');
// return if system plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/' . $this->_name . '/' . $this->_name . '.php')) {
return;
}
// return if NoNumber Framework plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
return;
}
// load the admin language file
$lang = JFactory::getLanguage();
if ($lang->getTag() != 'en-GB') {
// Loads English language file as fallback (for undefined stuff in other language file)
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB');
}
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1);
// 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);
return $this->helper->render($name);
}
示例7: onDisplay
/**
* Display the button
*
* @return array A two element array of ( imageName, textToInsert )
*/
function onDisplay($name)
{
jimport('joomla.filesystem.file');
// return if system plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . $this->_name . DS . $this->_name . '.php')) {
return;
}
// return if NoNumber! Elements plugin is not installed
if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'nonumberelements.php')) {
return;
}
// load the admin language file
$lang =& JFactory::getLanguage();
if ($lang->getTag() != 'en-GB') {
// Loads English language file as fallback (for undefined stuff in other language file)
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB');
}
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1);
// Load system plugin parameters
require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
$parameters =& NNParameters::getParameters();
$system_params = JPluginHelper::getPlugin('system', $this->_name);
$params = $parameters->getParams($system_params->params, JPATH_PLUGINS . DS . 'system' . DS . $this->_name . DS . $this->_name . '.xml');
// Include the Helper
require_once JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . DS . 'helper.php';
$class = get_class($this) . 'Helper';
$this->helper = new $class($params);
return $this->helper->render($name);
}
示例8: modAddToMenu
function modAddToMenu(&$params)
{
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$this->parameters = NNParameters::getInstance();
$this->params = $this->parameters->getParams($params->toObject(), JPATH_ADMINISTRATOR . '/modules/mod_addtomenu/mod_addtomenu.xml');
}
示例9: render
function render(&$params)
{
jimport('joomla.filesystem.file');
$app = JFactory::getApplication();
$parameters = NNParameters::getInstance();
$system_params = $parameters->getPluginParamValues('sourcerer');
// Load plugin language
$lang = JFactory::getLanguage();
$lang->load('plg_editors-xtd_sourcerer', JPATH_ADMINISTRATOR);
$language = 'en';
foreach ($lang->getLocale() as $locale) {
if (JFile::exists(JPATH_PLUGINS . '/editors-xtd/sourcerer/editarea/langs/' . $locale . '.js')) {
$language = $locale;
break;
}
}
// Add scripts and styles
JHtml::_('behavior.mootools');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php';
$sversion = NoNumberVersions::getXMLVersion('sourcerer', 'editors-xtd', null, 1);
$version = NoNumberVersions::getXMLVersion(null, null, null, 1);
$document = JFactory::getDocument();
$document->addScript(JURI::root(true) . '/plugins/editors-xtd/sourcerer/editarea/edit_area_full.js' . $sversion);
$document->addScript(JURI::root(true) . '/plugins/editors-xtd/sourcerer/js/script.js' . $sversion);
$script = "\n\t\t\teditAreaLoader.init({\n\t\t\t\tid: 'source',\t// id of the textarea to transform\n\t\t\t\tstart_highlight: true,\t// if start with highlight\n\t\t\t\tallow_resize: 'y',\n\t\t\t\tallow_toggle: false,\n\t\t\t\tword_wrap: true,\n\t\t\t\tlanguage: '" . $language . "',\n\t\t\t\tsyntax: 'php',\n\t\t\t\ttoolbar: 'fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, highlight, reset_highlight, word_wrap',\n\t\t\t\tsyntax_selection_allow: 'css,html,js,php'\n\t\t\t});\n\n\t\t\tvar sourcerer_syntax_word = '" . $system_params->syntax_word . "';\n\t\t\tvar sourcerer_editorname = '" . JRequest::getString('name', 'text') . "';\n\t\t\tvar sourcerer_default_addsourcetags = " . (int) $params->addsourcetags . ";\n\t\t\tvar sourcerer_root = '" . JURI::root(true) . "';\n\n\t\t\twindow.addEvent( 'domready', function() { sourcerer_init(); });\n\t\t";
$document->addScriptDeclaration($script);
$document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/popup.css' . $version);
$document->addStyleSheet(JURI::root(true) . '/plugins/editors-xtd/sourcerer/css/popup.css' . $sversion);
$params->code = '';
if ($params->use_example_code == 1 || $app->isAdmin() && $params->use_example_code == 2) {
$params->code = $params->example_code;
}
echo $this->getHTML($params);
}
示例10: onAfterRoute
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('tooltips', 1)) {
return;
}
}
// load the admin language file
$lang = JFactory::getLanguage();
if ($lang->getTag() != 'en-GB') {
// Loads English language file as fallback (for undefined stuff in other language file)
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB');
}
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1);
// 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::_('TT_NONUMBER_FRAMEWORK_NOT_INSTALLED') . ' ' . JText::sprintf('TT_EXTENSION_CAN_NOT_FUNCTION', JText::_('TOOLTIPS'));
$mq = JFactory::getApplication()->getMessageQueue();
foreach ($mq as $m) {
if ($m['message'] == $msg) {
$msg = '';
break;
}
}
if ($msg) {
JFactory::getApplication()->enqueueMessage($msg, 'error');
}
}
return;
}
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = NNParameters::getInstance();
$params = $parameters->getPluginParams($this->_name);
// allow in admin?
if (!$params->enable_admin || JFactory::getApplication()->input->get('option') == 'com_plugins') {
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;
}
}
}
// 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: getPluginParamValues
function getPluginParamValues($name, $type = 'system')
{
jimport('joomla.plugin.plugin');
$plugin = JPluginHelper::getPlugin($type, $name);
require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
$parameters =& NNParameters::getParameters();
return $parameters->getParams($plugin->params, JPATH_PLUGINS . DS . $type . DS . $name . DS . $name . '.xml');
}
示例12: onAfterRoute
function onAfterRoute()
{
$this->_pass = 0;
// return if disabled via url
// return if current page is raw format
// return if current page is a joomfishplus page
if (JRequest::getCmd('disable_sourcerer') || JRequest::getCmd('format') == 'raw' || JRequest::getCmd('option') == 'com_joomfishplus' || JRequest::getInt('nn_qp')) {
return;
}
$app = JFactory::getApplication();
// load the admin language file
$lang = JFactory::getLanguage();
if ($lang->getTag() != 'en-GB') {
// Loads English language file as fallback (for undefined stuff in other language file)
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB');
}
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1);
// return if NoNumber Framework plugin is not installed
jimport('joomla.filesystem.file');
if (!JFile::exists(JPATH_PLUGINS . '/system/nnframework/nnframework.php')) {
if ($app->isAdmin() && JRequest::getCmd('option') !== 'com_login') {
$msg = JText::_('SRC_NONUMBER_FRAMEWORK_NOT_INSTALLED');
$msg .= ' ' . JText::sprintf('SRC_EXTENSION_CAN_NOT_FUNCTION', JText::_('SOURCERER'));
$mq = $app->getMessageQueue();
foreach ($mq as $m) {
if ($m['message'] == $msg) {
$msg = '';
break;
}
}
if ($msg) {
$app->enqueueMessage($msg, 'error');
}
}
return;
}
// return if current page is an administrator page (and not acymailing)
if ($app->isAdmin() && JRequest::getCmd('option') != 'com_acymailing') {
return;
}
$this->_pass = 1;
// load the admin language file
$lang = JFactory::getLanguage();
if ($lang->getTag() != 'en-GB') {
// Loads English language file as fallback (for undefined stuff in other language file)
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_SITE, 'en-GB');
}
$lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_SITE, null, 1);
// Load plugin parameters
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = NNParameters::getInstance();
$params = $parameters->getPluginParams($this->_name, $this->_type, $this->params);
// Include the Helper
require_once JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/helper.php';
$class = get_class($this) . 'Helper';
$this->helper = new $class($params);
}
示例13: getConfig
/**
* Function that gets the config settings
*/
protected function getConfig()
{
if (!isset($this->config)) {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$parameters = NNParameters::getInstance();
$this->config = $parameters->getComponentParams('nonumbermanager');
}
return $this->config;
}
示例14: getPluginHelper
static function getPluginHelper(&$plugin, $params = null)
{
if (!$params) {
require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php';
$params = NNParameters::getInstance()->getPluginParams($plugin->get('_name'));
}
require_once JPATH_PLUGINS . '/' . $plugin->get('_type') . '/' . $plugin->get('_name') . '/helper.php';
$class = get_class($plugin) . 'Helper';
return new $class($params);
}
示例15: getConfig
/**
* Function that gets the config settings
*
* @return Object
*/
protected function getConfig()
{
if (!isset($this->config)) {
require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
$parameters =& NNParameters::getParameters();
$config = JComponentHelper::getParams('com_advancedmodules');
$this->config = $parameters->getParams($config->toObject(), JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml');
}
return $this->config;
}