Skip to content

Commit

Permalink
#9253 Hide announcement images behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and asmecher committed Nov 8, 2023
1 parent 31d3b23 commit b8d1f68
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions classes/components/forms/announcement/PKPAnnouncementForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use PKP\components\forms\FieldText;
use PKP\components\forms\FieldUploadImage;
use PKP\components\forms\FormComponent;
use PKP\config\Config;
use PKP\context\Context;
use PKP\db\DAORegistry;

Expand Down Expand Up @@ -68,20 +69,21 @@ public function __construct($action, $locales, string $baseUrl, string $temporar
'size' => 'large',
'toolbar' => 'bold italic superscript subscript | link | blockquote bullist numlist',
'plugins' => 'paste,link,lists',
]))
->addField(new FieldUploadImage('image', [
]));
if (Config::getVar('features', 'announcement_images')) {
$this->addField(new FieldUploadImage('image', [
'label' => __('manager.image'),
'baseUrl' => $baseUrl,
'options' => [
'url' => $temporaryFileApiUrl,
],
]))
->addField(new FieldText('dateExpire', [
'label' => __('manager.announcements.form.dateExpire'),
'description' => __('manager.announcements.form.dateExpireInstructions'),
'size' => 'small',
]));

}
$this->addField(new FieldText('dateExpire', [
'label' => __('manager.announcements.form.dateExpire'),
'description' => __('manager.announcements.form.dateExpireInstructions'),
'size' => 'small',
]));
if (!empty($announcementTypeOptions)) {
$this->addField(new FieldOptions('typeId', [
'label' => __('manager.announcementTypes.typeName'),
Expand Down

0 comments on commit b8d1f68

Please sign in to comment.