-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.php
38 lines (33 loc) · 1.25 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
*
* @package mahara
* @subpackage artefact-cloud
* @author Gregor Anzelj
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2012-2017 Gregor Anzelj, info@povsod.com
*
*/
define('INTERNAL', true);
define('MENUITEM', 'content/clouds');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'cloud');
define('SECTION_PAGE', 'index');
require_once(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('clouds', 'artefact.cloud'));
safe_require('artefact', 'cloud');
global $USER;
$data = array();
$clouds = ArtefactTypeCloud::get_user_services($USER->get('id'));
foreach ($clouds as $cloud) {
// Usually this file should exist (but if it happens to be deleted, don't try opening it)...
if (file_exists(get_config('docroot') . 'artefact/cloud/blocktype/' . $cloud->title . '/lib.php')) {
require_once('blocktype/' . $cloud->title . '/lib.php');
$data[] = call_static_method(generate_class_name('blocktype', $cloud->title), 'service_list');
}
}
$smarty = smarty();
setpageicon($smarty, 'icon icon-cloud');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('data', $data);
$smarty->display('artefact:cloud:index.tpl');