Skip to content

Commit

Permalink
Dev: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ptelu committed Jul 30, 2021
1 parent f4a5eef commit a889e51
Show file tree
Hide file tree
Showing 31 changed files with 1,431 additions and 1,294 deletions.
12 changes: 6 additions & 6 deletions application/extensions/TopbarWidget/views/baseTopbar_view.php
@@ -1,26 +1,26 @@
<?php
/**
* Base toolbar layout
*
* This is the base view for toolbars that have one part aligned to the left and one part aligned to the right
*
*
* @var string $topbarId defaults to 'surveybarid'
* @var string $leftSideContent the left side content
* @var string $rightSideContent the right side content
*
*
*/

?>

<div class='menubar surveybar' id="<?= !(empty($topbarId)) ? $topbarId : 'surveybarid' ?>">
<div class='row'>
<?php if (!empty($leftSideContent)): ?>
<?php if (!empty($leftSideContent)) : ?>
<!-- Left Side -->
<div class="<?= !empty($rightSideContent) ? 'col-md-6' : 'col-md-12'?>">
<div class="<?= !empty($rightSideContent) ? 'col-md-6' : 'col-md-12' ?>">
<?= $leftSideContent ?>
</div>
<?php endif; ?>

<?php if (!empty($rightSideContent)): ?>
<?php if (!empty($rightSideContent)) : ?>
<!-- Right Side -->
<div class="<?= !empty($leftSideContent) ? 'col-md-6' : 'col-md-12' ?> pull-right text-right">
<?= $rightSideContent ?>
Expand Down
@@ -1,7 +1,14 @@
<?php
/**
* @var string $backUrl
*/

?>

<!-- Save -->
<a id="save-button" class="btn btn-success pull-right" role="button">
<i class="fa fa-check"></i>
<?php eT("Save"); ?>
<?php eT('Save'); ?>
</a>
<!-- Back Button -->
<a class="btn btn-default" href="<?php echo $backUrl ?>" role="button">
Expand All @@ -12,10 +19,10 @@
<!-- Save and add question -->
<a class="btn btn-default" id='save-and-new-question-button' role="button">
<span class="fa fa-plus"></span>
<?php eT("Save & add question"); ?>
<?php eT('Save & add question'); ?>
</a>
<!-- Save and new group -->
<a class="btn btn-default" id='save-and-new-button' role="button">
<span class="fa fa-plus"></span>
<?php eT("Save & add group"); ?>
<?php eT('Save & add group'); ?>
</a>
@@ -1,6 +1,14 @@
<?php
/**
* @var Survey $oSurvey
* @var string $qid
*/

?>

<!-- Delete -->
<?php if (!empty($showDeleteButton)) : ?>
<?php if ($oSurvey->active != 'Y') : ?>
<?php if ($oSurvey->active !== 'Y') : ?>
<button class="btn btn-danger"
data-toggle="modal"
data-target="#confirmation-modal"
Expand Down
@@ -1,58 +1,66 @@
<?php
/**
* @var string $closeUrl
* @var string $returnUrl
*/

?>

<!-- White Close button -->
<?php if (!empty($showWhiteCloseButton)) :?>
<?php if (!empty($showWhiteCloseButton)) : ?>
<a class="btn btn-default" href="<?php echo $closeUrl ?>" role="button">
<span class="fa fa-close"></span>
<?php eT("Close");?>
<?php eT("Close"); ?>
</a>
<?php endif;?>
<?php endif; ?>

<!-- Save and Close -->
<?php if(!empty($showSaveAndCloseButton)): ?>
<a class="btn btn-default"
<?php if (!empty($showSaveAndCloseButton)): ?>
<a class="btn btn-default"
href="<?php echo $closeUrl; ?>"
role="button"
role="button"
id="save-and-close-button"
onclick="$(this).addClass('disabled').attr('onclick', 'return false;');">
<span class="fa fa-saved"></span>
<?php eT("Save and close");?>
<span class="fa fa-saved"></span>
<?php eT("Save and close"); ?>
</a>
<?php endif; ?>

<!-- Green Save and Close -->
<?php if(!empty($showGreenSaveAndCloseButton)): ?>
<a class="btn btn-success"
<?php if (!empty($showGreenSaveAndCloseButton)): ?>
<a class="btn btn-success"
href="<?php echo $closeUrl; ?>"
role="button"
role="button"
id="save-and-close-button"
onclick="$(this).addClass('disabled').attr('onclick', 'return false;');">
<span class="fa fa-saved"></span>
<?php eT("Save and close");?>
<span class="fa fa-saved"></span>
<?php eT("Save and close"); ?>
</a>
<?php endif; ?>

<!-- Save -->
<?php if(!empty($showSaveButton)): ?>
<?php if (!empty($showSaveButton)): ?>
<a id="save-button" class="btn btn-success pull-right" role="button">
<i class="fa fa-check"></i>
<?php eT("Save");?>
<?php eT("Save"); ?>
</a>
<?php endif; ?>

<!-- Export -->
<?php if(!empty($showExportButton)): ?>
<?php if (!empty($showExportButton)): ?>
<button class="btn btn-success" name="export-button" id="export-button" data-submit-form=1>
<span class="fa fa-download-alt"></span>
<?php eT("Export");?>
<?php eT("Export"); ?>
</button>
<?php endif;?>
<?php endif; ?>

<!-- Import -->
<?php if(!empty($showImportButton)): ?>
<?php if (!empty($showImportButton)): ?>
<button class="btn btn-success" name="import-button" id="import-button" data-submit-form=1>
<span class="fa fa-upload"></span>
<?php eT("Import");?>
<?php eT("Import"); ?>
</button>
<?php endif;?>
<?php endif; ?>

<!-- Return -->
<?php if (!empty($showBackButton)): ?>
Expand All @@ -61,12 +69,12 @@
&nbsp;&nbsp;
<?php eT('Back') ?>
</a>
<?php endif;?>
<?php endif; ?>

<!-- Close -->
<?php if(!empty($showCloseButton)): ?>
<?php if (!empty($showCloseButton)): ?>
<a class="btn btn-danger" href="<?php echo $closeUrl; ?>" role="button">
<span class="fa fa-close"></span>
<?php eT("Close");?>
<?php eT("Close"); ?>
</a>
<?php endif;?>
<?php endif; ?>
@@ -1,37 +1,45 @@
<?php
/**
* @var bool $showDelButton
* @var bool $hasSurveySettingsUpdatePermission
* @var bool $hasTokensDeletePermission
* @var Survey $oSurvey
*/

?>

<!-- Delete tokens table -->
<?php if (!empty($showDelButton) && ($hasSurveySettingsUpdatePermission || $hasTokensDeletePermission)): ?>
<?php if (!empty($showDelButton) && ($hasSurveySettingsUpdatePermission || $hasTokensDeletePermission)) : ?>
<a class="btn btn-danger" href="<?php echo Yii::App()->createUrl("admin/tokens/sa/kill/surveyid/$oSurvey->sid"); ?>" role="button">
<?php eT("Delete participants table"); ?>
</a>
<?php endif; ?>

<!-- Download CSV -->
<?php if(!empty($showDownloadButton)):?>
<?php if (!empty($showDownloadButton)) : ?>
<a class="btn btn-success pull-right" href="#" role="button" id="save-button">
<span class="fa fa fa-export" ></span>
<?php eT("Download CSV file"); ?>
<span class="fa fa fa-export"></span>
<?php eT("Download CSV file"); ?>
</a>
<?php endif;?>
<?php endif; ?>

<!-- Send invitations buttons -->
<?php if(!empty($showSendInvitationButton)):?>
<?php if (!empty($showSendInvitationButton)) : ?>
<a class="btn btn-success pull-right" href="#" role="button" id="send-invitation-button">
<span class="icon-invite" ></span>
<?php eT("Send invitations");?>
<span class="icon-invite"></span>
<?php eT("Send invitations"); ?>
</a>
<?php endif;?>
<?php endif; ?>

<!-- Send reminder buttons -->
<?php if(!empty($showSendReminderButton)):?>
<?php if (!empty($showSendReminderButton)) : ?>
<a class="btn btn-success pull-right" href="#" role="button" id="send-reminders-button">
<span class="icon-invite" ></span>
<?php eT("Send reminders");?>
<span class="icon-invite"></span>
<?php eT("Send reminders"); ?>
</a>
<?php endif;?>
<?php endif; ?>

<?php
/**
* Include the default buttons
*/
$this->render('includes/surveyTopbarRight_view', get_defined_vars());
<?php
// Include the default buttons
$this->render('includes/surveyTopbarRight_view', get_defined_vars());
?>
@@ -1,20 +1,20 @@
<?php
/**
* Question Editor toolbar layout.
*
* This is used instead of the base layout because two toolbars must be rendered at the same time (one of them hidden)
*
* @var Question $oQuestion
*/

$aData = get_defined_vars();
$leftSideContentSummary = $this->render('includes/questionTopbarLeft_view', get_defined_vars(), true);
$leftSideContentEditor = $this->render('includes/editQuestionTopbarLeft_view', get_defined_vars(), true);
$rightSideContent = $this->render('includes/editQuestionTopbarRight_view', get_defined_vars(), true);
$rightSideContentSummary = $this->render('includes/questionSummaryTopbarRight_view', get_defined_vars(), true);

?>

<!-- Question Top Bar -->
<div class='menubar surveybar' id="<?= !(empty($topbarId)) ? $topbarId : 'surveybarid' ?>">
<?php if ($oQuestion->qid !== 0): ?>
<?php if ($oQuestion->qid !== 0) : ?>
<div id="question-summary-topbar" class='row'>
<!-- Left Side -->
<div class="col-md-6">
Expand All @@ -28,12 +28,12 @@
<?php endif; ?>
<div id="question-create-edit-topbar" class='row' style="display: none;">
<!-- Left Side -->
<div class="<?= !empty($rightSideContent) ? 'col-md-6' : 'col-md-12'?>">
<div class="<?= !empty($rightSideContent) ? 'col-md-6' : 'col-md-12' ?>">
<?= $leftSideContentEditor ?>
</div>

<!-- Right Side -->
<div class="<?= !empty($leftSideContentEditor) ? 'col-md-6' : 'col-md-12'?> pull-right text-right">
<div class="<?= !empty($leftSideContentEditor) ? 'col-md-6' : 'col-md-12' ?> pull-right text-right">
<?= $rightSideContent ?>
</div>
</div>
Expand Down
27 changes: 14 additions & 13 deletions application/views/admin/export/generatestats/_header.php
Expand Up @@ -10,26 +10,27 @@
* @var $surveyid
* @var $sql
*/

?>

<!-- Message Box -->
<div class="jumbotron message-box">
<h2><?php eT("Results"); ?></h2>
<p><?php eT("Number of records in this query:")?>&nbsp;<?php echo $results;?></p>
<p><?php eT("Number of records in this query:") ?>&nbsp;<?php echo $results; ?></p>
<p><?php eT("Total records in survey:"); ?>&nbsp;<?php echo $total; ?></p>

<?php if($total): ?>
<?php if ($total) : ?>
<p><?php eT("Percentage of total:"); ?>&nbsp;<?php echo $percent; ?>%</p>
<?php endif;?>
<?php endif; ?>

<?php if($browse): ?>
<?php echo CHtml::form(array("admin/responses/sa/browse/surveyid/{$surveyid}"), 'post')."\n" ;?>
<p>
<?php Yii::app()->user->setState('sql_'.$surveyid,$sql); ?>
<input type='submit' class='btn btn-default' value='<?php eT("Browse");?>' />
<input type='hidden' name='subaction' value='all'/>
</p>
</form>
<?php endif;?>
<?php if ($browse) : ?>
<?php echo CHtml::form(["admin/responses/sa/browse/surveyid/{$surveyid}"], 'post') . "\n"; ?>
<p>
<?php Yii::app()->user->setState('sql_' . $surveyid, $sql); ?>
<input type='submit' class='btn btn-default' value='<?php eT("Browse"); ?>'/>
<input type='hidden' name='subaction' value='all'/>
</p>
<?php echo CHtml::endForm() ?>
<?php endif; ?>
</div>
<input type="hidden" id="showGraphOnPageLoad" />
<input type="hidden" id="showGraphOnPageLoad"/>

0 comments on commit a889e51

Please sign in to comment.