public function __construct($prefix = '', $fields = []) { parent::__construct($prefix, $fields); if (empty($fields)) { $fields = ['id' => ['type' => 'hidden', 'isArray' => true], 'name' => ['label' => wfMsg('manage-wikia-home-collections-name-field-label'), 'validator' => new WikiaValidatorListValue(['validator' => new WikiaValidatorString(array('required' => true, 'min' => 1), array('too_short' => 'wikia-hubs-validator-string-short'))]), 'isArray' => true], 'enabled' => ['label' => wfMsg('manage-wikia-home-collections-enabled-field-label'), 'type' => 'checkbox', 'validator' => new WikiaValidatorListValue(['validator' => new WikiaValidatorInteger()]), 'isArray' => true], 'sponsor_url' => ['label' => wfMsg('manage-wikia-home-collections-sponsor-url-field-label'), 'validator' => new WikiaValidatorListValue(['validator' => new WikiaValidatorUrl()]), 'isArray' => true], 'sponsor_hero_image' => ['label' => wfMsg('manage-wikia-home-collections-sponsor-hero-image-field-label'), 'validator' => new WikiaValidatorListValue(['validator' => new WikiaValidatorFileTitle(array('required' => false))]), 'isArray' => true], 'sponsor_image' => ['label' => wfMsg('manage-wikia-home-collections-sponsor-image-field-label'), 'validator' => new WikiaValidatorListValue(['validator' => new WikiaValidatorFileTitle(array('required' => false))]), 'isArray' => true]]; $this->setFields($fields); } }
public function __construct($prefix = '', $fields = []) { parent::__construct($prefix, $fields); if (empty($fields)) { $fields = ['hub_slot' => ['label' => wfMessage('manage-wikia-home-hubs-slot-name')->plain(), 'type' => 'select', 'isArray' => true]]; $fields['marketing_slot_title'] = ['label' => 'Title', 'type' => 'text', 'isArray' => true]; $fields['marketing_slot_image'] = ['type' => 'hidden', 'validator' => new WikiaValidatorListValue(array('validator' => new WikiaValidatorImageSize(array('minWidth' => self::SLOT_IMG_WIDTH, 'minHeight' => self::SLOT_IMG_HEIGHT, 'maxWidth' => self::SLOT_IMG_WIDTH, 'maxHeight' => self::SLOT_IMG_HEIGHT), array('min-width' => 'manage-wikia-home-marketing-invalid-width', 'max-width' => 'manage-wikia-home-marketing-invalid-width', 'min-height' => 'manage-wikia-home-marketing-invalid-height', 'max-height' => 'manage-wikia-home-marketing-invalid-height', 'wrong-size' => 'manage-wikia-home-marketing-invalid-size')))), 'attributes' => array('class' => 'required wmu-file-name-input'), 'class' => 'hidden', 'label' => 'Image', 'isArray' => true]; $fields['marketing_slot_link'] = ['label' => 'Link', 'type' => 'text', 'isArray' => true]; } $this->setFields($fields); }
public function __construct($prefix = '', $fields = []) { parent::__construct($prefix, $fields); $fields = ['visitors' => ['label' => wfMessage('manage-wikia-home-stats-visitors-label')->text(), 'validator' => new WikiaValidatorInteger(['required' => true, 'min' => 0])], 'mobilePercentage' => ['label' => wfMessage('manage-wikia-home-stats-mobile-percentage-label')->text(), 'validator' => new WikiaValidatorNumeric(['required' => true, 'min' => 0, 'max' => 100])], 'editsDefault' => ['label' => wfMessage('manage-wikia-home-stats-edits-default-label')->text(), 'validator' => new WikiaValidatorInteger(['required' => true, 'min' => 0])], 'totalPages' => ['label' => wfMessage('manage-wikia-home-stats-total-pages-label')->text(), 'validator' => new WikiaValidatorInteger(['required' => true, 'min' => 0])]]; $this->setFields($fields); }