Skip to content

Commit

Permalink
Dev: lost dir='rtl' in layout
Browse files Browse the repository at this point in the history
Dev: survey layout include public layout
  • Loading branch information
Shnoulle committed Oct 28, 2016
1 parent de31217 commit a9e5089
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 52 deletions.
2 changes: 1 addition & 1 deletion application/views/layouts/public.php
Expand Up @@ -26,7 +26,7 @@
Yii::app()->loadHelper('surveytranslator');
$lang=App()->getLanguage();
$langDir= (getLanguageRTL(App()->getLanguage())) ? "rtl": "ltr";
?><html lang="<?php echo $lang ?>" class="no-js <?php echo $lang ?> dir-<?php echo $langDir ?>">
?><html lang="<?php echo $lang ?>" class="no-js <?php echo $lang ?> dir-<?php echo $langDir ?>" <?php echo ($langDir=='rtl' ? 'dir="rtl"':''); ?>>
<head>
<?php
App()->clientScript->registerScript("nojsReplace","(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);",CClientScript::POS_HEAD);
Expand Down
52 changes: 3 additions & 49 deletions application/views/layouts/survey.php
@@ -1,53 +1,7 @@
<?php
/**
* @todo : remove this one : move to public MUST BE DONE !
* @see : public.php
*
* @var string sTemplate : the template to be used
* @var array aData : the global var for templatereplace
* @var array aReplacementData : the array of replacement for templatereplace
* @var startsurvey boolean start surevy (mean add survey.pstpl page)
**/
/* send the header : @see common_helper sendCacheHeaders */
//~ sendCacheHeaders(); // Send the header
if (!headers_sent())
{
if (Yii::app()->getConfig('x_frame_options','allow')=='sameorigin')
{
header('X-Frame-Options: SAMEORIGIN');
}
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); // this line lets IE7 run LimeSurvey in an iframe
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: text/html; charset=utf-8');
}
?><!DOCTYPE html>
<?php
Yii::app()->loadHelper('surveytranslator');
$lang=App()->getLanguage();
$langDir= (getLanguageRTL(App()->getLanguage())) ? "rtl": "ltr";
?><html lang="<?php echo $lang ?>" class="no-js <?php echo $lang ?> dir-<?php echo $langDir ?>">
<head>
<?php
App()->clientScript->registerScript("nojsReplace","(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);",CClientScript::POS_HEAD);
$oTemplate = Template::model()->getInstance($this->sTemplate);
App()->getClientScript()->registerPackage('fontawesome');
if($oTemplate->cssFramework == 'bootstrap')
{
Yii::app()->getClientScript()->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport');
App()->bootstrap->registerAllScripts();
}
Yii::app()->clientScript->registerPackage('survey-template');
// Maybe can add language changer here
/* Add head by template + star body (if template start body here ....) */
echo templatereplace(file_get_contents($oTemplate->viewPath."startpage.pstpl"),$this->aReplacementData,$this->aGlobalData);
if(!empty($this->bStartSurvey)){
echo templatereplace(file_get_contents($oTemplate->viewPath."survey.pstpl"),$this->aReplacementData,$this->aGlobalData);
}
echo $content;
echo templatereplace(file_get_contents($oTemplate->viewPath."endpage.pstpl"),$this->aReplacementData,$this->aGlobalData);
?>
</body>
</html>
Yii::import('views.layout.public', true)
//~ require_once('public.php');
6 changes: 4 additions & 2 deletions templates/flatmodern/views/completed.pstpl
@@ -1,4 +1,6 @@
<div class="completed-wrapper">
<div class='completed-text'>{COMPLETED}</div>
<div class='end-url'>"+{URL}+"</div>
<div class='completed-text'>{COMPLETED}
{URL}
</div>

</div>

0 comments on commit a9e5089

Please sign in to comment.