本文整理汇总了PHP中SettingsForm::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP SettingsForm::fetch方法的具体用法?PHP SettingsForm::fetch怎么用?PHP SettingsForm::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SettingsForm
的用法示例。
在下文中一共展示了SettingsForm::fetch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manage
/**
* @see Plugin::manage()
*/
function manage($args, $request)
{
switch ($request->getUserVar('verb')) {
case 'settings':
$context = $request->getContext();
AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_MANAGER);
$templateMgr = TemplateManager::getManager($request);
$templateMgr->register_function('plugin_url', array($this, 'smartyPluginUrl'));
$this->import('SettingsForm');
$form = new SettingsForm($this, $context->getId());
if ($request->getUserVar('save')) {
$form->readInputData();
if ($form->validate()) {
$form->execute();
return new JSONMessage(true);
}
} else {
$form->initData();
}
return new JSONMessage(true, $form->fetch($request));
}
return parent::manage($args, $request);
}
示例2: manage
/**
* @see GenericPlugin::manage()
*/
function manage($verb, $args, &$message, &$messageParams, &$pluginModalContent = null)
{
if (!parent::manage($verb, $args, $message, $messageParams, $pluginModalContent)) {
return false;
}
$request = $this->getRequest();
$router = $request->getRouter();
$context = $router->getContext($request);
$this->import('SettingsForm');
$form = new SettingsForm($this, $context->getId());
$templateMgr =& TemplateManager::getManager();
$templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
switch ($verb) {
case 'settings':
$form->initData();
$pluginModalContent = $form->fetch($request);
return true;
case 'save':
$form->readInputData();
if ($form->validate()) {
$form->execute();
$message = NOTIFICATION_TYPE_SUCCESS;
$messageParams = array('contents' => __('plugins.generic.alm.settings.saved'));
return false;
} else {
$pluginModalContent = $form->fetch($request);
}
default:
// Unknown management verb
assert(false);
}
return false;
}