MDL-29509 move customlang to admin tools
authorPetr Skoda <commits@skodak.org>
Sun, 25 Sep 2011 09:52:09 +0000 (11:52 +0200)
committerPetr Skoda <commits@skodak.org>
Mon, 26 Sep 2011 22:39:19 +0000 (00:39 +0200)
AMOS BEGIN
 MOV [checkin,report_customlang],[checkin,tool_customlang]
 MOV [checkout,report_customlang],[checkout,tool_customlang]
 MOV [checkoutdone,report_customlang],[checkoutdone,tool_customlang]
 MOV [checkoutinprogress,report_customlang],[checkoutinprogress,tool_customlang]
 MOV [confirmcheckin,report_customlang],[confirmcheckin,tool_customlang]
 MOV [customlang:edit,report_customlang],[customlang:edit,tool_customlang]
 MOV [customlang:view,report_customlang],[customlang:view,tool_customlang]
 MOV [filter,report_customlang],[filter,tool_customlang]
 MOV [filtercomponent,report_customlang],[filtercomponent,tool_customlang]
 MOV [filtercustomized,report_customlang],[filtercustomized,tool_customlang]
 MOV [filtermodified,report_customlang],[filtermodified,tool_customlang]
 MOV [filteronlyhelps,report_customlang],[filteronlyhelps,tool_customlang]
 MOV [filtershowstrings,report_customlang],[filtershowstrings,tool_customlang]
 MOV [filterstringid,report_customlang],[filterstringid,tool_customlang]
 MOV [filtersubstring,report_customlang],[filtersubstring,tool_customlang]
 MOV [headingcomponent,report_customlang],[headingcomponent,tool_customlang]
 MOV [headinglocal,report_customlang],[headinglocal,tool_customlang]
 MOV [headingstandard,report_customlang],[headingstandard,tool_customlang]
 MOV [headingstringid,report_customlang],[headingstringid,tool_customlang]
 MOV [markinguptodate,report_customlang],[markinguptodate,tool_customlang]
 MOV [markinguptodate_help,report_customlang],[markinguptodate_help,tool_customlang]
 MOV [markuptodate,report_customlang],[markuptodate,tool_customlang]
 MOV [modifiedno,report_customlang],[modifiedno,tool_customlang]
 MOV [modifiednum,report_customlang],[modifiednum,tool_customlang]
 MOV [nostringsfound,report_customlang],[nostringsfound,tool_customlang]
 MOV [placeholder,report_customlang],[placeholder,tool_customlang]
 MOV [placeholder_help,report_customlang],[placeholder_help,tool_customlang]
 MOV [placeholderwarning,report_customlang],[placeholderwarning,tool_customlang]
 MOV [pluginname,report_customlang],[pluginname,tool_customlang]
 MOV [savecheckin,report_customlang],[savecheckin,tool_customlang]
 MOV [savecontinue,report_customlang],[savecontinue,tool_customlang]
AMOS END

18 files changed:
admin/report/customlang/db/upgrade.php [deleted file]
admin/report/customlang/styles.css [deleted file]
admin/tool/customlang/db/access.php [moved from admin/report/customlang/db/access.php with 93% similarity]
admin/tool/customlang/db/install.php [new file with mode: 0644]
admin/tool/customlang/db/install.xml [moved from admin/report/customlang/db/install.xml with 86% similarity]
admin/tool/customlang/db/upgrade.php [new file with mode: 0644]
admin/tool/customlang/edit.php [moved from admin/report/customlang/edit.php with 65% similarity]
admin/tool/customlang/filter_form.php [moved from admin/report/customlang/filter_form.php with 83% similarity]
admin/tool/customlang/index.php [moved from admin/report/customlang/index.php with 65% similarity]
admin/tool/customlang/lang/en/tool_customlang.php [moved from admin/report/customlang/lang/en/report_customlang.php with 97% similarity]
admin/tool/customlang/lib.php [moved from admin/report/customlang/lib.php with 97% similarity]
admin/tool/customlang/locallib.php [moved from admin/report/customlang/locallib.php with 90% similarity]
admin/tool/customlang/module.js [moved from admin/report/customlang/module.js with 86% similarity]
admin/tool/customlang/renderer.php [moved from admin/report/customlang/renderer.php with 83% similarity]
admin/tool/customlang/settings.php [moved from admin/report/customlang/settings.php with 79% similarity]
admin/tool/customlang/styles.css [new file with mode: 0644]
admin/tool/customlang/version.php [moved from admin/report/customlang/version.php with 85% similarity]
lib/pluginlib.php

diff --git a/admin/report/customlang/db/upgrade.php b/admin/report/customlang/db/upgrade.php
deleted file mode 100644 (file)
index 0b12553..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
-/**
- * Language customization report upgrades
- *
- * @package    report
- * @subpackage customlang
- * @copyright  2010 David Mudrak <david.mudrak@gmail.com>
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-function xmldb_report_customlang_upgrade($oldversion) {
-    global $CFG, $DB, $OUTPUT;
-
-    $dbman = $DB->get_manager();
-    $result = true;
-
-    /**
-     * Use proper plugin prefix for tables
-     */
-    if ($oldversion < 2010111200) {
-        if ($dbman->table_exists('customlang')) {
-            $dbman->rename_table(new xmldb_table('customlang'), 'report_customlang');
-        }
-        if ($dbman->table_exists('customlang_components')) {
-            $dbman->rename_table(new xmldb_table('customlang_components'), 'report_customlang_components');
-        }
-        upgrade_plugin_savepoint(true, 2010111200, 'report', 'customlang');
-    }
-
-    /**
-     * Regenerate the foreign key after the tables rename
-     */
-    if ($oldversion < 2010111500) {
-        $table = new xmldb_table('report_customlang');
-        $oldkey = new xmldb_key('fk_component', XMLDB_KEY_FOREIGN, array('componentid'), 'customlang_components', array('id'));
-        $newkey = new xmldb_key('fk_component', XMLDB_KEY_FOREIGN, array('componentid'), 'report_customlang_components', array('id'));
-
-        $dbman->drop_key($table, $oldkey);
-        $dbman->add_key($table, $newkey);
-
-        upgrade_plugin_savepoint(true, 2010111500, 'report', 'customlang');
-    }
-
-    /**
-     * Change the version field from integer to varchar
-     */
-    if ($oldversion < 2011041900) {
-        $table = new xmldb_table('report_customlang_components');
-        $field = new xmldb_field('version', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'name');
-
-        $dbman->change_field_type($table, $field);
-
-        upgrade_plugin_savepoint(true, 2011041900, 'report', 'customlang');
-    }
-
-
-    return $result;
-}
diff --git a/admin/report/customlang/styles.css b/admin/report/customlang/styles.css
deleted file mode 100644 (file)
index e921972..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-.path-admin-report-customlang .langselectorbox,
-.path-admin-report-customlang fieldset.buttonsbar,
-.path-admin-report-customlang .menu {
-    margin: 5px auto;
-    text-align: center;
-}
-
-.path-admin-report-customlang .menu .singlebutton,
-.path-admin-report-customlang .menu .singlebutton form,
-.path-admin-report-customlang .menu .singlebutton form div {
-    display: inline;
-}
-
-
-.path-admin-report-customlang .mform.filterform {
-    width: 70%;
-    margin-left: auto;
-    margin-right: auto;
-}
-
-.path-admin-report-customlang .mform.filterform .fitem .fitemtitle {
-    width: 30%;
-}
-
-.path-admin-report-customlang .mform.filterform .fitem .felement {
-    width: 60%;
-    margin-left: 31%;
-}
-
-.path-admin-report-customlang #translator {
-    width: 100%;
-}
-
-.path-admin-report-customlang #translator .standard,
-.path-admin-report-customlang #translator .local {
-    min-width: 35%;
-}
-
-.path-admin-report-customlang #translator .customized {
-    background-color: #e7f1c3;
-}
-
-.path-admin-report-customlang #translator .customized.outdated {
-    background-color: #f3f2aa;
-}
-
-.path-admin-report-customlang #translator .modified {
-    background-color: #ffd3d9;
-}
-
-.path-admin-report-customlang #translator .customized.modified {
-    background-color: #d2ebff;
-}
-
-.path-admin-report-customlang #translator textarea {
-    width: 100%;
-    min-height: 4em;
-}
-
-.path-admin-report-customlang #translator .placeholderinfo {
-    text-align: center;
-    border: 1px dotted #ddd;
-    background-color: #f6f6f6;
-    margin-top: 0.5em;
-}
-
-#page-admin-report-customlang-index .continuebutton {
-    margin-top: 1em;
-}
similarity index 93%
rename from admin/report/customlang/db/access.php
rename to admin/tool/customlang/db/access.php
index c8c2626..fa7c1aa 100644 (file)
@@ -16,9 +16,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * Defines the capabilities used by the Language customization admin report
+ * Defines the capabilities used by the Language customization admin tool
  *
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die();
 $capabilities = array(
 
     /* allows the user to view the current language customization */
-    'report/customlang:view' => array(
+    'tool/customlang:view' => array(
         'riskbitmask' => RISK_CONFIG,
         'captype' => 'read',
         'contextlevel' => CONTEXT_SYSTEM,
@@ -39,7 +39,7 @@ $capabilities = array(
     ),
 
     /* allows the user to edit the current language customization */
-    'report/customlang:edit' => array(
+    'tool/customlang:edit' => array(
         'riskbitmask' => RISK_CONFIG | RISK_XSS,
         'captype' => 'write',
         'contextlevel' => CONTEXT_SYSTEM,
diff --git a/admin/tool/customlang/db/install.php b/admin/tool/customlang/db/install.php
new file mode 100644 (file)
index 0000000..0185011
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Post installation and migration code.
+ *
+ * @package    tool
+ * @subpackage customlang
+ * @copyright  2011 Petr Skoda {@link http://skodak.org}
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die;
+
+function xmldb_tool_customlang_install() {
+    global $CFG, $OUTPUT, $DB;
+
+    // this is a hack - this plugin used to live in admin/report/customlang,
+    // we want to remove the orphaned version info and capability
+    // unless there is a new report type with the same name
+    // the original tables can be dropped because they are used for caching only
+
+    if (!file_exists("$CFG->dirroot/report/customlang")) {
+        unset_all_config_for_plugin('report_customlang');
+        capabilities_cleanup('report_customlang');
+        $dbman = $DB->get_manager();
+        $table = new xmldb_table('report_customlang');
+        if ($dbman->table_exists($table)) {
+            $dbman->drop_table($table);
+        }
+        $table = new xmldb_table('report_customlang_components');
+        if ($dbman->table_exists($table)) {
+            $dbman->drop_table($table);
+        }
+    }
+}
+
+
similarity index 86%
rename from admin/report/customlang/db/install.xml
rename to admin/tool/customlang/db/install.xml
index 9392220..4cee03b 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="admin/report/customlang/db" VERSION="20110419" COMMENT="XMLDB file for Moodle admin/report/customlang"
+<XMLDB PATH="admin/tool/customlang/db" VERSION="20110925" COMMENT="XMLDB file for Moodle admin/tool/customlang"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
 >
   <TABLES>
-    <TABLE NAME="report_customlang" COMMENT="Contains the working checkout of all strings and their customization" NEXT="report_customlang_components">
+    <TABLE NAME="tool_customlang" COMMENT="Contains the working checkout of all strings and their customization" NEXT="tool_customlang_components">
       <FIELDS>
         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="lang"/>
         <FIELD NAME="lang" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" COMMENT="The code of the language this string belongs to. Like en, cs or es" PREVIOUS="id" NEXT="componentid"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="fk_component"/>
-        <KEY NAME="fk_component" TYPE="foreign" FIELDS="componentid" REFTABLE="report_customlang_components" REFFIELDS="id" PREVIOUS="primary"/>
+        <KEY NAME="fk_component" TYPE="foreign" FIELDS="componentid" REFTABLE="tool_customlang_components" REFFIELDS="id" PREVIOUS="primary"/>
       </KEYS>
       <INDEXES>
         <INDEX NAME="uq_lang_component_string" UNIQUE="true" FIELDS="lang, componentid, stringid" COMMENT="For a given language and component, string identifiers must be unique"/>
       </INDEXES>
     </TABLE>
-    <TABLE NAME="report_customlang_components" COMMENT="Contains the list of all installed plugins that provide their own language pack" PREVIOUS="report_customlang">
+    <TABLE NAME="tool_customlang_components" COMMENT="Contains the list of all installed plugins that provide their own language pack" PREVIOUS="tool_customlang">
       <FIELDS>
         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The normalized name of the plugin" PREVIOUS="id" NEXT="version"/>
diff --git a/admin/tool/customlang/db/upgrade.php b/admin/tool/customlang/db/upgrade.php
new file mode 100644 (file)
index 0000000..7829a93
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Language customization report upgrades
+ *
+ * @package    tool
+ * @subpackage customlang
+ * @copyright  2010 David Mudrak <david.mudrak@gmail.com>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+function xmldb_report_customlang_upgrade($oldversion) {
+    global $CFG, $DB, $OUTPUT;
+
+    $dbman = $DB->get_manager();
+
+
+
+    return true;
+}
similarity index 65%
rename from admin/report/customlang/edit.php
rename to admin/tool/customlang/edit.php
index 99c2ed9..f34e139 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
-require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
-require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/locallib.php');
-require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/filter_form.php');
+require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
+require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
+require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/filter_form.php');
 
 require_login(SITEID, false);
-require_capability('report/customlang:edit', get_system_context());
+require_capability('tool/customlang:edit', get_system_context());
 
 $lng                    = required_param('lng', PARAM_LANG);
 $currentpage            = optional_param('p', 0, PARAM_INT);
 $translatorsubmitted    = optional_param('translatorsubmitted', 0, PARAM_BOOL);
 
 $PAGE->set_pagelayout('standard');
-$PAGE->set_url('/admin/report/customlang/edit.php', array('lng' => $lng));
-navigation_node::override_active_url(new moodle_url('/admin/report/customlang/index.php'));
-$PAGE->set_title(get_string('pluginname', 'report_customlang'));
-$PAGE->set_heading(get_string('pluginname', 'report_customlang'));
-$PAGE->requires->js_init_call('M.report_customlang.init_editor', array(), true);
+$PAGE->set_url('/admin/tool/customlang/edit.php', array('lng' => $lng));
+navigation_node::override_active_url(new moodle_url('/admin/tool/customlang/index.php'));
+$PAGE->set_title(get_string('pluginname', 'tool_customlang'));
+$PAGE->set_heading(get_string('pluginname', 'tool_customlang'));
+$PAGE->requires->js_init_call('M.tool_customlang.init_editor', array(), true);
 
 if (empty($lng)) {
     // PARAM_LANG validation failed
@@ -46,15 +45,15 @@ if (empty($lng)) {
 }
 
 // pre-output processing
-$filter     = new report_customlang_filter_form($PAGE->url, null, 'post', '', array('class'=>'filterform'));
-$filterdata = report_customlang_utils::load_filter($USER);
+$filter     = new tool_customlang_filter_form($PAGE->url, null, 'post', '', array('class'=>'filterform'));
+$filterdata = tool_customlang_utils::load_filter($USER);
 $filter->set_data($filterdata);
 
 if ($filter->is_cancelled()) {
     redirect($PAGE->url);
 
 } elseif ($submitted = $filter->get_data()) {
-    report_customlang_utils::save_filter($submitted, $USER);
+    tool_customlang_utils::save_filter($submitted, $USER);
     redirect(new moodle_url($PAGE->url, array('p'=>0)));
 }
 
@@ -66,13 +65,13 @@ if ($translatorsubmitted) {
     if ($checkin === false) {
         $nexturl = $PAGE->url;
     } else {
-        $nexturl = new moodle_url('/admin/report/customlang/index.php', array('action'=>'checkin', 'lng' => $lng, 'sesskey'=>sesskey()));
+        $nexturl = new moodle_url('/admin/tool/customlang/index.php', array('action'=>'checkin', 'lng' => $lng, 'sesskey'=>sesskey()));
     }
 
     if (!is_array($strings)) {
         $strings = array();
     }
-    $current = $DB->get_records_list('report_customlang', 'id', array_keys($strings));
+    $current = $DB->get_records_list('tool_customlang', 'id', array_keys($strings));
     $now = time();
 
     foreach ($strings as $recordid => $customization) {
@@ -83,7 +82,7 @@ if ($translatorsubmitted) {
             $current[$recordid]->modified = 1;
             $current[$recordid]->outdated = 0;
             $current[$recordid]->timecustomized = null;
-            $DB->update_record('report_customlang', $current[$recordid]);
+            $DB->update_record('tool_customlang', $current[$recordid]);
             continue;
         }
 
@@ -96,7 +95,7 @@ if ($translatorsubmitted) {
             $current[$recordid]->modified = 1;
             $current[$recordid]->outdated = 0;
             $current[$recordid]->timecustomized = $now;
-            $DB->update_record('report_customlang', $current[$recordid]);
+            $DB->update_record('tool_customlang', $current[$recordid]);
             continue;
         }
     }
@@ -106,17 +105,17 @@ if ($translatorsubmitted) {
     }
     if (!empty($updates)) {
         list($sql, $params) = $DB->get_in_or_equal($updates);
-        $DB->set_field_select('report_customlang', 'outdated', 0, "local IS NOT NULL AND id $sql", $params);
+        $DB->set_field_select('tool_customlang', 'outdated', 0, "local IS NOT NULL AND id $sql", $params);
     }
 
     redirect($nexturl);
 }
 
-$translator = new report_customlang_translator($PAGE->url, $lng, $filterdata, $currentpage);
+$translator = new tool_customlang_translator($PAGE->url, $lng, $filterdata, $currentpage);
 
 // output starts here
-$output     = $PAGE->get_renderer('report_customlang');
-$paginator  = $output->paging_bar($translator->numofrows, $currentpage, report_customlang_translator::PERPAGE, $PAGE->url, 'p');
+$output     = $PAGE->get_renderer('tool_customlang');
+$paginator  = $output->paging_bar($translator->numofrows, $currentpage, tool_customlang_translator::PERPAGE, $PAGE->url, 'p');
 
 echo $output->header();
 $filter->display();
similarity index 83%
rename from admin/report/customlang/filter_form.php
rename to admin/tool/customlang/filter_form.php
index 8acba6b..4bfcd58 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
@@ -16,7 +15,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -29,51 +28,51 @@ require_once($CFG->dirroot . '/lib/formslib.php');
 /**
  * Form for filtering the strings to customize
  */
-class report_customlang_filter_form extends moodleform {
+class tool_customlang_filter_form extends moodleform {
 
     function definition() {
         $mform = $this->_form;
         $current = $this->_customdata['current'];
 
-        $mform->addElement('header', 'filtersettings', get_string('filter', 'report_customlang'));
+        $mform->addElement('header', 'filtersettings', get_string('filter', 'tool_customlang'));
 
         // Component
         $options = array();
-        foreach (report_customlang_utils::list_components() as $component => $normalized) {
+        foreach (tool_customlang_utils::list_components() as $component => $normalized) {
             list($type, $plugin) = normalize_component($normalized);
             if ($type == 'core' and is_null($plugin)) {
                 $plugin = 'moodle';
             }
             $options[$type][$normalized] = $component.'.php';
         }
-        $mform->addElement('selectgroups', 'component', get_string('filtercomponent', 'report_customlang'), $options,
+        $mform->addElement('selectgroups', 'component', get_string('filtercomponent', 'tool_customlang'), $options,
                            array('multiple'=>'multiple', 'size'=>7));
 
         // Customized only
-        $mform->addElement('advcheckbox', 'customized', get_string('filtercustomized', 'report_customlang'));
+        $mform->addElement('advcheckbox', 'customized', get_string('filtercustomized', 'tool_customlang'));
         $mform->setType('customized', PARAM_BOOL);
         $mform->setDefault('customized', 0);
 
         // Only helps
-        $mform->addElement('advcheckbox', 'helps', get_string('filteronlyhelps', 'report_customlang'));
+        $mform->addElement('advcheckbox', 'helps', get_string('filteronlyhelps', 'tool_customlang'));
         $mform->setType('helps', PARAM_BOOL);
         $mform->setDefault('helps', 0);
 
         // Modified only
-        $mform->addElement('advcheckbox', 'modified', get_string('filtermodified', 'report_customlang'));
+        $mform->addElement('advcheckbox', 'modified', get_string('filtermodified', 'tool_customlang'));
         $mform->setType('filtermodified', PARAM_BOOL);
         $mform->setDefault('filtermodified', 0);
 
         // Substring
-        $mform->addElement('text', 'substring', get_string('filtersubstring', 'report_customlang'));
+        $mform->addElement('text', 'substring', get_string('filtersubstring', 'tool_customlang'));
         $mform->setType('substring', PARAM_RAW);
 
         // String identifier
-        $mform->addElement('text', 'stringid', get_string('filterstringid', 'report_customlang'));
+        $mform->addElement('text', 'stringid', get_string('filterstringid', 'tool_customlang'));
         $mform->setType('stringid', PARAM_STRINGID);
 
         // Show strings - submit button
-        $mform->addElement('submit', 'submit', get_string('filtershowstrings', 'report_customlang'));
+        $mform->addElement('submit', 'submit', get_string('filtershowstrings', 'tool_customlang'));
     }
 }
 
similarity index 65%
rename from admin/report/customlang/index.php
rename to admin/tool/customlang/index.php
index 86ea785..28dae19 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
@@ -18,7 +17,7 @@
 /**
  * Performs checkout of the strings into the translation table
  *
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 
 define('NO_OUTPUT_BUFFERING', true); // progress bar is used here
 
-require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
-require_once($CFG->dirroot.'/'.$CFG->admin.'/report/customlang/locallib.php');
+require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
+require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
 require_once($CFG->libdir.'/adminlib.php');
 
 require_login(SITEID, false);
-require_capability('report/customlang:view', get_system_context());
+require_capability('tool/customlang:view', get_system_context());
 
 $action  = optional_param('action', '', PARAM_ALPHA);
 $confirm = optional_param('confirm', false, PARAM_BOOL);
 $lng     = optional_param('lng', '', PARAM_LANG);
 
-admin_externalpage_setup('reportcustomlang');
+admin_externalpage_setup('toolcustomlang');
 $langs = get_string_manager()->get_list_of_translations();
 
 // pre-output actions
 if ($action === 'checkout') {
     require_sesskey();
-    require_capability('report/customlang:edit', get_system_context());
+    require_capability('tool/customlang:edit', get_system_context());
     if (empty($lng)) {
         print_error('missingparameter');
     }
 
     $PAGE->set_cacheable(false);    // progress bar is used here
-    $output = $PAGE->get_renderer('report_customlang');
+    $output = $PAGE->get_renderer('tool_customlang');
     echo $output->header();
-    echo $output->heading(get_string('pluginname', 'report_customlang'));
+    echo $output->heading(get_string('pluginname', 'tool_customlang'));
     $progressbar = new progress_bar();
     $progressbar->create();         // prints the HTML code of the progress bar
 
     // we may need a bit of extra execution time and memory here
     @set_time_limit(HOURSECS);
     raise_memory_limit(MEMORY_EXTRA);
-    report_customlang_utils::checkout($lng, $progressbar);
+    tool_customlang_utils::checkout($lng, $progressbar);
 
-    echo $output->continue_button(new moodle_url('/admin/report/customlang/edit.php', array('lng' => $lng)), 'get');
+    echo $output->continue_button(new moodle_url('/admin/tool/customlang/edit.php', array('lng' => $lng)), 'get');
     echo $output->footer();
     exit;
 }
 
 if ($action === 'checkin') {
     require_sesskey();
-    require_capability('report/customlang:edit', get_system_context());
+    require_capability('tool/customlang:edit', get_system_context());
     if (empty($lng)) {
         print_error('missingparameter');
     }
 
     if (!$confirm) {
-        $output = $PAGE->get_renderer('report_customlang');
+        $output = $PAGE->get_renderer('tool_customlang');
         echo $output->header();
-        echo $output->heading(get_string('pluginname', 'report_customlang'));
+        echo $output->heading(get_string('pluginname', 'tool_customlang'));
         echo $output->heading($langs[$lng], 3);
-        $numofmodified = report_customlang_utils::get_count_of_modified($lng);
+        $numofmodified = tool_customlang_utils::get_count_of_modified($lng);
         if ($numofmodified != 0) {
-            echo $output->heading(get_string('modifiednum', 'report_customlang', $numofmodified), 3);
-            echo $output->confirm(get_string('confirmcheckin', 'report_customlang'),
+            echo $output->heading(get_string('modifiednum', 'tool_customlang', $numofmodified), 3);
+            echo $output->confirm(get_string('confirmcheckin', 'tool_customlang'),
                                   new moodle_url($PAGE->url, array('action'=>'checkin', 'lng'=>$lng, 'confirm'=>1)),
                                   new moodle_url($PAGE->url, array('lng'=>$lng)));
         } else {
-            echo $output->heading(get_string('modifiedno', 'report_customlang', $numofmodified), 3);
+            echo $output->heading(get_string('modifiedno', 'tool_customlang', $numofmodified), 3);
             echo $output->continue_button(new moodle_url($PAGE->url, array('lng' => $lng)));
         }
         echo $output->footer();
         die();
 
     } else {
-        report_customlang_utils::checkin($lng);
+        tool_customlang_utils::checkin($lng);
         redirect($PAGE->url);
     }
 }
 
-$output = $PAGE->get_renderer('report_customlang');
+$output = $PAGE->get_renderer('tool_customlang');
 
 // output starts here
 echo $output->header();
-echo $output->heading(get_string('pluginname', 'report_customlang'));
+echo $output->heading(get_string('pluginname', 'tool_customlang'));
 
 if (empty($lng)) {
     $s = new single_select($PAGE->url, 'lng', $langs);
@@ -113,27 +112,27 @@ if (empty($lng)) {
 
 echo $output->heading($langs[$lng], 3);
 
-$numofmodified = report_customlang_utils::get_count_of_modified($lng);
+$numofmodified = tool_customlang_utils::get_count_of_modified($lng);
 
 if ($numofmodified != 0) {
-    echo $output->heading(get_string('modifiednum', 'report_customlang', $numofmodified), 3);
+    echo $output->heading(get_string('modifiednum', 'tool_customlang', $numofmodified), 3);
 }
 
 $menu = array();
-if (has_capability('report/customlang:edit', get_system_context())) {
+if (has_capability('tool/customlang:edit', get_system_context())) {
     $menu['checkout'] = array(
-        'title'     => get_string('checkout', 'report_customlang'),
+        'title'     => get_string('checkout', 'tool_customlang'),
         'url'       => new moodle_url($PAGE->url, array('action' => 'checkout', 'lng' => $lng)),
         'method'    => 'post',
     );
     if ($numofmodified != 0) {
         $menu['checkin'] = array(
-            'title'     => get_string('checkin', 'report_customlang'),
+            'title'     => get_string('checkin', 'tool_customlang'),
             'url'       => new moodle_url($PAGE->url, array('action' => 'checkin', 'lng' => $lng)),
             'method'    => 'post',
         );
     }
 }
-echo $output->render(new report_customlang_menu($menu));
+echo $output->render(new tool_customlang_menu($menu));
 
 echo $output->footer();
@@ -16,9 +16,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * Strings for Language customization admin report
+ * Strings for Language customization admin tool
  *
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
similarity index 97%
rename from admin/report/customlang/lib.php
rename to admin/tool/customlang/lib.php
index d3a1fb1..5bb30a6 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
@@ -16,7 +15,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
similarity index 90%
rename from admin/report/customlang/locallib.php
rename to admin/tool/customlang/locallib.php
index 180518f..47bbdfa 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
@@ -16,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * Definition of classes used by language customization admin report
+ * Definition of classes used by language customization admin tool
  *
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -31,7 +30,7 @@ defined('MOODLE_INTERNAL') || die();
  *
  * All the public methods here are static ones, this class can not be instantiated
  */
-class report_customlang_utils {
+class tool_customlang_utils {
 
     /**
      * Rough number of strings that are being processed during a full checkout.
@@ -95,7 +94,7 @@ class report_customlang_utils {
         global $DB;
 
         // make sure that all components are registered
-        $current = $DB->get_records('report_customlang_components', null, 'name', 'name,version,id');
+        $current = $DB->get_records('tool_customlang_components', null, 'name', 'name,version,id');
         foreach (self::list_components() as $component) {
             if (empty($current[$component])) {
                 $record = new stdclass();
@@ -105,10 +104,10 @@ class report_customlang_utils {
                 } else {
                     $record->version = $version;
                 }
-                $DB->insert_record('report_customlang_components', $record);
+                $DB->insert_record('tool_customlang_components', $record);
             } elseif ($version = get_component_version($component)) {
                 if (is_null($current[$component]->version) or ($version > $current[$component]->version)) {
-                    $DB->set_field('report_customlang_components', 'version', $version, array('id' => $current[$component]->id));
+                    $DB->set_field('tool_customlang_components', 'version', $version, array('id' => $current[$component]->id));
                 }
             }
         }
@@ -116,14 +115,14 @@ class report_customlang_utils {
 
         // initialize the progress counter - stores the number of processed strings
         $done = 0;
-        $strinprogress = get_string('checkoutinprogress', 'report_customlang');
+        $strinprogress = get_string('checkoutinprogress', 'tool_customlang');
 
         // reload components and fetch their strings
         $stringman  = get_string_manager();
-        $components = $DB->get_records('report_customlang_components');
+        $components = $DB->get_records('tool_customlang_components');
         foreach ($components as $component) {
             $sql = "SELECT stringid, id, lang, componentid, original, master, local, timemodified, timecustomized, outdated, modified
-                      FROM {report_customlang} s
+                      FROM {tool_customlang} s
                      WHERE lang = ? AND componentid = ?
                   ORDER BY stringid";
             $current = $DB->get_records_sql($sql, array($lang, $component->id));
@@ -167,7 +166,7 @@ class report_customlang_utils {
                     }
 
                     if ($needsupdate) {
-                        $DB->update_record('report_customlang', $current[$stringid]);
+                        $DB->update_record('tool_customlang', $current[$stringid]);
                         continue;
                     }
 
@@ -188,13 +187,13 @@ class report_customlang_utils {
                         $record->timecustomized = null;
                     }
 
-                    $DB->insert_record('report_customlang', $record);
+                    $DB->insert_record('tool_customlang', $record);
                 }
             }
         }
 
         if (!is_null($progressbar)) {
-            $progressbar->update_full(100, get_string('checkoutdone', 'report_customlang'));
+            $progressbar->update_full(100, get_string('checkoutdone', 'tool_customlang'));
         }
     }
 
@@ -213,8 +212,8 @@ class report_customlang_utils {
 
         // get all customized strings from updated components
         $sql = "SELECT s.*, c.name AS component
-                  FROM {report_customlang} s
-                  JOIN {report_customlang_components} c ON s.componentid = c.id
+                  FROM {tool_customlang} s
+                  JOIN {tool_customlang_components} c ON s.componentid = c.id
                  WHERE s.lang = ?
                        AND (s.local IS NOT NULL OR s.modified = 1)
               ORDER BY componentid, stringid";
@@ -232,7 +231,7 @@ class report_customlang_utils {
             self::dump_strings($lang, $component, $strings);
         }
 
-        $DB->set_field_select('report_customlang', 'modified', 0, 'lang = ?', array($lang));
+        $DB->set_field_select('tool_customlang', 'modified', 0, 'lang = ?', array($lang));
         $sm = get_string_manager();
         $sm->reset_caches();
     }
@@ -359,7 +358,7 @@ EOF
     public static function get_count_of_modified($lang) {
         global $DB;
 
-        return $DB->count_records('report_customlang', array('lang'=>$lang, 'modified'=>1));
+        return $DB->count_records('tool_customlang', array('lang'=>$lang, 'modified'=>1));
     }
 
     /**
@@ -370,12 +369,12 @@ EOF
      * @param stdclass $persistant storage object
      */
     public static function save_filter(stdclass $data, stdclass $persistant) {
-        if (!isset($persistant->report_customlang_filter)) {
-            $persistant->report_customlang_filter = array();
+        if (!isset($persistant->tool_customlang_filter)) {
+            $persistant->tool_customlang_filter = array();
         }
         foreach ($data as $key => $value) {
             if ($key !== 'submit') {
-                $persistant->report_customlang_filter[$key] = serialize($value);
+                $persistant->tool_customlang_filter[$key] = serialize($value);
             }
         }
     }
@@ -389,8 +388,8 @@ EOF
      */
     public static function load_filter(stdclass $persistant) {
         $data = new stdclass();
-        if (isset($persistant->report_customlang_filter)) {
-            foreach ($persistant->report_customlang_filter as $key => $value) {
+        if (isset($persistant->tool_customlang_filter)) {
+            foreach ($persistant->tool_customlang_filter as $key => $value) {
                 $data->{$key} = unserialize($value);
             }
         }
@@ -399,9 +398,9 @@ EOF
 }
 
 /**
- * Represents the action menu of the report
+ * Represents the action menu of the tool
  */
-class report_customlang_menu implements renderable {
+class tool_customlang_menu implements renderable {
 
     /** @var menu items */
     protected $items = array();
@@ -449,7 +448,7 @@ class report_customlang_menu implements renderable {
 /**
  * Represents the translation tool
  */
-class report_customlang_translator implements renderable {
+class tool_customlang_translator implements renderable {
 
     /** @const int number of rows per page */
     const PERPAGE = 100;
@@ -490,8 +489,8 @@ class report_customlang_translator implements renderable {
 
         $csql = "SELECT COUNT(*)";
         $fsql = "SELECT s.id, s.*, c.name AS component";
-        $sql  = "  FROM {report_customlang_components} c
-                   JOIN {report_customlang} s ON s.componentid = c.id
+        $sql  = "  FROM {tool_customlang_components} c
+                   JOIN {tool_customlang} s ON s.componentid = c.id
                   WHERE s.lang = :lang
                         AND c.name $insql";
 
similarity index 86%
rename from admin/report/customlang/module.js
rename to admin/tool/customlang/module.js
index ec38cac..b87b518 100644 (file)
@@ -14,7 +14,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 /**
  * @namespace
  */
-M.report_customlang = M.report_customlang || {};
+M.tool_customlang = M.tool_customlang || {};
 
 /**
  * YUI instance holder
  */
-M.report_customlang.Y = {};
+M.tool_customlang.Y = {};
 
 /**
  * Initialize JS support for the edit.php
  *
  * @param {Object} Y YUI instance
  */
-M.report_customlang.init_editor = function(Y) {
-    M.report_customlang.Y = Y;
+M.tool_customlang.init_editor = function(Y) {
+    M.tool_customlang.Y = Y;
 
     Y.all('#translator .local textarea').each(function (textarea) {
         var cell = textarea.get('parentNode');
similarity index 83%
rename from admin/report/customlang/renderer.php
rename to admin/tool/customlang/renderer.php
index 330b5ae..f96f83b 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
@@ -16,9 +15,9 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * Output rendering of Language customization admin report
+ * Output rendering of Language customization admin tool
  *
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 defined('MOODLE_INTERNAL') || die();
 
 /**
- * Rendering methods for the report widgets
+ * Rendering methods for the tool widgets
  */
-class report_customlang_renderer extends plugin_renderer_base {
+class tool_customlang_renderer extends plugin_renderer_base {
 
     /**
-     * Renders customlang report menu
+     * Renders customlang tool menu
      *
      * @return string HTML
      */
-    protected function render_report_customlang_menu(report_customlang_menu $menu) {
+    protected function render_tool_customlang_menu(tool_customlang_menu $menu) {
         $output = '';
         foreach ($menu->get_items() as $item) {
             $output .= $this->single_button($item->url, $item->title, $item->method);
@@ -47,23 +46,23 @@ class report_customlang_renderer extends plugin_renderer_base {
     /**
      * Renders customlang translation table
      *
-     * @param report_customlang_translator $translator
+     * @param tool_customlang_translator $translator
      * @return string HTML
      */
-    protected function render_report_customlang_translator(report_customlang_translator $translator) {
+    protected function render_tool_customlang_translator(tool_customlang_translator $translator) {
         $output = '';
 
         if (empty($translator->strings)) {
-            return $this->heading(get_string('nostringsfound', 'report_customlang'), 3);
+            return $this->heading(get_string('nostringsfound', 'tool_customlang'), 3);
         }
 
         $table = new html_table();
         $table->id = 'translator';
         $table->head = array(
-            get_string('headingcomponent', 'report_customlang'),
-            get_string('headingstringid', 'report_customlang'),
-            get_string('headingstandard', 'report_customlang'),
-            get_string('headinglocal', 'report_customlang'),
+            get_string('headingcomponent', 'tool_customlang'),
+            get_string('headingstringid', 'tool_customlang'),
+            get_string('headingstandard', 'tool_customlang'),
+            get_string('headinglocal', 'tool_customlang'),
         );
 
         foreach ($translator->strings as $string) {
@@ -78,8 +77,8 @@ class report_customlang_renderer extends plugin_renderer_base {
             $master = html_writer::tag('div', s($string->master), array('class' => 'preformatted'));
             $minheight = strlen($string->master) / 200;
             if (preg_match('/\{\$a(->.+)?\}/', $string->master)) {
-                $master .= html_writer::tag('div', $this->help_icon('placeholder', 'report_customlang',
-                        get_string('placeholderwarning', 'report_customlang')), array('class' => 'placeholderinfo'));
+                $master .= html_writer::tag('div', $this->help_icon('placeholder', 'tool_customlang',
+                        get_string('placeholderwarning', 'tool_customlang')), array('class' => 'placeholderinfo'));
             }
             $cells[2] = new html_table_cell($master);
             $cells[2]->attributes['class'] = 'standard master';
@@ -93,8 +92,8 @@ class report_customlang_renderer extends plugin_renderer_base {
             if (!is_null($string->local) and $string->outdated) {
                 $mark  = html_writer::empty_tag('input', array('type' => 'checkbox', 'id' => 'update_' . $string->id,
                                                                'name' => 'updates[]', 'value' => $string->id));
-                $help  = $this->help_icon('markinguptodate', 'report_customlang');
-                $mark .= html_writer::tag('label', get_string('markuptodate', 'report_customlang') . $help,
+                $help  = $this->help_icon('markinguptodate', 'tool_customlang');
+                $mark .= html_writer::tag('label', get_string('markuptodate', 'tool_customlang') . $help,
                                           array('for' => 'update_' . $string->id));
                 $mark  = html_writer::tag('div', $mark, array('class' => 'uptodatewrapper'));
             } else {
@@ -134,8 +133,8 @@ class report_customlang_renderer extends plugin_renderer_base {
         $output .= html_writer::start_tag('div');
         $output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'translatorsubmitted', 'value'=>1));
         $output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=>sesskey()));
-        $save1   = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecontinue', 'value'=>get_string('savecontinue', 'report_customlang')));
-        $save2   = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecheckin', 'value'=>get_string('savecheckin', 'report_customlang')));
+        $save1   = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecontinue', 'value'=>get_string('savecontinue', 'tool_customlang')));
+        $save2   = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecheckin', 'value'=>get_string('savecheckin', 'tool_customlang')));
         $output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
         $output .= html_writer::table($table);
         $output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
similarity index 79%
rename from admin/report/customlang/settings.php
rename to admin/tool/customlang/settings.php
index 97564e7..667a8da 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
@@ -16,7 +15,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * @package    report
+ * @package    tool
  * @subpackage customlang
  * @copyright  2010 David Mudrak <david@moodle.com>
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -24,4 +23,4 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$ADMIN->add('language', new admin_externalpage('reportcustomlang', get_string('pluginname', 'report_customlang'), "$CFG->wwwroot/$CFG->admin/report/customlang/index.php", 'report/customlang:view'));
+$ADMIN->add('language', new admin_externalpage('toolcustomlang', get_string('pluginname', 'tool_customlang'), "$CFG->wwwroot/$CFG->admin/tool/customlang/index.php", 'tool/customlang:view'));
diff --git a/admin/tool/customlang/styles.css b/admin/tool/customlang/styles.css
new file mode 100644 (file)
index 0000000..c743bcf
--- /dev/null
@@ -0,0 +1,69 @@
+.path-admin-tool-customlang .langselectorbox,
+.path-admin-tool-customlang fieldset.buttonsbar,
+.path-admin-tool-customlang .menu {
+    margin: 5px auto;
+    text-align: center;
+}
+
+.path-admin-tool-customlang .menu .singlebutton,
+.path-admin-tool-customlang .menu .singlebutton form,
+.path-admin-tool-customlang .menu .singlebutton form div {
+    display: inline;
+}
+
+
+.path-admin-tool-customlang .mform.filterform {
+    width: 70%;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.path-admin-tool-customlang .mform.filterform .fitem .fitemtitle {
+    width: 30%;
+}
+
+.path-admin-tool-customlang .mform.filterform .fitem .felement {
+    width: 60%;
+    margin-left: 31%;
+}
+
+.path-admin-tool-customlang #translator {
+    width: 100%;
+}
+
+.path-admin-tool-customlang #translator .standard,
+.path-admin-tool-customlang #translator .local {
+    min-width: 35%;
+}
+
+.path-admin-tool-customlang #translator .customized {
+    background-color: #e7f1c3;
+}
+
+.path-admin-tool-customlang #translator .customized.outdated {
+    background-color: #f3f2aa;
+}
+
+.path-admin-tool-customlang #translator .modified {
+    background-color: #ffd3d9;
+}
+
+.path-admin-tool-customlang #translator .customized.modified {
+    background-color: #d2ebff;
+}
+
+.path-admin-tool-customlang #translator textarea {
+    width: 100%;
+    min-height: 4em;
+}
+
+.path-admin-tool-customlang #translator .placeholderinfo {
+    text-align: center;
+    border: 1px dotted #ddd;
+    background-color: #f6f6f6;
+    margin-top: 0.5em;
+}
+
+#page-admin-tool-customlang-index .continuebutton {
+    margin-top: 1em;
+}
similarity index 85%
rename from admin/report/customlang/version.php
rename to admin/tool/customlang/version.php
index 96b03d5..655f320 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 // This file is part of Moodle - http://moodle.org/
 //
 // Moodle is free software: you can redistribute it and/or modify
@@ -24,5 +23,6 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version  = 2011041900;
-$plugin->requires = 2010120700;
+$plugin->version   = 2011092500;
+$plugin->requires  = 2011092100;
+$plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
index 89ccdac..1fae2ea 100644 (file)
@@ -343,7 +343,7 @@ class plugin_manager {
 
             'report' => array(
                 'backups', 'configlog', 'courseoverview',
-                'customlang', 'log', 'questioninstances',
+                'log', 'questioninstances',
                 'security', 'spamcleaner', 'stats'
             ),
 
@@ -367,7 +367,7 @@ class plugin_manager {
             ),
 
             'tool' => array(
-                'bloglevelupgrade', 'capability', 'dbtransfer', 'generator',
+                'bloglevelupgrade', 'capability', 'customlang', 'dbtransfer', 'generator',
                 'health', 'innodb', 'langimport', 'multilangupgrade',
                 'profiling', 'unittest', 'uploaduser', 'unsuproles', 'xmldb'
             ),