Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: Add widget for advanced question setting (TODO: duplication from…
… general settings?)
- Loading branch information
1 parent
78e92c5
commit f0dbcc2
Showing
6 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
application/extensions/AdvancedSettingWidget/AdvancedSettingWidget.php
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,18 @@ | ||
<?php | ||
|
||
class AdvancedSettingWidget extends CWidget | ||
{ | ||
/** @var AdvancedSetting */ | ||
public $setting; | ||
|
||
/** | ||
* @todo Classes instead of switch. | ||
*/ | ||
public function run() | ||
{ | ||
if ($this->setting['inputtype'] === 'singleselect') { | ||
//echo '<pre>'; var_dump($this->setting); echo '</pre>';die; | ||
} | ||
$this->render($this->setting['inputtype']); | ||
} | ||
} |
Empty file.
27 changes: 27 additions & 0 deletions
27
application/extensions/AdvancedSettingWidget/views/singleselect.php
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,27 @@ | ||
<div class="form-row"> | ||
<i | ||
class="fa fa-question pull-right" | ||
@click="triggerShowHelp=!triggerShowHelp" | ||
v-if="(elHelp.length>0) && !readonly" | ||
:aria-expanded="!triggerShowHelp" | ||
:aria-controls="'help-'+(elName || elId)" | ||
/></i> | ||
<label class="form-label" :for="elId"> | ||
<?= $this->setting['title']; ?> | ||
</label> | ||
<select | ||
class="form-control" | ||
name="<?= $this->setting['name']; ?>" | ||
id="<?= $this->setting['name']; ?>" | ||
> | ||
<?php foreach ($this->setting['aFormElementOptions']['options']['option'] as $option): ?> | ||
<option | ||
v-for="(optionObject, i) in elOptions.options.option" | ||
:key="i" | ||
:value="<?= json_encode($option['value']); ?>" | ||
> | ||
<?= $option['text']; ?> | ||
</option> | ||
<?php endforeach; ?> | ||
</select> | ||
</div> |
18 changes: 18 additions & 0 deletions
18
application/extensions/AdvancedSettingWidget/views/switch.php
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,18 @@ | ||
<div class="form-row"> | ||
<i | ||
class="fa fa-question pull-right" | ||
@click="triggerShowHelp=!triggerShowHelp" | ||
v-if="(elHelp.length>0) && !readonly" | ||
:aria-expanded="!triggerShowHelp" | ||
:aria-controls="'help-'+(elName || elId)" | ||
></i> | ||
<label class="form-label"><?= gT($this->setting['title']); ?></label> | ||
<div class="inputtype--toggle-container"> | ||
<input | ||
type="checkbox" | ||
name="<?= $this->setting['name']; ?>" | ||
id="<?= $this->setting['name']; ?>" | ||
/> | ||
</div> | ||
</div> | ||
|
Empty file.
Empty file.