Skip to content

Commit

Permalink
Dev: templateoptions => themeoptions, for url, functions, and strings
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Nov 21, 2017
1 parent 215b1c1 commit 41b72b8
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions application/controllers/admin/templates.php
Expand Up @@ -30,7 +30,7 @@ public function runWithParams($params)
parent::runWithParams($params);
}else{
Yii::app()->setFlashMessage(gT("We are sorry but you don't have permissions to do this."),'error');
$this->getController()->redirect(array("admin/templateoptions"));
$this->getController()->redirect(array("admin/themeoptions"));
}
}

Expand Down Expand Up @@ -70,7 +70,7 @@ public function templatezip($templatename)
}
}else{
Yii::app()->setFlashMessage(gT("We are sorry but you don't have permissions to do this."),'error');
$this->getController()->redirect(array("admin/templateoptions"));
$this->getController()->redirect(array("admin/themeoptions"));
}
}

Expand Down Expand Up @@ -241,7 +241,7 @@ public function upload()
$this->_renderWrappedTemplate('templates', $aViewUrls, $aData);
}else{
Yii::app()->setFlashMessage(gT("We are sorry but you don't have permissions to do this."),'error');
$this->getController()->redirect(array("admin/templateoptions"));
$this->getController()->redirect(array("admin/themeoptions"));
}


Expand Down Expand Up @@ -468,7 +468,7 @@ public function templaterename()
Yii::app()->user->setFlash('error',sprintf(gT("Template '%s' could not be found."), $sOldName));
}

$this->getController()->redirect(array('admin/templateoptions'));
$this->getController()->redirect(array('admin/themeoptions'));
}
}
}else{
Expand Down Expand Up @@ -571,7 +571,7 @@ public function delete($templatename)
Yii::app()->setFlashMessage(gT("We are sorry but you don't have permissions to do this."),'error');
}
// Redirect with default templatename, editfile and screenname
$this->getController()->redirect(array("admin/templateoptions"));
$this->getController()->redirect(array("admin/themeoptions"));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/admin/template_helper.php
Expand Up @@ -65,7 +65,7 @@ function mkdir_p($target){
}
}

function templateoptions($optionarray, $selectedvalue) {
function themeoptions($optionarray, $selectedvalue) {
$return='';
foreach ($optionarray as $arkey=>$arvalue) {
$return .= "<option value='".HTMLEscape($arkey)."'";
Expand Down
2 changes: 1 addition & 1 deletion application/models/TemplateConfiguration.php
Expand Up @@ -660,7 +660,7 @@ protected function getTemplateForPath($oRTemplate, $sPath )
//throw new Exception("can't find a template for template '{$oRTemplate->template_name}' for path '$sPath'.");
TemplateConfiguration::uninstall($this->template_name);
Yii::app()->setFlashMessage(sprintf(gT("Templates '%s' has been uninstalled because it's not compatible with this LimeSurvey version."), $this->template_name), 'error');
Yii::app()->getController()->redirect(array("admin/templateoptions"));
Yii::app()->getController()->redirect(array("admin/themeoptions"));
break;
}
$oRTemplate = $oMotherTemplate;
Expand Down
2 changes: 1 addition & 1 deletion application/models/TemplateManifest.php
Expand Up @@ -271,7 +271,7 @@ public static function importManifest($sTemplateName, $aDatas=array() )

if ($bExtends && !Template::model()->findByPk($bExtends)){
Yii::app()->setFlashMessage(sprintf(gT("You can't import template '%s' because '%s' is not installed."), $sTemplateName, $bExtends ), 'error');
Yii::app()->getController()->redirect(array("admin/templateoptions"));
Yii::app()->getController()->redirect(array("admin/themeoptions"));
}

// Metadas is never inherited
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/super/_configuration_menu.php
Expand Up @@ -134,7 +134,7 @@
<?php if(Permission::model()->hasGlobalPermission('templates','read')): ?>
<!-- Template Editor -->
<li class="dropdown-item">
<a href="<?php echo $this->createUrl("admin/templateoptions"); ?>">
<a href="<?php echo $this->createUrl("admin/themeoptions"); ?>">
<?php eT("Template list");?>
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/survey/surveySummary_view.php
Expand Up @@ -526,7 +526,7 @@
<?php $templatename = $oSurvey->template;
if (Permission::model()->hasGlobalPermission('templates','read'))
{
$sTemplateOptionsUrl = $this->createUrl("admin/templateoptions/sa/updatesurvey",array('surveyid'=>$oSurvey->sid, "gsid"=>$oSurvey->gsid));
$sTemplateOptionsUrl = $this->createUrl("admin/themeoptions/sa/updatesurvey",array('surveyid'=>$oSurvey->sid, "gsid"=>$oSurvey->gsid));
$sTemplateEditorUrl = $this->createUrl("admin/templates/sa/view",array('templatename' => $oSurvey->template));
//$sTemplateEditorUrl = $this->createUrl("admin/templates/sa/view",array('editfile'=>'layout_first_page.twig', "screenname"=>'welcome', 'template' => $oSurvey->template));
?>
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/surveysgroups/update.php
Expand Up @@ -42,8 +42,8 @@
<div id="templateSettingsFortThisGroup" class="tab-pane">
<?php
if (is_a($templateOptionsModel, 'TemplateConfiguration')){
// $this->renderPartial('./templateoptions/update', array('model'=>$templateOptionsModel, 'templateOptionPage'=>$templateOptionPage));
$this->renderPartial('./templateoptions/index', array('model'=>$templateOptionsModel, 'bFromSurveyGroup'=>true));
// $this->renderPartial('./themeoptions/update', array('model'=>$templateOptionsModel, 'templateOptionPage'=>$templateOptionPage));
$this->renderPartial('./themeoptions/index', array('model'=>$templateOptionsModel, 'bFromSurveyGroup'=>true));
}
?>
</div>
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/templates/templateeditorbar_view.php
Expand Up @@ -200,7 +200,7 @@ function copyprompt(text, defvalue, copydirectory, action)
<select class="listboxtemplates form-control" id='templatedir' name='templatedir' onchange="javascript: var uri = new Uri('<?php
// Don't put 'sa' into the URL dirctly because YIi will then try to use filenames directly in the path because of the route
echo $this->createUrl("admin/templates",array('sa'=>'view','editfile'=>$relativePathEditfile,'screenname'=>$screenname)); ?>'); uri.addQueryParam('templatename',this.value); window.open(uri.toString(), '_top')">
<?php echo templateoptions($templates, $templatename); ?>
<?php echo themeoptions($templates, $templatename); ?>
</select>
</div>

Expand Down Expand Up @@ -229,7 +229,7 @@ function copyprompt(text, defvalue, copydirectory, action)
<?php endif;?>

<?php if(isset($fullpagebar['returnbutton'])):?>
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/templateoptions"); ?>" role="button">
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/themeoptions"); ?>" role="button">
<span class="fa fa-backward" ></span>
&nbsp;&nbsp;
<?php eT("Return to template list"); ?>
Expand Down
8 changes: 4 additions & 4 deletions application/views/admin/themeoptions/index.php
Expand Up @@ -2,7 +2,7 @@
/* @var $this AdminController */
/* @var $dataProvider CActiveDataProvider */

// TODO: rename to template_list.php
// TODO: rename to template_list.php and move to template controller

// DO NOT REMOVE This is for automated testing to validate we see that page
echo viewHelper::getViewTestTag('templateOptions');
Expand All @@ -26,7 +26,7 @@
),
)
));
echo '<h3>'.gT('Installed templates:').'</h3>';
echo '<h3>'.gT('Installed survey themes:').'</h3>';
}


Expand Down Expand Up @@ -91,7 +91,7 @@
</div>

<?php if (count($model->templatesWithNoDb) > 0 && !$bFromSurveyGroup):?>
<h3><?php eT('Available templates:'); ?></h3>
<h3><?php eT('Available survey themes:'); ?></h3>
<div class="row">
<div class="col-sm-12 content-right">

Expand All @@ -110,7 +110,7 @@
<td class="col-md-1"><?php echo $oTemplate->preview; ?></td>
<td class="col-md-2"><?php echo $oTemplate->sTemplateName; ?></td>
<td class="col-md-3"><?php echo $oTemplate->config->metadatas->description; ?></td>
<td class="col-md-2"><?php eT('XML template');?></td>
<td class="col-md-2"><?php eT('XML themes');?></td>
<td class="col-md-2"><?php echo $oTemplate->config->metadatas->extends; ?></td>
<td class="col-md-1"><?php echo $oTemplate->buttons; ?></td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/themeoptions/update.php
Expand Up @@ -7,7 +7,7 @@

?>

<div class="row h1"><?php echo sprintf(gT('Update template options for %s'),'<em>' . $model->template_name . '</em>'); ?></div>
<div class="row h1"><?php echo sprintf(gT('Update survey theme options for %s'),'<em>' . $model->template_name . '</em>'); ?></div>
<!-- Using bootstrap tabs to differ between just hte options and advanced direct settings -->
<div class="row">
<!-- Nav tabs -->
Expand All @@ -34,7 +34,7 @@
if($jsonError !== JSON_ERROR_NONE && $model->options !== 'inherit')
{
//return
echo "<div class='ls-flex-column fill'><h4>".gT('There are no simple options in this template.')."</h4></div>";
echo "<div class='ls-flex-column fill'><h4>".gT('There are no simple options in this survey theme.')."</h4></div>";
}
//if however there is no error in the parsing of the json string go forth and render the form
else
Expand Down
4 changes: 2 additions & 2 deletions themes/survey/default/options/options.twig
Expand Up @@ -9,9 +9,9 @@
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
(¯`·._.·(¯`·._.· Default survey template options ._.·´¯)·._.·´¯)
(¯`·._.·(¯`·._.· Default survey Theme options ._.·´¯)·._.·´¯)
This is the form for the option parameters of the basic default template.
This is the form for the option parameters of the basic default theme.
#}

Expand Down

0 comments on commit 41b72b8

Please sign in to comment.