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