forked from FMCorz/moodle-block_xp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored aiming at filter_manager::course_default_filters_to_course
- Loading branch information
Showing
7 changed files
with
70 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
<?php | ||
|
||
class block_xp_course_filters extends block_xp_filters { | ||
class block_xp_filters_course extends block_xp_filters { | ||
|
||
protected $courseid; | ||
|
||
public function __construct($id) { | ||
$this->$courseid = $id; | ||
$this->courseid = $id; | ||
|
||
parent::__construct(); | ||
} | ||
|
||
public function load() { | ||
throw new coding_exception('not implemented.'); | ||
} | ||
global $DB; | ||
|
||
$records = $DB->get_recordset('block_xp_filters', | ||
array('courseid' => $this->courseid)); | ||
|
||
public function save() { | ||
throw new coding_exception('not implemented.'); | ||
unset($this->filters); | ||
|
||
foreach ($records as $key => $filter_data) { | ||
$filter = $this->create_filter(); | ||
$filter->load($filter_data); | ||
$this->filters[] = $filter; | ||
} | ||
} | ||
|
||
public function create_filter() { | ||
return new block_xp_filter_course($this->courseid); | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters