ÿØÿà 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/backup/import.php000064400000023725152266573270022201 0ustar00. /** * This script is used to configure and execute the import proccess. * * @package core * @subpackage backup * @copyright Moodle * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define('NO_OUTPUT_BUFFERING', true); // Require both the backup and restore libs require_once('../config.php'); require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php'); require_once($CFG->dirroot . '/backup/moodle2/backup_plan_builder.class.php'); require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php'); require_once($CFG->dirroot . '/backup/util/ui/import_extensions.php'); // The courseid we are importing to $courseid = required_param('id', PARAM_INT); // The id of the course we are importing FROM (will only be set if past first stage $importcourseid = optional_param('importid', false, PARAM_INT); // We just want to check if a search has been run. True if anything is there. $searchcourses = optional_param('searchcourses', false, PARAM_BOOL); // The target method for the restore (adding or deleting) $restoretarget = optional_param('target', backup::TARGET_CURRENT_ADDING, PARAM_INT); // Load the course and context $course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST); $context = context_course::instance($courseid); // Must pass login require_login($course); // Must hold restoretargetimport in the current course require_capability('moodle/restore:restoretargetimport', $context); // Set up the page $PAGE->set_title($course->shortname . ': ' . get_string('import')); $PAGE->set_heading($course->fullname); $PAGE->set_url(new moodle_url('/backup/import.php', array('id'=>$courseid))); $PAGE->set_context($context); $PAGE->set_pagelayout('admin'); // Prepare the backup renderer $renderer = $PAGE->get_renderer('core','backup'); // Check if we already have a import course id if ($importcourseid === false || $searchcourses) { // Obviously not... show the selector so one can be chosen $url = new moodle_url('/backup/import.php', array('id'=>$courseid)); $search = new import_course_search(array('url'=>$url)); // show the course selector echo $OUTPUT->header(); \backup_helper::print_coursereuse_selector('import'); echo html_writer::tag('div', get_string('importinfo'), ['class' => 'pb-3']); $backup = new import_ui(false, array()); echo $renderer->progress_bar($backup->get_progress_bar()); $html = $renderer->import_course_selector($url, $search); echo $html; echo $OUTPUT->footer(); die(); } // Load the course +context to import from $importcourse = $DB->get_record('course', array('id'=>$importcourseid), '*', MUST_EXIST); $importcontext = context_course::instance($importcourseid); // Make sure the user can backup from that course require_capability('moodle/backup:backuptargetimport', $importcontext); // Attempt to load the existing backup controller (backupid will be false if there isn't one) $backupid = optional_param('backup', false, PARAM_ALPHANUM); if (!($bc = backup_ui::load_controller($backupid))) { $bc = new backup_controller(backup::TYPE_1COURSE, $importcourse->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_YES, backup::MODE_IMPORT, $USER->id); $bc->get_plan()->get_setting('users')->set_status(backup_setting::LOCKED_BY_CONFIG); $settings = $bc->get_plan()->get_settings(); // For the initial stage we want to hide all locked settings and if there are // no visible settings move to the next stage $visiblesettings = false; foreach ($settings as $setting) { if ($setting->get_status() !== backup_setting::NOT_LOCKED) { $setting->set_visibility(backup_setting::HIDDEN); } else { $visiblesettings = true; } } import_ui::skip_current_stage(!$visiblesettings); } // Prepare the import UI $backup = new import_ui($bc, array('importid'=>$importcourse->id, 'target'=>$restoretarget)); // Process the current stage $backup->process(); // If this is the confirmation stage remove the filename setting if ($backup->get_stage() == backup_ui::STAGE_CONFIRMATION) { $backup->get_setting('filename')->set_visibility(backup_setting::HIDDEN); } // If it's the final stage process the import if ($backup->get_stage() == backup_ui::STAGE_FINAL) { echo $OUTPUT->header(); \backup_helper::print_coursereuse_selector('import'); echo html_writer::tag('div', get_string('importinfo'), ['class' => 'pb-3']); // Display an extra progress bar so that we can show the current stage. echo html_writer::start_div('', array('id' => 'executionprogress')); echo $renderer->progress_bar($backup->get_progress_bar()); // Start the progress display - we split into 2 chunks for backup and restore. $progress = new \core\progress\display(); $progress->start_progress('', 2); $backup->get_controller()->set_progress($progress); // Prepare logger for backup. $logger = new core_backup_html_logger($CFG->debugdeveloper ? backup::LOG_DEBUG : backup::LOG_INFO); $backup->get_controller()->add_logger($logger); // First execute the backup $backup->execute(); // Before destroying the backup object, we still need to generate the progress bar. $progressbar = $renderer->progress_bar($backup->get_progress_bar()); $backup->destroy(); unset($backup); // Note that we've done that progress. $progress->progress(1); // Check whether the backup directory still exists. If missing, something // went really wrong in backup, throw error. Note that backup::MODE_IMPORT // backups don't store resulting files ever $tempdestination = make_backup_temp_directory($backupid, false); if (!file_exists($tempdestination) || !is_dir($tempdestination)) { throw new \moodle_exception('unknownbackupexporterror'); // Shouldn't happen ever. } // Prepare the restore controller. We don't need a UI here as we will just use what // ever the restore has (the user has just chosen). $rc = new restore_controller($backupid, $course->id, backup::INTERACTIVE_YES, backup::MODE_IMPORT, $USER->id, $restoretarget); // Start a progress section for the restore, which will consist of 2 steps // (the precheck and then the actual restore). $progress->start_progress('Restore process', 2); $rc->set_progress($progress); // Set logger for restore. $rc->add_logger($logger); // Convert the backup if required.... it should NEVER happed if ($rc->get_status() == backup::STATUS_REQUIRE_CONV) { $rc->convert(); } // Mark the UI finished. $rc->finish_ui(); // Execute prechecks $warnings = false; if (!$rc->execute_precheck()) { $precheckresults = $rc->get_precheck_results(); if (is_array($precheckresults)) { if (!empty($precheckresults['errors'])) { // If errors are found, terminate the import. fulldelete($tempdestination); echo $renderer->precheck_notices($precheckresults); echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id'=>$course->id))); echo $OUTPUT->footer(); die(); } if (!empty($precheckresults['warnings'])) { // If warnings are found, go ahead but display warnings later. $warnings = $precheckresults['warnings']; } } } if ($restoretarget == backup::TARGET_CURRENT_DELETING || $restoretarget == backup::TARGET_EXISTING_DELETING) { restore_dbops::delete_course_content($course->id); } // Execute the restore. $rc->execute_plan(); // Delete the temp directory now fulldelete($tempdestination); // End restore section of progress tracking (restore/precheck). $progress->end_progress(); // All progress complete. Hide progress area. $progress->end_progress(); echo html_writer::end_div(); echo html_writer::script('document.getElementById("executionprogress").style.display = "none";'); // Display a notification and a continue button if ($warnings) { echo $OUTPUT->box_start(); echo $OUTPUT->notification(get_string('warning'), 'notifyproblem'); echo html_writer::start_tag('ul', array('class'=>'list')); foreach ($warnings as $warning) { echo html_writer::tag('li', $warning); } echo html_writer::end_tag('ul'); echo $OUTPUT->box_end(); } echo $progressbar; echo $OUTPUT->notification(get_string('importsuccess', 'backup'), 'notifysuccess'); echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id'=>$course->id))); // Get and display log data if there was any. $loghtml = $logger->get_html(); if ($loghtml != '') { echo $renderer->log_display($loghtml); } echo $OUTPUT->footer(); die(); } else { // Otherwise save the controller and progress $backup->save_controller(); } // Display the current stage. echo $OUTPUT->header(); \backup_helper::print_coursereuse_selector('import'); echo html_writer::tag('div', get_string('importinfo'), ['class' => 'pb-3']); if ($backup->enforce_changed_dependencies()) { debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER); } echo $renderer->progress_bar($backup->get_progress_bar()); echo $backup->display($renderer); $backup->destroy(); unset($backup); echo $OUTPUT->footer(); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/lesson/import.php000064400000007663152267036100023004 0ustar00. /** * Imports lesson pages * * @package mod_lesson * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later **/ require_once("../../config.php"); require_once($CFG->libdir.'/questionlib.php'); require_once($CFG->dirroot.'/mod/lesson/locallib.php'); require_once($CFG->dirroot.'/mod/lesson/import_form.php'); require_once($CFG->dirroot.'/mod/lesson/format.php'); // Parent class $id = required_param('id', PARAM_INT); // Course Module ID $pageid = optional_param('pageid', '', PARAM_INT); // Page ID $PAGE->set_url('/mod/lesson/import.php', array('id'=>$id, 'pageid'=>$pageid)); $cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST)); require_login($course, false, $cm); $context = context_module::instance($cm->id); require_capability('mod/lesson:edit', $context); $strimportquestions = get_string("importquestions", "lesson"); $strlessons = get_string("modulenameplural", "lesson"); $manager = lesson_page_type_manager::get($lesson); $data = new stdClass; $data->id = $PAGE->cm->id; $data->pageid = $pageid; $mform = new lesson_import_form(null, array('formats'=>lesson_get_import_export_formats('import'))); $mform->set_data($data); $PAGE->navbar->add($strimportquestions); $PAGE->set_title($strimportquestions); $PAGE->set_heading($course->fullname); $PAGE->activityheader->set_attrs([ 'hidecompletion' => true, 'description' => '' ]); $PAGE->add_body_class('limitedwidth'); echo $OUTPUT->header(); $headinglevel = $PAGE->activityheader->get_heading_level(); echo $OUTPUT->heading_with_help($strimportquestions, 'importquestions', 'lesson', '', '', $headinglevel); if ($data = $mform->get_data()) { require_sesskey(); $realfilename = $mform->get_new_filename('questionfile'); $importfile = make_request_directory() . "/{$realfilename}"; if (!$result = $mform->save_file('questionfile', $importfile, true)) { throw new moodle_exception('uploadproblem'); } $formatclass = 'qformat_'.$data->format; $formatclassfile = $CFG->dirroot.'/question/format/'.$data->format.'/format.php'; if (!is_readable($formatclassfile)) { throw new \moodle_exception('unknowformat', '', '', $data->format); } require_once($formatclassfile); $format = new $formatclass(); $format->set_importcontext($context); // Do anything before that we need to if (! $format->importpreprocess()) { throw new \moodle_exception('preprocesserror', 'lesson'); } // Process the uploaded file if (! $format->importprocess($importfile, $lesson, $pageid)) { throw new \moodle_exception('processerror', 'lesson'); } // In case anything needs to be done after if (! $format->importpostprocess()) { throw new \moodle_exception('postprocesserror', 'lesson'); } echo "
"; echo $OUTPUT->continue_button('view.php?id='.$PAGE->cm->id); } else { // Print upload form $mform->display(); } echo $OUTPUT->footer(); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/glossary/import.php000064400000037461152267043170023350 0ustar00dirroot/course/lib.php"); require_once("$CFG->dirroot/course/modlib.php"); require_once('import_form.php'); $id = required_param('id', PARAM_INT); // Course Module ID $mode = optional_param('mode', 'letter', PARAM_ALPHA ); $hook = optional_param('hook', 'ALL', PARAM_ALPHANUM); $url = new moodle_url('/mod/glossary/import.php', array('id'=>$id)); if ($mode !== 'letter') { $url->param('mode', $mode); } if ($hook !== 'ALL') { $url->param('hook', $hook); } $PAGE->set_url($url); if (! $cm = get_coursemodule_from_id('glossary', $id)) { throw new \moodle_exception('invalidcoursemodule'); } if (! $course = $DB->get_record("course", array("id"=>$cm->course))) { throw new \moodle_exception('coursemisconf'); } if (! $glossary = $DB->get_record("glossary", array("id"=>$cm->instance))) { throw new \moodle_exception('invalidid', 'glossary'); } require_login($course, false, $cm); $context = context_module::instance($cm->id); require_capability('mod/glossary:import', $context); $strglossaries = get_string("modulenameplural", "glossary"); $strglossary = get_string("modulename", "glossary"); $strallcategories = get_string("allcategories", "glossary"); $straddentry = get_string("addentry", "glossary"); $strnoentries = get_string("noentries", "glossary"); $strsearchindefinition = get_string("searchindefinition", "glossary"); $strsearch = get_string("search"); $strimportentries = get_string('importentriesfromxml', 'glossary'); $PAGE->navbar->add($strimportentries); $PAGE->set_title($glossary->name); $PAGE->set_heading($course->fullname); $PAGE->set_secondary_active_tab('modulepage'); $PAGE->activityheader->disable(); $form = new mod_glossary_import_form(''); if ($form->is_cancelled()) { redirect(new moodle_url('view.php', ['id' => $id])); } echo $OUTPUT->header(); echo $OUTPUT->heading($strimportentries); if ( !$data = $form->get_data() ) { echo $OUTPUT->box_start('glossarydisplay generalbox'); // display upload form $data = new stdClass(); $data->id = $id; $form->set_data($data); $form->display(); echo $OUTPUT->box_end(); echo $OUTPUT->footer(); exit; } $result = $form->get_file_content('file'); if (empty($result)) { echo $OUTPUT->box_start('glossarydisplay generalbox'); echo $OUTPUT->continue_button('import.php?id='.$id); echo $OUTPUT->box_end(); echo $OUTPUT->footer(); die(); } // Large exports are likely to take their time and memory. core_php_time_limit::raise(); raise_memory_limit(MEMORY_EXTRA); if ($xml = glossary_read_imported_file($result)) { $importedentries = 0; $importedcats = 0; $entriesrejected = 0; $rejections = ''; $glossarycontext = $context; if ($data->dest == 'newglossary') { // If the user chose to create a new glossary $xmlglossary = $xml['GLOSSARY']['#']['INFO'][0]['#']; if ( $xmlglossary['NAME'][0]['#'] ) { $glossary = new stdClass(); $glossary->modulename = 'glossary'; $glossary->module = $cm->module; $glossary->name = ($xmlglossary['NAME'][0]['#']); $glossary->globalglossary = ($xmlglossary['GLOBALGLOSSARY'][0]['#']); $glossary->intro = ($xmlglossary['INTRO'][0]['#']); $glossary->introformat = isset($xmlglossary['INTROFORMAT'][0]['#']) ? $xmlglossary['INTROFORMAT'][0]['#'] : FORMAT_MOODLE; $glossary->showspecial = ($xmlglossary['SHOWSPECIAL'][0]['#']); $glossary->showalphabet = ($xmlglossary['SHOWALPHABET'][0]['#']); $glossary->showall = ($xmlglossary['SHOWALL'][0]['#']); $glossary->cmidnumber = null; // Setting the default values if no values were passed if ( isset($xmlglossary['ENTBYPAGE'][0]['#']) ) { $glossary->entbypage = ($xmlglossary['ENTBYPAGE'][0]['#']); } else { $glossary->entbypage = $CFG->glossary_entbypage; } if ( isset($xmlglossary['ALLOWDUPLICATEDENTRIES'][0]['#']) ) { $glossary->allowduplicatedentries = ($xmlglossary['ALLOWDUPLICATEDENTRIES'][0]['#']); } else { $glossary->allowduplicatedentries = $CFG->glossary_dupentries; } if ( isset($xmlglossary['DISPLAYFORMAT'][0]['#']) ) { $glossary->displayformat = ($xmlglossary['DISPLAYFORMAT'][0]['#']); } else { $glossary->displayformat = 2; } if ( isset($xmlglossary['ALLOWCOMMENTS'][0]['#']) ) { $glossary->allowcomments = ($xmlglossary['ALLOWCOMMENTS'][0]['#']); } else { $glossary->allowcomments = $CFG->glossary_allowcomments; } if ( isset($xmlglossary['USEDYNALINK'][0]['#']) ) { $glossary->usedynalink = ($xmlglossary['USEDYNALINK'][0]['#']); } else { $glossary->usedynalink = $CFG->glossary_linkentries; } if ( isset($xmlglossary['DEFAULTAPPROVAL'][0]['#']) ) { $glossary->defaultapproval = ($xmlglossary['DEFAULTAPPROVAL'][0]['#']); } else { $glossary->defaultapproval = $CFG->glossary_defaultapproval; } // These fields were not included in export, assume zero. $glossary->assessed = 0; $glossary->availability = null; // Check if we're creating the new glossary on the front page or inside a course. if ($cm->course == SITEID) { // On the front page, activities are in section 1. $glossary->section = 1; } else { // Inside a course, add to the general section (0). $glossary->section = 0; } // New glossary is always visible. $glossary->visible = 1; $glossary->visibleoncoursepage = 1; // Include new glossary and return the new ID if ( !($glossary = add_moduleinfo($glossary, $course)) ) { echo $OUTPUT->notification("Error while trying to create the new glossary."); glossary_print_tabbed_table_end(); echo $OUTPUT->footer(); exit; } else { $glossarycontext = context_module::instance($glossary->coursemodule); glossary_xml_import_files($xmlglossary, 'INTROFILES', $glossarycontext->id, 'intro', 0); echo $OUTPUT->box(get_string("newglossarycreated","glossary"),'generalbox boxaligncenter boxwidthnormal'); } } else { echo $OUTPUT->notification("Error while trying to create the new glossary."); echo $OUTPUT->footer(); exit; } } $xmlentries = $xml['GLOSSARY']['#']['INFO'][0]['#']['ENTRIES'][0]['#']['ENTRY']; $sizeofxmlentries = is_array($xmlentries) ? count($xmlentries) : 0; for($i = 0; $i < $sizeofxmlentries; $i++) { // Inserting the entries $xmlentry = $xmlentries[$i]; $newentry = new stdClass(); $newentry->concept = trim($xmlentry['#']['CONCEPT'][0]['#']); $definition = $xmlentry['#']['DEFINITION'][0]['#']; if (!is_string($definition)) { throw new \moodle_exception('errorparsingxml', 'glossary'); } $newentry->definition = trusttext_strip($definition); if (isset($xmlentry['#']['DEFINITIONTRUST'][0]['#'])) { $newentry->definitiontrust = !empty($xmlentry['#']['DEFINITIONTRUST'][0]['#']) && trusttext_trusted($context); } if ( isset($xmlentry['#']['CASESENSITIVE'][0]['#']) ) { $newentry->casesensitive = $xmlentry['#']['CASESENSITIVE'][0]['#']; } else { $newentry->casesensitive = $CFG->glossary_casesensitive; } $permissiongranted = 1; if ( $newentry->concept and $newentry->definition ) { if ( !$glossary->allowduplicatedentries ) { // checking if the entry is valid (checking if it is duplicated when should not be) if ( $newentry->casesensitive ) { $dupentry = $DB->record_exists_select('glossary_entries', 'glossaryid = :glossaryid AND concept = :concept', array( 'glossaryid' => $glossary->id, 'concept' => $newentry->concept)); } else { $dupentry = $DB->record_exists_select('glossary_entries', 'glossaryid = :glossaryid AND LOWER(concept) = :concept', array( 'glossaryid' => $glossary->id, 'concept' => core_text::strtolower($newentry->concept))); } if ($dupentry) { $permissiongranted = 0; } } } else { $permissiongranted = 0; } if ($permissiongranted) { $newentry->glossaryid = $glossary->id; $newentry->sourceglossaryid = 0; $newentry->approved = 1; $newentry->userid = $USER->id; $newentry->teacherentry = 1; $newentry->definitionformat = $xmlentry['#']['FORMAT'][0]['#']; $newentry->timecreated = time(); $newentry->timemodified = time(); // Setting the default values if no values were passed if ( isset($xmlentry['#']['USEDYNALINK'][0]['#']) ) { $newentry->usedynalink = $xmlentry['#']['USEDYNALINK'][0]['#']; } else { $newentry->usedynalink = $CFG->glossary_linkentries; } if ( isset($xmlentry['#']['FULLMATCH'][0]['#']) ) { $newentry->fullmatch = $xmlentry['#']['FULLMATCH'][0]['#']; } else { $newentry->fullmatch = $CFG->glossary_fullmatch; } $newentry->id = $DB->insert_record("glossary_entries",$newentry); $importedentries++; $xmlaliases = @$xmlentry['#']['ALIASES'][0]['#']['ALIAS']; // ignore missing ALIASES $sizeofxmlaliases = is_array($xmlaliases) ? count($xmlaliases) : 0; for($k = 0; $k < $sizeofxmlaliases; $k++) { /// Importing aliases $xmlalias = $xmlaliases[$k]; $aliasname = $xmlalias['#']['NAME'][0]['#']; if (!empty($aliasname)) { $newalias = new stdClass(); $newalias->entryid = $newentry->id; $newalias->alias = trim($aliasname); $newalias->id = $DB->insert_record("glossary_alias",$newalias); } } if (!empty($data->catsincl)) { // If the categories must be imported... $xmlcats = @$xmlentry['#']['CATEGORIES'][0]['#']['CATEGORY']; // ignore missing CATEGORIES $sizeofxmlcats = is_array($xmlcats) ? count($xmlcats) : 0; for($k = 0; $k < $sizeofxmlcats; $k++) { $xmlcat = $xmlcats[$k]; $newcat = new stdClass(); $newcat->name = $xmlcat['#']['NAME'][0]['#']; $newcat->usedynalink = $xmlcat['#']['USEDYNALINK'][0]['#']; if ( !$category = $DB->get_record("glossary_categories", array("glossaryid"=>$glossary->id,"name"=>$newcat->name))) { // Create the category if it does not exist $category = new stdClass(); $category->name = $newcat->name; $category->glossaryid = $glossary->id; $category->id = $DB->insert_record("glossary_categories",$category); $importedcats++; } if ( $category ) { // inserting the new relation $entrycat = new stdClass(); $entrycat->entryid = $newentry->id; $entrycat->categoryid = $category->id; $DB->insert_record("glossary_entries_categories",$entrycat); } } } // Import files embedded in the entry text. glossary_xml_import_files($xmlentry['#'], 'ENTRYFILES', $glossarycontext->id, 'entry', $newentry->id); // Import files attached to the entry. if (glossary_xml_import_files($xmlentry['#'], 'ATTACHMENTFILES', $glossarycontext->id, 'attachment', $newentry->id)) { $DB->update_record("glossary_entries", array('id' => $newentry->id, 'attachment' => '1')); } // Import tags associated with the entry. if (core_tag_tag::is_enabled('mod_glossary', 'glossary_entries')) { $xmltags = @$xmlentry['#']['TAGS'][0]['#']['TAG']; // Ignore missing TAGS. $sizeofxmltags = is_array($xmltags) ? count($xmltags) : 0; for ($k = 0; $k < $sizeofxmltags; $k++) { // Importing tags. $tag = $xmltags[$k]['#']; if (!empty($tag)) { core_tag_tag::add_item_tag('mod_glossary', 'glossary_entries', $newentry->id, $glossarycontext, $tag); } } } } else { $entriesrejected++; if ( $newentry->concept and $newentry->definition ) { // add to exception report (duplicated entry)) $rejections .= "$newentry->concept" . "" . get_string("duplicateentry","glossary"). ""; } else { // add to exception report (no concept or definition found)) $rejections .= "---" . "" . get_string("noconceptfound","glossary"). ""; } } } // Reset caches. \mod_glossary\local\concept_cache::reset_glossary($glossary); // processed entries echo $OUTPUT->box_start('glossarydisplay generalbox'); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if (!empty($data->catsincl)) { echo ''; echo ''; echo ''; echo ''; } echo '
'; echo get_string("totalentries","glossary"); echo ':'; echo $importedentries + $entriesrejected; echo '
'; echo get_string("importedentries","glossary"); echo ':'; echo $importedentries; if ( $entriesrejected ) { echo ' (' . get_string("rejectedentries","glossary") . ": $entriesrejected)"; } echo '
'; echo get_string("importedcategories","glossary"); echo ':'; echo $importedcats; echo '

'; // rejected entries if ($rejections) { echo $OUTPUT->heading(get_string("rejectionrpt","glossary"), 4); echo ''; echo $rejections; echo '

'; } /// Print continue button, based on results if ($importedentries) { echo $OUTPUT->continue_button('view.php?id='.$id); } else { echo $OUTPUT->continue_button('import.php?id='.$id); } echo $OUTPUT->box_end(); } else { echo $OUTPUT->box_start('glossarydisplay generalbox'); echo get_string('errorparsingxml', 'glossary'); echo $OUTPUT->continue_button('import.php?id='.$id); echo $OUTPUT->box_end(); } /// Finish the page echo $OUTPUT->footer(); home/smkb8269/public_html/lms.smk-almanshuriyah.sch.id/mod/data/import.php000064400000011567152267107170022416 0ustar00. /** * This file is part of the Database module for Moodle * * @copyright 2005 Martin Dougiamas http://dougiamas.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @package mod_data */ require_once('../../config.php'); require_once('lib.php'); require_once($CFG->libdir.'/csvlib.class.php'); require_once('import_form.php'); $id = optional_param('id', 0, PARAM_INT); // course module id $d = optional_param('d', 0, PARAM_INT); // database id $rid = optional_param('rid', 0, PARAM_INT); // record id $fielddelimiter = optional_param('fielddelimiter', ',', PARAM_CLEANHTML); // characters used as field delimiters for csv file import $fieldenclosure = optional_param('fieldenclosure', '', PARAM_CLEANHTML); // characters used as record delimiters for csv file import $redirectbackto = optional_param('backto', '', PARAM_LOCALURL); // The location to redirect back to. $url = new moodle_url('/mod/data/import.php'); if ($rid !== 0) { $url->param('rid', $rid); } if ($fielddelimiter !== '') { $url->param('fielddelimiter', $fielddelimiter); } if ($fieldenclosure !== '') { $url->param('fieldenclosure', $fieldenclosure); } if ($id) { $url->param('id', $id); $PAGE->set_url($url); $cm = get_coursemodule_from_id('data', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST); $data = $DB->get_record('data', array('id'=>$cm->instance), '*', MUST_EXIST); } else { $url->param('d', $d); $PAGE->set_url($url); $data = $DB->get_record('data', array('id'=>$d), '*', MUST_EXIST); $course = $DB->get_record('course', array('id'=>$data->course), '*', MUST_EXIST); $cm = get_coursemodule_from_instance('data', $data->id, $course->id, false, MUST_EXIST); } require_login($course, false, $cm); $context = context_module::instance($cm->id); require_capability('mod/data:manageentries', $context); $form = new mod_data_import_form(new moodle_url('/mod/data/import.php'), ['dataid' => $data->id, 'backtourl' => $redirectbackto]); if ($form->is_cancelled()) { $redirectbackto = !empty($redirectbackto) ? $redirectbackto : new \moodle_url('/mod/data/view.php', ['d' => $data->id]); redirect($redirectbackto); } /// Print the page header $pagename = get_string('uploadrecords', 'data'); $PAGE->navbar->add($pagename); $PAGE->add_body_class('limitedwidth'); $titleparts = [ $pagename, format_string($data->name), format_string($course->fullname), ]; $PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $titleparts)); $PAGE->set_heading($course->fullname); $PAGE->set_secondary_active_tab('modulepage'); $PAGE->activityheader->disable(); echo $OUTPUT->header(); echo $OUTPUT->heading_with_help($pagename, 'uploadrecords', 'mod_data'); if ($formdata = $form->get_data()) { $uploadedfilepath = $form->save_temp_file('recordsfile'); $filestempdir = null; if (!$uploadedfilepath) { throw new coding_exception('No file uploaded.'); } $importer = new \mod_data\local\importer\csv_entries_importer($uploadedfilepath, $form->get_new_filename('recordsfile')); if (!$importer->get_data_file_content()) { echo $OUTPUT->notification(get_string('errordatafilenotfound', 'data'), \core\output\notification::NOTIFY_ERROR); } else { $importer->import_csv($cm, $data, $formdata->encoding, $formdata->fielddelimiter); unlink($uploadedfilepath); $addedrecordsmessages = $importer->get_added_records_messages(); echo html_writer::div(implode('
', $addedrecordsmessages)); if (count($addedrecordsmessages) > 0) { echo $OUTPUT->notification(count($addedrecordsmessages) . ' ' . get_string('recordssaved', 'data'), \core\output\notification::NOTIFY_SUCCESS); } else { echo $OUTPUT->notification(get_string('recordsnotsaved', 'data'), \core\output\notification::NOTIFY_ERROR); } } } else { /// Upload records section. Only for teachers and the admin. echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide'); $form->display(); echo $OUTPUT->box_end(); } /// Finish the page echo $OUTPUT->footer(); home/smkb8269/public_html/wp-admin/import.php000064400000017126152267740200015036 0ustar00add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '

' . __( 'This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.' ) . '

' . '

' . __( 'In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.' ) . '

', ) ); get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Import' ) . '

' . '

' . __( 'Support forums' ) . '

' ); if ( current_user_can( 'install_plugins' ) ) { // List of popular importer plugins from the WordPress.org API. $popular_importers = wp_get_popular_importers(); } else { $popular_importers = array(); } // Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'. if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id']; if ( $importer_id !== $_GET['invalid'] ) { // Prevent redirect loops. wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) ); exit; } unset( $importer_id ); } add_thickbox(); wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); require_once ABSPATH . 'wp-admin/admin-header.php'; $parent_file = 'tools.php'; ?>

' . __( 'Error:' ) . ' ' . sprintf( /* translators: %s: Importer slug. */ __( 'The %s importer is invalid or is not installed.' ), '' . esc_html( $_GET['invalid'] ) . '' ); wp_admin_notice( $importer_not_installed, array( 'additional_classes' => array( 'error' ), ) ); endif; ?>

$pop_data ) { if ( isset( $importers[ $pop_importer ] ) ) { continue; } if ( isset( $importers[ $pop_data['importer-id'] ] ) ) { continue; } // Fill the array of registered (already installed) importers with data of the popular importers from the WordPress.org API. $importers[ $pop_data['importer-id'] ] = array( $pop_data['name'], $pop_data['description'], 'install' => $pop_data['plugin-slug'], ); } if ( empty( $importers ) ) { echo '

' . __( 'No importers are available.' ) . '

'; // TODO: Make more helpful. } else { uasort( $importers, '_usort_by_first_member' ); ?> $data ) { $plugin_slug = ''; $action = ''; $is_plugin_installed = false; if ( isset( $data['install'] ) ) { $plugin_slug = $data['install']; if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) { // Looks like an importer is installed, but not active. $plugins = get_plugins( '/' . $plugin_slug ); if ( ! empty( $plugins ) ) { $keys = array_keys( $plugins ); $plugin_file = $plugin_slug . '/' . $keys[0]; $url = wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_file, 'from' => 'import', ), admin_url( 'plugins.php' ) ), 'activate-plugin_' . $plugin_file ); $action = sprintf( '%s', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); $is_plugin_installed = true; } } if ( empty( $action ) ) { if ( is_main_site() ) { $url = wp_nonce_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin_slug, 'from' => 'import', ), self_admin_url( 'update.php' ) ), 'install-plugin_' . $plugin_slug ); $action = sprintf( '%5$s', esc_url( $url ), esc_attr( $plugin_slug ), esc_attr( $data[0] ), /* translators: %s: Importer name. */ esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ), _x( 'Install Now', 'plugin' ) ); } else { $action = sprintf( /* translators: %s: URL to Import screen on the main site. */ __( 'This importer is not installed. Please install importers from the main site.' ), get_admin_url( get_current_network_id(), 'import.php' ) ); } } } else { $url = add_query_arg( array( 'import' => $importer_id, ), self_admin_url( 'admin.php' ) ); $action = sprintf( '%3$s', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); $is_plugin_installed = true; } if ( ! $is_plugin_installed && is_main_site() ) { $url = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $plugin_slug, 'from' => 'import', 'TB_iframe' => 'true', 'width' => 600, 'height' => 550, ), network_admin_url( 'plugin-install.php' ) ); $action .= sprintf( ' | %3$s', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'More information about %s' ), $data[0] ) ), __( 'Details' ) ); } echo " "; } ?>
{$data[0]} {$action} {$data[1]}
' . sprintf( /* translators: %s: URL to Add Plugins screen. */ __( 'If the importer you need is not listed, search the plugin directory to see if an importer is available.' ), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '

'; } /** * Fires at the end of the Import screen. * * @since 6.8.0 */ do_action( 'import_filters' ); ?>
sprintf( /* translators: 1: php.ini, 2: post_max_size, 3: upload_max_filesize */ __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your %1$s file or by %2$s being defined as smaller than %3$s in %1$s.' ), 'php.ini', 'post_max_size', 'upload_max_filesize' ), ); } $overrides = array( 'test_form' => false, 'test_type' => false, ); $_FILES['import']['name'] .= '.txt'; $upload = wp_handle_upload( $_FILES['import'], $overrides ); if ( isset( $upload['error'] ) ) { return $upload; } // Construct the attachment array. $attachment = array( 'post_title' => wp_basename( $upload['file'] ), 'post_content' => $upload['url'], 'post_mime_type' => $upload['type'], 'guid' => $upload['url'], 'context' => 'import', 'post_status' => 'private', ); // Save the data. $id = wp_insert_attachment( $attachment, $upload['file'] ); /* * Schedule a cleanup for one day from now in case of failed * import or missing wp_import_cleanup() call. */ wp_schedule_single_event( time() + DAY_IN_SECONDS, 'importer_scheduled_cleanup', array( $id ) ); return array( 'file' => $upload['file'], 'id' => $id, ); } /** * Returns a list from WordPress.org of popular importer plugins. * * @since 3.5.0 * * @return array Importers with metadata for each. */ function wp_get_popular_importers() { $locale = get_user_locale(); $cache_key = 'popular_importers_' . md5( $locale . wp_get_wp_version() ); $popular_importers = get_site_transient( $cache_key ); if ( ! $popular_importers ) { $url = add_query_arg( array( 'locale' => $locale, 'version' => wp_get_wp_version(), ), 'http://api.wordpress.org/core/importers/1.1/' ); $options = array( 'user-agent' => 'WordPress/' . wp_get_wp_version() . '; ' . home_url( '/' ) ); if ( wp_http_supports( array( 'ssl' ) ) ) { $url = set_url_scheme( $url, 'https' ); } $response = wp_remote_get( $url, $options ); $popular_importers = json_decode( wp_remote_retrieve_body( $response ), true ); if ( is_array( $popular_importers ) ) { set_site_transient( $cache_key, $popular_importers, 2 * DAY_IN_SECONDS ); } else { $popular_importers = false; } } if ( is_array( $popular_importers ) ) { // If the data was received as translated, return it as-is. if ( $popular_importers['translated'] ) { return $popular_importers['importers']; } foreach ( $popular_importers['importers'] as &$importer ) { // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText $importer['description'] = translate( $importer['description'] ); if ( 'WordPress' !== $importer['name'] ) { // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText $importer['name'] = translate( $importer['name'] ); } } return $popular_importers['importers']; } return array( // slug => name, description, plugin slug, and register_importer() slug. 'blogger' => array( 'name' => __( 'Blogger' ), 'description' => __( 'Import posts, comments, and users from a Blogger blog.' ), 'plugin-slug' => 'blogger-importer', 'importer-id' => 'blogger', ), 'wpcat2tag' => array( 'name' => __( 'Categories and Tags Converter' ), 'description' => __( 'Convert existing categories to tags or tags to categories, selectively.' ), 'plugin-slug' => 'wpcat2tag-importer', 'importer-id' => 'wp-cat2tag', ), 'livejournal' => array( 'name' => __( 'LiveJournal' ), 'description' => __( 'Import posts from LiveJournal using their API.' ), 'plugin-slug' => 'livejournal-importer', 'importer-id' => 'livejournal', ), 'movabletype' => array( 'name' => __( 'Movable Type and TypePad' ), 'description' => __( 'Import posts and comments from a Movable Type or TypePad blog.' ), 'plugin-slug' => 'movabletype-importer', 'importer-id' => 'mt', ), 'rss' => array( 'name' => __( 'RSS' ), 'description' => __( 'Import posts from an RSS feed.' ), 'plugin-slug' => 'rss-importer', 'importer-id' => 'rss', ), 'tumblr' => array( 'name' => __( 'Tumblr' ), 'description' => __( 'Import posts & media from Tumblr using their API.' ), 'plugin-slug' => 'tumblr-importer', 'importer-id' => 'tumblr', ), 'wordpress' => array( 'name' => 'WordPress', 'description' => __( 'Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ), 'plugin-slug' => 'wordpress-importer', 'importer-id' => 'wordpress', ), ); } home/smkb8269/public_html/views/employees/import.php000064400000004025152270377140016456 0ustar00

'.$sub_title.'

' : ''?>

Petunjuk Singkat

  1. Buka Aplikasi Microsoft Excel untuk pengguna Windows atau Libre Office Calc untuk pengguna Linux
  2. Isikan data dengan urutan [NIK] [NAMA LENGKAP] [JENIS KELAMIN] [ALAMAT JALAN] [TEMPAT LAHIR] [TANGGAL LAHIR]
  3. Copy data yang sudah diketik tersebut tanpa judul kolom (Point 2) kemudian paste didalam form textarea dibawah.
  4. Kolom JENIS KELAMIN diisi huruf "L" jika Laki-laki dan "P" jika Perempuan.
  5. Kolom TANGGAL LAHIR diisi dengan format "YYYY-MM-DD". Contoh : 1991-03-15
home/smkb8269/public_html/wordpress/wp-admin/import.php000064400000017126152270464360017072 0ustar00add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '

' . __( 'This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.' ) . '

' . '

' . __( 'In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.' ) . '

', ) ); get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Import' ) . '

' . '

' . __( 'Support forums' ) . '

' ); if ( current_user_can( 'install_plugins' ) ) { // List of popular importer plugins from the WordPress.org API. $popular_importers = wp_get_popular_importers(); } else { $popular_importers = array(); } // Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'. if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id']; if ( $importer_id !== $_GET['invalid'] ) { // Prevent redirect loops. wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) ); exit; } unset( $importer_id ); } add_thickbox(); wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); require_once ABSPATH . 'wp-admin/admin-header.php'; $parent_file = 'tools.php'; ?>

' . __( 'Error:' ) . ' ' . sprintf( /* translators: %s: Importer slug. */ __( 'The %s importer is invalid or is not installed.' ), '' . esc_html( $_GET['invalid'] ) . '' ); wp_admin_notice( $importer_not_installed, array( 'additional_classes' => array( 'error' ), ) ); endif; ?>

$pop_data ) { if ( isset( $importers[ $pop_importer ] ) ) { continue; } if ( isset( $importers[ $pop_data['importer-id'] ] ) ) { continue; } // Fill the array of registered (already installed) importers with data of the popular importers from the WordPress.org API. $importers[ $pop_data['importer-id'] ] = array( $pop_data['name'], $pop_data['description'], 'install' => $pop_data['plugin-slug'], ); } if ( empty( $importers ) ) { echo '

' . __( 'No importers are available.' ) . '

'; // TODO: Make more helpful. } else { uasort( $importers, '_usort_by_first_member' ); ?> $data ) { $plugin_slug = ''; $action = ''; $is_plugin_installed = false; if ( isset( $data['install'] ) ) { $plugin_slug = $data['install']; if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) { // Looks like an importer is installed, but not active. $plugins = get_plugins( '/' . $plugin_slug ); if ( ! empty( $plugins ) ) { $keys = array_keys( $plugins ); $plugin_file = $plugin_slug . '/' . $keys[0]; $url = wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_file, 'from' => 'import', ), admin_url( 'plugins.php' ) ), 'activate-plugin_' . $plugin_file ); $action = sprintf( '%s', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); $is_plugin_installed = true; } } if ( empty( $action ) ) { if ( is_main_site() ) { $url = wp_nonce_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin_slug, 'from' => 'import', ), self_admin_url( 'update.php' ) ), 'install-plugin_' . $plugin_slug ); $action = sprintf( '%5$s', esc_url( $url ), esc_attr( $plugin_slug ), esc_attr( $data[0] ), /* translators: %s: Importer name. */ esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ), _x( 'Install Now', 'plugin' ) ); } else { $action = sprintf( /* translators: %s: URL to Import screen on the main site. */ __( 'This importer is not installed. Please install importers from the main site.' ), get_admin_url( get_current_network_id(), 'import.php' ) ); } } } else { $url = add_query_arg( array( 'import' => $importer_id, ), self_admin_url( 'admin.php' ) ); $action = sprintf( '%3$s', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); $is_plugin_installed = true; } if ( ! $is_plugin_installed && is_main_site() ) { $url = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $plugin_slug, 'from' => 'import', 'TB_iframe' => 'true', 'width' => 600, 'height' => 550, ), network_admin_url( 'plugin-install.php' ) ); $action .= sprintf( ' | %3$s', esc_url( $url ), /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'More information about %s' ), $data[0] ) ), __( 'Details' ) ); } echo " "; } ?>
{$data[0]} {$action} {$data[1]}
' . sprintf( /* translators: %s: URL to Add Plugins screen. */ __( 'If the importer you need is not listed, search the plugin directory to see if an importer is available.' ), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '

'; } /** * Fires at the end of the Import screen. * * @since 6.8.0 */ do_action( 'import_filters' ); ?>