ÿØÿà 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/h5p/classes/editor_ajax.php000064400000021020152267235560024024 0ustar00. /** * Class \core_h5p\editor_ajax * * @package core_h5p * @copyright 2020 Victor Deniz , base on code by Joubel AS * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_h5p; use Moodle\H5PEditorAjaxInterface; use core\dml\table as dml_table; /** * Moodle's implementation of the H5P Editor Ajax interface. * * Makes it possible for the editor's core ajax functionality to communicate with the * database used by Moodle. * * @package core_h5p * @copyright 2020 Victor Deniz , base on code by Joubel AS * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class editor_ajax implements H5PEditorAjaxInterface { /** The component for H5P. */ public const EDITOR_AJAX_TOKEN = 'editorajax'; /** * Gets latest library versions that exists locally * * @return array Latest version of all local libraries */ public function getLatestLibraryVersions(): array { global $DB; $sql = "SELECT hl2.id, hl2.machinename as machine_name, hl2.title, hl2.majorversion as major_version, hl2.minorversion AS minor_version, hl2.patchversion as patch_version, '' as has_icon, 0 as restricted, hl2.enabled FROM {h5p_libraries} hl2 LEFT JOIN {h5p_libraries} hl1 ON hl1.machinename = hl2.machinename AND (hl2.majorversion < hl1.majorversion OR (hl2.majorversion = hl1.majorversion AND hl2.minorversion < hl1.minorversion) ) WHERE hl2.runnable = 1 AND hl1.majorversion is null ORDER BY hl2.title"; return $DB->get_records_sql($sql); } /** * Get locally stored Content Type Cache. * * If machine name is provided it will only get the given content type from the cache. * * @param null|string $machinename * * @return mixed|null Returns results from querying the database */ public function getContentTypeCache($machinename = null) { global $DB; // Added some extra fields to the result because they are expected by functions calling this. They have been // taken from method getCachedLibsMap() in h5peditor.class.php. $sql = "SELECT l.id, l.machinename AS machine_name, l.majorversion AS major_version, l.minorversion AS minor_version, l.patchversion AS patch_version, l.coremajor AS h5p_major_version, l.coreminor AS h5p_minor_version, l.title, l.tutorial, l.example, '' AS summary, '' AS description, '' AS icon, 0 AS created_at, 0 AS updated_at, 0 AS is_recommended, 0 AS popularity, '' AS screenshots, '' AS license, '' AS owner FROM {h5p_libraries} l"; $params = []; if (!empty($machinename)) { $sql .= ' WHERE l.machinename = :machine_name'; $params = ['machine_name' => $machinename]; } return $DB->get_records_sql($sql, $params); } /** * Gets recently used libraries for the current author * * @return array machine names. The first element in the array is the * most recently used. */ public function getAuthorsRecentlyUsedLibraries(): array { // This is to be implemented when the Hub client is used. return []; } /** * Checks if the provided token is valid for this endpoint. * * @param string $token The token that will be validated for. * * @return bool True if successful validation */ public function validateEditorToken($token): bool { return core::validToken(self::EDITOR_AJAX_TOKEN, $token); } /** * Get translations in one language for a list of libraries. * * @param array $libraries An array of libraries, in the form " . * @param string $languagecode Language code * * @return array Translations in $languagecode available for libraries $libraries */ public function getTranslations($libraries, $languagecode): array { $translations = []; $langcache = \cache::make('core', 'h5p_content_type_translations'); $missing = []; foreach ($libraries as $libstring) { // Check if this library has been saved previously into the cache. $librarykey = helper::get_cache_librarykey($libstring); $cachekey = "{$librarykey}/{$languagecode}"; $libtranslation = $langcache->get($cachekey); if ($libtranslation) { // The library has this language stored into the cache. $translations[$libstring] = $libtranslation; } else { // This language for the library hasn't been stored previously into the cache, so we need to get it from DB. $missing[] = $libstring; } } // Get all language files for libraries which aren't stored into the cache and merge them with the cache ones. return array_merge( $translations, $this->get_missing_translations($missing, $languagecode) ); } /** * Get translation for $language for libraries in $missing. * * @param array $missing An array of libraries, in the form " . * @param string $language Language code * @return array Translations in $language available for libraries $missing */ protected function get_missing_translations(array $missing, string $language): array { global $DB; if (empty($missing)) { return []; } $wheres = []; $params = [ file_storage::COMPONENT, file_storage::LIBRARY_FILEAREA, ]; $sqllike = $DB->sql_like('f.filepath', '?'); $params[] = '%language%'; foreach ($missing as $library) { $librarydata = core::libraryFromString($library); $wheres[] = '(h.machinename = ? AND h.majorversion = ? AND h.minorversion = ?)'; $params[] = $librarydata['machineName']; $params[] = $librarydata['majorVersion']; $params[] = $librarydata['minorVersion']; } $params[] = "{$language}.json"; $wheresql = implode(' OR ', $wheres); $filestable = new dml_table('files', 'f', 'f_'); $filestableselect = $filestable->get_field_select(); $libtable = new dml_table('h5p_libraries', 'h', 'h_'); $libtableselect = $libtable->get_field_select(); $sql = "SELECT {$filestableselect}, {$libtableselect} FROM {h5p_libraries} h LEFT JOIN {files} f ON h.id = f.itemid AND f.component = ? AND f.filearea = ? AND $sqllike WHERE ($wheresql) AND f.filename = ?"; // Get the content of all these language files and put them into the translations array. $langcache = \cache::make('core', 'h5p_content_type_translations'); $fs = get_file_storage(); $translations = []; $results = $DB->get_recordset_sql($sql, $params); $toset = []; foreach ($results as $result) { $file = $fs->get_file_instance($filestable->extract_from_result($result)); $library = $libtable->extract_from_result($result); $libstring = core::record_to_string($library); $librarykey = helper::get_cache_librarykey($libstring); $translations[$libstring] = $file->get_content(); $cachekey = "{$librarykey}/{$language}"; $toset[$cachekey] = $translations[$libstring]; } $langcache->set_many($toset); $results->close(); return $translations; } }