Skip to content

Commit

Permalink
Fixed issue: Page Header in Theme Editor
Browse files Browse the repository at this point in the history
- Added Green Bar (SurveyManagerBar)
- Adjusted Action Bar
- Renamed 'Return to theme list ' Button to 'Back'
  • Loading branch information
thedirtypanda committed Jun 4, 2021
1 parent cf648bc commit 47cc653
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
10 changes: 9 additions & 1 deletion application/controllers/admin/themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,10 @@ protected function _strip_ext($name)
* @param string $templatename
* @return void
*/
public function index($editfile = '', $screenname = 'welcome', $templatename = '')
public function index(string $editfile = '', string $screenname = 'welcome', string $templatename = '')
{
if ($templatename == '') {
// @todo getGlobalSetting is deprecated!
$templatename = getGlobalSetting('defaulttheme');
}

Expand All @@ -551,9 +552,16 @@ public function index($editfile = '', $screenname = 'welcome', $templatename = '
App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts') . 'templates.js');
App()->getClientScript()->registerPackage('ace');
App()->getClientScript()->registerPackage('jsuri');

// Green SurveyManagerBar Page Title
$pageTitle = gT('Theme editor:') . ' ' . $templatename;
$aData['pageTitle'] = $pageTitle;

// White Bar
$aData['fullpagebar']['returnbutton'] = true;

$this->_renderWrappedTemplate('themes', $aViewUrls, $aData);

// This helps handle the load/save buttons)
if ($screenname != 'welcome') {
Yii::app()->session['step'] = 1;
Expand Down
17 changes: 10 additions & 7 deletions application/views/admin/themes/templateeditorbar_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,16 @@ function copyprompt(text, defvalue, copydirectory, action)
//-->
</script>


<!-- Template Editor Bar -->
<div class='menubar' id="templateeditorbar">
<div class='row container-fluid'>

<!-- Left Menu -->
<div class="col-md-5">

<div class="col-md-5" style="margin-top: 10px; margin-bottom: 10px;">

<?php $importModal=false;?>
<?php if(is_writable($tempdir)):?>


<!-- Export -->
<?php if(Permission::model()->hasGlobalPermission('templates','export') && class_exists('ZipArchive')):?>
<a class="btn btn-default" id="button-export" href="<?php echo $this->createUrl('admin/themes/sa/templatezip/templatename/' . $templatename) ?>" role="button">
Expand Down Expand Up @@ -163,7 +161,9 @@ class="btn btn-danger selector--ConfirmModal">
</div>

<!-- Right Menu -->
<div class="col-md-7 text-right form-inline">
<div class="col-md-7 text-right form-inline" style="margin-top: 10px; margin-bottom: 10px;">

<!-- Theme Select Box -->
<div class="form-group">
<label for='templatedir'><?php eT("Theme:"); ?></label>
<select class="listboxtemplates form-control" id='templatedir' name='templatedir' onchange="javascript: var uri = new Uri('<?php
Expand All @@ -173,6 +173,7 @@ class="btn btn-danger selector--ConfirmModal">
</select>
</div>

<!-- Screen Select Box -->
<div class="form-group">
<label for='listboxtemplates'><?php eT("Screen:"); ?></label>
<?php echo CHtml::dropDownList('screenname',$screenname,$screens,array(
Expand All @@ -197,11 +198,12 @@ class="btn btn-danger selector--ConfirmModal">
</a>
<?php endif;?>

<!-- Return to Theme List -->
<?php if(isset($fullpagebar['returnbutton'])):?>
<a class="btn btn-default" href="<?php echo $this->createUrl("themeOptions/index"); ?>" role="button">
<span class="fa fa-backward" ></span>
&nbsp;&nbsp;
<?php eT("Return to theme list"); ?>
<?php eT("Back"); ?>
</a>
<?php endif;?>
</div>
Expand All @@ -212,8 +214,9 @@ class="btn btn-danger selector--ConfirmModal">
<?php $this->renderPartial('themeOptions/import_modal', ['importTemplate' => 'importtemplate', 'importModal' => 'importModal']); ?>
<?php endif;?>

<!-- Template Editor -->
<div class="col-lg-12 templateeditor">
<div class="h3 theme-editor-header"><?php eT("Theme editor:"); ?> <i><?php echo $templatename; ?></i></div>
<!-- <div class="h3 theme-editor-header"><?php eT("Theme editor:"); ?> <i><?php echo $templatename; ?></i></div> -->

<?php if(!is_template_editable($templatename)):?>
<div class="alert alert-info alert-dismissible" role="alert">
Expand Down

0 comments on commit 47cc653

Please sign in to comment.