| Línea 73... |
Línea 73... |
| 73 |
* @param boolean $short does not apply to block context
|
73 |
* @param boolean $short does not apply to block context
|
| 74 |
* @param boolean $escape does not apply to block context
|
74 |
* @param boolean $escape does not apply to block context
|
| 75 |
* @return string the human readable context name.
|
75 |
* @return string the human readable context name.
|
| 76 |
*/
|
76 |
*/
|
| 77 |
public function get_context_name($withprefix = true, $short = false, $escape = true) {
|
77 |
public function get_context_name($withprefix = true, $short = false, $escape = true) {
|
| 78 |
global $DB, $CFG;
|
78 |
global $DB;
|
| Línea 79... |
Línea 79... |
| 79 |
|
79 |
|
| 80 |
$name = '';
|
80 |
$name = '';
|
| 81 |
if ($blockinstance = $DB->get_record('block_instances', array('id' => $this->_instanceid))) {
|
- |
|
| 82 |
global $CFG;
|
- |
|
| 83 |
require_once("$CFG->dirroot/blocks/moodleblock.class.php");
|
- |
|
| 84 |
require_once("$CFG->dirroot/blocks/$blockinstance->blockname/block_$blockinstance->blockname.php");
|
81 |
if ($blockinstance = $DB->get_record('block_instances', array('id' => $this->_instanceid))) {
|
| 85 |
$blockname = "block_$blockinstance->blockname";
|
82 |
$blockobject = block_instance($blockinstance->blockname);
|
| 86 |
if ($blockobject = new $blockname()) {
|
83 |
if ($blockobject) {
|
| 87 |
if ($withprefix) {
|
84 |
if ($withprefix) {
|
| 88 |
$name = get_string('block').': ';
|
85 |
$name = get_string('block').': ';
|
| 89 |
}
|
86 |
}
|
| 90 |
$name .= $blockobject->title;
|
87 |
$name .= $blockobject->title;
|