本文整理匯總了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));
}