Commit 0e48b3bd authored by Aaron Wells's avatar Aaron Wells
Browse files

Bug 1600668: Support for new Google Drive folders URLs

Change-Id: I71818f1bded211ecae5d16d07fef0a433e095cd4
behatnotneeded: Can't test Google embeds in Behat
parent 134cfd9e
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -105,12 +105,24 @@ class PluginBlocktypeGoogleApps extends MaharaCoreBlocktype {
            // $2 - id, key, etc. of the collection
            array(
                'match' => '#.*docs.google.com/([a-zA-Z0-9\_\-\.\/]*)leaf\?id=([a-zA-Z0-9\_\-]+).*#',
                'url'   => $httpstr . '://docs.google.com/$1leaf?id=$2',
                'url'   => $httpstr . '://drive.google.com/$1folderview?id=$2',
                'type'  => 'spanicon',
            ),
            array(
                'match' => '#.*docs.google.com/([a-zA-Z0-9\_\-\.\/]*)open\?id=([a-zA-Z0-9\_\-]+).*#',
                'url'   => $httpstr . '://docs.google.com/$1open?id=$2',
                'url'   => $httpstr . '://drive.google.com/$1folderview?id=$2',
                'type'  => 'spanicon',
            ),
            // drive.google.com/folderview or drive.google.com/open - Google Drive folders
            // (formerly Google Docs collections)
            array(
                'match' => '#.*drive.google.com/([a-zA-Z0-9\_\-\.\/]*)open\?id=([a-zA-Z0-9\_\-]+).*#',
                'url'   => $httpstr . '://drive.google.com/$1folderview?id=$2',
                'type'  => 'spanicon',
            ),
            array(
                'match' => '#.*drive.google.com/([a-zA-Z0-9\_\-\.\/]*)folderview\?id=([a-zA-Z0-9\_\-]+).*#',
                'url'   => $httpstr . '://drive.google.com/$1folderview?id=$2',
                'type'  => 'spanicon',
            ),
            // docs.google.com/present - Google presentation incl. custom domain presentation