ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/theme/yui_combo.php000064400000042451152266366750022511 0ustar00. /** * This file is responsible for serving of yui Javascript and CSS * * @package core * @copyright 2009 Petr Skoda (skodak) {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ // disable moodle specific debug messages and any errors in output, // comment out when debugging or better look into error log! define('NO_DEBUG_DISPLAY', true); // we need just the values from config.php and minlib.php define('ABORT_AFTER_CONFIG', true); require('../config.php'); // this stops immediately at the beginning of lib/setup.php // get special url parameters list($parts, $slasharguments) = combo_params(); if (!$parts) { combo_not_found(); } $parts = trim($parts, '&'); // Remove any duplicate parts, since each file only needs to be loaded once (which also helps reduce total file size). $parts = implode('&', array_unique(explode('&', $parts))); // Limit length of parts to match the YUI loader limit of 1024, to prevent loading an arbitrary number of files. if (strlen($parts) > 1024) { $parts = substr($parts, 0, 1024); // If the shortened $parts has been cut off mid-way through a filename, trim back to the end of the previous filename. if (substr($parts, -3) !== '.js' && substr($parts, -4) !== '.css') { $parts = substr($parts, 0, strrpos($parts, '&')); } } // find out what we are serving - only one type per request $content = ''; if (substr($parts, -3) === '.js') { $mimetype = 'application/javascript'; } else if (substr($parts, -4) === '.css') { $mimetype = 'text/css'; } else { combo_not_found(); } $etag = sha1($parts); // if they are requesting a revision that's not -1, and they have supplied an // If-Modified-Since header, we can send back a 304 Not Modified since the // content never changes (the rev number is increased any time the content changes) if (strpos($parts, '/-1/') === false and (!empty($_SERVER['HTTP_IF_NONE_MATCH']) || !empty($_SERVER['HTTP_IF_MODIFIED_SINCE']))) { $lifetime = 60*60*24*360; // 1 year, we do not change YUI versions often, there are a few custom yui modules header('HTTP/1.1 304 Not Modified'); header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT'); header('Cache-Control: public, max-age='.$lifetime); header('Content-Type: '.$mimetype); header('Etag: "'.$etag.'"'); die; } $parts = explode('&', $parts); $cache = true; $lastmodified = 0; while (count($parts)) { $part = array_shift($parts); if (empty($part)) { continue; } $filecontent = ''; $part = min_clean_param($part, 'SAFEPATH'); $bits = explode('/', $part); if (count($bits) < 2) { $content .= "\n// Wrong combo resource $part!\n"; continue; } $version = array_shift($bits); if ($version === 'rollup') { $yuipatchedversion = explode('_', array_shift($bits)); $revision = $yuipatchedversion[0]; $rollupname = array_shift($bits); if (strpos($rollupname, 'yui-moodlesimple') !== false) { if (substr($rollupname, -3) === '.js') { // Determine which version of this rollup should be used. $filesuffix = '.js'; preg_match('/(-(debug|min))?\.js/', $rollupname, $matches); if (isset($matches[1])) { $filesuffix = $matches[0]; } $type = 'js'; } else if (substr($rollupname, -4) === '.css') { $type = 'css'; } else { continue; } // Allow support for revisions on YUI between official releases. // We can just discard the subrevision since it is only used to invalidate the browser cache. $yuipatchedversion = explode('_', $revision); $yuiversion = $yuipatchedversion[0]; $yuimodules = array( 'yui', 'oop', 'event-custom-base', 'dom-core', 'dom-base', 'color-base', 'dom-style', 'selector-native', 'selector', 'node-core', 'node-base', 'event-base', 'event-base-ie', 'pluginhost-base', 'pluginhost-config', 'event-delegate', 'node-event-delegate', 'node-pluginhost', 'dom-screen', 'node-screen', 'node-style', 'querystring-stringify-simple', 'io-base', 'json-parse', 'transition', 'selector-css2', 'selector-css3', 'dom-style-ie', // Some extras we use everywhere. 'escape', 'attribute-core', 'event-custom-complex', 'base-core', 'attribute-base', 'attribute-extras', 'attribute-observable', 'base-observable', 'base-base', 'base-pluginhost', 'base-build', 'event-synthetic', 'attribute-complex', 'event-mouseenter', 'event-key', 'event-outside', 'event-focus', 'classnamemanager', 'widget-base', 'widget-htmlparser', 'widget-skin', 'widget-uievents', 'widget-stdmod', 'widget-position', 'widget-position-align', 'widget-stack', 'widget-position-constrain', 'overlay', 'widget-autohide', 'button-core', 'button-plugin', 'widget-buttons', 'widget-modality', 'panel', 'yui-throttle', 'dd-ddm-base', 'dd-drag', 'dd-plugin', ); // We need to add these new parts to the beginning of the $parts list, not the end. if ($type === 'js') { $newparts = array(); foreach ($yuimodules as $module) { $newparts[] = $yuiversion . '/' . $module . '/' . $module . $filesuffix; } $newparts[] = 'yuiuseall/yuiuseall'; $parts = array_merge($newparts, $parts); } else { $newparts = array(); foreach ($yuimodules as $module) { $candidate = $yuiversion . '/' . $module . '/assets/skins/sam/' . $module . '.css'; if (!file_exists("$CFG->libdir/yuilib/$candidate")) { continue; } $newparts[] = $candidate; } if ($newparts) { $parts = array_merge($newparts, $parts); } } } continue; } if ($version === 'm') { $version = 'moodle'; } if ($version === 'moodle') { if (count($bits) <= 3) { // This is an invalid module load attempt. $content .= "\n// Incorrect moodle module inclusion. Not enough component information in {$part}.\n"; continue; } $revision = (int)array_shift($bits); if (!min_is_revision_valid_and_current($revision)) { // A non-current revision means please don't cache the JS $revision = -1; $cache = false; } $frankenstyle = array_shift($bits); $filename = array_pop($bits); $modulename = $bits[0]; $dir = core_component::get_component_directory($frankenstyle); // For shifted YUI modules, we need the YUI module name in frankenstyle format. $frankenstylemodulename = join('-', array($version, $frankenstyle, $modulename)); $frankenstylefilename = preg_replace('/' . $modulename . '/', $frankenstylemodulename, $filename); // Submodules are stored in a directory with the full submodule name. // We need to remove the -debug.js, -min.js, and .js from the file name to calculate that directory name. $frankenstyledirectoryname = str_replace(array('-min.js', '-debug.js', '.js', '.css'), '', $frankenstylefilename); // By default, try and use the /yui/build directory. $contentfile = $dir . '/yui/build/' . $frankenstyledirectoryname; if ($mimetype == 'text/css') { // CSS assets are in a slightly different place to the JS. $contentfile = $contentfile . '/assets/skins/sam/' . $frankenstylefilename; // Add the path to the bits to handle fallback for non-shifted assets. $bits[] = 'assets'; $bits[] = 'skins'; $bits[] = 'sam'; } else { $contentfile = $contentfile . '/' . $frankenstylefilename; } // If the shifted versions don't exist, fall back to the non-shifted file. if (!file_exists($contentfile) or !is_file($contentfile)) { // We have to revert to the non-minified and non-debug versions. $filename = preg_replace('/-(min|debug)\./', '.', $filename); $contentfile = $dir . '/yui/' . join('/', $bits) . '/' . $filename; } } else if ($version === '2in3') { $contentfile = "$CFG->libdir/yuilib/$part"; } else if ($version == 'gallery') { if (count($bits) <= 2) { // This is an invalid module load attempt. $content .= "\n// Incorrect moodle module inclusion. Not enough component information in {$part}.\n"; continue; } $revision = (int)array_shift($bits); if (!min_is_revision_valid_and_current($revision)) { // A non-current revision means please don't cache the JS $revision = -1; $cache = false; } $contentfile = "$CFG->libdir/yuilib/gallery/" . join('/', $bits); } else if ($version == 'yuiuseall') { // Create global Y that is available in global scope, // this is the trick behind original SimpleYUI. $filecontent = "var Y = YUI().use('*');"; } else { // Allow support for revisions on YUI between official releases. // We can just discard the subrevision since it is only used to invalidate the browser cache. $yuipatchedversion = explode('_', $version); $yuiversion = $yuipatchedversion[0]; if ($yuiversion != $CFG->yui3version) { $content .= "\n// Wrong yui version $part!\n"; continue; } $newpart = explode('/', $part); $newpart[0] = $yuiversion; $part = implode('/', $newpart); $contentfile = "$CFG->libdir/yuilib/$part"; } if (!file_exists($contentfile) or !is_file($contentfile)) { $location = '$CFG->dirroot'.preg_replace('/^'.preg_quote($CFG->dirroot, '/').'/', '', $contentfile); $content .= "\n// Combo resource $part ($location) not found!\n"; continue; } if (empty($filecontent)) { $filecontent = file_get_contents($contentfile); } $fmodified = filemtime($contentfile); if ($fmodified > $lastmodified) { $lastmodified = $fmodified; } $relroot = preg_replace('|^http.?://[^/]+|', '', $CFG->wwwroot); $sep = ($slasharguments ? '/' : '?file='); if ($mimetype === 'text/css') { if ($version == 'moodle') { // Search for all images in the file and replace with an appropriate link to the yui_image.php script $imagebits = array( $sep . $version, $frankenstyle, $modulename, array_shift($bits), '$1.$2' ); $filecontent = preg_replace('/([a-z0-9_-]+)\.(png|gif)/', $relroot . '/theme/yui_image.php' . implode('/', $imagebits), $filecontent); } else if ($version == '2in3') { // First we need to remove relative paths to images. These are used by YUI modules to make use of global assets. // I've added this as a separate regex so it can be easily removed once // YUI standardise there CSS methods $filecontent = preg_replace('#(\.\./\.\./\.\./\.\./assets/skins/sam/)?([a-z0-9_-]+)\.(png|gif)#', '$2.$3', $filecontent); // search for all images in yui2 CSS and serve them through the yui_image.php script $filecontent = preg_replace('/([a-z0-9_-]+)\.(png|gif)/', $relroot.'/theme/yui_image.php'.$sep.$CFG->yui2version.'/$1.$2', $filecontent); } else if ($version == 'gallery') { // Replace any references to the CDN with a relative link. $filecontent = preg_replace('#(' . preg_quote('http://yui.yahooapis.com/') . '(gallery-[^/]*/))#', '../../../../', $filecontent); // Replace all relative image links with the a link to yui_image.php. $filecontent = preg_replace('#(' . preg_quote('../../../../') . ')(gallery-[^/]*/assets/skins/sam/[a-z0-9_-]+)\.(png|gif)#', $relroot . '/theme/yui_image.php' . $sep . '/gallery/' . $revision . '/$2.$3', $filecontent); } else { // First we need to remove relative paths to images. These are used by YUI modules to make use of global assets. // I've added this as a separate regex so it can be easily removed once // YUI standardise there CSS methods $filecontent = preg_replace('#(\.\./\.\./\.\./\.\./assets/skins/sam/)?([a-z0-9_-]+)\.(png|gif)#', '$2.$3', $filecontent); // search for all images in yui2 CSS and serve them through the yui_image.php script $filecontent = preg_replace('/([a-z0-9_-]+)\.(png|gif)/', $relroot.'/theme/yui_image.php'.$sep.$version.'/$1.$2', $filecontent); } } $content .= $filecontent; } if ($lastmodified == 0) { $lastmodified = time(); } if ($cache) { combo_send_cached($content, $mimetype, $etag, $lastmodified); } else { combo_send_uncached($content, $mimetype); } /** * Send the JavaScript cached * @param string $content * @param string $mimetype * @param string $etag * @param int $lastmodified */ function combo_send_cached($content, $mimetype, $etag, $lastmodified) { $lifetime = 60*60*24*360; // 1 year, we do not change YUI versions often, there are a few custom yui modules header('Content-Disposition: inline; filename="combo"'); header('Last-Modified: '. gmdate('D, d M Y H:i:s', $lastmodified) .' GMT'); header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT'); header('Pragma: '); header('Cache-Control: public, max-age='.$lifetime.', immutable'); header('Accept-Ranges: none'); header('Content-Type: '.$mimetype); header('Etag: "'.$etag.'"'); if (!min_enable_zlib_compression()) { header('Content-Length: '.strlen($content)); } echo $content; die; } /** * Send the JavaScript uncached * @param string $content * @param string $mimetype */ function combo_send_uncached($content, $mimetype) { header('Content-Disposition: inline; filename="combo"'); header('Last-Modified: '. gmdate('D, d M Y H:i:s', time()) .' GMT'); header('Expires: '. gmdate('D, d M Y H:i:s', time() + 2) .' GMT'); header('Pragma: '); header('Accept-Ranges: none'); header('Content-Type: '.$mimetype); if (!min_enable_zlib_compression()) { header('Content-Length: '.strlen($content)); } echo $content; die; } function combo_not_found($message = '') { header('HTTP/1.0 404 not found'); if ($message) { echo $message; } else { echo 'Combo resource not found, sorry.'; } die; } function combo_params() { if (isset($_SERVER['QUERY_STRING']) and strpos($_SERVER['QUERY_STRING'], 'file=/') === 0) { // url rewriting $slashargument = substr($_SERVER['QUERY_STRING'], 6); return array($slashargument, true); } else if (isset($_SERVER['REQUEST_URI']) and strpos($_SERVER['REQUEST_URI'], '?') !== false) { $parts = explode('?', $_SERVER['REQUEST_URI'], 2); return array($parts[1], false); } else if (isset($_SERVER['QUERY_STRING']) and strpos($_SERVER['QUERY_STRING'], '?') !== false) { // note: buggy or misconfigured IIS does return the query string in REQUEST_URI return array($_SERVER['QUERY_STRING'], false); } else if ($slashargument = min_get_slash_argument(false)) { $slashargument = ltrim($slashargument, '/'); return array($slashargument, true); } else { // unsupported server, sorry! combo_not_found('Unsupported server - query string can not be determined, try disabling YUI combo loading in admin settings.'); } }