Skip to content

Commit

Permalink
Dev Fixed up invalid HTML
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@8368 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Feb 10, 2010
1 parent 09a1d54 commit a951a2c
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 133 deletions.
11 changes: 4 additions & 7 deletions admin/dataentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,12 @@
if (!$surveyid && !$subaction)
{
//$dataentryoutput .= "</table>\n";
$dataentryoutput .= "<table width='99%' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n"
."\t<tr><td colspan='2' height='4' class='settingcaption'><strong>"
.$clang->gT("Data Entry")."</strong></td></tr>\n"
."\t<tr><td align='center'>\n"
."<strong><font color='red'>".$clang->gT("Error")."</font></strong><br />\n"
.$clang->gT("You have not selected a survey for data-entry.")."<br /><br />\n"
$dataentryoutput .= "<div class='header'>".$clang->gT("Data Entry")."</div>\n"
."\t<div class='messagebox'><div class='warningheader'>".$clang->gT("Error")."</div><p>\n"
.$clang->gT("You have not selected a survey for data-entry.")."<p>\n"
."<input type='submit' value='"
.$clang->gT("Main Admin Screen")."' onclick=\"window.open('$scriptname', '_top')\" /><br />\n"
."</font></td></tr></table>\n";
."</div>\n";
return;
}

Expand Down
67 changes: 7 additions & 60 deletions admin/dumpgroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,26 @@



//0: Groups Table
//1: Groups Table
$gquery = "SELECT *
FROM {$dbprefix}groups
WHERE gid=$gid";
$gdump = BuildCSVFromQuery($gquery);

//1: Questions Table
//2: Questions Table
$qquery = "SELECT *
FROM {$dbprefix}questions
WHERE gid=$gid";
$qdump = BuildCSVFromQuery($qquery);

//2: Answers table
//3: Answers table
$aquery = "SELECT DISTINCT {$dbprefix}answers.*
FROM {$dbprefix}answers, {$dbprefix}questions
WHERE ({$dbprefix}answers.qid={$dbprefix}questions.qid)
AND ({$dbprefix}questions.gid=$gid)";
$adump = BuildCSVFromQuery($aquery);

//3: Conditions table - THIS CAN ONLY EXPORT CONDITIONS THAT RELATE TO THE SAME GROUP
//4: Conditions table - THIS CAN ONLY EXPORT CONDITIONS THAT RELATE TO THE SAME GROUP
$cquery = "SELECT DISTINCT {$dbprefix}conditions.*
FROM {$dbprefix}conditions, {$dbprefix}questions, {$dbprefix}questions b
WHERE ({$dbprefix}conditions.cqid={$dbprefix}questions.qid)
Expand All @@ -83,60 +83,7 @@
AND (b.gid=$gid)";
$cdump = BuildCSVFromQuery($cquery);

//4: Labelsets Table
$lsquery = "SELECT DISTINCT {$dbprefix}labelsets.*
FROM {$dbprefix}labelsets, {$dbprefix}questions
WHERE ({$dbprefix}labelsets.lid={$dbprefix}questions.lid)
AND (type in ('F', 'W', 'H', 'Z', '1', ':', ';'))
AND (gid=$gid)";
$lsdump = BuildCSVFromQuery($lsquery);

//5: Labelsets1 Table
//This exists specifically to deal with dual-scale questions (or any future question that may have 2 labelsets)
$lsquery = "SELECT DISTINCT {$dbprefix}labelsets.* FROM {$dbprefix}labelsets, {$dbprefix}questions WHERE ({$dbprefix}labelsets.lid={$dbprefix}questions.lid1) AND (type in ('1')) AND (gid=$gid)";
$ls1dump = BuildCSVFromQuery($lsquery);
$ls1=explode("\n", trim($ls1dump));

if(count($ls1)>3) {
//If there is actually some data here, then add just the data (not the headers) into
// $ls1dump - which will be outputted directly after $lsdump
$ls1dump=$ls1[4];
$ls1dump .= "\n";
} else {
//If there is no data then make it an empty string.
$ls1dump = "";
}

//4a: Labels Table
$lquery = "SELECT {$dbprefix}labels.* FROM {$dbprefix}labels, {$dbprefix}questions WHERE ({$dbprefix}labels.lid={$dbprefix}questions.lid) AND (type in ('F', 'H', 'Z', 'W', '1', ':', ';')) AND (gid=$gid)";
$ldump = BuildCSVFromQuery($lquery);

//5a: Labels1 Table
// See explanation for Labelsets1 Table!! These are the actual labels
$lquery = "SELECT {$dbprefix}labels.* FROM {$dbprefix}labels, {$dbprefix}questions WHERE ({$dbprefix}labels.lid={$dbprefix}questions.lid1) AND (type in ('1')) AND (gid=$gid)";
$l1dump = BuildCSVFromQuery($lquery);
$ld1=explode("\n", trim($l1dump));

if(count($ld1)>3) {
//If there is actually some data here, then add just the data (not the headers) into
// $l1dump - which will be outputted directly after $ldump
$l1dump=array();
foreach($ld1 as $key=>$ld) {
//Put every line, other than the first three into this string
if($key > 3) {
$l1dump[]=$ld;
}
}
$l1dump = implode("\n", $l1dump);
$l1dump .= "\n";
} else {
//If there is no data then make it an empty string.
$l1dump = "";
}



//8: Question Attributes
//5: Question Attributes
$query = "SELECT {$dbprefix}question_attributes.*
FROM {$dbprefix}question_attributes, {$dbprefix}questions
WHERE ({$dbprefix}question_attributes.qid={$dbprefix}questions.qid)
Expand All @@ -146,7 +93,7 @@
if($action=='exportstructureLsrcCsvGroup')
{
include_once($homedir.'/remotecontrol/lsrc.config.php');
$lsrcString = $dumphead. $gdump. $qdump. $adump. $cdump. $lsdump. $ls1dump. $ldump. $l1dump. $qadump;
$lsrcString = $dumphead. $gdump. $qdump. $adump. $cdump. $qadump;
//Select title as Filename and save
$groupTitleSql = "SELECT group_name
FROM {$dbprefix}groups
Expand All @@ -165,7 +112,7 @@
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: cache");

echo $dumphead, $gdump, $qdump, $adump, $cdump, $lsdump, $ls1dump, $ldump, $l1dump, $qadump;
echo $dumphead, $gdump, $qdump, $adump, $cdump, $qadump;
exit;
}

Expand Down
4 changes: 2 additions & 2 deletions admin/globalsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function globalsettingsdisplay()
$editsurvey .= "\t<div class='tab-page'> <h2 class='tab'>".$clang->gT("Overview & Update")."</h2>\n";
$editsurvey .= checksettings();
$thisupdatecheckperiod=getGlobalSetting('updatecheckperiod');
$editsurvey .= "<br /></p><div class='settingcaption'>".$clang->gT("Updates")."</div><ul>"
$editsurvey .= "<br /></p><div class='header'>".$clang->gT("Updates")."</div><ul>"
. "\t<li><label for='updatecheckperiod'>".$clang->gT("Check for updates:")."</label>\n"
. "\t\t\t<select name='updatecheckperiod' id='updatecheckperiod'>\n"
. "\t\t\t\t<option value='0'";
Expand Down Expand Up @@ -456,7 +456,7 @@ function checksettings()
{$deactivatedtokens=count($oldtokenlist);} else {$deactivatedtokens=0;}
if(isset($tokenlist) && is_array($tokenlist))
{$activetokens=count($tokenlist);} else {$activetokens=0;}
$cssummary = "<div class='settingcaption'>".$clang->gT("System overview")."</div>\n";
$cssummary = "<div class='header'>".$clang->gT("System overview")."</div>\n";
// Database name & default language
$cssummary .= "<br /><table class='statisticssummary'><tr>\n"
. "<td width='50%' align='right'>\n"
Expand Down
35 changes: 17 additions & 18 deletions admin/grouphandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,22 @@
$egquery = "SELECT * FROM ".db_table_name('groups')." WHERE sid=$surveyid AND gid=$gid AND language='$baselang'";
$egresult = db_execute_assoc($egquery);
$editgroup = PrepareEditorScript();
$editgroup .= "<table width='100%' border='0'>\n\t<tr><td class='settingcaption'>"
. "".$clang->gT("Edit Group")."</td></tr></table>\n"
. "<form name='editgroup' action='$scriptname' method='post'>\n"
$editgroup .= "<div class='header'>".$clang->gT("Edit Group")."</div>\n"
. "<form name='frmeditgroup' id='frmeditgroup' action='$scriptname' method='post'>\n"
. '<div class="tab-pane" id="tab-pane-group-'.$gid.'">';

$esrow = $egresult->FetchRow();
$editgroup .= '<div class="tab-page"> <h2 class="tab">'.getLanguageNameFromCode($esrow['language'],false);
$editgroup .= '('.$clang->gT("Base Language").')';
$esrow = array_map('htmlspecialchars', $esrow);
$editgroup .= '</h2>';
$editgroup .= "\t<div class='settingrow'><span class='settingcaption'>".$clang->gT("Title").":</span>\n"
. "<span class='settingentry'><input type='text' maxlength='100' size='80' name='group_name_{$esrow['language']}' value=\"{$esrow['group_name']}\" />\n"
. "\t</span></div>\n"
. "\t<div class='settingrow'><span class='settingcaption'>".$clang->gT("Description:")."</span>\n"
. "<span class='settingentry'><textarea cols='70' rows='8' name='description_{$esrow['language']}'>{$esrow['description']}</textarea>\n"
$editgroup .= '</h2><ul>';
$editgroup .= "\t<li><label for='group_name_{$esrow['language']}'>".$clang->gT("Title").":</label>\n"
. "<input type='text' maxlength='100' size='80' name='group_name_{$esrow['language']}' id='group_name_{$esrow['language']}' value=\"{$esrow['group_name']}\" />\n"
. "\t</li>\n"
. "\t<li><label for='description_{$esrow['language']}'>".$clang->gT("Description:")."</label>\n"
. "<textarea cols='70' rows='8' id='description_{$esrow['language']}' name='description_{$esrow['language']}'>{$esrow['description']}</textarea>\n"
. getEditor("group-desc","description_".$esrow['language'], "[".$clang->gT("Description:", "js")."](".$esrow['language'].")",$surveyid,$gid,'',$action)
. "\t</span></div><div class='settingrow'></div></div>"; // THis empty div class is needed for forcing the tabpage border under the button
. "\t</li></ul></div>";


$egquery = "SELECT * FROM ".db_table_name('groups')." WHERE sid=$surveyid AND gid=$gid AND language!='$baselang'";
Expand All @@ -151,14 +150,14 @@
{
$editgroup .= '<div class="tab-page"> <h2 class="tab">'.getLanguageNameFromCode($esrow['language'],false);
$esrow = array_map('htmlspecialchars', $esrow);
$editgroup .= '</h2>';
$editgroup .= "\t<div class='settingrow'><span class='settingcaption'>".$clang->gT("Title").":</span>\n"
. "<span class='settingentry'><input type='text' maxlength='100' size='80' name='group_name_{$esrow['language']}' value=\"{$esrow['group_name']}\" />\n"
. "\t</span></div>\n"
. "\t<div class='settingrow'><span class='settingcaption'>".$clang->gT("Description:")."</span>\n"
. "<span class='settingentry'><textarea cols='70' rows='8' name='description_{$esrow['language']}'>{$esrow['description']}</textarea>\n"
. getEditor("group-desc","description_".$esrow['language'], "[".$clang->gT("Description:", "js")."](".$esrow['language'].")",$surveyid,$gid,'',$action)
. "\t</span></div><div class='settingrow'></div></div>"; // THis empty div class is needed for forcing the tabpage border under the button
$editgroup .= '</h2><ul>';
$editgroup .= "\t<li><label for='group_name_{$esrow['language']}'>".$clang->gT("Title").":</label>\n"
. "<input type='text' maxlength='100' size='80' name='group_name_{$esrow['language']}' id='group_name_{$esrow['language']}' value=\"{$esrow['group_name']}\" />\n"
. "\t</li>\n"
. "\t<li><label for='description_{$esrow['language']}'>".$clang->gT("Description:")."</label>\n"
. "<textarea cols='70' rows='8' id='description_{$esrow['language']}' name='description_{$esrow['language']}'>{$esrow['description']}</textarea>\n"
. getEditor("group-desc","description_".$esrow['language'], "[".$clang->gT("Description:", "js")."](".$esrow['language'].")",$surveyid,$gid,'',$action)
. "\t</li></ul></div>";
}
$editgroup .= '</div>';
$editgroup .= "\t<p><input type='submit' class='standardbtn' value='".$clang->gT("Update Group")."' />\n"
Expand Down
73 changes: 30 additions & 43 deletions admin/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,13 @@
{
$surveysummary .= "<a href=\"#\" accesskey='d' onclick=\"window.open('"
. $publicurl."/index.php?sid=$surveyid&amp;newtest=Y&amp;lang=$baselang', '_blank')\" title=\"".$icontext2."\" >"
. "<img src='$imagefiles/do.png' name='DoSurvey' alt='$icontext' />"
. "<img src='$imagefiles/do.png' name='DoSurvey2' alt='$icontext' />"
. "</a>\n";

} else {
$surveysummary .= "<a href=\"#\" onclick=\"$('#printpopup').css('visibility','hidden'); $('#langpopup2').css('visibility','visible');\" "
. "title=\"".$icontext2."\" accesskey='d'>"
. "<img src='$imagefiles/do.png' name='DoSurvey' alt='$icontext' />"
. "<img src='$imagefiles/do.png' name='DoSurvey2' alt='$icontext' />"
. "</a>\n";

$tmp_survlangs = GetAdditionalLanguagesFromSurveyID($surveyid);
Expand Down Expand Up @@ -2125,15 +2125,14 @@
{
if($export4lsrc === true && hasRight($surveyid,'export'))
{
$exportstructure = "<form name='exportstructureGroup' action='$scriptname' method='post'>\n"
."<table width='100%' border='0' >\n<tr><td class='settingcaption'>"
.$clang->gT("Export Group Structure")."\n</td></tr>\n"
."<tr>\n"
."<td style='text-align:center;'>\n";
$exportstructure.="<br /><input type='radio' class='radiobtn' name='type' value='structurecsvGroup' checked='checked' id='surveycsv'
$exportstructure = "<form id='exportstructureGroup' name='exportstructureGroup' action='$scriptname' method='post'>\n"
."<div class='header'>".$clang->gT("Export group structure")."\n</div>\n"
."<ul>\n"
."<li>\n";
$exportstructure.="<input type='radio' class='radiobtn' name='type' value='structurecsvGroup' checked='checked' id='surveycsv'
onclick=\"this.form.action.value='exportstructurecsvGroup'\"/>"
."<label for='surveycsv'>"
.$clang->gT("LimeSurvey group File (*.csv)")."</label><br />\n";
.$clang->gT("LimeSurvey group file (*.csv)")."</label></li>\n";

// $exportstructure.="<input type='radio' class='radiobtn' name='type' value='structurequeXMLGroup' id='queXML' onclick=\"this.form.action.value='exportstructurequexml'\" />"
// ."<label for='queXML'>"
Expand All @@ -2146,26 +2145,21 @@
//echo $export4lsrc;
if($export4lsrc)
{
$exportstructure.="<br/><input type='radio' class='radiobtn' name='type' value='structureLsrcCsvGroup' id='LsrcCsv'
$exportstructure.="<li><input type='radio' class='radiobtn' name='type' value='structureLsrcCsvGroup' id='LsrcCsv'
onclick=\"this.form.action.value='exportstructureLsrcCsvGroup'\" />"
."<label for='LsrcCsv'>"
.$clang->gT("Save for Lsrc (*.csv)")." "
."</label>\n";
."</label></li>\n";
}

$exportstructure.="<br />&nbsp;</td>\n"
."</tr>\n"
."<tr><td height='2' bgcolor='silver'></td></tr>\n"
."<tr>\n"
."<td align='center'>\n"
$exportstructure.="</ul>\n"
."<p>\n"
."<input type='submit' value='"
.$clang->gT("Export To File")."' />\n"
.$clang->gT("Export to file")."' />\n"
."<input type='hidden' name='sid' value='$surveyid' />\n"
."<input type='hidden' name='gid' value='$gid' />\n"
."<input type='hidden' name='action' value='exportstructurecsvGroup' />\n"
."</td>\n"
."</tr>\n";
$exportstructure.="</table><br /></form>\n";
."<input type='hidden' name='action' value='exportstructurecsvGroup' />\n";
$exportstructure.="</form>\n";
}
else
{
Expand All @@ -2178,15 +2172,14 @@
{
if($export4lsrc === true && hasRight($surveyid,'export'))
{
$exportstructure = "<form name='exportstructureQuestion' action='$scriptname' method='post'>\n"
."<table width='100%' border='0' >\n<tr><td class='settingcaption'>"
.$clang->gT("Export Question Structure")."\n</td></tr>\n"
."<tr>\n"
."<td style='text-align:center;'>\n";
$exportstructure.="<br /><input type='radio' class='radiobtn' name='type' value='structurecsvQuestion' checked='checked' id='surveycsv'
$exportstructure = "<form id='exportstructureQuestion' name='exportstructureQuestion' action='$scriptname' method='post'>\n"
."<div class='header'>".$clang->gT("Export question structure")."\n</div>\n"
."<ul>\n"
."<li>\n";
$exportstructure.="<input type='radio' class='radiobtn' name='type' value='structurecsvQuestion' checked='checked' id='surveycsv'
onclick=\"this.form.action.value='exportstructurecsvQuestion'\"/>"
."<label for='surveycsv'>"
.$clang->gT("LimeSurvey group File (*.csv)")."</label><br />\n";
.$clang->gT("LimeSurvey group file (*.csv)")."</label></li>\n";

// $exportstructure.="<input type='radio' class='radiobtn' name='type' value='structurequeXMLGroup' id='queXML' onclick=\"this.form.action.value='exportstructurequexml'\" />"
// ."<label for='queXML'>"
Expand All @@ -2199,27 +2192,22 @@
//echo $export4lsrc;
if($export4lsrc)
{
$exportstructure.="<br/><input type='radio' class='radiobtn' name='type' value='structureLsrcCsvQuestion' id='LsrcCsv'
$exportstructure.="<li><input type='radio' class='radiobtn' name='type' value='structureLsrcCsvQuestion' id='LsrcCsv'
onclick=\"this.form.action.value='exportstructureLsrcCsvQuestion'\" />"
."<label for='LsrcCsv'>"
.$clang->gT("Save for Lsrc (*.csv)")." "
."</label>\n";
."</label></li>\n";
}

$exportstructure.="<br />&nbsp;</td>\n"
."</tr>\n"
."<tr><td height='2' bgcolor='silver'></td></tr>\n"
."<tr>\n"
."<td align='center'>\n"
$exportstructure.="</ul>\n"
."<p>\n"
."<input type='submit' value='"
.$clang->gT("Export To File")."' />\n"
.$clang->gT("Export to file")."' />\n"
."<input type='hidden' name='sid' value='$surveyid' />\n"
."<input type='hidden' name='gid' value='$gid' />\n"
."<input type='hidden' name='qid' value='$qid' />\n"
."<input type='hidden' name='action' value='exportstructurecsvQuestion' />\n"
."</td>\n"
."</tr>\n";
$exportstructure.="</table><br /></form>\n";
."<input type='hidden' name='action' value='exportstructurecsvQuestion' />\n";
$exportstructure.="</form>\n";
}
else
{
Expand Down Expand Up @@ -2448,7 +2436,7 @@
$esrow = array_map('htmlspecialchars', $esrow);

// header
$editsurvey = "<div class='settingcaption'>".$clang->gT("Edit survey settings - Step 1 of 2")."</div>\n";
$editsurvey = "<div class='header'>".$clang->gT("Edit survey settings - Step 1 of 2")."</div>\n";

// beginning TABs section - create tab pane
$editsurvey .= "<div class='tab-pane' id='tab-pane-survey-$surveyid'>\n";
Expand Down Expand Up @@ -3000,8 +2988,7 @@
. "}\n"
. "}\n"
. "--></script>\n"
. "<table width='100%' border='0'>\n<tr><td class='settingcaption'>"
. "".$clang->gT("Edit survey settings - Step 2 of 2")."</td></tr></table>\n";
. "<div class='header'>".$clang->gT("Edit survey settings - Step 2 of 2")."</div>\n";
$editsurvey .= "<form id='addnewsurvey' name='addnewsurvey' action='$scriptname' method='post'>\n"
. '<div class="tab-pane" id="tab-pane-surveyls-'.$surveyid.'">';
foreach ($grplangs as $grouplang)
Expand Down
8 changes: 8 additions & 0 deletions admin/scripts/surveysettings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// $Id: templates.js 7699 2009-09-30 22:28:50Z c_schmitz $

$(document).ready(function(){
$( 'textarea' ).ckeditor( function() { /* callback code */ }, { skin : 'office2003',
width:'600px',
toolbar:'Basic'
});
});

0 comments on commit a951a2c

Please sign in to comment.