[moodle] / contrib / plugins / grade / report / visual / flex.php Repository:

Annotation of /contrib/plugins/grade/report/visual/flex.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download)

1 : dservos 1.1 <?php
2 :     require_once '../../../config.php';
3 :    
4 :     if(!isset($courseid) || is_null($courseid)) {
5 :     $courseid = required_param('id');
6 :     }
7 :    
8 :     if(!isset($course) || is_null($course)) {
9 :     if(isset($DB) && !is_null($DB)) {
10 :     $course = $DB->get_record('course', array('id' => $courseid));
11 :     } else {
12 :     $course = get_record('course', 'id', $courseid);
13 :     }
14 :     }
15 :    
16 :     $flashvars = array();
17 :     $flashvars['username'] = $USER->username;
18 :     $flashvars['userid'] = $USER->id;
19 :     $flashvars['courseid'] = $courseid;
20 :     $flashvars['coursefullname'] = $course->fullname;
21 :     $flashvars['courseshortname'] = $course->shortname;
22 :     $flashvars['sessionid'] = session_id();
23 :     $flashvars['sessioncookie'] = $CFG->sessioncookie;
24 :     $flashvars['sessiontest'] = $SESSION->session_test;
25 :     $flashvars['dirroot'] = $CFG->dirroot;
26 :     $flashvars['wwwroot'] = $CFG->wwwroot;
27 :     $flashvars['langmodulename'] = get_string('modulename', 'gradereport_visual');
28 :     $flashvars['langgrade'] =get_string('grades');
29 :    
30 :     $flashvarstext = '';
31 :     foreach($flashvars as $key=>$val) {
32 :     $flashvarstext .= $key. '=' . addslashes(urlencode(strip_tags($val))) . '&';
33 :     }
34 :     $flashvarstext = substr($flashvarstext, 0, strlen($flashvarstext) - 1);
35 :    
36 :     ?>
37 :     <div style="vertical-align: top; text-align: center;">
38 :     <script src="AC_OETags.js" language="javascript"></script>
39 :     <script language="JavaScript" type="text/javascript">
40 :     <!--
41 :     // -----------------------------------------------------------------------------
42 :     // Major version of Flash required
43 :     var requiredMajorVersion = 9;
44 :     // Minor version of Flash required
45 :     var requiredMinorVersion = 0;
46 :     // Minor version of Flash required
47 :     var requiredRevision = 28;
48 :     // -----------------------------------------------------------------------------
49 :    
50 :    
51 :     // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
52 :     var hasProductInstall = DetectFlashVer(6, 0, 65);
53 :    
54 :     // Version check based upon the values defined in globals
55 :     var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
56 :    
57 :     if ( hasProductInstall && !hasRequestedVersion ) {
58 :     // DO NOT MODIFY THE FOLLOWING FOUR LINES
59 :     // Location visited after installation is complete if installation is required
60 :     var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
61 :     var MMredirectURL = window.location;
62 :     document.title = document.title.slice(0, 47) + " - Flash Player Installation";
63 :     var MMdoctitle = document.title;
64 :    
65 :     AC_FL_RunContent(
66 :     "flashVars", "<?php echo $flashvarstext; ?>",
67 :    
68 :     "src", "playerProductInstall",
69 :     "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
70 :     "width", "800",
71 :     "height", "600",
72 :     "align", "middle",
73 :     "id", "flare_visualization",
74 :     "quality", "high",
75 :     "bgcolor", "#FFFFFF",
76 :     "name", "flare_visualization",
77 :     "allowScriptAccess","sameDomain",
78 :     "type", "application/x-shockwave-flash",
79 :     "pluginspage", "http://www.adobe.com/go/getflashplayer"
80 :     );
81 :     } else if (hasRequestedVersion) {
82 :     // if we've detected an acceptable version
83 :     // embed the Flash Content SWF when all tests are passed
84 :     AC_FL_RunContent(
85 :     "flashVars", "<?php echo $flashvarstext; ?>",
86 :    
87 :     "src", "flare_visualization",
88 :     "width", "800",
89 :     "height", "600",
90 :     "align", "middle",
91 :     "id", "flare_visualization",
92 :     "quality", "high",
93 :     "bgcolor", "#FFFFFF",
94 :     "name", "flare_visualization",
95 :     "allowScriptAccess","sameDomain",
96 :     "type", "application/x-shockwave-flash",
97 :     "pluginspage", "http://www.adobe.com/go/getflashplayer"
98 :     );
99 :     } else { // flash is too old or we can't detect the plugin
100 :     var alternateContent = 'Alternate HTML content should be placed here. '
101 :     + 'This content requires the Adobe Flash Player. '
102 :     + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
103 :     document.write(alternateContent); // insert non-flash content
104 :     }
105 :     // -->
106 :     </script>
107 :     <noscript>
108 :     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
109 :     id="flare_visualization" width="800" height="600"
110 :     codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
111 :     <param name="flashVars" value="<?php echo $flashvarstext;?>" />
112 :    
113 :     <param name="movie" value="flare_visualization.swf" />
114 :     <param name="quality" value="high" />
115 :     <param name="bgcolor" value="#FFFFFF" />
116 :     <param name="allowScriptAccess" value="sameDomain" />
117 :     <embed src="flare_visualization.swf" quality="high" bgcolor="#ffffff"
118 :     flashVars="<?php echo $flashvarstext; ?>"
119 :     width="800" height="600" name="flare_visualization" align="middle"
120 :     play="true"
121 :     loop="false"
122 :     quality="high"
123 :     allowScriptAccess="sameDomain"
124 :     type="application/x-shockwave-flash"
125 :     pluginspage="http://www.adobe.com/go/getflashplayer">
126 :     </embed>
127 :     </object>
128 :     </noscript>
129 :     </div>

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7