forked from pkp/pkp-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afd867f
commit 9665558
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
/** | ||
* @file classes/components/form/FieldSlider.php | ||
* | ||
* Copyright (c) 2014-2024 Simon Fraser University | ||
* Copyright (c) 2000-2024 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class FieldSlider | ||
* | ||
* @ingroup classes_controllers_form | ||
* | ||
* @brief A color picker field in a form. | ||
*/ | ||
|
||
namespace PKP\components\forms; | ||
|
||
class FieldSlider extends Field | ||
{ | ||
/** @copydoc Field::$component */ | ||
public $component = 'field-slider'; | ||
|
||
|
||
/** | ||
* Range min value | ||
*/ | ||
public int $min; | ||
|
||
/** | ||
* Range max value | ||
*/ | ||
public int $max; | ||
|
||
/** | ||
* Label for min value, it displays actual value when not present | ||
*/ | ||
public ?string $minLabel = null; | ||
|
||
/** | ||
* Label for max value, it displays actual value when not present | ||
*/ | ||
public ?string $maxLabel = null; | ||
|
||
/** | ||
* Expects translation string, which should contain {$value} placeholder. It displays actual value if not present. | ||
*/ | ||
public ?string $valueLabel = null; | ||
|
||
/** | ||
* Expects translation string, which might contain {$value} placeholder. It fallback to valueLabel is not present.. | ||
*/ | ||
public ?string $valueLabelMin = null; | ||
|
||
/** | ||
* Expects translation string, which might contain {$value} placeholder. It fallback to valueLabel is not present.. | ||
*/ | ||
public ?string $valueLabelMax = null; | ||
|
||
|
||
|
||
/** | ||
* @copydoc Field::getConfig() | ||
*/ | ||
public function getConfig() | ||
{ | ||
$config = parent::getConfig(); | ||
$config['min'] = $this->min; | ||
$config['max'] = $this->max; | ||
$config['minLabel'] = $this->minLabel; | ||
$config['maxLabel'] = $this->maxLabel; | ||
$config['valueLabel'] = $this->valueLabel; | ||
$config['valueLabelMin'] = $this->valueLabelMin; | ||
$config['valueLabelMax'] = $this->valueLabelMax; | ||
|
||
return $config; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters