Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 174... Línea 174...
174
    public function uninstall_cleanup() {
174
    public function uninstall_cleanup() {
175
        global $DB, $CFG;
175
        global $DB, $CFG;
Línea 176... Línea 176...
176
 
176
 
177
        if ($block = $DB->get_record('block', array('name'=>$this->name))) {
177
        if ($block = $DB->get_record('block', array('name'=>$this->name))) {
178
            // Inform block it's about to be deleted.
-
 
179
            if (file_exists("$CFG->dirroot/blocks/$block->name/block_$block->name.php")) {
178
            // Inform block it's about to be deleted.
180
                $blockobject = block_instance($block->name);
179
            $blockobject = block_instance($block->name);
181
                if ($blockobject) {
180
            if ($blockobject) {
182
                    $blockobject->before_delete();  // Only if we can create instance, block might have been already removed.
-
 
183
                }
181
                $blockobject->before_delete();  // Only if we can create instance, block might have been already removed.
Línea 184... Línea 182...
184
            }
182
            }
185
 
183
 
186
            // First delete instances and related contexts.
184
            // First delete instances and related contexts.