Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #18110: Unable to get empty help in question attributes (#…
- Loading branch information
Showing
18 changed files
with
147 additions
and
88 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
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
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
46 changes: 28 additions & 18 deletions
46
application/extensions/AdvancedSettingWidget/views/layout.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 |
---|---|---|
@@ -1,29 +1,39 @@ | ||
<div class="form-group <?= isset($this->setting['hidden']) && $this->setting['hidden'] === '1' ? 'hidden' : '' ?>"> | ||
<div class="form-group <?= $this->setting['hidden'] ? 'hidden' : '' ?>"> | ||
<div class="question-option-general-setting-block"> | ||
<label class="form-label" :for="elId"> | ||
<?= gT($this->setting['caption']) ?> | ||
</label> | ||
<?php if (in_array($this->setting['inputtype'], AdvancedSettingWidget::SINGLEINPUTTYPE) && !$this->setting['i18n']): ?> | ||
<label class="form-label" for="<?= CHtml::getIdByName($inputBaseName); ?>"> | ||
<?= gT($this->setting['caption']) ?> | ||
</label> | ||
<?php else: ?> | ||
<strong class="form-label" id="label-<?= CHtml::getIdByName($inputBaseName); ?>"> | ||
<?= gT($this->setting['caption']) ?> | ||
</strong> | ||
<?php endif; ?> | ||
<!-- TODO: Object method $setting->isLocalized(). --> | ||
<?php if (isset($this->setting['i18n']) && $this->setting['i18n'] == 1): ?> | ||
<?php if ($this->setting['i18n']): ?> | ||
<i | ||
class="fa fa-globe" | ||
data-toggle="tooltip" | ||
title="<?= gT("This setting is localized") ?>" | ||
></i> | ||
<?php endif; ?> | ||
<i | ||
role="button" | ||
class="fa fa-question-circle text-success" | ||
onclick="jQuery('#general-setting-help-<?= $this->setting['name'] ?>').slideToggle()" | ||
data-toggle="tooltip" | ||
title="<?= gT("See help") ?>" | ||
></i> | ||
<?php if ($this->setting['help']): ?> | ||
<a | ||
role="button" | ||
data-toggle="collapse" | ||
href="#help-<?= CHtml::getIdByName($inputBaseName); ?>" | ||
><i | ||
class="fa fa-question-circle text-info" | ||
data-toggle="tooltip" | ||
title="<?= CHtml::encode(strip_tags($this->setting['help'])) ?>" | ||
> </i><span class="sr-only"><?= gT("Show help"); ?></span> </a> | ||
<div class="help-block collapse" id="help-<?= CHtml::getIdByName($inputBaseName); ?>" aria-expanded="false"><?= $this->setting['help']; ?></div> | ||
<?php endif; ?> | ||
<?= $content ?> | ||
<div | ||
id="general-setting-help-<?= $this->setting['name'] ?>" | ||
class="question-option-help well" | ||
> | ||
<?= gT($this->setting['help']) ?> | ||
</div> | ||
</div> | ||
</div> | ||
<script> | ||
function getNames(){ | ||
return 'testing'; | ||
} | ||
</script> |
5 changes: 3 additions & 2 deletions
5
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
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
16 changes: 9 additions & 7 deletions
16
application/extensions/AdvancedSettingWidget/views/text.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
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
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
37 changes: 21 additions & 16 deletions
37
application/extensions/GeneralOptionWidget/views/layout.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 |
---|---|---|
@@ -1,21 +1,26 @@ | ||
<div class="form-group"> | ||
<div class="question-option-general-setting-block"> | ||
<label class="form-label"> | ||
<?= $this->generalOption->title; ?> | ||
</label> | ||
<i | ||
role="button" | ||
class="fa fa-question-circle text-success" | ||
onclick="jQuery('#general-setting-help-<?= $this->generalOption->name; ?>').slideToggle()" | ||
data-toggle="tooltip" | ||
title="<?= gT("See help"); ?>" | ||
></i> | ||
<?php if (in_array($this->generalOption->inputType, GeneralOptionWidget::SINGLEINPUTTYPE)): ?> | ||
<label class="form-label" for="<?= CHtml::getIdByName($this->generalOption->name); ?>"> | ||
<?= $this->generalOption->title; ?> | ||
</label> | ||
<?php else: ?> | ||
<strong class="form-label" id="label-<?= CHtml::getIdByName($this->generalOption->name); ?>"> | ||
<?= $this->generalOption->title; ?> | ||
</strong> | ||
<?php endif; ?> | ||
<?php if ($this->generalOption->formElement->help): ?> | ||
<a | ||
role="button" | ||
data-toggle="collapse" | ||
href="#help-<?= CHtml::getIdByName($this->generalOption->name); ?>" | ||
><i | ||
class="fa fa-question-circle text-info" | ||
data-toggle="tooltip" | ||
title="<?= CHtml::encode(strip_tags($this->generalOption->formElement->help)) ?>" | ||
> </i><span class="sr-only"><?= gT("Show help"); ?></span> </a> | ||
<div class="help-block collapse" id="help-<?= CHtml::getIdByName($this->generalOption->name); ?>" aria-expanded="false"><?= $this->generalOption->formElement->help; ?></div> | ||
<?php endif; ?> | ||
<?= $content; ?> | ||
<div | ||
id="general-setting-help-<?= $this->generalOption->name; ?>" | ||
class="question-option-help well" | ||
> | ||
<?= $this->generalOption->formElement->help; ?> | ||
</div> | ||
</div> | ||
</div> |
7 changes: 4 additions & 3 deletions
7
application/extensions/GeneralOptionWidget/views/questiongroup.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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<select | ||
class="form-control" | ||
name="question[<?= $this->generalOption->name ?>]" | ||
id="<?= $this->generalOption->name ?>" | ||
id="<?= CHtml::getIdByName($this->generalOption->name) ?>" | ||
<?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?> | ||
<?= $this->generalOption->disabled ? 'disabled' : '' ?> | ||
> | ||
<!-- TODO: Fix weird object reference. --> | ||
<?php foreach ($this->generalOption->formElement->options['options'] as $option) : ?> | ||
<?php if ($this->generalOption->formElement->value == $option->value) : ?> | ||
<option value="<?= $option->value ?>" selected="selected"><?= $option->text ?></option> | ||
<option value="<?= Chtml::encode($option->value) ?>" selected="selected"><?= $option->text ?></option> | ||
<?php else : ?> | ||
<option value="<?= $option->value ?>"><?= $option->text ?></option> | ||
<option value="<?= Chtml::encode($option->value) ?>"><?= $option->text ?></option> | ||
<?php endif; ?> | ||
<?php endforeach; ?> | ||
</select> |
Oops, something went wrong.