本文整理汇总了PHP中WFParameter::addElementPath方法的典型用法代码示例。如果您正苦于以下问题:PHP WFParameter::addElementPath方法的具体用法?PHP WFParameter::addElementPath怎么用?PHP WFParameter::addElementPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WFParameter
的用法示例。
在下文中一共展示了WFParameter::addElementPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$language = JFactory::getLanguage();
$language->load('plg_editors_jce', JPATH_ADMINISTRATOR);
$client = JRequest::getWord('client', 'site');
$model = $this->getModel();
$plugin = WFExtensionHelper::getPlugin();
$xml = WF_EDITOR_LIBRARIES . '/xml/config/editor.xml';
$data = null;
// get params from editor plugin
if ($plugin->params && $plugin->params !== "{}") {
$data = json_decode($plugin->params);
} else {
$component = WFExtensionHelper::getComponent();
// get params from component "params" field (legacy)
if ($component->params) {
$data = json_decode($component->params);
}
}
// get params definitions
$params = new WFParameter($data, $xml, 'editor');
$params->addElementPath(JPATH_COMPONENT . '/elements');
$this->assign('model', $model);
$this->assign('params', $params);
$this->assign('client', $client);
WFToolbarHelper::apply();
WFToolbarHelper::save();
WFToolbarHelper::help('config.about');
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
$db = JFactory::getDBO();
$client = JRequest::getWord('client', 'admin');
$model = $this->getModel();
$this->document->setTitle(WFText::_('WF_PREFERENCES_TITLE'));
$this->document->addStyleSheet('templates/system/css/system.css');
$component = WFExtensionHelper::getComponent();
$xml = JPATH_COMPONENT . '/models/preferences.xml';
// get params definitions
$params = new WFParameter($component->params, $xml, 'preferences');
$params->addElementPath(JPATH_COMPONENT . '/elements');
if (WFModel::authorize('admin')) {
$form = $model->getForm('permissions');
} else {
$form = null;
}
$this->assign('params', $params);
$this->assign('permissons', $form);
$this->addStyleSheet('components/com_jce/media/css/preferences.css');
$this->addScript('components/com_jce/media/js/preferences.js');
if (JRequest::getInt('close') == 1) {
$this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.close();});');
} else {
$this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.init();});');
}
parent::display($tpl);
}
示例3: 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();
}
}
示例4: display
function display($tpl = null)
{
$db = JFactory::getDBO();
$language = JFactory::getLanguage();
$language->load('plg_editors_jce', JPATH_ADMINISTRATOR);
$client = JRequest::getWord('client', 'site');
$model = $this->getModel();
$lists = array();
$component = WFExtensionHelper::getComponent();
$xml = WF_EDITOR_LIBRARIES . DS . 'xml' . DS . 'config' . DS . 'editor.xml';
// get params definitions
$params = new WFParameter($component->params, $xml, 'editor');
$params->addElementPath(JPATH_COMPONENT . DS . 'elements');
$this->assignRef('model', $model);
$this->assignRef('params', $params);
$this->assignRef('client', $client);
WFToolbarHelper::save();
WFToolbarHelper::apply();
WFToolbarHelper::help('config.about');
parent::display($tpl);
}
示例5: 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;
}
示例6: foreach
}
}
foreach ($items as $extension) {
// get extension xml file
$file = $extension->manifest;
if ($extension->core == 0) {
// Load extension language file
$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 . '.' . $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>';
示例7: foreach
// Get extensions supported by this plugin
$extensions = $this->model->getExtensions($plugin->name);
foreach ($extensions as $extension) {
// get extension xml file
$file = $extension->manifest;
if ($extension->core == 0) {
// Load extension language file
$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>