本文整理汇总了PHP中nnHtml::selectlist方法的典型用法代码示例。如果您正苦于以下问题:PHP nnHtml::selectlist方法的具体用法?PHP nnHtml::selectlist怎么用?PHP nnHtml::selectlist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nnHtml
的用法示例。
在下文中一共展示了nnHtml::selectlist方法的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('akeebasubs')) {
return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_AKEEBASUBS')) . '</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="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_AKEEBASUBS')) . '</fieldset>';
}
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);
}
}
示例3: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
if (!NNFrameworkFunctions::extensionInstalled('virtuemart')) {
return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
}
$group = $this->def('group', 'categories');
$this->db = JFactory::getDBO();
$tables = $this->db->getTableList();
if (!in_array($this->db->getPrefix() . 'virtuemart_' . $group, $tables)) {
return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_VIRTUEMART')) . '</fieldset>';
}
$query = $this->db->getQuery(true);
$query->select('config')->from('#__virtuemart_configs')->where('virtuemart_config_id = 1');
$this->db->setQuery($query);
$config = $this->db->loadResult();
$lang = substr($config, strpos($config, 'vmlang='));
$lang = substr($lang, 0, strpos($lang, '|'));
if (preg_match('#"([^"]*_[^"]*)"#', $lang, $lang)) {
$this->lang = $lang['1'];
} else {
$this->lang = 'en_gb';
}
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$options = $this->{'get' . $group}();
$size = (int) $this->def('size');
$multiple = $this->def('multiple');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例4: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$this->db = JFactory::getDBO();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
$show_all = $this->get('show_all');
$attribs = 'class="inputbox"';
$groups = $this->getUserGroups();
$options = array();
if ($show_all) {
$option = new stdClass();
$option->value = -1;
$option->text = '- ' . JText::_('JALL') . ' -';
$option->disable = '';
$options[] = $option;
}
foreach ($groups as $group) {
$option = new stdClass();
$option->value = $group->value;
$option->text = $group->text;
$repeat = $show_all ? $group->level + 1 : $group->level;
$option->text = str_repeat('- ', $repeat) . $option->text;
$option->text = nnText::prepareSelectItem($option->text);
$option->disable = '';
$options[] = $option;
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple, $attribs);
}
示例5: 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);
}
}
示例6: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$this->db = JFactory::getDbo();
if (!is_array($this->value)) {
$this->value = explode(',', $this->value);
}
$group = $this->def('group', 'countries');
$options = array();
foreach ($this->{$group} as $key => $val) {
if (!$val) {
$options[] = JHtml::_('select.option', '-', ' ', 'value', 'text', true);
} else {
if ($key['0'] == '-') {
$options[] = JHtml::_('select.option', '-', $val, 'value', 'text', true);
} else {
$val = NNText::prepareSelectItem($val);
$options[] = JHtml::_('select.option', $key, $val);
}
}
}
$size = (int) $this->def('size');
$multiple = $this->def('multiple');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例7: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$this->db = JFactory::getDBO();
$frontend = $this->get('frontend', 1);
$admin = $this->get('admin', 1);
$size = (int) $this->get('size');
if (!$frontend && !$admin)
{
return '';
}
$components = $this->getComponents($frontend, $admin);
$options = array();
foreach ($components as $component)
{
$options[] = JHtml::_('select.option', $component->element, $component->name);
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1);
}
示例8: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
$attribs = 'class="inputbox"';
$options = array();
$templates = $this->getTemplates();
foreach ($templates as $styles) {
$level = 0;
foreach ($styles as $style) {
$style->level = $level;
$options[] = $style;
if (count($styles) <= 2) {
$level = 0;
break;
}
$level = 1;
}
}
// fix old '::' separator and change it to '--'
$value = json_encode($this->value);
$value = str_replace('::', '--', $value);
$value = (array) json_decode($value, true);
return nnHtml::selectlist($options, $this->name, $value, $this->id, $size, $multiple, $attribs);
}
示例9: 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);
}
}
示例10: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
if (!NNFrameworkFunctions::extensionInstalled('flexicontent')) {
return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</fieldset>';
}
$group = $this->def('group', 'categories');
$this->db = JFactory::getDBO();
$tables = $this->db->getTableList();
if (!in_array($this->db->getPrefix() . 'flexicontent_' . $group, $tables)) {
return '<fieldset class="radio">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</fieldset>';
}
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);
}
}
示例11: getInput
protected function getInput()
{
if (!nnFrameworkFunctions::extensionInstalled('flexicontent'))
{
return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</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() . 'flexicontent_' . $group, $tables))
{
return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_FLEXICONTENT')) . '</label></fieldset>';
}
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);
}
示例12: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$size = (int) $this->get('size');
$multiple = $this->get('multiple');
$client = $this->get('client', 'SITE');
jimport('joomla.language.helper');
$langs = JLanguageHelper::createLanguageList($this->value, constant('JPATH_' . strtoupper($client)), true);
$options = array();
foreach ($langs as $lang)
{
if ($lang['value'])
{
$option = new stdClass;
$option->value = $lang['value'];
$option->text = $lang['text'] . ' [' . $lang['value'] . ']';
$options[] = $option;
}
}
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例13: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$size = (int) $this->def('size');
$attribs = 'class="inputbox"';
$options = $this->getTags();
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, 1, $attribs);
}
示例14: getInput
protected function getInput()
{
$size = (int) $this->def('size');
$multiple = $this->def('multiple', 1);
require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
$options = MenusHelper::getMenuLinks();
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}
示例15: getInput
protected function getInput()
{
$this->params = $this->element->attributes();
$size = (int) $this->get('size');
$multiple = $this->get('multiple', 0);
JFactory::getLanguage()->load('com_menus', JPATH_ADMINISTRATOR);
$options = $this->getMenuItems();
require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
}