Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Content bank class
-
 
19
 *
-
 
20
 * @package    core_contentbank
-
 
21
 * @copyright  2020 Amaia Anabitarte <amaia@moodle.com>
-
 
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
23
 */
-
 
24
 
16
 
Línea 25... Línea 17...
25
namespace core_contentbank;
17
namespace core_contentbank;
26
 
18
 
27
use core_plugin_manager;
19
use core_plugin_manager;
Línea 244... Línea 236...
244
 
236
 
245
        $categories = $categoriescache->get($userid);
237
        $categories = $categoriescache->get($userid);
Línea 246... Línea 238...
246
        $courses = $coursescache->get($userid);
238
        $courses = $coursescache->get($userid);
-
 
239
 
-
 
240
        if ($categories === false || $courses === false) {
-
 
241
            // Required fields for preloading the context record.
247
 
242
            $contextfields = 'ctxid, ctxpath, ctxdepth, ctxlevel, ctxinstance, ctxlocked';
248
        if ($categories === false || $courses === false) {
243
 
249
            list($categories, $courses) = get_user_capability_contexts($capability, true, $userid, true,
244
            list($categories, $courses) = get_user_capability_contexts($capability, true, $userid, true,
250
                'fullname, ctxlevel, ctxinstance, ctxid', 'name, ctxlevel, ctxinstance, ctxid', 'fullname', 'name');
245
                "fullname, {$contextfields}", "name, {$contextfields}", 'fullname', 'name');
251
            $categoriescache->set($userid, $categories);
246
            $categoriescache->set($userid, $categories);
Línea 252... Línea 247...
252
            $coursescache->set($userid, $courses);
247
            $coursescache->set($userid, $courses);