Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 73... Línea 73...
73
    if ($contenttype->can_access()) {
73
    if ($contenttype->can_access()) {
74
        $contenttypes[] = $contenttypename;
74
        $contenttypes[] = $contenttypename;
75
    }
75
    }
76
}
76
}
Línea 77... Línea -...
77
 
-
 
78
$foldercontents = $cb->search_contents($search, $contextid, $contenttypes);
-
 
79
 
77
 
80
// Get the toolbar ready.
78
// Get the toolbar ready.
Línea -... Línea 79...
-
 
79
$toolbar = array ();
-
 
80
 
-
 
81
if (has_capability('moodle/contentbank:viewunlistedcontent', $context)) {
-
 
82
    $display = get_user_preferences('core_contentbank_displayunlisted', 1);
-
 
83
    $toolbar[] = [
-
 
84
        'name' => 'displayunlisted',
-
 
85
        'id' => 'displayunlisted',
-
 
86
        'checkbox' => true,
-
 
87
        'checked' => !empty($display),
-
 
88
        'label' => get_string('displayunlisted', 'contentbank'),
-
 
89
        'class' => 'displayunlisted m-2',
-
 
90
        'action' => 'displayunlisted',
-
 
91
    ];
-
 
92
    $PAGE->requires->js_call_amd(
-
 
93
        'core_contentbank/displayunlisted',
-
 
94
        'init',
-
 
95
        ['[data-action=displayunlisted]']
-
 
96
    );
81
$toolbar = array ();
97
}
82
 
98
 
83
// Place the Add button in the toolbar.
99
// Place the Add button in the toolbar.
84
if (has_capability('moodle/contentbank:useeditor', $context)) {
100
if (has_capability('moodle/contentbank:useeditor', $context)) {
85
    // Get the content types for which the user can use an editor.
101
    // Get the content types for which the user can use an editor.
Línea 127... Línea 143...
127
} else if (!empty($statusmsg) && get_string_manager()->string_exists($statusmsg, 'core_contentbank')) {
143
} else if (!empty($statusmsg) && get_string_manager()->string_exists($statusmsg, 'core_contentbank')) {
128
    $statusmsg = get_string($statusmsg, 'core_contentbank');
144
    $statusmsg = get_string($statusmsg, 'core_contentbank');
129
    echo $OUTPUT->notification($statusmsg, 'notifysuccess');
145
    echo $OUTPUT->notification($statusmsg, 'notifysuccess');
130
}
146
}
Línea -... Línea 147...
-
 
147
 
-
 
148
$foldercontents = $cb->search_contents($search, $contextid, $contenttypes);
131
 
149
 
132
// Render the contentbank contents.
150
// Render the contentbank contents.
133
$folder = new \core_contentbank\output\bankcontent($foldercontents, $toolbar, $context, $cb);
151
$folder = new \core_contentbank\output\bankcontent($foldercontents, $toolbar, $context, $cb);
Línea 134... Línea 152...
134
echo $OUTPUT->render($folder);
152
echo $OUTPUT->render($folder);