|
16 | 16 | * You should have received a copy of the GNU General Public License
|
17 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18 | 18 | *
|
19 |
| - * @package block_rlip |
20 |
| - * @subpackage rlip |
| 19 | + * @package local_datahub |
21 | 20 | * @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) |
24 | 23 | *
|
25 | 24 | */
|
26 | 25 |
|
27 | 26 | 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 |
| - |
0 commit comments