View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
05835 | Bug reports | Statistics | public | 2012-02-20 15:51 | 2012-03-15 01:32 |
Reporter | ResearchOnBlogs | Assigned To | c_schmitz | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.91+ | ||||
Fixed in Version | 1.92+ | ||||
Summary | 05835: offer possibility to use JS in statistics_user.php | ||||
Description | It would be useful to use jQuery in the template file statistics_user.php. I order to that, I wrote some lines in offer this possibility. Hope you could put this into core. | ||||
Tags | No tags attached. | ||||
Attached Files | js_insert_to_user_statistics.php (1,693 bytes)
//Create header (fixes bug #3097) $templatedir = sGetTemplatePath($surveyinfo["template"]); // do we need this to get the path? $surveylanguage = $language; sendcacheheaders(); if ( !$embedded ) { $header= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"".$surveylanguage."\" lang=\"".$surveylanguage."\""; if (getLanguageRTL($surveylanguage)) { $header.=" dir=\"rtl\" "; } $header.= ">\n\t<head>\n"; $header.= "<title>$sitename</title>\n"; $header.= "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n"; $header.= "<link href=\"".$thisSurveyCssPath."/template.css\" rel=\"stylesheet\" type=\"text/css\" />\n"; // NEW part - if(file_exists($templatedir ."/statistics_user_template.js")){ $header.= statistic_user_js_insert($surveyinfo, $thisSurveyCssPath); } $header.= "</head>\n<body>\n"; echo $header; } else { if ( function_exists( $embedded_headerfunc ) ) echo $embedded_headerfunc(); } /* * If you need to modify the public statistic via js, * insert a "statistics_user_template.js" - file in your template folder * by KRAV * * creates js insert for page header */ function statistic_user_js_insert($surveyinfo, $thisSurveyCssPath){ global $rooturl; $js_insert = '<script type="text/javascript" src=\"".$rooturl."/scripts/jquery/jquery.js\"></script>'; $js_insert .= '<script type="text/javascript" src="'. $thisSurveyCssPath .'/statistics_user_template.js"></script>'; return $js_insert; } | ||||
Bug heat | 8 | ||||
Complete LimeSurvey version number (& build) | 12416 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | ? | ||||
Server OS (if known) | ? | ||||
Webserver software & version (if known) | ? | ||||
PHP Version | ? | ||||
Can you please explain to us what you intend to achieve by putting JS into this file? What can this be used for? |
|
With this feature you have the possibility to work with JS on the public statistics page and do everything you would do with jQuery. I used it, for theming and replacing strings (insertans..). The code checks, if there is a "statistics_user_template.js" in your template folder and if it's there, the file and jquery will be included |
|
Carsten, what do you think? |
|
I think the the standard template.js should be included and jQuery along with it. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2012-02-20 15:51 | ResearchOnBlogs | New Issue | |
2012-02-20 15:51 | ResearchOnBlogs | File Added: js_insert_to_user_statistics.php | |
2012-02-22 14:32 | Mazi | Note Added: 17540 | |
2012-02-22 14:32 | Mazi | Assigned To | => tpartner |
2012-02-22 14:32 | Mazi | Status | new => feedback |
2012-02-22 14:42 | ResearchOnBlogs | Note Added: 17543 | |
2012-02-22 14:42 | ResearchOnBlogs | Status | feedback => assigned |
2012-02-22 15:57 | Mazi | Issue Monitored: Mazi | |
2012-02-22 15:57 | Mazi | Assigned To | tpartner => c_schmitz |
2012-02-22 15:58 | Mazi | Note Added: 17560 | |
2012-03-12 17:40 | c_schmitz | Note Added: 17894 | |
2012-03-12 17:44 | c_schmitz | Status | assigned => resolved |
2012-03-12 17:44 | c_schmitz | Fixed in Version | => 1.92+ |
2012-03-12 17:44 | c_schmitz | Resolution | open => fixed |
2012-03-14 18:14 | c_schmitz | Changeset attached | => Import 2012-03-09 13:30:34 master 1a83827b |
2012-03-15 01:32 | c_schmitz | Status | resolved => closed |
2021-08-03 11:48 | guest | Bug heat | 6 => 8 |