本文整理汇总了PHP中CParameter::render方法的典型用法代码示例。如果您正苦于以下问题:PHP CParameter::render方法的具体用法?PHP CParameter::render怎么用?PHP CParameter::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CParameter
的用法示例。
在下文中一共展示了CParameter::render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _buildFieldParams
/**
* Read custom params from XML file and render them
**/
public function _buildFieldParams($type, $params = '')
{
$xmlPath = JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'fields' . DS . $type . '.xml';
$html = '';
if (JFile::exists($xmlPath)) {
$params = new CParameter($params, $xmlPath);
$html = $params->render();
}
return $html;
}
示例2: ajaxShowSettings
/**
* Ajax method to display the application settings
*
* @params $id Int Application id.
* @params $appName String Application element
**/
public function ajaxShowSettings($id, $appName)
{
$filter = JFilterInput::getInstance();
$id = $filter->clean($id, 'int');
$appName = $filter->clean($appName, 'string');
// Check permissions
$my =& JFactory::getUser();
if ($my->id == 0) {
return $this->ajaxBlockUnregister();
}
$objResponse = new JAXResponse();
$appsModel = CFactory::getModel('apps');
$lang =& JFactory::getLanguage();
$lang->load('com_community');
$lang->load('plg_' . JString::strtolower($appName));
$lang->load('plg_' . JString::strtolower($appName), JPATH_ROOT . DS . 'administrator');
$xmlPath = CPluginHelper::getPluginPath('community', $appName) . DS . $appName . DS . 'config.xml';
jimport('joomla.filesystem.file');
$actions = '';
if (JFile::exists($xmlPath)) {
$paramStr = $appsModel->getUserAppParams($id);
$params = new CParameter($paramStr, $xmlPath);
//$paramData = (isset($params->_xml['_default']->param)) ? $params->_xml['_default']->param : array();
$paramData = $params->getParams();
$html = '<form method="POST" action="" name="appSetting" id="appSetting">';
$html .= $params->render();
$html .= '<input type="hidden" value="' . $id . '" name="appid"/>';
$html .= '<input type="hidden" value="' . $appName . '" name="appname"/>';
$html .= '</form>';
if (!empty($paramData) && $paramData !== false) {
$actions = '<input onclick="joms.apps.saveSettings()" type="submit" value="' . JText::_('COM_COMMUNITY_APPS_SAVE_BUTTON') . '" class="button" name="Submit"/>';
}
} else {
$html = '<div class-"ajax-notice-apps-configure">' . JText::_('COM_COMMUNITY_APPS_AJAX_NO_CONFIG') . '</div>';
}
$objResponse->addScriptCall('cWindowAddContent', $html, $actions);
$objResponse->addAssign('cwin_logo', 'innerHTML', JText::_('COM_COMMUNITY_APPS_SETTINGS_TITLE'));
return $objResponse->sendResponse();
}
示例3: ajaxShowSettings
/**
* Ajax method to display the application settings
*
* @params $id Int Application id.
* @params $appName String Application element
**/
public function ajaxShowSettings($id, $appName)
{
$filter = JFilterInput::getInstance();
$id = $filter->clean($id, 'int');
$appName = $filter->clean($appName, 'string');
// Check permissions
$my = CFactory::getUser();
if ($my->id == 0) {
return $this->ajaxBlockUnregister();
}
$json = array();
$appsModel = CFactory::getModel('apps');
$lang = JFactory::getLanguage();
$lang->load('com_community');
$lang->load('plg_community_' . JString::strtolower($appName));
$lang->load('plg_community_' . JString::strtolower($appName), JPATH_ROOT . '/administrator');
$xmlPath = CPluginHelper::getPluginPath('community', $appName) . '/config.xml';
jimport('joomla.filesystem.file');
$actions = '';
if (JFile::exists($xmlPath)) {
$paramStr = $appsModel->getUserAppParams($id);
$params = new CParameter($paramStr, $xmlPath);
//$paramData = (isset($params->_xml['_default']->param)) ? $params->_xml['_default']->param : array();
//$paramData = $params->getParams();
$html = '<form method="POST" action="" name="appSetting" id="appSetting" class="reset-gap">';
$html .= $params->render();
$html .= '<input type="hidden" value="' . $id . '" name="appid"/>';
$html .= '<input type="hidden" value="' . $appName . '" name="appname"/>';
$html .= '</form>';
$actions = '<input onclick="joms.apps.saveSettings()" type="submit" value="' . JText::_('COM_COMMUNITY_APPS_SAVE_BUTTON') . '" class="joms-button--primary joms-button--full-small" name="Submit"/>';
$json['html'] = $html;
$json['btnSave'] = JText::_('COM_COMMUNITY_APPS_SAVE_BUTTON');
} else {
$html = '<div class-"ajax-notice-apps-configure">' . JText::_('COM_COMMUNITY_APPS_AJAX_NO_CONFIG') . '</div>';
$json['html'] = $html;
}
$json['title'] = JText::_('COM_COMMUNITY_APPS_SETTINGS_TITLE');
$json['paramStr'] = isset($paramStr) ? $paramStr : '';
$json['xmlPath'] = $xmlPath;
die(json_encode($json));
}