Skip to content

Commit

Permalink
New Feature: (minor) Added survey title to browse menu bar heading
Browse files Browse the repository at this point in the history
Dev: New function in common.php getSurveyName($surveyid) returns survey title as text 
Dev: when given survey id - will use it to add the survey title to other menu bars on 
Dev: pages where the survey title doesn't show

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey181@6589 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 28, 2009
1 parent babca7b commit 6a591cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion admin/browse.php
Expand Up @@ -56,7 +56,7 @@
}


$surveyoptions = browsemenubar($clang->gT("Browse Responses"));
$surveyoptions = browsemenubar($clang->gT("Browse Responses"), getSurveyName($surveyid));
$browseoutput = "<table><tr><td></td></tr></table>\n"
."<table class='menubar'>\n";

Expand Down
20 changes: 17 additions & 3 deletions common.php
Expand Up @@ -1798,15 +1798,15 @@ function fixmovedquestionConditions($qid,$oldgid,$newgid) //Function rewrites th
}
}

function browsemenubar($title='')
function browsemenubar($title='', $surveyname='')
{
global $surveyid, $scriptname, $imagefiles, $homeurl, $clang, $sumrows5, $surrows;

$thissurvey=getSurveyInfo($surveyid);
//BROWSE MENU BAR
$browsemenubar = "<div class='menubar'>\n"
. "\t<div class='menubar-title'>\n"
. "\t<strong>$title</strong>"
. "\t<strong>$title</strong>: ($surveyname)"
. "\t</div>"
. "\t<div class='menubar-main'>\n"
. "\t<div class='menubar-left'>\n"
Expand Down Expand Up @@ -5657,4 +5657,18 @@ function strip_javascript($content){
);
$text = preg_replace($search, '', $content);
return $text;
}
}

/**
* This function returns the survey name in the base language
*
* @param string $surveyid Survey ID
* @return string Survey Name
*/
function getSurveyName($surveyid)
{
$sumquery1 = "SELECT * FROM ".db_table_name('surveys')." inner join ".db_table_name('surveys_languagesettings')." on (surveyls_survey_id=sid and surveyls_language=language) WHERE sid=$surveyid"; //Getting data for this survey
$sumresult1 = db_select_limit_assoc($sumquery1, 1); //Checked
$s1row = $sumresult1->FetchRow();
return $s1row['surveyls_title'];
}

0 comments on commit 6a591cd

Please sign in to comment.