Skip to content

Commit deb3120

Browse files
Marko Vidbergbrentboghosian
Marko Vidberg
authored andcommitted
ELIS-8632 Code changes for migration to local plugin
1 parent 41670af commit deb3120

File tree

246 files changed

+5758
-5707
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+5758
-5707
lines changed

adminlib.php

+3-120
Original file line numberDiff line numberDiff line change
@@ -16,128 +16,11 @@
1616
* You should have received a copy of the GNU General Public License
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*
19-
* @package block_rlip
20-
* @subpackage rlip
19+
* @package local_datahub
2120
* @author Remote-Learner.net Inc
22-
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
23-
* @copyright (C) 2008-2013 Remote Learner.net Inc http://www.remote-learner.net
21+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22+
* @copyright (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
2423
*
2524
*/
2625

2726
defined('MOODLE_INTERNAL') || die();
28-
29-
/**
30-
* custom class that handles the versioning structure for RLIP file plugins
31-
*/
32-
class plugininfo_rlipfile extends plugininfo_base {
33-
34-
/**
35-
* Gathers and returns the information about all plugins of the given type
36-
*
37-
* @param string $type the name of the plugintype, eg. mod, auth or workshopform
38-
* @param string $typerootdir full path to the location of the plugin dir
39-
* @param string $typeclass the name of the actually called class
40-
* @return array of plugintype classes, indexed by the plugin name
41-
*/
42-
static function get_plugins($plugintype, $plugintyperootdir, $plugintypeclass) {
43-
global $CFG, $DB;
44-
45-
// track our method result
46-
$result = array();
47-
if (!$DB->get_manager()->table_exists('config_plugins')) {
48-
return $result;
49-
}
50-
51-
// obtain the list of all file plugins
52-
$fileplugins = get_plugin_list('rlipfile');
53-
54-
foreach ($fileplugins as $pluginname => $pluginpath) {
55-
if ($pluginname == 'phpunit') {
56-
// phpunit directory is a false-positive
57-
continue;
58-
}
59-
60-
// set up the main plugin information
61-
$instance = new $plugintypeclass();
62-
$instance->type = $plugintype;
63-
$instance->typerootdir = $plugintyperootdir;
64-
$instance->name = 'rlipfile_'.$pluginname;
65-
$instance->rootdir = $pluginpath;
66-
$instance->displayname = get_string('pluginname', $instance->name);
67-
68-
// track the current database version
69-
$versiondb = get_config($instance->name, 'version');
70-
$instance->versiondb = ($versiondb !== false) ? $versiondb : NULL;
71-
72-
// track the proposed new version
73-
$plugin = new stdClass;
74-
include("{$instance->rootdir}/version.php");
75-
$instance->versiondisk = $plugin->version;
76-
$instance->init_is_standard(); //is this really needed?
77-
78-
// append to results
79-
$result[$instance->name] = $instance;
80-
}
81-
82-
return $result;
83-
}
84-
}
85-
86-
/**
87-
* custom class that handles the versioning structure for RLIP import plugins
88-
*/
89-
class plugininfo_rlipimport extends plugininfo_base {
90-
91-
/**
92-
* Gathers and returns the information about all plugins of the given type
93-
*
94-
* @param string $type the name of the plugintype, eg. mod, auth or workshopform
95-
* @param string $typerootdir full path to the location of the plugin dir
96-
* @param string $typeclass the name of the actually called class
97-
* @return array of plugintype classes, indexed by the plugin name
98-
*/
99-
static function get_plugins($plugintype, $plugintyperootdir, $plugintypeclass) {
100-
global $CFG, $DB;
101-
102-
// track our method result
103-
$result = array();
104-
if (!$DB->get_manager()->table_exists('config_plugins')) {
105-
return $result;
106-
}
107-
108-
// obtain the list of all file plugins
109-
$fileplugins = get_plugin_list('rlipimport');
110-
111-
foreach ($fileplugins as $pluginname => $pluginpath) {
112-
// error_log("rlipimport::subplugin: {$pluginname}");
113-
if (!file_exists("{$pluginpath}/version.php")) {
114-
// test/sample directories false-positive
115-
continue;
116-
}
117-
118-
// set up the main plugin information
119-
$instance = new $plugintypeclass();
120-
$instance->type = $plugintype;
121-
$instance->typerootdir = $plugintyperootdir;
122-
$instance->name = 'rlipimport_'.$pluginname;
123-
$instance->rootdir = $pluginpath;
124-
$instance->displayname = get_string('pluginname', $instance->name);
125-
126-
// track the current database version
127-
$versiondb = get_config($instance->name, 'version');
128-
$instance->versiondb = ($versiondb !== false) ? $versiondb : NULL;
129-
130-
// track the proposed new version
131-
$plugin = new stdClass;
132-
include("{$instance->rootdir}/version.php");
133-
$instance->versiondisk = $plugin->version;
134-
$instance->init_is_standard(); //is this really needed?
135-
136-
// append to results
137-
$result[$instance->name] = $instance;
138-
}
139-
140-
return $result;
141-
}
142-
}
143-

block_rlip.php

-123
This file was deleted.

classes/plugininfo/dhexport.php

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
/**
3+
* ELIS(TM): Enterprise Learning Intelligence Suite
4+
* Copyright (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* @package local_datahub
20+
* @author Remote-Learner.net Inc
21+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22+
* @copyright (C) 2008-2013 Remote Learner.net Inc (http://www.remote-learner.net)
23+
*
24+
*/
25+
26+
namespace local_datahub\plugininfo;
27+
28+
defined('MOODLE_INTERNAL') || die();
29+
30+
/**
31+
* This class defines dhexport subplugininfo
32+
*/
33+
class dhexport extends \core\plugininfo\base {
34+
/** @var string the plugintype name, eg. mod, auth or workshopform */
35+
public $type = 'local';
36+
/** @var string full path to the location of all the plugins of this type */
37+
public $typerootdir = '/local/datahub/dhexport/';
38+
/** @var string the plugin name, eg. assignment, ldap */
39+
public $name = 'eliscore';
40+
/** @var string the localized plugin name */
41+
public $displayname = 'Datahub export subplugins';
42+
/** @var string the plugin source, one of core_plugin_manager::PLUGIN_SOURCE_xxx constants */
43+
public $source;
44+
/** @var string fullpath to the location of this plugin */
45+
public $rootdir;
46+
/** @var int|string the version of the plugin's source code */
47+
public $versiondisk;
48+
/** @var int|string the version of the installed plugin */
49+
public $versiondb;
50+
/** @var int|float|string required version of Moodle core */
51+
public $versionrequires;
52+
/** @var mixed human-readable release information */
53+
/** @var mixed human-readable release information */
54+
public $release = '2.6.0.0';
55+
/** @var array other plugins that this one depends on, lazy-loaded by {@link get_other_required_plugins()} */
56+
public $dependencies;
57+
/** @var int number of instances of the plugin - not supported yet */
58+
public $instances;
59+
/** @var int order of the plugin among other plugins of the same type - not supported yet */
60+
public $sortorder;
61+
/** @var array|null array of {@link \core\update\info} for this plugin */
62+
public $availableupdates;
63+
}

classes/plugininfo/dhfile.php

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* ELIS(TM): Enterprise Learning Intelligence Suite
4+
* Copyright (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* @package local_datahub
20+
* @author Remote-Learner.net Inc
21+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22+
* @copyright (C) 2008-2013 Remote Learner.net Inc (http://www.remote-learner.net)
23+
*
24+
*/
25+
26+
namespace local_datahub\plugininfo;
27+
28+
defined('MOODLE_INTERNAL') || die();
29+
30+
/**
31+
* This class defines dhfile subplugininfo
32+
*/
33+
class dhfile extends \core\plugininfo\base {
34+
/** @var string the plugintype name, eg. mod, auth or workshopform */
35+
public $type = 'local';
36+
/** @var string full path to the location of all the plugins of this type */
37+
public $typerootdir = '/local/datahub/dhfile/';
38+
/** @var string the plugin name, eg. assignment, ldap */
39+
public $name = 'dhfile';
40+
/** @var string the localized plugin name */
41+
public $displayname = 'Datahub file subplugins';
42+
/** @var string the plugin source, one of core_plugin_manager::PLUGIN_SOURCE_xxx constants */
43+
public $source;
44+
/** @var string fullpath to the location of this plugin */
45+
public $rootdir;
46+
/** @var int|string the version of the plugin's source code */
47+
public $versiondisk;
48+
/** @var int|string the version of the installed plugin */
49+
public $versiondb;
50+
/** @var int|float|string required version of Moodle core */
51+
public $versionrequires;
52+
/** @var mixed human-readable release information */
53+
public $release = '2.6.0.0';
54+
/** @var array other plugins that this one depends on, lazy-loaded by {@link get_other_required_plugins()} */
55+
public $dependencies;
56+
/** @var int number of instances of the plugin - not supported yet */
57+
public $instances;
58+
/** @var int order of the plugin among other plugins of the same type - not supported yet */
59+
public $sortorder;
60+
/** @var array|null array of {@link \core\update\info} for this plugin */
61+
public $availableupdates;
62+
}

0 commit comments

Comments
 (0)