This repository has been archived by the owner on Jul 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderable.php
115 lines (88 loc) · 3.23 KB
/
renderable.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
defined('MOODLE_INTERNAL') || die();
class gallery_view_gallery implements renderable {
public $gallery;
public $edit;
public $coursemodule;
public $images;
public $canadd;
public $canedit;
public $caneditown;
public $candelete;
public $candeleteown;
public $candownload;
public $currentuser;
public function __construct(gallery $gallery, array $images, $coursemodule, $edit = 0, $canadd = 0, $canedit = 0, $caneditown = 0, $candelete = 0, $candeleteown = 0, $candownload = 0,$currentuser = 0) {
$this->gallery = $gallery;
$this->edit = $edit;
$this->coursemodule = $coursemodule;
$this->images = $images;
$this->canadd = $canadd;
$this->canedit = $canedit;
$this->caneditown = $caneditown;
$this->candelete = $candelete;
$this->candeleteown = $candeleteown;
$this->currentuser = $currentuser;
$this->candownload = $candownload;
}
}
class gallery_header implements renderable {
public $heading;
public $subpage;
public $context;
public function __construct($heading, $context, $subpage = 0) {
$this->heading = $heading;
$this->subpage = $subpage;
$this->context = $context;
}
}
class gallery_image_preview implements renderable {
public $image;
public $thumbnails;
public $context;
public $edit;
public $coursemodule;
public $user;
public $showoriginalimage;
public $showthumbstitles;
public $previewheight;
public $canedit;
public $caneditown;
public $candelete;
public $candeleteown;
public $currentuser;
public function __construct($image, $thumbnails, $coursemodule, $context, $showoriginalimage, $showthumbstitles, $previewheight, $edit = 0, $canedit = 0, $caneditown = 0, $candelete = 0, $candeleteown = 0, $currentuser = 0) {
global $DB;
$this->image = $image;
$this->thumbnails = $thumbnails;
$this->context = $context;
$this->edit = $edit;
$this->coursemodule = $coursemodule;
$this->canedit = $canedit;
$this->caneditown = $caneditown;
$this->candelete = $candelete;
$this->candeleteown = $candeleteown;
$this->currentuser = $currentuser;
$this->showoriginalimage = $showoriginalimage;
$this->showthumbstitles = $showthumbstitles;
$this->previewheight = $previewheight;
if($image->data()->sourcetype == GALLERY_IMAGE_SOURCE_OWN)
$this->user = $DB->get_record('user',array('id'=>$image->data()->sourceuser));
}
}
class gallery_form implements renderable {
public $form = null;
public $classname = '';
public $jsinitfunction = '';
public function __construct($classname, moodleform $form, $jsinitfunction = '') {
$this->classname = $classname;
$this->form = $form;
$this->jsinitfunction = $jsinitfunction;
}
}
class gallery_no_permission implements renderable {
public $cm;
public function __construct($cm) {
$this->cm = $cm;
}
}