Skip to content

Commit

Permalink
Dev: page-odd without javascript too, move page-odd to {SURVEYFORMAT}
Browse files Browse the repository at this point in the history
Dev: fixed issue : allowjumps and not showprogress for withindex class

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11152 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Shnoulle committed Oct 13, 2011
1 parent 442bbf4 commit 71bf7c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
7 changes: 6 additions & 1 deletion application/helpers/replacements_helper.php
Expand Up @@ -131,7 +131,12 @@ function templatereplace($line, $replacements=array(),&$redata=array(), $debugSr
{
$surveyformat = "";
}
if (isset($thissurvey['showprogress']) && $thissurvey['showprogress']=="Y" && $surveyformat!="allinone" && (isset($_SESSION['step']) && $_SESSION['step']>0)){
if ((isset($_SESSION['step']) && $_SESSION['step'] % 2) && $surveyformat!="allinone")
{
$surveyformat .= " page-odd";
}

if (isset($thissurvey['allowjumps']) && $thissurvey['allowjumps']=="Y" && $surveyformat!="allinone" && (isset($_SESSION['step']) && $_SESSION['step']>0)){
$surveyformat .= " withindex";
}
if (isset($thissurvey['showprogress']) && $thissurvey['showprogress']=="Y"){
Expand Down
13 changes: 0 additions & 13 deletions application/libraries/Group_format.php
Expand Up @@ -529,19 +529,6 @@ function run($args) {
$redata = compact(array_keys(get_defined_vars()));
echo templatereplace(file_get_contents("$thistpl/startpage.pstpl"),array(),$redata,'Group_format[530]');

//ALTER PAGE CLASS TO PROVIDE WHOLE-PAGE ALTERNATION
if ($_SESSION['step'] != $_SESSION['prevstep'] ||
(isset($_SESSION['stepno']) && $_SESSION['stepno'] % 2))
{
if (!isset($_SESSION['stepno'])) $_SESSION['stepno'] = 0;
if ($_SESSION['step'] != $_SESSION['prevstep']) ++$_SESSION['stepno'];
if ($_SESSION['stepno'] % 2)
{
echo "<script type=\"text/javascript\">\n"
. " $(\"body\").addClass(\"page-odd\");\n"
. "</script>\n";
}
}

$hiddenfieldnames=implode("|", $inputnames);

Expand Down
13 changes: 0 additions & 13 deletions application/libraries/Question_format.php
Expand Up @@ -476,19 +476,6 @@ function run($args) {
$redata = compact(array_keys(get_defined_vars()));
echo templatereplace(file_get_contents("$thistpl/startpage.pstpl"),array(),$redata,'Question_format[477]');

//ALTER PAGE CLASS TO PROVIDE WHOLE-PAGE ALTERNATION
if ($_SESSION['step'] != $_SESSION['prevstep'] ||
(isset($_SESSION['stepno']) && $_SESSION['stepno'] % 2))
{
if (!isset($_SESSION['stepno'])) $_SESSION['stepno'] = 0;
if ($_SESSION['step'] != $_SESSION['prevstep']) ++$_SESSION['stepno'];
if ($_SESSION['stepno'] % 2)
{
echo "<script type=\"text/javascript\">\n"
. " $(\"body\").addClass(\"page-odd\");\n"
. "</script>\n";
}
}

echo "\n<form method='post' action='".site_url("survey")."' id='limesurvey' name='limesurvey' autocomplete='off'>\n";
echo sDefaultSubmitHandler();
Expand Down

0 comments on commit 71bf7c7

Please sign in to comment.