Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 141... Línea 141...
141
 
141
 
Línea 142... Línea 142...
142
    $status = [];
142
    $status = [];
143
 
143
 
144
    if (!empty($data->reset_book_tags)) {
144
    if (!empty($data->reset_book_tags)) {
145
        // Loop through the books and remove the tags from the chapters.
145
        // Loop through the books and remove the tags from the chapters.
146
        if ($books = $DB->get_records('book', array('course' => $data->courseid))) {
146
        if ($books = $DB->get_records('book', ['course' => $data->courseid])) {
147
            foreach ($books as $book) {
147
            foreach ($books as $book) {
148
                if (!$cm = get_coursemodule_from_instance('book', $book->id)) {
148
                if (!$cm = get_coursemodule_from_instance('book', $book->id)) {
Línea 149... Línea 149...
149
                    continue;
149
                    continue;
150
                }
150
                }
151
 
151
 
152
                $context = context_module::instance($cm->id);
152
                $context = context_module::instance($cm->id);
Línea 153... Línea -...
153
                core_tag_tag::delete_instances('mod_book', null, $context->id);
-
 
154
            }
153
                core_tag_tag::delete_instances('mod_book', null, $context->id);
155
        }
154
            }
156
 
155
        }
157
 
156
 
158
        $status[] = [
157
        $status[] = [
159
            'component' => get_string('modulenameplural', 'book'),
158
            'component' => get_string('modulenameplural', 'book'),
Línea 160... Línea 159...
160
            'item' => get_string('tagsdeleted', 'book'),
159
            'item' => get_string('removeallbooktags', 'book'),
161
            'error' => false
160
            'error' => false,
Línea 170... Línea 169...
170
 *
169
 *
171
 * @param MoodleQuickForm $mform
170
 * @param MoodleQuickForm $mform
172
 */
171
 */
173
function book_reset_course_form_definition(&$mform) {
172
function book_reset_course_form_definition(&$mform) {
174
    $mform->addElement('header', 'bookheader', get_string('modulenameplural', 'book'));
173
    $mform->addElement('header', 'bookheader', get_string('modulenameplural', 'book'));
-
 
174
    $mform->addElement('static', 'bookdelete', get_string('delete'));
175
    $mform->addElement('checkbox', 'reset_book_tags', get_string('removeallbooktags', 'book'));
175
    $mform->addElement('checkbox', 'reset_book_tags', get_string('removeallbooktags', 'book'));
176
}
176
}
Línea 177... Línea 177...
177
 
177
 
178
/**
178
/**
Línea 697... Línea 697...
697
/**
697
/**
698
 * Get icon mapping for font-awesome.
698
 * Get icon mapping for font-awesome.
699
 */
699
 */
700
function mod_book_get_fontawesome_icon_map() {
700
function mod_book_get_fontawesome_icon_map() {
701
    return [
701
    return [
702
        'mod_book:chapter' => 'fa-bookmark-o',
-
 
703
        'mod_book:nav_prev' => 'fa-arrow-left',
-
 
704
        'mod_book:nav_sep' => 'fa-minus',
-
 
705
        'mod_book:add' => 'fa-plus',
702
        'mod_book:add' => 'fa-plus',
706
        'mod_book:nav_next' => 'fa-arrow-right',
703
        'mod_book:chapter' => 'fa-book-bookmark',
707
        'mod_book:nav_exit' => 'fa-arrow-up',
-
 
708
    ];
704
    ];
709
}
705
}
Línea 710... Línea 706...
710
 
706
 
711
/**
707
/**