class CourseObjectSignup in Course 7
Same name and namespace in other branches
- 6 modules/course_signup/course_signup.classes.inc \CourseObjectSignup
- 7.2 modules/course_signup/course_signup.classes.inc \CourseObjectSignup
Hierarchy
- class \Entity implements EntityInterface
- class \CourseHandler
- class \CourseObject
- class \CourseObjectNode
- class \CourseObjectSignup
- class \CourseObjectNode
- class \CourseObject
- class \CourseHandler
Expanded class hierarchy of CourseObjectSignup
1 string reference to 'CourseObjectSignup'
- course_signup_course_handlers in modules/
course_signup/ course_signup.module - Implements hook_course_handlers().
File
- modules/
course_signup/ course_signup.classes.inc, line 3
View source
class CourseObjectSignup extends CourseObjectNode {
/**
* Specify that this object needs a navigation listener.
*/
public function hasPolling() {
return TRUE;
}
public function create($node = NULL) {
if (!$this
->getOption('instance')) {
$this
->setOption('instance', $this
->getCourseNid());
}
}
public function getTakeType() {
return 'content';
}
public function take() {
if ($this
->getFulfillment()
->isComplete()) {
return t("You have been marked attended by an administrator.");
}
else {
return t("You must be marked attended by an administrator.");
}
}
public function optionsForm(&$form, &$form_state) {
parent::optionsForm($form, $form_state);
$form['node']['instance']['#title'] = t('Signup to check');
$form['node']['instance']['#description'] .= ' ' . t('Node must be signup-enabled. Defaults to this course.');
}
/**
* Set a specialized instance ID.
*
* Either the course node ID, or another signup node ID.
*/
public function optionsSubmit(&$form, &$form_state) {
if (isset($form_state['values']['instance'])) {
if (!$form_state['values']['instance']) {
$form_state['values']['instance'] = $this
->getCourseNid();
}
}
parent::optionsSubmit($form, $form_state);
}
public function getReports() {
$reports = parent::getReports();
$reports += array(
'attendance' => array(
'title' => t('Attendance'),
),
);
return $reports;
}
public function getReport($key) {
module_load_include('inc', 'signup', 'includes/node_output');
switch ($key) {
case 'attendance':
return array(
'title' => t('Attendance'),
'content' => t('These are the users who have enrolled in this course object.<br/>You may administer attendance on the !signups tab.', array(
'!signups' => l('Signups', "node/{$this->node->nid}/signups"),
)) . signup_user_list_output($this->node),
);
}
return parent::getReport($key);
}
function getNodeTypes() {
return signup_content_types();
}
function getCloneAbility() {
return t('Attendance objects will be created as a reference to the new course.');
}
function freeze() {
return TRUE;
}
function thaw($ice) {
// Not creating a new signup. Using this course.
return $this
->getCourseNid();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CourseHandler:: |
final public | function | Merge an array of options onto the existing options. | |
CourseHandler:: |
public | function | Get an array of access messages. | |
CourseHandler:: |
protected | function | Return an array of database fields. This determines what fields should be serialized instead of stored. | |
CourseHandler:: |
function | |||
CourseHandler:: |
public | function | Get an handler option's value. | |
CourseHandler:: |
private | function | Merge arrays with replace, not append. | |
CourseHandler:: |
public | function | Set an access message to be displayed along with the course object when it is in the outline. For example, "This activity will open on XYZ" or "Please complete Step 1 to take this activity." | |
CourseHandler:: |
public | function | Set an option for this handler. | |
CourseHandler:: |
final public | function | Set this entire handler's options. | |
CourseObject:: |
protected | property | ||
CourseObject:: |
function |
Builds a structured array representing the entity's content. Overrides Entity:: |
||
CourseObject:: |
function | Get the object component for this course object. | ||
CourseObject:: |
function | Get the object component title for this course object. | ||
CourseObject:: |
function | Get the Course that contains this CourseObject. | ||
CourseObject:: |
function | Get the course node ID this CourseObject belongs to. | ||
CourseObject:: |
public | function | Get the user's fulfillment for this course object. | |
CourseObject:: |
function | Get the instance ID. This could be the external component ID, a Node ID... | ||
CourseObject:: |
public static | function | Return the number of occurances that can be in a course at the same time. For example, the design of the Certificate module can only have 1 set of mappings per node. The same goes for Course Credit. We may also want a course object that can only be… | 2 |
CourseObject:: |
function | Get the module that provides this course object. | ||
CourseObject:: |
public | function |
Get options, with session options, except weight, having precedence. Overrides CourseHandler:: |
|
CourseObject:: |
public | function | Get the user's status in this course object. | 2 |
CourseObject:: |
public | function | Return the URL to the course object router. | |
CourseObject:: |
public | function | ||
CourseObject:: |
public | function | ||
CourseObject:: |
function | Is this object graded? | 2 | |
CourseObject:: |
public | function | Is this course object required for course completion? | |
CourseObject:: |
public | function | If this course object is required, can be it skipped? | |
CourseObject:: |
function | Checks the temporary status of a course object. | ||
CourseObject:: |
private | function | ||
CourseObject:: |
public | function | Override navigation links. | 1 |
CourseObject:: |
public | function | Overrides a course outline list item. | 1 |
CourseObject:: |
function | Give the course object a chance do asynchronous polling and set completion on demand. | ||
CourseObject:: |
public | function | Get all course object implementations of getOptionsSummary(). | |
CourseObject:: |
function | Set the object component for this course object. | ||
CourseObject:: |
public | function | Set the Course for this CourseObject. | |
CourseObject:: |
public | function | Mark this object for deletion. | |
CourseObject:: |
function | Set the internal course object ID. | ||
CourseObject:: |
function | Set the module that provides this course object. | ||
CourseObject:: |
public | function | ||
CourseObject:: |
final public | function | Take a course object. | |
CourseObject:: |
function | Remove any records associated with this course object for the user. | 2 | |
CourseObject:: |
public | function |
Generate URI from course object. Overrides Entity:: |
|
CourseObjectNode:: |
protected | property | ||
CourseObjectNode:: |
function |
Deny access to objects without content. Overrides CourseObject:: |
||
CourseObjectNode:: |
public static | function |
Course context handler callback. Overrides CourseObject:: |
|
CourseObjectNode:: |
public | function |
Destroy the node instance. Overrides CourseObject:: |
|
CourseObjectNode:: |
public | function |
Get the URL to edit this course object, if any. Overrides CourseObject:: |
|
CourseObjectNode:: |
function | |||
CourseObjectNode:: |
public static | function | When passed a node, this method should return the "parent" nodes that are contained in a course outline. | 2 |
CourseObjectNode:: |
function |
Get core options summary. Overrides CourseObject:: |
2 | |
CourseObjectNode:: |
public | function |
Get the URL to take this course object, if any. Overrides CourseObject:: |
1 |
CourseObjectNode:: |
function |
Get the object title, or return this object's node's title if the option
is set. Overrides CourseObject:: |
||
CourseObjectNode:: |
public | function |
Get the URL to view this course object, if any. Overrides CourseObject:: |
|
CourseObjectNode:: |
function |
Show a warning if this object has an instance, but the node does not exist. Overrides CourseHandler:: |
2 | |
CourseObjectNode:: |
function |
Grant access to course content before going to it. Overrides CourseObject:: |
||
CourseObjectNode:: |
public | function | ||
CourseObjectNode:: |
public | function |
Define configuration elements and their defaults. Overrides CourseObject:: |
4 |
CourseObjectNode:: |
public | function |
Validate the options form. Check the node type. Overrides CourseObject:: |
|
CourseObjectNode:: |
function |
Duration expired (or something) - CourseObject is telling us so. Overrides CourseObject:: |
||
CourseObjectNode:: |
function |
On object write, set privacy on this node. Overrides CourseObject:: |
1 | |
CourseObjectNode:: |
function |
When setting our instance ID, also set the node. Overrides CourseObject:: |
||
CourseObjectNode:: |
public | function | Set the node and instance ID (node ID) of this CourseObjectNode. | |
CourseObjectNode:: |
public | function |
Overrides CourseHandler:: |
|
CourseObjectSignup:: |
public | function |
Create a node and set it as this course object's node. Overrides CourseObjectNode:: |
|
CourseObjectSignup:: |
function |
Freeze data to persist over cloning/exporting. Overrides CourseObjectNode:: |
||
CourseObjectSignup:: |
function |
Returns an translated error message if this object has issues with cloning. Overrides CourseObjectNode:: |
||
CourseObjectSignup:: |
function |
Return a list of valid node types. Overrides CourseObjectNode:: |
||
CourseObjectSignup:: |
public | function |
Let the course object provide its own reports. Overrides CourseObject:: |
|
CourseObjectSignup:: |
public | function |
Let the course object provide its own reports. Overrides CourseObject:: |
|
CourseObjectSignup:: |
public | function |
Simple node course object behavior is to just redirect to the node. Overrides CourseObjectNode:: |
|
CourseObjectSignup:: |
public | function |
Specify that this object needs a navigation listener. Overrides CourseObject:: |
|
CourseObjectSignup:: |
public | function |
Default options form for all course objects. Overrides CourseObjectNode:: |
|
CourseObjectSignup:: |
public | function |
Set a specialized instance ID. Overrides CourseObjectNode:: |
|
CourseObjectSignup:: |
public | function |
Overrides CourseObject:: |
|
CourseObjectSignup:: |
function |
Thaw data frozen from an earlier export/clone. Overrides CourseObjectNode:: |
||
Entity:: |
protected | property | 1 | |
Entity:: |
protected | property | ||
Entity:: |
protected | property | ||
Entity:: |
protected | property | ||
Entity:: |
protected | property | ||
Entity:: |
public | function |
Returns the bundle of the entity. Overrides EntityInterface:: |
|
Entity:: |
protected | function | Defines the entity label if the 'entity_class_label' callback is used. | 1 |
Entity:: |
protected | function | Override this in order to implement a custom default URI and specify 'entity_class_uri' as 'uri callback' hook_entity_info(). | |
Entity:: |
public | function |
Returns the info of the type of the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the type of the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Exports the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Gets the raw, translated value of a property or field. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Checks if the entity has a certain exportable status. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the entity identifier, i.e. the entities name or numeric id. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the internal, numeric identifier. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Checks whether the entity is the default revision. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the label of the entity. Overrides EntityInterface:: |
|
Entity:: |
protected | function | Set up the object instance on construction or unserializiation. | |
Entity:: |
public | function |
Generate an array for rendering the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the EntityMetadataWrapper of the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function | Magic method to only serialize what's necessary. | |
Entity:: |
public | function | Magic method to invoke setUp() on unserialization. |