Commit 28a76855 authored by Chenu Denis's avatar Chenu Denis
Browse files

[feature] Move from plugin settings to own settings

parent 48fb21fb
$(function() {
$("[data-moveto]").each( function() {
var moveTo = $(this).data('moveto');
$(this).appendTo($("#"+moveTo));
});
$("[data-click-name]").on("click", function() {
event.preventDefault();
$("button[name='" + $(this).data("click-name") + "'][value='" + $(this).data("click-value") +"']").first().trigger("click");
});
});
......@@ -4,11 +4,11 @@
<name>reloadAnyResponse</name>
<type>plugin</type>
<creationDate>2018-04-18</creationDate>
<lastUpdate>2021-11-10</lastUpdate>
<lastUpdate>2021-11-25</lastUpdate>
<author>Denis Chenu</author>
<authorUrl>https://extensions.sondages.pro/reloadanyresponse</authorUrl>
<supportUrl>https://support.sondages.pro/</supportUrl>
<version>5.0.0-beta1</version>
<version>5.1.0</version>
<license>GNU Affero General Public License v3.0</license>
<description><![CDATA[Allow to reload any response for admin user and respondant.]]></description>
</metadata>
......
This diff is collapsed.
<div class="row">
<div class="col-lg-12 content-right">
<?php if($title) {
echo CHtml::tag(
"h3",
array(
'id' => 'title-form-' . $pluginClass
),
$title
);
} ?>
<?php if($warningString) {
echo CHtml::tag("p",array('class'=>'alert alert-warning'),$warningString);
} ?>
<?php echo CHtml::beginForm();?>
<?php foreach($aSettings as $legend=>$settings) {
$fieldId = CHtml::getIdByName($legend);
$legend = CHtml::link(
"§" ,
"#{$fieldId}",
array(
'class' => 'self-link',
'name' => "{$fieldId}",
'aria-label' => gT("Link")
)
) . " " . $legend;
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'title'=>$legend,
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'labelWidth'=>6,
'controlWidth'=>6,
'settings' => $settings,
));
} ?>
<?php if(!empty($aSurveyPluginsSettings)) {
echo CHtml::tag('fieldset',
array(),
CHtml::tag('legend', array(),gT('Settings by plugins')),
false
);
foreach($aSurveyPluginsSettings as $id => $plugin) {
$title = sprintf(gT("Settings for plugin %s"), $plugin['name']);
$fieldId = CHtml::getIdByName($title);
$title = CHtml::link(
"§" ,
"#{$fieldId}",
array(
'class' => 'self-link',
'name' => "{$fieldId}",
'aria-label' => gT("Link")
)
) . " " . $title;
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'settings' => $plugin['settings'],
'form' => false,
'title' => $title,
'prefix' => "plugin[{$plugin['name']}]",
));
}
} ?>
<div class='row'>
<div class='col-md-offset-6 submit-buttons'>
<?php
echo CHtml::htmlButton('<i class="fa fa-check" aria-hidden="true"></i> '.gT('Save'),array('type'=>'submit','name'=>'save'.$pluginClass,'value'=>'save','class'=>'btn btn-primary'));
echo " ";
echo CHtml::htmlButton('<i class="fa fa-check-circle-o " aria-hidden="true"></i> '.gT('Save and close'),array('type'=>'submit','name'=>'save'.$pluginClass,'value'=>'redirect','class'=>'btn btn-default'));
echo " ";
echo CHtml::link(gT('Close'),Yii::app()->createUrl('admin/survey',array('sa'=>'view','surveyid'=>$surveyId)),array('class'=>'btn btn-danger'));
?>
<div class='hidden' style='display:none'>
<div data-moveto='title-form-<?= $pluginClass ?>' class='pull-right hidden-xs'>
<?php
echo CHtml::link('<i class="fa fa-check" aria-hidden="true"></i> '.gT('Save'),"#",array('class'=>'btn btn-primary','data-click-name'=>'save'.$pluginClass,'data-click-value'=>'save'));
echo " ";
echo CHtml::link('<i class="fa fa-check-circle-o" aria-hidden="true"></i> '.gT('Save and close'),"#",array('class'=>'btn btn-default','data-click-name'=>'save'.$pluginClass,'data-click-value'=>'redirect'));
echo " ";
echo CHtml::link(gT('Close'),Yii::app()->createUrl('admin/survey',array('sa'=>'view','surveyid'=>$surveyId)),array('class'=>'btn btn-danger'));
?>
</div>
</div>
</div>
</div>
<?php echo CHtml::endForm();?>
</div>
</div>
<?php
Yii:app()->clientScript->registerScriptFile($assetUrl.'/settings.js',CClientScript::POS_END);
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment