Skip to content

Commit

Permalink
Fixed issue #7282: Public statistics layout uses quirks mode in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Feb 14, 2013
1 parent 768936f commit 8b578c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 31 deletions.
40 changes: 19 additions & 21 deletions application/controllers/Statistics_userController.php
Expand Up @@ -124,7 +124,7 @@ function actionAction($surveyid,$language)
require_once(APPPATH.'third_party/pchart/pchart/pData.class');
require_once(APPPATH.'third_party/pchart/pchart/pCache.class');

$MyCache = new pCache(Yii::app()->getConfig("tempdir").'/');
$MyCache = new pCache(Yii::app()->getConfig("tempdir").DIRECTORY_SEPARATOR);
//$currentuser is created as prefix for pchart files
if (isset($_SERVER['REDIRECT_REMOTE_USER']))
{
Expand Down Expand Up @@ -156,13 +156,6 @@ function actionAction($surveyid,$language)
$surveylanguage= $language;
sendCacheHeaders();
$condition = false;
$header= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
. "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"".$surveylanguage."\" lang=\"".$surveylanguage."\"";
if (getLanguageRTL($surveylanguage))
{
$condition = true;
$header.=" dir=\"rtl\" ";
}
$sitename = Yii::app()->getConfig("sitename");

$data['surveylanguage'] = $surveylanguage;
Expand Down Expand Up @@ -362,7 +355,25 @@ function actionAction($surveyid,$language)
}// end if -> for removing the error message in case there are no filters
$summary = $allfields;


// Get the survey inforamtion
$thissurvey = getSurveyInfo($surveyid,$language);

//SET THE TEMPLATE DIRECTORY
if (!isset($thissurvey['templatedir']) || !$thissurvey['templatedir'])
{
$data['sTemplatePath'] = validateTemplateDir("default");
}
else
{
$data['sTemplatePath'] = validateTemplateDir($thissurvey['templatedir']);
}


//---------- CREATE STATISTICS ----------
$redata = compact(array_keys(get_defined_vars()));
doHeader();
echo templatereplace(file_get_contents(getTemplatePath(validateTemplateDir($data['sTemplatePath'])).DIRECTORY_SEPARATOR."startpage.pstpl"),array(), $redata);


//some progress bar stuff
Expand Down Expand Up @@ -439,19 +450,6 @@ function actionAction($surveyid,$language)
$prb->hide();
}

// Get the survey inforamtion
$thissurvey = getSurveyInfo($surveyid,$language);

//SET THE TEMPLATE DIRECTORY
if (!isset($thissurvey['templatedir']) || !$thissurvey['templatedir'])
{
$data['sTemplatePath'] = validateTemplateDir("default");
}
else
{
$data['sTemplatePath'] = validateTemplateDir($thissurvey['templatedir']);
}

$redata = compact(array_keys(get_defined_vars()));
$data['redata'] = $redata;
header_includes('statistics_user.js');
Expand Down
6 changes: 0 additions & 6 deletions application/controllers/admin/conditionsaction.php
Expand Up @@ -1284,8 +1284,6 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
->bindValue(":lang1", $sLanguage, PDO::PARAM_STR)
->bindValue(":lang2", $sLanguage, PDO::PARAM_STR)
->query() or safeDie ("Couldn't get other conditions for question $qid<br />$query<br />");



$querytoken = "SELECT count(*) as recordcount "
."FROM {{conditions}} "
Expand Down Expand Up @@ -1317,8 +1315,6 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
->bindValue(":qid", $qid, PDO::PARAM_INT)
->query() or safeDie ("Couldn't get other conditions for question $qid<br />$query<br />");



$conditionscount=$conditionscount+$conditionscounttoken;

if ($conditionscount > 0)
Expand Down Expand Up @@ -1592,7 +1588,6 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
}
//END DISPLAY CONDITIONS FOR THIS QUESTION


// BEGIN: DISPLAY THE COPY CONDITIONS FORM
if ($subaction == "copyconditionsform" || $subaction == "copyconditions")
{
Expand Down Expand Up @@ -1692,7 +1687,6 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
$qcount = 0;
}


//BEGIN: DISPLAY THE ADD or EDIT CONDITION FORM
if ($subaction == "editconditionsform" || $subaction == "insertcondition" ||
$subaction == "updatecondition" || $subaction == "deletescenario" ||
Expand Down
4 changes: 0 additions & 4 deletions application/views/statistics_user_view.php
@@ -1,7 +1,3 @@
<?php
doHeader();
echo templatereplace(file_get_contents(getTemplatePath(validateTemplateDir($sTemplatePath))."/startpage.pstpl"),array(), $redata);
?>
<script type='text/javascript'>
var graphUrl="<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/graph"); ?>";
</script>
Expand Down

0 comments on commit 8b578c1

Please sign in to comment.