]> git.mjollnir.org Git - moodle.git/commitdiff
portfolio: MDL-20892 moved portfolio/type/* plugins to portfolio/*
authorPenny Leach <penny@liip.ch>
Wed, 18 Nov 2009 13:27:38 +0000 (13:27 +0000)
committerPenny Leach <penny@liip.ch>
Wed, 18 Nov 2009 13:27:38 +0000 (13:27 +0000)
30 files changed:
admin/mnet/adminlib.php
admin/settings/plugins.php
lib/moodlelib.php
lib/portfolio/exporter.php
lib/portfolio/plugin.php
lib/portfoliolib.php
lib/simpletest/getstringperformancetester.php
lib/simpletest/portfolio_testclass.php
mnet/xmlrpc/server.php
portfolio/boxnet/lib.php [moved from portfolio/type/boxnet/lib.php with 100% similarity]
portfolio/boxnet/simpletest/testportfoliopluginboxnet.php [moved from portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php with 96% similarity]
portfolio/boxnet/version.php [moved from portfolio/type/boxnet/version.php with 100% similarity]
portfolio/download/file.php [moved from portfolio/type/download/file.php with 85% similarity]
portfolio/download/helper.js [moved from portfolio/type/download/helper.js with 100% similarity]
portfolio/download/lib.php [moved from portfolio/type/download/lib.php with 92% similarity]
portfolio/download/simpletest/testportfolioplugindownload.php [moved from portfolio/type/download/simpletest/testportfolioplugindownload.php with 85% similarity]
portfolio/download/version.php [moved from portfolio/type/download/version.php with 100% similarity]
portfolio/flickr/lib.php [moved from portfolio/type/flickr/lib.php with 100% similarity]
portfolio/flickr/version.php [moved from portfolio/type/flickr/version.php with 100% similarity]
portfolio/googledocs/db/events.php [moved from portfolio/type/googledocs/db/events.php with 71% similarity]
portfolio/googledocs/lib.php [moved from portfolio/type/googledocs/lib.php with 100% similarity]
portfolio/googledocs/version.php [moved from portfolio/type/googledocs/version.php with 100% similarity]
portfolio/mahara/db/install.xml [moved from portfolio/type/mahara/db/install.xml with 91% similarity]
portfolio/mahara/db/upgrade.php [moved from portfolio/type/mahara/db/upgrade.php with 100% similarity]
portfolio/mahara/lib.php [moved from portfolio/type/mahara/lib.php with 99% similarity]
portfolio/mahara/preconfig.php [moved from portfolio/type/mahara/preconfig.php with 86% similarity]
portfolio/mahara/version.php [moved from portfolio/type/mahara/version.php with 100% similarity]
portfolio/picasa/db/events.php [moved from portfolio/type/picasa/db/events.php with 72% similarity]
portfolio/picasa/lib.php [moved from portfolio/type/picasa/lib.php with 100% similarity]
portfolio/picasa/version.php [moved from portfolio/type/picasa/version.php with 100% similarity]

index 7a8ff37cbc65ca99cfe6daf54e0fc4533df9e007..701aed27cdb31452dc65de2d9928e892e9c4eae3 100644 (file)
@@ -37,7 +37,7 @@ function mnet_get_functions($type, $parentname) {
         }
     } else if ('portfolio' == $type) {
         $docname = 'lib.php';
-        $relname = '/portfolio/type/' . $parentname . '/'. $docname;
+        $relname = '/portfolio/' . $parentname . '/'. $docname;
         $filename = $CFG->dirroot . $relname;
         require_once($CFG->libdir . '/portfoliolib.php');
         $publishes = (array)portfolio_static_function($parentname, 'mnet_publishes');
@@ -197,7 +197,7 @@ function upgrade_RPC_functions() {
         }
     }
 
-    if ($plugins = get_list_of_plugins('portfolio/type')) {
+    if ($plugins = get_list_of_plugins('portfolio')) {
         foreach ($plugins as $p) {
             mnet_get_functions('portfolio', $p);
         }
index eff0fbc02e4fb3dee5378a769d336ebf918125a6..852f80aaab20a144109d074e89ad2be05fef4eb3 100644 (file)
@@ -178,7 +178,7 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
     $ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', get_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true), '', $url);
 
     foreach (portfolio_instances(false, false) as $portfolio) {
-        require_once($CFG->dirroot . '/portfolio/type/' . $portfolio->get('plugin') . '/lib.php');
+        require_once($CFG->dirroot . '/portfolio/' . $portfolio->get('plugin') . '/lib.php');
         $classname = 'portfolio_plugin_' . $portfolio->get('plugin');
         $ADMIN->add(
             'portfoliosettings',
index 438485b76eeeb89973e183579ce8e5c7c52f255e..ee364c983a995a6f2a64b4fc79bc60844aabdbad 100644 (file)
@@ -6727,7 +6727,7 @@ function get_plugin_types($fullpaths=true) {
                       'gradereport'   => 'grade/report',
                       'webservice'    => 'webservice',
                       'repository'    => 'repository',
-                      'portfolio'     => 'portfolio/type',
+                      'portfolio'     => 'portfolio',
                       'qtype'         => 'question/type',
                       'qformat'       => 'question/format');
 
index f542698118878a77c714d31773adc845dac4f6c3..ed08e048ada2912ef701e3a88697843cff01ebde 100644 (file)
@@ -134,7 +134,7 @@ class portfolio_exporter {
         $this->instance =& $instance;
         $this->caller =& $caller;
         if ($instance) {
-            $this->instancefile = 'portfolio/type/' . $instance->get('plugin') . '/lib.php';
+            $this->instancefile = 'portfolio/' . $instance->get('plugin') . '/lib.php';
             $this->instance->set('exporter', $this);
         }
         $this->callerfile = $callerfile;
@@ -169,7 +169,7 @@ class portfolio_exporter {
         if (property_exists($this, $field)) {
             $this->{$field} =& $value;
             if ($field == 'instance') {
-                $this->instancefile = 'portfolio/type/' . $this->instance->get('plugin') . '/lib.php';
+                $this->instancefile = 'portfolio/' . $this->instance->get('plugin') . '/lib.php';
                 $this->instance->set('exporter', $this);
             }
             $this->dirty = true;
index fd0dbe9666433d2062776ab755cc760cbadb8924..f9bb5f6718643eefc9883a3e71c41a35116d3dfe 100644 (file)
@@ -462,7 +462,7 @@ abstract class portfolio_plugin_base {
             }
         }
         $newid = $DB->insert_record('portfolio_instance', $new);
-        require_once($CFG->dirroot . '/portfolio/type/' . $plugin . '/lib.php');
+        require_once($CFG->dirroot . '/portfolio/' . $plugin . '/lib.php');
         $classname = 'portfolio_plugin_'  . $plugin;
         $obj = new $classname($newid);
         $obj->set_config($config);
index 7cd706f7f4e3a239d9782a7b9c99fd41872ebd67..50b1b80a01bc7b1b5b5a7bf211b1e8158e2530f1 100644 (file)
@@ -587,7 +587,7 @@ function portfolio_instance($instanceid, $record=null) {
             throw new portfolio_exception('invalidinstance', 'portfolio');
         }
     }
-    require_once($CFG->dirroot . '/portfolio/type/'. $instance->plugin . '/lib.php');
+    require_once($CFG->dirroot . '/portfolio/'. $instance->plugin . '/lib.php');
     $classname = 'portfolio_plugin_' . $instance->plugin;
     return new $classname($instanceid, $instance);
 }
@@ -622,7 +622,7 @@ function portfolio_static_function($plugin, $function) {
         array_shift($args);
     }
 
-    require_once($CFG->dirroot . '/portfolio/type/' . $plugin .  '/lib.php');
+    require_once($CFG->dirroot . '/portfolio/' . $plugin .  '/lib.php');
     return call_user_func_array(array('portfolio_plugin_' . $plugin, $function), $args);
 }
 
index 2315c64a82584a0035f927160e670a4a5752b5ba..962be2edbf0c55d0a7502f2fd2187846f26ebd31 100644 (file)
@@ -302,7 +302,7 @@ function places_to_search_for_lang_strings() {
         'gradeimport_' => array('grade/import'),
         'gradeexport_' => array('grade/export'),
         'profilefield_' => array('user/profile/field'),
-        'portfolio_' => array('portfolio/type'),
+        'portfolio_' => array('portfolio'),
         '' => array('mod')
     );
 }
index 29aa3db5922c4705403deab88276fc2d2c68234c..7cb77adcb52d966b6ad519e886e14d186d7df5c1 100644 (file)
@@ -178,9 +178,9 @@ Mock::generatePartial('portfolio_exporter_test', 'partialmock_exporter', array('
 
 
 // Generate a mock class for each plugin subclass present
-$portfolio_plugins = get_list_of_plugins('portfolio/type');
+$portfolio_plugins = get_list_of_plugins('portfolio');
 foreach ($portfolio_plugins as $plugin) {
-    require_once($CFG->dirroot . "/portfolio/type/$plugin/lib.php");
+    require_once($CFG->dirroot . "/portfolio/$plugin/lib.php");
     Mock::generatePartial("portfolio_plugin_$plugin", "partialmock_plugin_$plugin", array('send_package'));
 }
 
@@ -231,7 +231,7 @@ class portfoliolib_test extends FakeDBUnitTestCase {
 
     public function test_caller_with_plugins() {
         if (!empty($this->caller)) {
-            $plugins = get_list_of_plugins('portfolio/type');
+            $plugins = get_list_of_plugins('portfolio');
 
             foreach ($plugins as $plugin) {
                 // Instantiate a fake plugin instance
index 5cb3e523216934ff26d74d17a891a3452b676b00..e54d83c4488a0f0744f50980e65f48ac309f012b 100644 (file)
@@ -488,7 +488,7 @@ function mnet_server_dispatch($payload) {
 
         if ($filename == 'lib.php') {
             $pluginclass = 'portfolio_plugin_' . $plugin;
-            $includefile = '/portfolio/type/'.$plugin.'/lib.php';
+            $includefile = '/portfolio/'.$plugin.'/lib.php';
             $response    = mnet_server_invoke_method($includefile, $methodname, $method, $payload, $pluginclass);
             $response = mnet_server_prepare_response($response);
             echo $response;
similarity index 96%
rename from portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php
rename to portfolio/boxnet/simpletest/testportfoliopluginboxnet.php
index 30bb1bff74e6fabc0643fc3994e9f9e106aca335..4ddb2dfd74028ad1a065319225d5ae8b274cf696 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 require_once("$CFG->libdir/simpletest/testportfoliolib.php");
-require_once("$CFG->dirroot/portfolio/type/boxnet/lib.php");
+require_once("$CFG->dirroot/portfolio/boxnet/lib.php");
 require_once("$CFG->dirroot/$CFG->admin/generator.php");
 
 Mock::generate('boxclient', 'mock_boxclient');
 Mock::generatePartial('portfolio_plugin_boxnet', 'mock_boxnetplugin', array('ensure_ticket', 'ensure_account_tree'));
 
 class testPortfolioPluginBoxnet extends portfoliolib_test {
-    public static $includecoverage = array('lib/portfoliolib.php', 'portfolio/type/boxnet/lib.php');
+    public static $includecoverage = array('lib/portfoliolib.php', 'portfolio/boxnet/lib.php');
     public function setUp() {
         global $DB;
 
similarity index 85%
rename from portfolio/type/download/file.php
rename to portfolio/download/file.php
index 9ed312b00a6cff08d5c6028c3969b4a0fe3f3c88..6c1a4b8690395f4d005891f80995774d0f7fb034 100644 (file)
@@ -4,7 +4,7 @@
 // (using portfolio/file.php) but still give them the 'return to where you were' link
 // to go back to their assignment, or whatever
 
-require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
 
 if (empty($CFG->enableportfolios)) {
     print_error('disabled', 'portfolio');
@@ -15,7 +15,7 @@ $PAGE->requires->yui_lib('dom');
 $id = required_param('id', PARAM_INT);
 
 require_login();
-$PAGE->set_url('/portfolio/type/download/file.php', array('id' => $id));
+$PAGE->set_url('/portfolio/download/file.php', array('id' => $id));
 
 $exporter = portfolio_exporter::rewaken_object($id);
 $exporter->verify_rewaken();
@@ -24,7 +24,7 @@ $exporter->print_header(get_string('downloading', 'portfolio_download'), false);
 $returnurl = $exporter->get('caller')->get_return_url();
 echo $OUTPUT->notification('<a href="' . $returnurl . '">' . get_string('returntowhereyouwere', 'portfolio') . '</a><br />');
 
-$PAGE->requires->js('/portfolio/type/download/helper.js');
+$PAGE->requires->js('/portfolio/download/helper.js');
 $PAGE->requires->js_function_call('submit_download_form')->on_dom_ready();
 
 // if they don't have javascript, they can submit the form here to get the file.
similarity index 92%
rename from portfolio/type/download/lib.php
rename to portfolio/download/lib.php
index 3ad63109a741dcc875680975d8a4a6f4a7c6dee2..3959382063c41d7e50617929aaae8d1b0bd51c6c 100644 (file)
@@ -32,7 +32,7 @@ class portfolio_plugin_download extends portfolio_plugin_pull_base {
     public function steal_control($stage) {
         if ($stage == PORTFOLIO_STAGE_FINISHED) {
             global $CFG;
-            return $CFG->wwwroot . '/portfolio/type/download/file.php?id=' . $this->get('exporter')->get('id');
+            return $CFG->wwwroot . '/portfolio/download/file.php?id=' . $this->get('exporter')->get('id');
         }
     }
 
similarity index 85%
rename from portfolio/type/download/simpletest/testportfolioplugindownload.php
rename to portfolio/download/simpletest/testportfolioplugindownload.php
index 8d3dfc8e52b40d0ad198a134ccb6052e5a910c5d..294fbc4c27183dc71bac1c7cf885abf31f69ce9c 100755 (executable)
@@ -1,13 +1,13 @@
 <?php
 require_once($CFG->libdir.'/simpletest/testportfoliolib.php');
-require_once($CFG->dirroot.'/portfolio/type/download/lib.php');
+require_once($CFG->dirroot.'/portfolio/download/lib.php');
 
 Mock::generate('boxclient', 'mock_boxclient');
 Mock::generatePartial('portfolio_plugin_download', 'mock_downloadplugin', array('ensure_ticket', 'ensure_account_tree'));
 
 
 class testPortfolioPluginDownload extends portfoliolib_test {
-    public static $includecoverage = array('lib/portfoliolib.php', 'portfolio/type/download/lib.php');
+    public static $includecoverage = array('lib/portfoliolib.php', 'portfolio/download/lib.php');
     public function setUp() {
         parent::setUp();
         $this->plugin = &new mock_boxnetplugin($this);
similarity index 71%
rename from portfolio/type/googledocs/db/events.php
rename to portfolio/googledocs/db/events.php
index b6342a7de53d8d0d28fe48ec921d7ca273f68e52..7b76bab2f6eddd2ac2c0de65d409bb956aeb64d2 100644 (file)
@@ -2,7 +2,7 @@
 
 $handlers = array (
     'user_deleted' => array (
-         'handlerfile'      => '/portfolio/type/googledocs/lib.php',
+         'handlerfile'      => '/portfolio/googledocs/lib.php',
          'handlerfunction'  => 'portfolio_googledocs_user_deleted',
          'schedule'         => 'cron'
      ),
similarity index 91%
rename from portfolio/type/mahara/db/install.xml
rename to portfolio/mahara/db/install.xml
index 8c576e0da0547e241fa49b35874f03f52d74eb35..48ef556f195d1a74ff4fb661fdc076d2491e7907 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="portfolio/type/mahara/db" VERSION="20080827" COMMENT="XMLDB file for Moodle portfolio/type/mahara"
+<XMLDB PATH="portfolio/mahara/db" VERSION="20080827" COMMENT="XMLDB file for Moodle portfolio/mahara"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
 >
similarity index 99%
rename from portfolio/type/mahara/lib.php
rename to portfolio/mahara/lib.php
index 8688644e18d3b870200d63b8e07881b42193299a..57127566304e3ca71a263c5f56b791d2e0afb00a 100644 (file)
@@ -234,7 +234,7 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base {
             return false;
         }
         global $CFG;
-        return $CFG->wwwroot . '/portfolio/type/mahara/preconfig.php?id=' . $this->exporter->get('id');
+        return $CFG->wwwroot . '/portfolio/mahara/preconfig.php?id=' . $this->exporter->get('id');
     }
 
     public function verify_file_request_params($params) {
similarity index 86%
rename from portfolio/type/mahara/preconfig.php
rename to portfolio/mahara/preconfig.php
index 847e9bb44bbbaba72d2e61c77eadda54f325622c..3eb8e4d5a6759ad0b65dd6b818895ce5aefa9b74 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-require_once(dirname(dirname(dirname(dirname(__FILE__)))). '/config.php');
+require_once(dirname(dirname(dirname(__FILE__))). '/config.php');
 
 if (empty($CFG->enableportfolios)) {
     print_error('disabled', 'portfolio');
@@ -18,7 +18,7 @@ if (!$landed) {
     $exporter->verify_rewaken();
 
     $mnetauth = get_auth_plugin('mnet');
-    if (!$url = $mnetauth->start_jump_session($exporter->get('instance')->get_config('mnethostid'), '/portfolio/type/mahara/preconfig.php?landed=1&id=' . $id, true)) {
+    if (!$url = $mnetauth->start_jump_session($exporter->get('instance')->get_config('mnethostid'), '/portfolio/mahara/preconfig.php?landed=1&id=' . $id, true)) {
         throw new porfolio_exception('failedtojump', 'portfolio_mahara');
     }
     redirect($url);
similarity index 72%
rename from portfolio/type/picasa/db/events.php
rename to portfolio/picasa/db/events.php
index 62845c04b69595ff3fb88df4f3c17905a22d6315..6e438e5067d54e9a5bb8763ce15b0c6595738b2f 100644 (file)
@@ -2,7 +2,7 @@
 
 $handlers = array (
     'user_deleted' => array (
-         'handlerfile'      => '/portfolio/type/picasa/lib.php',
+         'handlerfile'      => '/portfolio/picasa/lib.php',
          'handlerfunction'  => 'portfolio_picasa_user_deleted',
          'schedule'         => 'cron'
      ),