Moodle  2.2.1
http://www.collinsharper.com
lesson_page_type_manager Class Reference

Public Member Functions

 load_lesson_types (lesson $lesson)
 get_page_type_strings ($type=null, $special=true)
 get_page_type_idstring ($id)
 load_page ($pageid, lesson $lesson)
 load_all_pages (lesson $lesson)
 get_page_form ($type, $arguments)
 get_add_page_type_links ($previd)

Static Public Member Functions

static get (lesson $lesson)

Protected Attributes

 $types = array()

Detailed Description

A management class for page types

This class is responsible for managing the different pages. A manager object can be retrieved by calling the following line of code: $manager = lesson_page_type_manager::get($lesson); The first time the page type manager is retrieved the it includes all of the different page types located in mod/lesson/pagetypes.

Definition at line 2586 of file locallib.php.


Member Function Documentation

static get ( lesson lesson) [static]

Retrieves the lesson page type manager object

If the object hasn't yet been created it is created here.

lesson_page_type_manager $pagetypemanager

Parameters:
lesson$lesson
Returns:
lesson_page_type_manager

Definition at line 2603 of file locallib.php.

Here is the caller graph for this function:

get_add_page_type_links ( previd)

Returns an array of links to use as add page links

Parameters:
int$previdThe id of the previous page
Returns:
array

Definition at line 2750 of file locallib.php.

get_page_form ( type,
arguments 
)

Fetches an mform that can be used to create/edit an page

Parameters:
int$typeThe id for the page type
array$argumentsAny arguments to pass to the mform
Returns:
lesson_add_page_form_base

Definition at line 2734 of file locallib.php.

Here is the call graph for this function:

Returns the basic string used to identify a page type provided with an id

This string can be used to instantiate or identify the page type class. If the page type id is unknown then 'unknown' is returned

Parameters:
int$id
Returns:
string

Definition at line 2660 of file locallib.php.

get_page_type_strings ( type = null,
special = true 
)

Returns an array of strings to describe the loaded page types

Parameters:
int$typeCan be used to return JUST the string for the requested type
Returns:
array

Definition at line 2641 of file locallib.php.

load_all_pages ( lesson lesson)

This function loads ALL pages that belong to the lesson.

Parameters:
lesson$lesson
Returns:
array An array of lesson_page_type_*

Definition at line 2696 of file locallib.php.

Here is the call graph for this function:

load_lesson_types ( lesson lesson)

Finds and loads all lesson page types in mod/lesson/pagetypes

Parameters:
lesson$lesson

Definition at line 2617 of file locallib.php.

load_page ( pageid,
lesson lesson 
)

Loads a page for the provided lesson given it's id

This function loads a page from the lesson when given both the lesson it belongs to as well as the page's id. If the page doesn't exist an error is thrown

Parameters:
int$pageidThe id of the page to load
lesson$lessonThe lesson the page belongs to
Returns:
lesson_page A class that extends lesson_page

Definition at line 2680 of file locallib.php.

Here is the call graph for this function:


Field Documentation

$types = array() [protected]

Definition at line 2592 of file locallib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations