本文整理汇总了PHP中WFParameter::getGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP WFParameter::getGroups方法的具体用法?PHP WFParameter::getGroups怎么用?PHP WFParameter::getGroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WFParameter
的用法示例。
在下文中一共展示了WFParameter::getGroups方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getParams
function getParams($data)
{
jimport('joomla.form.form');
if (class_exists('JForm')) {
//JForm::addFormPath(JPATH_PLUGINS . '/system/jcemediabox');
$xml = JPATH_PLUGINS . '/system/jcemediabox/jcemediabox.xml';
$params = new WFParameter($data, $xml, '', array('control' => 'config:fields:fieldset'));
$params->addElementPath(JPATH_PLUGINS . '/system/jcemediabox/elements');
$groups = array();
$array = array();
foreach ($params->getGroups() as $group) {
$groups[] = $params->getParams('params', $group);
}
foreach ($groups as $group) {
$array = array_merge($array, $group);
}
return $array;
} else {
// get params definitions
$params = new JParameter($data, JPATH_PLUGINS . '/system/jcemediabox.xml');
$xml = JPATH_PLUGINS . '/system/jcemediabox.xml';
$params->loadSetupFile($xml);
return $params->getParams();
}
}
示例2: getLayoutParams
function getLayoutParams(&$row)
{
// get params definitions
$xml = WF_EDITOR_LIBRARIES . '/xml/config/layout.xml';
// get editor params
$params = new WFParameter($row->params, $xml, 'editor');
$params->addElementPath(JPATH_COMPONENT . '/elements');
$params->addElementPath(WF_EDITOR . '/elements');
$groups = $params->getGroups();
$row->layout_params = $params;
$row->layout_groups = $groups;
}
示例3: trim
$language->load('com_jce_' . $extension->folder . '_' . trim($extension->extension), JPATH_SITE);
}
if (JFile::exists($file)) {
// get params for plugin
$key = $plugin->name . '.' . $type . '.' . $extension->extension;
$params = new WFParameter($this->profile->params, $file, $key);
// add element paths
$params->addElementPath(array(WF_EDITOR . '/elements'));
// render params
if (!$params->hasParent()) {
$key = array($plugin->name, $type, $extension->extension);
$enabled = (int) $params->get('enable', 1);
$checked = $enabled ? ' checked="checked"' : '';
$html .= '<h3><input type="hidden" id="params' . implode('', $key) . 'enable" name="params[' . implode('][', $key) . '][enable]" value="' . $enabled . '" /><input type="checkbox" data-name="' . $extension->extension . '" class="plugins-enable-checkbox"' . $checked . '/>' . WFText::_($extension->name) . '</h3>';
$html .= '<p>' . WFText::_($extension->description) . '</p>';
foreach ($params->getGroups() as $group) {
$html .= $params->render('params[' . implode('][', $key) . ']', $group, array('enable'));
}
}
}
}
if ($html) {
echo '<fieldset class="adminform panelform"><legend>' . WFText::_('WF_EXTENSIONS_' . strtoupper($type) . '_TITLE') . '</legend>';
echo $html;
echo '</fieldset>';
}
}
?>
</div>
<?php
}
示例4: trim
$language = JFactory::getLanguage();
$language->load('com_jce_' . $extension->folder . '_' . trim($extension->extension), JPATH_SITE);
}
if (JFile::exists($file)) {
// get params for plugin
$key = $plugin->name . '.' . $extension->type . '.' . $extension->extension;
$params = new WFParameter($this->profile->params, $file, $key);
// add element paths
$params->addElementPath(JPATH_COMPONENT . DS . 'elements');
$params->addElementPath(JPATH_COMPONENT_SITE . DS . 'elements');
$params->addElementPath(WF_EDITOR . DS . 'elements');
// render params
if (!$params->hasParent()) {
echo '<fieldset class="adminform panelform"><legend>' . WFText::_($extension->name) . '</legend>';
echo '<p>' . WFText::_($extension->description) . '</p>';
foreach ($params->getGroups() as $group => $num) {
echo $params->render('params[' . $plugin->name . '][' . $extension->type . '][' . $group . ']', $group);
}
echo '</fieldset>';
}
}
}
?>
</div>
<?php
}
}
}
if (!$count) {
echo WFText::_('WF_PROFILES_NO_PLUGINS');
}
示例5: display
//.........这里部分代码省略.........
$components = $db->loadObjectList();
$options = array();
for ($i = 0; $i < count($components); $i++) {
if (isset($components[$i]->element)) {
$components[$i]->option = $components[$i]->element;
}
if (!in_array($components[$i]->option, $exclude)) {
$options[] = JHTML::_('select.option', $components[$i]->option, WFText::_($components[$i]->name), 'value', 'text');
}
}
$disabled = !$row->components ? ' disabled="disabled"' : '';
$lists['components'] = JHTML::_('select.genericlist', $options, 'components[]', 'class="inputbox levels" size="10" multiple="multiple"' . $disabled, 'value', 'text', explode(',', $row->components));
$options = array();
$options[] = JHTML::_('select.option', 'all', WFText::_('WF_PROFILES_COMPONENTS_ALL'));
$options[] = JHTML::_('select.option', 'select', WFText::_('WF_PROFILES_COMPONENTS_SELECT'));
$lists['components-select'] = JHTML::_('select.radiolist', $options, 'components-select', 'class="inputbox"', 'value', 'text', $row->components ? 'select' : 'all', false);
$options = array();
$options[] = JHTML::_('select.option', '', '-- ' . WFText::_('WF_PROFILES_AREA_SELECT') . ' --');
$options[] = JHTML::_('select.option', 0, WFText::_('WF_PROFILES_AREA_BOTH'));
$options[] = JHTML::_('select.option', 1, WFText::_('WF_PROFILES_AREA_FRONTEND'));
$options[] = JHTML::_('select.option', 2, WFText::_('WF_PROFILES_AREA_BACKEND'));
$lists['area'] = JHTML::_('select.genericlist', $options, 'area', 'class="inputbox levels" size="1"', 'value', 'text', $row->area);
$query = 'SELECT types' . ' FROM #__wf_profiles' . ' WHERE id NOT IN (17,28,29,30)';
$db->setQuery($query);
$types = $db->loadResultArray();
if (WF_JOOMLA15) {
// get list of Groups for dropdown filter
$query = 'SELECT id AS value, name AS text' . ' FROM #__core_acl_aro_groups' . ' WHERE id NOT IN (17,28,29,30)';
$db->setQuery($query);
$types = $db->loadObjectList();
$i = '-';
$options = array(JHTML::_('select.option', '0', WFText::_('Guest')));
foreach ($types as $type) {
$options[] = JHTML::_('select.option', $type->value, $i . WFText::_($type->text));
$i .= '-';
}
} else {
$options = array();
$join = ' LEFT JOIN #__usergroups AS b ON a.lft > b.lft AND a.rgt < b.rgt';
$where = '';
$query = 'SELECT a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level' . ' FROM #__usergroups AS a' . ' LEFT JOIN #__usergroups AS b ON a.lft > b.lft AND a.rgt < b.rgt' . ' GROUP BY a.id' . ' ORDER BY a.lft ASC';
// Prevent parenting to children of this item.
/*if ($id = $this->form->getValue('id')) {
$query->join('LEFT', '`#__usergroups` AS p ON p.id = '.(int) $id);
$query->where('NOT(a.lft >= p.lft AND a.rgt <= p.rgt)');
}*/
// Get the options.
$db->setQuery($query);
$options = $db->loadObjectList();
// Pad the option text with spaces using depth level as a multiplier.
for ($i = 0, $n = count($options); $i < $n; $i++) {
$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;
}
}
$lists['types'] = JHTML::_('select.genericlist', $options, 'types[]', 'class="inputbox levels" size="8" multiple="multiple"', 'value', 'text', $row->types == '' ? '' : explode(',', $row->types));
$options = array();
if ($row->id && $row->users) {
$query = 'SELECT id as value, username as text' . ' FROM #__users' . ' WHERE id IN (' . $row->users . ')';
$db->setQuery($query);
$gusers = $db->loadObjectList();
if ($gusers) {
foreach ($gusers as $guser) {
$options[] = JHTML::_('select.option', $guser->value, $guser->text);
}
}
}
$lists['users'] = JHTML::_('select.genericlist', $options, 'users[]', 'class="inputbox users" size="10" multiple="multiple"', 'value', 'text', '');
// get params definitions
$xml = WF_EDITOR_LIBRARIES . DS . 'xml' . DS . 'config' . DS . 'profiles.xml';
// get editor params
$params = new WFParameter($row->params, $xml, 'editor');
$params->addElementPath(JPATH_COMPONENT . DS . 'elements');
$params->addElementPath(WF_EDITOR . DS . 'elements');
// get width
$width = $params->get('editor_width', 600);
$groups = $params->getGroups();
$this->assign('width', $width);
$this->assignRef('lists', $lists);
$this->assignRef('profile', $row);
$this->assignRef('params', $params);
$this->assignRef('groups', $groups);
$this->assignRef('plugins', $plugins);
$options = WFToolsHelper::getOptions($params);
$this->document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Profiles.init(' . json_encode($options) . ')});');
if ($row->id) {
JToolBarHelper::title(WFText::_('WF_ADMINISTRATION') . ' :: ' . WFText::_('WF_PROFILES_EDIT') . ' - [' . $row->name . ']', 'logo.png');
} else {
JToolBarHelper::title(WFText::_('WF_ADMINISTRATION') . ' :: ' . WFText::_('WF_PROFILES_NEW'), 'logo.png');
}
WFToolbarHelper::save();
WFToolbarHelper::apply();
WFToolbarHelper::cancel('cancelEdit', 'Close');
WFToolbarHelper::help('profiles.edit');
JRequest::setVar('hidemainmenu', 1);
$this->setLayout('form');
break;
}
$this->assignRef('model', $model);
parent::display($tpl);
}