From: Penny Leach Date: Wed, 18 Nov 2009 13:27:38 +0000 (+0000) Subject: portfolio: MDL-20892 moved portfolio/type/* plugins to portfolio/* X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=edf1fc350a90dbae3f64d6ddd65e60c3caab4a62;p=moodle.git portfolio: MDL-20892 moved portfolio/type/* plugins to portfolio/* --- diff --git a/admin/mnet/adminlib.php b/admin/mnet/adminlib.php index 7a8ff37cbc..701aed27cd 100644 --- a/admin/mnet/adminlib.php +++ b/admin/mnet/adminlib.php @@ -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); } diff --git a/admin/settings/plugins.php b/admin/settings/plugins.php index eff0fbc02e..852f80aaab 100644 --- a/admin/settings/plugins.php +++ b/admin/settings/plugins.php @@ -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', diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 438485b76e..ee364c983a 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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'); diff --git a/lib/portfolio/exporter.php b/lib/portfolio/exporter.php index f542698118..ed08e048ad 100644 --- a/lib/portfolio/exporter.php +++ b/lib/portfolio/exporter.php @@ -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; diff --git a/lib/portfolio/plugin.php b/lib/portfolio/plugin.php index fd0dbe9666..f9bb5f6718 100644 --- a/lib/portfolio/plugin.php +++ b/lib/portfolio/plugin.php @@ -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); diff --git a/lib/portfoliolib.php b/lib/portfoliolib.php index 7cd706f7f4..50b1b80a01 100644 --- a/lib/portfoliolib.php +++ b/lib/portfoliolib.php @@ -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); } diff --git a/lib/simpletest/getstringperformancetester.php b/lib/simpletest/getstringperformancetester.php index 2315c64a82..962be2edbf 100644 --- a/lib/simpletest/getstringperformancetester.php +++ b/lib/simpletest/getstringperformancetester.php @@ -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') ); } diff --git a/lib/simpletest/portfolio_testclass.php b/lib/simpletest/portfolio_testclass.php index 29aa3db592..7cb77adcb5 100644 --- a/lib/simpletest/portfolio_testclass.php +++ b/lib/simpletest/portfolio_testclass.php @@ -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 diff --git a/mnet/xmlrpc/server.php b/mnet/xmlrpc/server.php index 5cb3e52321..e54d83c448 100644 --- a/mnet/xmlrpc/server.php +++ b/mnet/xmlrpc/server.php @@ -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; diff --git a/portfolio/type/boxnet/lib.php b/portfolio/boxnet/lib.php similarity index 100% rename from portfolio/type/boxnet/lib.php rename to portfolio/boxnet/lib.php diff --git a/portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php b/portfolio/boxnet/simpletest/testportfoliopluginboxnet.php similarity index 96% rename from portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php rename to portfolio/boxnet/simpletest/testportfoliopluginboxnet.php index 30bb1bff74..4ddb2dfd74 100644 --- a/portfolio/type/boxnet/simpletest/testportfoliopluginboxnet.php +++ b/portfolio/boxnet/simpletest/testportfoliopluginboxnet.php @@ -1,13 +1,13 @@ 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; diff --git a/portfolio/type/boxnet/version.php b/portfolio/boxnet/version.php similarity index 100% rename from portfolio/type/boxnet/version.php rename to portfolio/boxnet/version.php diff --git a/portfolio/type/download/file.php b/portfolio/download/file.php similarity index 85% rename from portfolio/type/download/file.php rename to portfolio/download/file.php index 9ed312b00a..6c1a4b8690 100644 --- a/portfolio/type/download/file.php +++ b/portfolio/download/file.php @@ -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('' . get_string('returntowhereyouwere', 'portfolio') . '
'); -$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. diff --git a/portfolio/type/download/helper.js b/portfolio/download/helper.js similarity index 100% rename from portfolio/type/download/helper.js rename to portfolio/download/helper.js diff --git a/portfolio/type/download/lib.php b/portfolio/download/lib.php similarity index 92% rename from portfolio/type/download/lib.php rename to portfolio/download/lib.php index 3ad63109a7..3959382063 100644 --- a/portfolio/type/download/lib.php +++ b/portfolio/download/lib.php @@ -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'); } } diff --git a/portfolio/type/download/simpletest/testportfolioplugindownload.php b/portfolio/download/simpletest/testportfolioplugindownload.php similarity index 85% rename from portfolio/type/download/simpletest/testportfolioplugindownload.php rename to portfolio/download/simpletest/testportfolioplugindownload.php index 8d3dfc8e52..294fbc4c27 100755 --- a/portfolio/type/download/simpletest/testportfolioplugindownload.php +++ b/portfolio/download/simpletest/testportfolioplugindownload.php @@ -1,13 +1,13 @@ 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); diff --git a/portfolio/type/download/version.php b/portfolio/download/version.php similarity index 100% rename from portfolio/type/download/version.php rename to portfolio/download/version.php diff --git a/portfolio/type/flickr/lib.php b/portfolio/flickr/lib.php similarity index 100% rename from portfolio/type/flickr/lib.php rename to portfolio/flickr/lib.php diff --git a/portfolio/type/flickr/version.php b/portfolio/flickr/version.php similarity index 100% rename from portfolio/type/flickr/version.php rename to portfolio/flickr/version.php diff --git a/portfolio/type/googledocs/db/events.php b/portfolio/googledocs/db/events.php similarity index 71% rename from portfolio/type/googledocs/db/events.php rename to portfolio/googledocs/db/events.php index b6342a7de5..7b76bab2f6 100644 --- a/portfolio/type/googledocs/db/events.php +++ b/portfolio/googledocs/db/events.php @@ -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' ), diff --git a/portfolio/type/googledocs/lib.php b/portfolio/googledocs/lib.php similarity index 100% rename from portfolio/type/googledocs/lib.php rename to portfolio/googledocs/lib.php diff --git a/portfolio/type/googledocs/version.php b/portfolio/googledocs/version.php similarity index 100% rename from portfolio/type/googledocs/version.php rename to portfolio/googledocs/version.php diff --git a/portfolio/type/mahara/db/install.xml b/portfolio/mahara/db/install.xml similarity index 91% rename from portfolio/type/mahara/db/install.xml rename to portfolio/mahara/db/install.xml index 8c576e0da0..48ef556f19 100644 --- a/portfolio/type/mahara/db/install.xml +++ b/portfolio/mahara/db/install.xml @@ -1,5 +1,5 @@ - diff --git a/portfolio/type/mahara/db/upgrade.php b/portfolio/mahara/db/upgrade.php similarity index 100% rename from portfolio/type/mahara/db/upgrade.php rename to portfolio/mahara/db/upgrade.php diff --git a/portfolio/type/mahara/lib.php b/portfolio/mahara/lib.php similarity index 99% rename from portfolio/type/mahara/lib.php rename to portfolio/mahara/lib.php index 8688644e18..5712756630 100644 --- a/portfolio/type/mahara/lib.php +++ b/portfolio/mahara/lib.php @@ -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) { diff --git a/portfolio/type/mahara/preconfig.php b/portfolio/mahara/preconfig.php similarity index 86% rename from portfolio/type/mahara/preconfig.php rename to portfolio/mahara/preconfig.php index 847e9bb44b..3eb8e4d5a6 100644 --- a/portfolio/type/mahara/preconfig.php +++ b/portfolio/mahara/preconfig.php @@ -1,5 +1,5 @@ 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); diff --git a/portfolio/type/mahara/version.php b/portfolio/mahara/version.php similarity index 100% rename from portfolio/type/mahara/version.php rename to portfolio/mahara/version.php diff --git a/portfolio/type/picasa/db/events.php b/portfolio/picasa/db/events.php similarity index 72% rename from portfolio/type/picasa/db/events.php rename to portfolio/picasa/db/events.php index 62845c04b6..6e438e5067 100644 --- a/portfolio/type/picasa/db/events.php +++ b/portfolio/picasa/db/events.php @@ -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' ), diff --git a/portfolio/type/picasa/lib.php b/portfolio/picasa/lib.php similarity index 100% rename from portfolio/type/picasa/lib.php rename to portfolio/picasa/lib.php diff --git a/portfolio/type/picasa/version.php b/portfolio/picasa/version.php similarity index 100% rename from portfolio/type/picasa/version.php rename to portfolio/picasa/version.php