A management class for page types.
More...
|
| check_page_order ($page1, $page2) |
| This function detects errors in the ordering between 2 pages and updates the page records.
|
|
|
array | $types = array() |
| An array of different page type classes.
|
|
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.
- Copyright
- 2009 Sam Hemelryk
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ check_page_order()
lesson_page_type_manager::check_page_order |
( |
| $page1, |
|
|
| $page2 ) |
|
protected |
This function detects errors in the ordering between 2 pages and updates the page records.
- Parameters
-
stdClass | $page1 | Either the first of 2 pages or null if the $page2 param is the first in the list. |
stdClass | $page1 | Either the second of 2 pages or null if the $page1 param is the last in the list. |
◆ get()
static lesson_page_type_manager::get |
( |
lesson | $lesson | ) |
|
|
static |
Retrieves the lesson page type manager object.
If the object hasn't yet been created it is created here.
@staticvar lesson_page_type_manager $pagetypemanager
- Parameters
-
- Return values
-
◆ get_add_page_type_links()
lesson_page_type_manager::get_add_page_type_links |
( |
| $previd | ) |
|
Returns an array of links to use as add page links.
- Parameters
-
int | $previd | The id of the previous page |
- Return values
-
◆ get_page_form()
lesson_page_type_manager::get_page_form |
( |
| $type, |
|
|
| $arguments ) |
Fetches an mform that can be used to create/edit an page.
- Parameters
-
int | $type | The id for the page type |
array | $arguments | Any arguments to pass to the mform |
- Return values
-
◆ get_page_type_idstring()
lesson_page_type_manager::get_page_type_idstring |
( |
| $id | ) |
|
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
-
- Return values
-
◆ get_page_type_strings()
lesson_page_type_manager::get_page_type_strings |
( |
| $type = null, |
|
|
| $special = true ) |
Returns an array of strings to describe the loaded page types.
- Parameters
-
int | $type | Can be used to return JUST the string for the requested type |
- Return values
-
◆ load_all_pages()
lesson_page_type_manager::load_all_pages |
( |
lesson | $lesson | ) |
|
This function loads ALL pages that belong to the lesson.
- Parameters
-
- Return values
-
array | An array of lesson_page_type_* |
◆ load_lesson_types()
lesson_page_type_manager::load_lesson_types |
( |
lesson | $lesson | ) |
|
Finds and loads all lesson page types in mod/lesson/pagetypes.
- Parameters
-
◆ load_page()
lesson_page_type_manager::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 | $pageid | The id of the page to load |
lesson | $lesson | The lesson the page belongs to |
- Return values
-
The documentation for this class was generated from the following file: