Skip to content

Commit

Permalink
Issue #4661 : add some placeholder : {SURVEYLANG}, {SURVEYFORMAT}, {S…
Browse files Browse the repository at this point in the history
…URVEYCONTACT}

Dev : get the surveylang with clang, format for survey (maybe add position too ???), a real global survey contact
DEV had the new class to body class on all template

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@9222 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Shnoulle committed Oct 12, 2010
1 parent af6cc72 commit 6343121
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 15 deletions.
42 changes: 38 additions & 4 deletions common_functions.php
Expand Up @@ -2494,7 +2494,37 @@ function templatereplace($line, $replacements=array())
.use_firebug()
."\t</head>", $line);
}

// Get some vars : move elsewhere ?
// surveyformat
if (isset($thissurvey['format']))
{
$surveyformat = str_replace(array("A","S","G"),array("allinone","questionbyquestion","groupbygroup"),$thissurvey['format']);
}
else
{
$surveyformat = "";
}
// real survey contact
if (isset($surveylist['contact']))
{
$surveycontact = $surveylist['contact'];
}
elseif (isset($thissurvey['admin']) && $thissurvey['admin']!="")
{
$surveycontact=sprintf($clang->gT("Please contact %s ( %s ) for further assistance."),$thissurvey['admin'],$thissurvey['adminemail']);
}
else
{
$surveycontact="";
}

if (stripos ($line,"</head>"))
{
$line=str_ireplace("</head>",
"<script type=\"text/javascript\" src=\"$rooturl/scripts/survey_runtime.js\"></script>\n"
.use_firebug()
."\t</head>", $line);
}

// If there are non-bracketed replacements to be made do so above this line.
// Only continue in this routine if there are bracketed items to replace {}
Expand All @@ -2510,16 +2540,20 @@ function templatereplace($line, $replacements=array())
if (strpos($line, "{SURVEYLISTHEADING}") !== false) $line=str_replace("{SURVEYLISTHEADING}", $surveylist['listheading'], $line);
if (strpos($line, "{SURVEYLIST}") !== false) $line=str_replace("{SURVEYLIST}", $surveylist['list'], $line);
if (strpos($line, "{NOSURVEYID}") !== false) $line=str_replace("{NOSURVEYID}", $surveylist['nosid'], $line);
if (strpos($line, "{SURVEYCONTACT}") !== false) $line=str_replace("{SURVEYCONTACT}", $surveylist['contact'], $line);


if (strpos($line, "{SITENAME}") !== false) $line=str_replace("{SITENAME}", $sitename, $line);

if (strpos($line, "{SURVEYLIST}") !== false) $line=str_replace("{SURVEYLIST}", $surveylist, $line);
if (strpos($line, "{CHECKJAVASCRIPT}") !== false) $line=str_replace("{CHECKJAVASCRIPT}", "<noscript><span class='warningjs'>".$clang->gT("Caution: JavaScript execution is disabled in your browser. You may not be able to answer all questions in this survey. Please, verify your browser parameters.")."</span></noscript>", $line);
if (strpos($line, "{ANSWERTABLE}") !== false) $line=str_replace("{ANSWERTABLE}", $printoutput, $line);

if (strpos($line, "{SURVEYLANGAGE}") !== false) $line=str_replace("{SURVEYLANGAGE}", $clang->langcode, $line);
if (strpos($line, "{SURVEYCONTACT}") !== false) $line=str_replace("{SURVEYCONTACT}", $surveycontact, $line);
if (strpos($line, "{SURVEYNAME}") !== false) $line=str_replace("{SURVEYNAME}", $thissurvey['name'], $line);
if (strpos($line, "{SURVEYDESCRIPTION}") !== false) $line=str_replace("{SURVEYDESCRIPTION}", $thissurvey['description'], $line);
if (strpos($line, "{WELCOME}") !== false) $line=str_replace("{WELCOME}", $thissurvey['welcome'], $line);
if (strpos($line, "{SURVEYFORMAT}") !== false) $line=str_replace("{SURVEYFORMAT}", $surveyformat, $line);
if (strpos($line, "{WELCOME}") !== false) $line=str_replace("{WELCOME}", $thissurvey['welcome'], $line);
if (strpos($line, "{LANGUAGECHANGER}") !== false) $line=str_replace("{LANGUAGECHANGER}", $languagechanger, $line);
if (strpos($line, "{PERCENTCOMPLETE}") !== false) $line=str_replace("{PERCENTCOMPLETE}", $percentcomplete, $line);

Expand Down Expand Up @@ -7543,4 +7577,4 @@ function SSL_mode()
};
};

// Closing PHP tag intentionally left out - yes, it is okay
// Closing PHP tag intentionally left out - yes, it is okay
2 changes: 1 addition & 1 deletion templates/basic/startpage.pstpl
Expand Up @@ -22,7 +22,7 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body>
<body class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">
<table width="80%" align="center" class="bf" cellpadding="0" cellspacing="11">
<tr>
<td>
Expand Down
2 changes: 1 addition & 1 deletion templates/bluengrey/startpage.pstpl
Expand Up @@ -25,6 +25,6 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body>
<body class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">
<br/>
<div id="container">
4 changes: 2 additions & 2 deletions templates/business_grey/startpage.pstpl
@@ -1,6 +1,6 @@

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>A SURVEY: {SURVEYNAME}</title>
<title>{SITENAME}: {SURVEYNAME}</title>
<meta name="generator" content="LimeSurvey http://www.limesurvey.org" />

<!-- The following line includes template.css and if an RTL-language is used template-rtl.css -->
Expand All @@ -23,5 +23,5 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body>
<body class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">
<div class="surveyBorder">
2 changes: 1 addition & 1 deletion templates/clear_logo/startpage.pstpl
Expand Up @@ -19,5 +19,5 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body>
<body class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">

2 changes: 1 addition & 1 deletion templates/default/startpage.pstpl
Expand Up @@ -21,7 +21,7 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body class="default">
<body class="default lang-{SURVEYLANGAGE} {SURVEYFORMAT}">
<table width="75%" align="center" class="outerframe">
<tr>
<td>
2 changes: 1 addition & 1 deletion templates/eirenicon/startpage.pstpl
Expand Up @@ -21,7 +21,7 @@
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>

<body bgcolor="#C0C0C0">
<body bgcolor="#C0C0C0" class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">
<table width="75%" align="center" style="border-collapse: collapse; border-color:#333333" bgcolor="#EDEDED" border="1" cellspacing="0">
<tr>
<td>
2 changes: 1 addition & 1 deletion templates/limespired/startpage.pstpl
Expand Up @@ -22,7 +22,7 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body id="page_bg">
<body id="page_bg" class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">
<div id="wrapper2">
<div id="wrapper">
<div id="header">
Expand Down
2 changes: 1 addition & 1 deletion templates/mint_idea/startpage.pstpl
Expand Up @@ -19,7 +19,7 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body>
<body class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">

<div id="layout">

Expand Down
2 changes: 1 addition & 1 deletion templates/sherpa/startpage.pstpl
Expand Up @@ -22,7 +22,7 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body>
<body class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">

<table align="center" cellpadding="0" cellspacing="0">
<tr class="grayboxheader">
Expand Down
2 changes: 1 addition & 1 deletion templates/vallendar/startpage.pstpl
Expand Up @@ -20,7 +20,7 @@
<script type="text/javascript" src="{TEMPLATEURL}template.js"></script>
<link rel="shortcut icon" href="{TEMPLATEURL}favicon.ico" />
</head>
<body bgcolor="#C0C0C0">
<body bgcolor="#C0C0C0" class="lang-{SURVEYLANGAGE} {SURVEYFORMAT}">
<table width="75%" align="center" style="border-collapse: collapse;border-color:#333333" bgcolor="#EDEDED" border="1" cellspacing="0">
<tr>
<td>

0 comments on commit 6343121

Please sign in to comment.