Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AnnouncementSettingsForm.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.tab.settings.form.ContextSettingsForm');
17 
19 
23  function AnnouncementSettingsForm($wizardMode = false) {
24  $settings = array(
25  'enableAnnouncements' => 'bool',
26  'enableAnnouncementsHomepage' => 'bool',
27  'numAnnouncementsHomepage' => 'int',
28  'announcementsIntroduction' => 'string',
29  );
30 
31  parent::ContextSettingsForm($settings, 'controllers/tab/settings/announcements/form/announcementSettingsForm.tpl', $wizardMode);
32  }
33 
34 
35  //
36  // Implement template methods from Form.
37  //
41  function getLocaleFieldNames() {
42  return array('announcementsIntroduction');
43  }
44 
45 
46  //
47  // Implement template methods from ContextSettingsForm.
48  //
52  function fetch($request) {
53  for($x = 1; $x < 11; $x++) {
54  $numAnnouncementsHomepageOptions[$x] = $x;
55  }
56 
57  $params = array(
58  'numAnnouncementsHomepageOptions' => $numAnnouncementsHomepageOptions,
59  'disableAnnouncementsHomepage' => !$this->getData('enableAnnouncementsHomepage')
60  );
61 
62  return parent::fetch($request, $params);
63  }
64 }
65 
66 ?>
Form to edit announcement settings.
getData($key)
Definition: Form.inc.php:210
Base class for forms that manage context settings data.