View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 04602 | Bug reports | Theme editor | public | 2010-09-15 13:45 | 2010-09-29 16:29 |
| Reporter | ronvdburg | Assigned To | DenisChenu | ||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 1.90+ | ||||
| Fixed in Version | 1.90+ | ||||
| Summary | 04602: Templaterootdir is referring to templatedir and thus gaines templatename twice | ||||
| Description | print_img_radio.png is not being found | ||||
| Steps To Reproduce | Edit template, select screen 'Printable survey page', check Apache's error log. Look at common.php and search for function 'sGetTemplateURL'. Now look at admin/templates.php and search for 'sGetTemplateURL'. | ||||
| Additional Information | Included is a patch that does the following: 2) Variable $templaterooturl is renamed to $templateurl. This is to help the developer remind that the templatename is already included. Please note, there are also variables $usertemplaterootdir and $standardtemplaterootdir. These variables do refer to the rootdir (.../templates/) and not to the actual subdir <templatename>. So, these variables are not renamed. | ||||
| Tags | No tags attached. | ||||
| Attached Files | templateroot-to-template.patch (7,391 bytes)
Index: source/limesurvey/admin/templates.php
===================================================================
--- source/limesurvey/admin/templates.php (revision 9133)
+++ source/limesurvey/admin/templates.php (working copy)
@@ -458,8 +458,8 @@
</tr>
</table>";
$addbr=false;
-$templaterootdir=sGetTemplatePath($templatename);
-$templaterooturl=sGetTemplateURL($templatename);
+$templatedir=sGetTemplatePath($templatename);
+$templateurl=sGetTemplateURL($templatename);
switch($screenname) {
case 'surveylist':
unset($files);
@@ -548,19 +548,19 @@
foreach($Register as $qs) {
$files[]=array("name"=>$qs);
}
- foreach(file("$templaterootdir/startpage.pstpl") as $op)
+ foreach(file("$templatedir/startpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/survey.pstpl") as $op)
+ foreach(file("$templatedir/survey.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/register.pstpl") as $op)
+ foreach(file("$templatedir/register.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/endpage.pstpl") as $op)
+ foreach(file("$templatedir/endpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
@@ -573,15 +573,15 @@
$files[]=array("name"=>$qs);
}
- foreach(file("$templaterootdir/startpage.pstpl") as $op)
+ foreach(file("$templatedir/startpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/save.pstpl") as $op)
+ foreach(file("$templatedir/save.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/endpage.pstpl") as $op)
+ foreach(file("$templatedir/endpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
@@ -594,15 +594,15 @@
$files[]=array("name"=>$qs);
}
- foreach(file("$templaterootdir/startpage.pstpl") as $op)
+ foreach(file("$templatedir/startpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/load.pstpl") as $op)
+ foreach(file("$templatedir/load.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/endpage.pstpl") as $op)
+ foreach(file("$templatedir/endpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
@@ -615,15 +615,15 @@
$files[]=array("name"=>$qs);
}
- foreach(file("$templaterootdir/startpage.pstpl") as $op)
+ foreach(file("$templatedir/startpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/clearall.pstpl") as $op)
+ foreach(file("$templatedir/clearall.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/endpage.pstpl") as $op)
+ foreach(file("$templatedir/endpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
@@ -646,7 +646,7 @@
}
$questionoutput=array();
- foreach(file("$templaterootdir/print_question.pstpl") as $op)
+ foreach(file("$templatedir/print_question.pstpl") as $op)
{ // echo '<pre>line '.__LINE__.'$op = '.htmlspecialchars(print_r($op)).'</pre>';
$questionoutput[]=templatereplace($op, array(
'QUESTION_NUMBER'=>'1',
@@ -661,27 +661,27 @@
'QUESTIONHELP'=>'This is some help text for this question.',
'ANSWER'=>'<ul>
<li>
- <img src="'.$templaterooturl.'/'.$templatename.'/print_img_radio.png" alt="First choice" class="input-radio" height="14" width="14">
+ <img src="'.$templateurl.'/print_img_radio.png" alt="First choice" class="input-radio" height="14" width="14">
First choice
</li>
<li>
- <img src="'.$templaterooturl.'/'.$templatename.'/print_img_radio.png" alt="Second choice" class="input-radio" height="14" width="14">
+ <img src="'.$templateurl.'/print_img_radio.png" alt="Second choice" class="input-radio" height="14" width="14">
Second choice
</li>
<li>
- <img src="'.$templaterooturl.'/'.$templatename.'/print_img_radio.png" alt="Third choice" class="input-radio" height="14" width="14">
+ <img src="'.$templateurl.'/print_img_radio.png" alt="Third choice" class="input-radio" height="14" width="14">
Third choice
</li>
</ul>'
));
}
$groupoutput=array();
- foreach(file("$templaterootdir/print_group.pstpl") as $op)
+ foreach(file("$templatedir/print_group.pstpl") as $op)
{
$groupoutput[]=templatereplace($op, array('QUESTIONS'=>implode(' ',$questionoutput)));
}
- foreach(file("$templaterootdir/print_survey.pstpl") as $op)
+ foreach(file("$templatedir/print_survey.pstpl") as $op)
{
$myoutput[]=templatereplace($op, array('GROUPS'=>implode(' ',$groupoutput),
'FAX_TO' => $clang->gT("Please fax your completed survey to:")." 000-000-000",
@@ -699,15 +699,15 @@
foreach ($printtemplate as $qs) {
$files[]=array("name"=>$qs);
}
- foreach(file("$templaterootdir/startpage.pstpl") as $op)
+ foreach(file("$templatedir/startpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/printanswers.pstpl") as $op)
+ foreach(file("$templatedir/printanswers.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
- foreach(file("$templaterootdir/endpage.pstpl") as $op)
+ foreach(file("$templatedir/endpage.pstpl") as $op)
{
$myoutput[]=templatereplace($op);
}
@@ -739,10 +739,10 @@
//Get list of 'otherfiles'
$otherfiles=array();
-if ($handle = opendir($templaterootdir)) {
+if ($handle = opendir($templatedir)) {
while(false !== ($file = readdir($handle))) {
if (!array_search($file, $normalfiles)) {
- if (!is_dir($templaterootdir.DIRECTORY_SEPARATOR.$file)) {
+ if (!is_dir($templatedir.DIRECTORY_SEPARATOR.$file)) {
$otherfiles[]=array("name"=>$file);
}
}
| ||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | 9129 | ||||
| I will donate to the project if issue is resolved | |||||
| Browser | |||||
| Database type & version | mysql 5.0.77 | ||||
| Server OS (if known) | Centos 5.3 / Linux 2.6.18 | ||||
| Webserver software & version (if known) | apache 2.2.3 | ||||
| PHP Version | 5.1.6 | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2010-09-15 13:45 | ronvdburg | New Issue | |
| 2010-09-15 13:45 | ronvdburg | File Added: templateroot-to-template.patch | |
| 2010-09-16 11:09 | DenisChenu | Assigned To | => DenisChenu |
| 2010-09-16 11:09 | DenisChenu | Status | new => confirmed |
| 2010-09-16 11:32 | DenisChenu | Note Added: 12852 | |
| 2010-09-16 11:32 | DenisChenu | Status | confirmed => resolved |
| 2010-09-16 11:32 | DenisChenu | Resolution | open => fixed |
| 2010-09-16 11:32 | DenisChenu | Fixed in Version | => 1.90+ |
| 2010-09-29 16:29 | c_schmitz | Note Added: 12937 | |
| 2010-09-29 16:29 | c_schmitz | Status | resolved => closed |
| 2015-12-11 14:40 | c_schmitz | Category | Templates => Theme editor |