Skip to content

Commit

Permalink
Fix issue 04117: Check for old table layouts
Browse files Browse the repository at this point in the history
Dev Converted table-based layouts to tableless/CSS layouts (where applicable)

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8419 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Tony Partner committed Feb 21, 2010
1 parent 8d2d84d commit e323723
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 82 deletions.
118 changes: 46 additions & 72 deletions admin/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
. "</li>\n"
. "</ul>\n"
. "<p><input type='hidden' name='action' value='savepersonalsettings' /><input class='submit' type='submit' value='".$clang->gT("Save settings")
."' /></form></div>";
."' /></p></form></div>";
}


Expand Down Expand Up @@ -1323,13 +1323,8 @@
$anscount = $result->RecordCount();
$row=$result->FetchRow();
$maxsortorder=$row['sortorder']+1;
$vasummary .= "<table width='100%' >\n"
."<tr >\n"
."<td colspan='4' class='settingcaption'>\n"
.$clang->gT("Edit answer options")
."</td>\n"
."</tr>\n"
."<tr><td colspan='5'><form name='editanswers' method='post' action='$scriptname'onsubmit=\"return codeCheck('code_',$maxsortorder,'".$clang->gT("Error: You are trying to use duplicate answer codes.",'js')."','".$clang->gT("Error: 'other' is a reserved keyword.",'js')."');\">\n"
$vasummary .= "<div class='header'>".$clang->gT("Edit answer options")."</div>\n"
."<form name='editanswers' method='post' action='$scriptname'onsubmit=\"return codeCheck('code_',$maxsortorder,'".$clang->gT("Error: You are trying to use duplicate answer codes.",'js')."','".$clang->gT("Error: 'other' is a reserved keyword.",'js')."');\">\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"
Expand Down Expand Up @@ -1467,7 +1462,7 @@
}
else
{
$vasummary .= "<input type='submit' disabled='disabled value='".$clang->gT("Del")."' />\n";
$vasummary .= "<input type='submit' disabled='disabled' value='".$clang->gT("Del")."' />\n";
}

// Don't show Default Button for array question types
Expand Down Expand Up @@ -1558,7 +1553,7 @@
$vasummary .= "<input type='hidden' name='codeids' value='$codeids' />\n";
$vasummary .= "</div>";
}
$vasummary .= "</div></form></td></tr></table>";
$vasummary .= "</div></form>";


}
Expand Down Expand Up @@ -1872,15 +1867,12 @@
{
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'
onclick=\"this.form.action.value='exportstructurecsvGroup'\"/>"
."<label for='surveycsv'>"
.$clang->gT("LimeSurvey group File (*.csv)")."</label><br />\n";
$exportstructure = "<div class='header'>".$clang->gT("Export Group Structure")."</div>\n";
$exportstructure .= "<form name='exportstructureGroup' action='$scriptname' method='post'>\n"
."<p>\n"
."<input type='radio' class='radiobtn' name='type' value='structurecsvGroup' checked='checked' id='surveycsv' onclick=\"this.form.action.value='exportstructurecsvGroup'\"/>\n"
."<label for='surveycsv'>".$clang->gT("LimeSurvey group file (*.csv)")."</label>\n"
."</p>";

// $exportstructure.="<input type='radio' class='radiobtn' name='type' value='structurequeXMLGroup' id='queXML' onclick=\"this.form.action.value='exportstructurequexml'\" />"
// ."<label for='queXML'>"
Expand All @@ -1893,27 +1885,21 @@
//echo $export4lsrc;
if($export4lsrc)
{
$exportstructure.="<br/><input type='radio' class='radiobtn' name='type' value='structureLsrcCsvGroup' id='LsrcCsv'
onclick=\"this.form.action.value='exportstructureLsrcCsvGroup'\" />"
$exportstructure.="<p><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></p>\n";
}

$exportstructure.="<br />&nbsp;</td>\n"
."</tr>\n"
."<tr><td height='2' bgcolor='silver'></td></tr>\n"
."<tr>\n"
."<td align='center'>\n"
$exportstructure.="<p>\n"
."<input type='submit' value='"
.$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";
}
."</p>\n";
$exportstructure.="</form>\n";
}
else
{
include('dumpgroup.php');
Expand All @@ -1925,15 +1911,11 @@
{
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'
onclick=\"this.form.action.value='exportstructurecsvQuestion'\"/>"
."<label for='surveycsv'>"
.$clang->gT("LimeSurvey group File (*.csv)")."</label><br />\n";
$exportstructure = "<div class='header'>".$clang->gT("Export Question Structure")."</div>\n";
$exportstructure .= "<form name='exportstructureQuestion' action='$scriptname' method='post'>\n"
."<p><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 question file (*.csv)")."</label>\n"
."</p>";

// $exportstructure.="<input type='radio' class='radiobtn' name='type' value='structurequeXMLGroup' id='queXML' onclick=\"this.form.action.value='exportstructurequexml'\" />"
// ."<label for='queXML'>"
Expand All @@ -1946,28 +1928,21 @@
//echo $export4lsrc;
if($export4lsrc)
{
$exportstructure.="<br/><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";
$exportstructure.="<p><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"
."</p>";
}

$exportstructure.="<br />&nbsp;</td>\n"
."</tr>\n"
."<tr><td height='2' bgcolor='silver'></td></tr>\n"
."<tr>\n"
."<td align='center'>\n"
."<input type='submit' value='"
.$clang->gT("Export To File")."' />\n"
$exportstructure.="<p>\n"
."<input type='submit' value='".$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";
}
."</p>\n";
$exportstructure.="</form>\n";
}
else
{
include('dumpquestion.php');
Expand Down Expand Up @@ -2203,7 +2178,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 @@ -2310,7 +2285,7 @@
. "</li>\n";

$editsurvey .= "<li><label for='preview'>".$clang->gT("Template Preview:")."</label>\n"
. "<img id='preview' src='$publicurl/templates/{$esrow['template']}/preview.png' />\n"
. "<img alt='".$clang->gT("Template Preview:")."' id='preview' src='$publicurl/templates/{$esrow['template']}/preview.png' />\n"
. "</li>\n" ;

//ALLOW SAVES
Expand Down Expand Up @@ -2756,8 +2731,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 Expand Up @@ -2876,7 +2850,7 @@

$newsurvey .= ""
. "<li><label for='surveyls_title'>".$clang->gT("Title").":</label>\n"
. "<input type='text' size='82' maxlength='200' id='surveyls_title' name='surveyls_title' /><font size='1'> ".$clang->gT("(This field is mandatory.)")."</font></label></li>\n"
. "<input type='text' size='82' maxlength='200' id='surveyls_title' name='surveyls_title' /><font size='1'> ".$clang->gT("(This field is mandatory.)")."</font></li>\n"
. "<li><label for='description'>".$clang->gT("Description:")."</label>\n"
. "<textarea cols='80' rows='10' id='description' name='description'></textarea>"
. getEditor("survey-desc","description", "[".$clang->gT("Description:", "js")."]",'','','',$action)
Expand All @@ -2900,7 +2874,7 @@

// End General TAB
// Create Survey Button
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' />\n";
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' /></p>\n";

$newsurvey .= "</div>\n";

Expand All @@ -2915,7 +2889,7 @@
. "<option value='A'>".$clang->gT("All in one")."</option>\n"
. "</select>\n"
. "</li>\n";
$newsurvey .= "<li><label for='settingcaption'>".$clang->gT("Template:")."</label>\n"
$newsurvey .= "<li><label for='template'>".$clang->gT("Template:")."</label>\n"
. "<select id='template' name='template'>\n";
foreach (gettemplatelist() as $tname)
{
Expand All @@ -2931,7 +2905,7 @@
$newsurvey .= "</select>\n"
. "</li>\n"
. "<li><label for='preview'>".$clang->gT("Template Preview:")."</label>\n"
. "<img id='preview' src='$publicurl/templates/{$defaulttemplate}/preview.png' />\n"
. "<img alt='".$clang->gT("Template Preview:")."' id='preview' src='$publicurl/templates/{$defaulttemplate}/preview.png' />\n"
. "</li>\n";

//ALLOW SAVES
Expand Down Expand Up @@ -2989,7 +2963,7 @@
$newsurvey.= "<li><label for='urldescrip'>".$clang->gT("URL description:")."</label>\n"
. "<input type='text' maxlength='255' size='50' id='urldescrip' name='urldescrip' value='";
if (isset($esrow)) {$newsurvey .= $esrow['surveyls_urldescription'];}
$newsurvey .= "' /></label></li>\n";
$newsurvey .= "' /></li>\n";
$newsurvey .= "<li><label for='autoredirect'>".$clang->gT("Automatically load URL when survey complete?")."</label>\n"
. "<select name='autoredirect' id='autoredirect'>\n"
. "<option value='Y'>".$clang->gT("Yes")."</option>\n"
Expand All @@ -3009,7 +2983,7 @@

// End Presention and navigation TAB
// Create Survey Button
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' />\n";
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' /></p>\n";
$newsurvey .= "</div>\n";

// Publication and access control TAB
Expand Down Expand Up @@ -3074,11 +3048,11 @@
. "<select id='htmlemail' name='htmlemail'>\n"
. "<option value='Y' selected='selected'>".$clang->gT("Yes")."</option>\n"
. "<option value='N'>".$clang->gT("No")."</option>\n"
. "</select></li></l>\n";
. "</select></li></ul>\n";

// End Publication and access control TAB
// Create Survey Button
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' />\n";
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' /></p>\n";
$newsurvey .= "</div>\n";

// Notification and Data management TAB
Expand All @@ -3092,7 +3066,7 @@

//EMAIL SURVEY RESPONSES TO
$newsurvey .= "<li><label for='emailresponseto'>".$clang->gT("Email responses to:")."</label>\n"
. "<input type='text' id='emailresponseto' name='emailresponseto'>\n"
. "<input type='text' id='emailresponseto' name='emailresponseto' />\n"
. "</li>\n";

// ANONYMOUS
Expand Down Expand Up @@ -3154,7 +3128,7 @@

// End Notification and Data management TAB
// Create Survey Button
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' />\n";
$newsurvey .= "<p><input type='button' onclick=\"if (isEmpty(document.getElementById('surveyls_title'), '".$clang->gT("Error: You have to enter a title for this survey.",'js')."')) { document.getElementById('addnewsurvey').submit(); }; return false;\" value='".$clang->gT("Create Survey")."' /></p>\n";
$newsurvey .= "</div>\n";
$newsurvey .= "</form>\n";

Expand All @@ -3169,7 +3143,7 @@
. "<li><label for='translinksfields'>".$clang->gT("Convert resources links and INSERTANS fields?")."</label>\n"
. "<input id='translinksfields' name=\"translinksfields\" type=\"checkbox\" checked='checked'/></li></ul>\n"
. "<p><input type='submit' value='".$clang->gT("Import Survey")."' />\n"
. "<input type='hidden' name='action' value='importsurvey' /></form>\n";
. "<input type='hidden' name='action' value='importsurvey' /></p></form>\n";
// . "</form>\n";

// End Import TAB
Expand Down
42 changes: 34 additions & 8 deletions admin/questionhandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@
$eqresult = db_execute_assoc($eqquery);
}
$editquestion = PrepareEditorScript();
$editquestion .= "<table width='100%' border='0'>\n\t<tr><td class='settingcaption'>";
$editquestion .= "<div class='header'>";
if (!$adding) {$editquestion .=$clang->gT("Edit question");} else {$editquestion .=$clang->gT("Add a new question");};
$editquestion .= "</td></tr></table>\n"
$editquestion .= "</div>\n"
. "<form name='frmeditquestion' id='frmeditquestion' action='$scriptname' method='post' onsubmit=\"return isEmpty(document.getElementById('title'), '".$clang->gT("Error: You have to enter a question code.",'js')."');\">\n"
. '<div class="tab-pane" id="tab-pane-editquestion-'.$surveyid.'">';

Expand Down Expand Up @@ -460,7 +460,7 @@
if ($adding)
{
$editquestion .="<p><input type='submit' value='".$clang->gT("Add question")."' />\n"
. "\t<input type='hidden' name='action' value='insertnewquestion' /><br/><br/>&nbsp;\n";
. "\t<input type='hidden' name='action' value='insertnewquestion' />\n";
}
else
{
Expand All @@ -469,19 +469,42 @@
. "\t<input type='hidden' id='qid' name='qid' value='$qid' />";
}
$editquestion .= "\t<input type='hidden' id='sid' name='sid' value='$surveyid' /></p>\n"
. "</div></div></form><p>\n";
. "</div></div></form>\n";



if ($adding)
{
// Import dialogue

$editquestion .= "<table width='100%' border='0'>\n\t<tr><td class='settingcaption'>";
$editquestion .= "<br /><div class='header'>";
$editquestion .=$clang->gT("...or import a question");
$editquestion .= "</td></tr></table>\n"
$editquestion .= "</div>\n"
. "\t<form enctype='multipart/form-data' id='importquestion' name='importquestion' action='$scriptname' method='post' onsubmit='return validatefilename(this,\"".$clang->gT('Please select a file to import!','js')."\");'>\n"
. "<table width='100%' border='0' >\n\t"

/////////////////////////////////////////////////////////////////////////////////////////////////////

. "<ul>\n"
. "\t<li>\n"
. "\t<label for='the_file'>".$clang->gT("Select CSV File").":</label>\n"
. "\t<input name='the_file' id='the_file' type=\"file\" size=\"50\" />\n"
. "\t</li>\n"
. "\t<li>\n"
. "\t<label for='translinksfields'>".$clang->gT("Convert resources links?")."</label>\n"
. "\t<input name='translinksfields' id='translinksfields' type='checkbox' checked='checked'/>\n"
. "\t</li>\n"
. "</ul>\n"
. "\t<p>\n"
. "\t<input type='submit' value='".$clang->gT("Import Question")."' />\n"
. "\t<input type='hidden' name='action' value='importquestion' />\n"
. "\t<input type='hidden' name='sid' value='$surveyid' />\n"
. "\t<input type='hidden' name='gid' value='$gid' />\n"
. "\t</p>\n"

////////////////////////////////////////////////////////////////////////////////////////////////////

/*
. "<table width='100%' border='0' >\n\t"
. "\t<tr>"
. "<td align='right' width='35%'><strong>".$clang->gT("Select CSV File").":</strong></td>\n"
. "<td align='left'><input name=\"the_file\" type=\"file\" size=\"50\" /></td></tr>\n"
Expand All @@ -492,7 +515,10 @@
. "\t<input type='hidden' name='action' value='importquestion' />\n"
. "\t<input type='hidden' name='sid' value='$surveyid' />\n"
. "\t<input type='hidden' name='gid' value='$gid' />\n"
. "\t</td></tr></table></form>\n\n"
. "\t</td></tr></table>\n"
*/

."</form>\n\n"
."<script type='text/javascript'>\n"
."<!--\n"
."document.getElementById('title').focus();\n"
Expand Down
6 changes: 4 additions & 2 deletions admin/styles/default/adminstyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,8 @@ textarea.updater-changelog {
#importlabels li label:first-child,
#addattribute li label:first-child,
#exportdialog li label:first-child,
#frmeditquestion li label:first-child,
#frmeditquestion li label:first-child,
#importquestion li label:first-child,
#frmglobalsettings li label:first-child {
width: 44%;
text-align: right;
Expand Down Expand Up @@ -1084,7 +1085,8 @@ textarea.updater-changelog {
padding-bottom:5px;
}

#frmeditquestion li {
#frmeditquestion li,
#importquestion li {
list-style-type: none;
clear:left;
padding-bottom:7px;
Expand Down

0 comments on commit e323723

Please sign in to comment.