Skip to content

Commit

Permalink
portfolio: MDL-20892 moved portfolio/type/* plugins to portfolio/*
Browse files Browse the repository at this point in the history
  • Loading branch information
Penny Leach committed Nov 18, 2009
1 parent cc2e5b1 commit edf1fc3
Show file tree
Hide file tree
Showing 30 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions admin/mnet/adminlib.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion admin/settings/plugins.php
Expand Up @@ -178,7 +178,7 @@
$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',
Expand Down
2 changes: 1 addition & 1 deletion lib/moodlelib.php
Expand Up @@ -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');

Expand Down
4 changes: 2 additions & 2 deletions lib/portfolio/exporter.php
Expand Up @@ -134,7 +134,7 @@ public function __construct(&$instance, &$caller, $callerfile) {
$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;
Expand Down Expand Up @@ -169,7 +169,7 @@ public function set($field, &$value) {
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;
Expand Down
2 changes: 1 addition & 1 deletion lib/portfolio/plugin.php
Expand Up @@ -462,7 +462,7 @@ public static function create_instance($plugin, $name, $config) {
}
}
$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);
Expand Down
4 changes: 2 additions & 2 deletions lib/portfoliolib.php
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/simpletest/getstringperformancetester.php
Expand Up @@ -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')
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/simpletest/portfolio_testclass.php
Expand Up @@ -178,9 +178,9 @@ public function get_filesize() {


// 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'));
}

Expand Down Expand Up @@ -231,7 +231,7 @@ protected function setup_caller($class, $callbackargs, $user=null) {

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
Expand Down
2 changes: 1 addition & 1 deletion mnet/xmlrpc/server.php
Expand Up @@ -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;
Expand Down
File renamed without changes.
@@ -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;

Expand Down
File renamed without changes.
Expand Up @@ -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');
Expand All @@ -15,7 +15,7 @@
$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();
Expand All @@ -24,7 +24,7 @@
$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.
Expand Down
File renamed without changes.
Expand Up @@ -32,7 +32,7 @@ public function prepare_package() {
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');
}
}

Expand Down
@@ -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);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -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'
),
Expand Down
File renamed without changes.
File renamed without changes.
@@ -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"
>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion portfolio/type/mahara/lib.php → portfolio/mahara/lib.php
Expand Up @@ -234,7 +234,7 @@ public function steal_control($stage) {
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) {
Expand Down
@@ -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');
Expand All @@ -18,7 +18,7 @@
$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);
Expand Down
File renamed without changes.
Expand Up @@ -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'
),
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit edf1fc3

Please sign in to comment.