abstract class CourseObjectAccess in Course 7
Same name and namespace in other branches
- 6 includes/course.core.inc \CourseObjectAccess
- 7.2 includes/CourseObjectAccess.inc \CourseObjectAccess
Access handler for CourseObjects.
Subtypes must define take(), see(), and view().
Hierarchy
- class \CourseObjectAccess
Expanded class hierarchy of CourseObjectAccess
File
- includes/
CourseObjectAccess.inc, line 8
View source
abstract class CourseObjectAccess {
private $courseObject;
private $type;
public function setType($type) {
$this->type = $type;
}
/**
* Helper method to get possible objects.
*/
public function getObjectOptions() {
$options = array(
'',
);
foreach ($this
->getCourseObject()
->getCourse()
->getObjects() as $courseObject) {
if ($courseObject
->getId() != $this
->getCourseObject()
->getId()) {
$options[$courseObject
->getId()] = $courseObject
->getTitle();
}
}
return $options;
}
public function setCourseObject($courseObject) {
$this->courseObject = $courseObject;
}
public function getCourseObject() {
return $this->courseObject;
}
public abstract function take();
public abstract function see();
public abstract function view();
public function getOptions() {
$plugins = $this
->getCourseObject()
->getOption('plugins');
if (isset($plugins['access'][$this->type])) {
return $plugins['access'][$this->type];
}
else {
return $this
->optionsDefinition();
}
}
public function getOption($option) {
$options = $this
->getOptions();
if (isset($options[$option])) {
return $options[$option];
}
else {
return NULL;
}
}
public function optionsValidate($form, &$form_state) {
}
public function optionsDefinition() {
return array();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CourseObjectAccess:: |
private | property | ||
CourseObjectAccess:: |
private | property | ||
CourseObjectAccess:: |
public | function | ||
CourseObjectAccess:: |
public | function | Helper method to get possible objects. | 1 |
CourseObjectAccess:: |
public | function | ||
CourseObjectAccess:: |
public | function | ||
CourseObjectAccess:: |
public | function | 3 | |
CourseObjectAccess:: |
public | function | 1 | |
CourseObjectAccess:: |
abstract public | function | 3 | |
CourseObjectAccess:: |
public | function | ||
CourseObjectAccess:: |
public | function | ||
CourseObjectAccess:: |
abstract public | function | 3 | |
CourseObjectAccess:: |
abstract public | function | 3 |