コード例 #1
0
 /**
  * Run langpack update
  */
 public function execute()
 {
     $controller = new \tool_langimport\controller();
     if ($controller->update_all_installed_languages()) {
         foreach ($controller->info as $message) {
             mtrace($message);
         }
         return true;
     } else {
         foreach ($controller->errors as $message) {
             mtrace($message);
         }
         return false;
     }
 }
コード例 #2
0
 /**
  * Run langpack update
  */
 public function execute()
 {
     global $CFG;
     if (!empty($CFG->skiplangupgrade)) {
         mtrace('Langpack update skipped. ($CFG->skiplangupgrade set)');
         return;
     }
     $controller = new \tool_langimport\controller();
     if ($controller->update_all_installed_languages()) {
         foreach ($controller->info as $message) {
             mtrace($message);
         }
         return true;
     } else {
         foreach ($controller->errors as $message) {
             mtrace($message);
         }
         return false;
     }
 }
コード例 #3
0
ファイル: index.php プロジェクト: alanaipe2015/moodle
    require_sesskey();
    get_string_manager()->reset_caches();
    redirect($PAGE->url);
}
if (!empty($CFG->skiplangupgrade)) {
    echo $OUTPUT->header();
    echo $OUTPUT->box(get_string('langimportdisabled', 'tool_langimport'));
    echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('purgecaches' => 1)), get_string('purgestringcaches', 'tool_langimport'));
    echo $OUTPUT->footer();
    die;
}
define('INSTALLATION_OF_SELECTED_LANG', 2);
define('DELETION_OF_SELECTED_LANG', 4);
define('UPDATE_ALL_LANG', 5);
get_string_manager()->reset_caches();
$controller = new tool_langimport\controller();
if ($mode == INSTALLATION_OF_SELECTED_LANG and confirm_sesskey() and !empty($pack)) {
    core_php_time_limit::raise();
    $controller->install_languagepacks($pack);
}
if ($mode == DELETION_OF_SELECTED_LANG and (!empty($uninstalllang) or !empty($confirmtounistall))) {
    // Actually deleting languages, languages to delete are passed as GET parameter as string
    // ...need to populate them to array.
    if (empty($uninstalllang)) {
        $uninstalllang = explode('-', $confirmtounistall);
    }
    if (in_array('en', $uninstalllang)) {
        // TODO.
        $controller->errors[] = get_string('noenglishuninstall', 'tool_langimport');
    } else {
        if (empty($confirmtounistall) and confirm_sesskey()) {
コード例 #4
0
ファイル: index.php プロジェクト: stronk7/moodle
    require_sesskey();
    get_string_manager()->reset_caches();
    redirect($PAGE->url);
}
if (!empty($CFG->skiplangupgrade)) {
    echo $OUTPUT->header();
    echo $OUTPUT->box(get_string('langimportdisabled', 'tool_langimport'));
    echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('purgecaches' => 1)), get_string('purgestringcaches', 'tool_langimport'));
    echo $OUTPUT->footer();
    die;
}
define('INSTALLATION_OF_SELECTED_LANG', 2);
define('DELETION_OF_SELECTED_LANG', 4);
define('UPDATE_ALL_LANG', 5);
get_string_manager()->reset_caches();
$controller = new tool_langimport\controller();
if ($mode == INSTALLATION_OF_SELECTED_LANG and confirm_sesskey() and !empty($pack)) {
    core_php_time_limit::raise();
    $controller->install_languagepacks($pack);
}
if ($mode == DELETION_OF_SELECTED_LANG and (!empty($uninstalllang) or !empty($confirmtounistall))) {
    // Actually deleting languages, languages to delete are passed as GET parameter as string
    // ...need to populate them to array.
    if (empty($uninstalllang)) {
        $uninstalllang = explode('-', $confirmtounistall);
    }
    if (in_array('en', $uninstalllang)) {
        // TODO.
        $controller->errors[] = get_string('noenglishuninstall', 'tool_langimport');
    } else {
        if (empty($confirmtounistall) and confirm_sesskey()) {