/** * @copydoc PKPPlugin::manage() */ function manage($verb, $args, &$message, &$messageParams, &$pluginModalContent = null) { $request = $this->getRequest(); $press = $request->getPress(); switch ($verb) { case 'settings': $this->import('BrowseBlockSettingsForm'); $form = new BrowseBlockSettingsForm($this, $press->getId()); if ($request->getUserVar('save')) { $form->readInputData(); if ($form->validate()) { $form->execute(); $message = NOTIFICATION_TYPE_SUCCESS; return false; } else { $pluginModalContent = $form->fetch($request); } } else { $form->initData(); $pluginModalContent = $form->fetch($request); } return true; default: return parent::manage($verb, $args, $message, $messageParams); } }
/** * @copydoc PKPPlugin::manage() */ function manage($args, $request) { $press = $request->getPress(); switch ($request->getUserVar('verb')) { case 'settings': $this->import('BrowseBlockSettingsForm'); $form = new BrowseBlockSettingsForm($this, $press->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); }