Skip to content

Commit

Permalink
Fixed issue #4832: ofer a possibility to deactivate the javascript se…
Browse files Browse the repository at this point in the history
…lector

Dev: adding an php getJsMode funtion, and adding this function to the body class. None affect template editor too.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9671 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Shnoulle committed Jan 11, 2011
1 parent e5334a1 commit e0b94af
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
44 changes: 41 additions & 3 deletions admin/admin_functions.php
Expand Up @@ -327,7 +327,7 @@ function getAdminHeader($meta=false)
if (!isset($_SESSION['adminlang']) || $_SESSION['adminlang']=='') {$_SESSION['adminlang']=$defaultlang;}
$strAdminHeader="<?xml version=\"1.0\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
."<html ";

if (getLanguageRTL($_SESSION['adminlang']))
{
$strAdminHeader.=" dir=\"rtl\" ";
Expand Down Expand Up @@ -372,7 +372,7 @@ function getAdminHeader($meta=false)
$strAdminHeader .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"$cssinclude\" />\n";
}
$strAdminHeader.= use_firebug()
. "</head>\n<body>\n";
. "</head>\n<body class='".getJsMode()."'>\n";
if (isset($_SESSION['dateformat']))
{
$formatdata=getDateFormatData($_SESSION['dateformat']);
Expand All @@ -381,7 +381,6 @@ function getAdminHeader($meta=false)
var userlanguage='".$_SESSION['adminlang']."';
</script>";
}

// Prepare flashmessage
if (isset($_SESSION['flashmessage']) && $_SESSION['flashmessage']!='')
{
Expand Down Expand Up @@ -410,3 +409,42 @@ function getAdminHeader($meta=false)
return $strAdminHeader;
}

function getJsMode(){
global $defaulthtmleditormode;

switch ($defaulthtmleditormode)
{
case 'none':
$defauljsmode="none";
break;
case 'popup':
$defauljsmode="simple";
break;
case 'inline':
$defauljsmode="full";
break;
default:
$defauljsmode="full";
break;
}
if (isset($_SESSION['htmleditormode'])){
switch ($_SESSION['htmleditormode']){
case 'none':
$userjsmode="none";
break;
case 'popup':
$userjsmode="simple";
break;
case 'inline':
$userjsmode="full";
break;
default:
$userjsmode=$defauljsmode;
break;
}
}
else{
$userjsmode=$defauljsmode;
}
return $userjsmode;
}
7 changes: 3 additions & 4 deletions admin/scripts/admin_core.js
Expand Up @@ -237,14 +237,13 @@ $(document).ready(function(){
});
});

if ($("#question_type").length > 0){
if ($("body.full #question_type").length > 0){
$("#question_type").msDropDown();

$("#question_type").change(function(event){

var selected_value = qDescToCode[''+$("#question_type_child .selected").text()];
OtherSelection(selected_value);
});
});

$.getScript('../scripts/jquery/jquery-qtip.js', function() {
$("#question_type_child a").each(function(index,element){
Expand Down Expand Up @@ -273,7 +272,7 @@ $(document).ready(function(){
});
});

}
}



Expand Down
2 changes: 1 addition & 1 deletion admin/scripts/templates.js
Expand Up @@ -2,7 +2,7 @@
// based on TTabs from http://interface.eyecon.ro/

$(document).ready(function(){
if($("#changes").length > 0) {
if(($("body.full #changes").length > 0) || ($("body.simple #changes").length > 0)) {
editAreaLoader.init({
language: adminlanguage,
id : "changes" // textarea id
Expand Down

0 comments on commit e0b94af

Please sign in to comment.