예제 #1
0
 public function updateField($curData)
 {
     $field = new \Ip\Form\Field\Checkbox(array('label' => $this->label, 'name' => $this->field, 'layout' => $this->layout, 'attributes' => $this->attributes));
     if (isset($curData[$this->field])) {
         $field->setValue($curData[$this->field]);
     }
     return $field;
 }
예제 #2
0
파일: Forms.php 프로젝트: Umz/ImpressPages
 public static function getAdvancedForm()
 {
     $form = new \Ip\Form();
     $form->addClass('ipsConfigForm');
     $form->addClass('ipsConfigFormAdvanced');
     $form->addClass('hidden');
     $form->setAjaxSubmit(0);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'automaticCron', 'value' => ipGetOption('Config.automaticCron', 1), 'label' => __('Execute cron automatically', 'Ip-admin', false), 'hint' => __('ImpressPages execute cron once every hour on randomly selected visitor page load. I you have setup cron manually, you can disable automatic cron functionality.', 'Ip-admin')));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'cronPassword', 'value' => ipGetOption('Config.cronPassword', 1), 'label' => __('Cron password', 'Ip-admin', false), 'hint' => __('Protect cron from being abusively executed by the strangers.', 'Ip-admin', false), 'note' => '<span class="ipsUrlLabel">' . __('Cron URL: ', 'Ip-admin') . '</span><a target="_blank" class="ipsUrl"></a>'));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'removeOldEmails', 'value' => ipGetOption('Config.removeOldEmails', 0), 'label' => __('Remove old emails from the log', 'Ip-admin', false)));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'removeOldEmailsDays', 'value' => ipGetOption('Config.removeOldEmailsDays', 720), 'label' => __('Days to keep emails', 'Ip-admin', false), 'hint' => __('Meaningful only if "Remove old emails" is on.', 'Ip-admin', false)));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'removeOldRevisions', 'value' => ipGetOption('Config.removeOldRevisions', 0), 'label' => __('Remove old page revisions', 'Ip-admin', false)));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'removeOldRevisionsDays', 'value' => ipGetOption('Config.removeOldRevisionsDays', 720), 'label' => __('Days to keep revisions', 'Ip-admin', false), 'hint' => __('Meaningful only if "Remove old page revisions" is on.', 'Ip-admin', false)));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'allowAnonymousUploads', 'value' => ipGetOption('Config.allowAnonymousUploads', 1), 'label' => __('Allow anonymous uploads', 'Ip-admin', false), 'hint' => __('Disabling this feature will prevent users from uploading files to your website. E.g. in contact forms.', 'Ip-admin')));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'trailingSlash', 'value' => ipGetOption('Config.trailingSlash', 1), 'label' => __('Add trailing slash at the end of page URL', 'Ip-admin', false), 'hint' => __('This won\'t change existing URLs. Only new and updated pages will get slash at the end.', 'Ip-admin')));
     $field->addClass('ipsAutoSave');
     $field->addAttribute('data-fieldid', $field->getName());
     $field->addAttribute('id', $field->getName());
     $field->addAttribute('data-fieldname', $field->getName());
     $form->addField($field);
     return $form;
 }