MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004861AContentUser Interfacepublic2011-09-30 11:012013-03-15 10:58
Reporterharris 
Assigned Toharris 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version1.2 
Summary0004861: Detect flash and save it in session
DescriptionIn vitals, check if flash is set in cookie, if so, save it in session. This is useful for the multi-file uploader.

Additional InformationAdd the following code from ATutor to AContent

/*~~~~~~~~~~~~~~~~~flash detection~~~~~~~~~~~~~~~~*/
if(isset($_COOKIE["flash"])){
    $_SESSION['flash'] = $_COOKIE["flash"];

    //delete the cookie
    ATutor.setcookie("flash",'',time()-3600);
}

if (!isset($_SESSION["flash"])) {
    $_custom_head .= '
        <script type="text/javascript">
        <!--

            //VB-Script for InternetExplorer
            function iExploreCheck()
            {
                document.writeln("<scr" + "ipt language=\'VBscript\'>");
                //document.writeln("\'Test to see if VBScripting works");
                document.writeln("detectableWithVB = False");
                document.writeln("If ScriptEngineMajorVersion >= 2 then");
                document.writeln(" detectableWithVB = True");
                document.writeln("End If");
                //document.writeln("\'This will check for the plugin");
                document.writeln("Function detectActiveXControl(activeXControlName)");
                document.writeln(" on error resume next");
                document.writeln(" detectActiveXControl = False");
                document.writeln(" If detectableWithVB Then");
                document.writeln(" detectActiveXControl = IsObject(CreateObject(activeXControlName))");
                document.writeln(" End If");
                document.writeln("End Function");
                document.writeln("</scr" + "ipt>");
                return detectActiveXControl("ShockwaveFlash.ShockwaveFlash.1");
            }


            var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : false;
            if(!(plugin) && (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)))
                if (iExploreCheck())
                    flash_detect = "flash=yes";
                else
                    flash_detect = "flash=no";

            else if(plugin)
                flash_detect = "flash=yes";
            else
                flash_detect = "flash=no";

            writeCookie(flash_detect);

            function writeCookie(value)
            {
                var today = new Date();
                var the_date = new Date("December 31, 2099");
                var the_cookie_date = the_date.toGMTString();
                var the_cookie = value + ";expires=" + the_cookie_date;
                document.cookie = the_cookie;
            }
        //-->
        </script>
';
}



/*~~~~~~~~~~~~~~end flash detection~~~~~~~~~~~~~~~*/
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005438)
harris (developer)
2011-09-30 11:18

svn 321
(0006262)
greg (administrator)
2013-03-15 10:58

fixed in 1.3

- Issue History
Date Modified Username Field Change
2011-09-30 11:01 harris New Issue
2011-09-30 11:16 harris Assigned To => harris
2011-09-30 11:16 harris Status new => assigned
2011-09-30 11:18 harris Note Added: 0005438
2011-09-30 11:18 harris Status assigned => resolved
2011-09-30 11:18 harris Resolution open => fixed
2011-10-05 15:55 greg Fixed in Version => 1.2
2013-03-15 10:58 greg Note Added: 0006262
2013-03-15 10:58 greg Status resolved => closed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker