16 import(
'lib.pkp.classes.form.Form');
32 $this->_contextId = $contextId;
33 $this->_plugin = $plugin;
35 parent::__construct($plugin->getTemplateResource(
'settingsForm.tpl'));
44 $contextId = $this->_contextId;
45 $plugin = $this->_plugin;
47 $this->
setData(
'displayPage', $plugin->getSetting($contextId,
'displayPage'));
48 $this->
setData(
'recentItems', $plugin->getSetting($contextId,
'recentItems'));
55 $this->
readUserVars(array(
'displayPage',
'recentItems'));
58 if ((
int) $this->
getData(
'recentItems') <= 0) $this->
setData(
'recentItems',
'');
60 $this->
addCheck(
new FormValidator($this,
'recentItems',
'required',
'plugins.generic.webfeed.settings.recentItemsRequired'));
68 public function fetch($request, $template =
null, $display =
false) {
70 $templateMgr->assign(
'pluginName', $this->_plugin->getName());
71 return parent::fetch($request, $template, $display);
77 public function execute(...$functionArgs) {
78 $plugin = $this->_plugin;
79 $contextId = $this->_contextId;
81 $plugin->updateSetting($contextId,
'displayPage', $this->
getData(
'displayPage'));
82 $plugin->updateSetting($contextId,
'recentItems', $this->
getData(
'recentItems'));
84 parent::execute(...$functionArgs);