Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 222... Línea 222...
222
    public static function update($tagcoll, $data) {
222
    public static function update($tagcoll, $data) {
223
        global $DB;
223
        global $DB;
224
        $defaulttagcollid = self::get_default();
224
        $defaulttagcollid = self::get_default();
225
        $allowedfields = array('name', 'searchable', 'customurl');
225
        $allowedfields = array('name', 'searchable', 'customurl');
226
        if ($tagcoll->id == $defaulttagcollid) {
226
        if ($tagcoll->id == $defaulttagcollid) {
227
            $allowedfields = array('name');
227
            $allowedfields = array('name', 'searchable');
228
        }
228
        }
Línea 229... Línea 229...
229
 
229
 
230
        $updatedata = array();
230
        $updatedata = array();
231
        $data = (array)$data;
231
        $data = (array)$data;
Línea 357... Línea 357...
357
            $search = '', $fromctx = 0, $ctx = 0, $rec = 1) {
357
            $search = '', $fromctx = 0, $ctx = 0, $rec = 1) {
358
        global $DB;
358
        global $DB;
Línea 359... Línea 359...
359
 
359
 
360
        $fromclause = 'FROM {tag_instance} ti JOIN {tag} tg ON tg.id = ti.tagid';
360
        $fromclause = 'FROM {tag_instance} ti JOIN {tag} tg ON tg.id = ti.tagid';
-
 
361
        $whereclause = 'WHERE ti.itemtype <> \'tag\'';
361
        $whereclause = 'WHERE ti.itemtype <> \'tag\'';
362
 
362
        list($sql, $params) = $DB->get_in_or_equal($tagcollid ? array($tagcollid) :
363
        // Get tags from all searchable tag collections, if $tagcollid is specifid, limit only to this collection.
-
 
364
        $tagcollids = array_keys(self::get_collections(true));
-
 
365
        if ($tagcollid) {
-
 
366
            $tagcollids = array_intersect($tagcollids, [$tagcollid]);
-
 
367
        }
363
            array_keys(self::get_collections(true)));
368
        list($sql, $params) = $DB->get_in_or_equal($tagcollids, SQL_PARAMS_QM, 'param', true, -1);
-
 
369
        $whereclause .= ' AND tg.tagcollid ' . $sql;
364
        $whereclause .= ' AND tg.tagcollid ' . $sql;
370
 
365
        if ($isstandard) {
371
        if ($isstandard) {
366
            $whereclause .= ' AND tg.isstandard = 1';
372
            $whereclause .= ' AND tg.isstandard = 1';
367
        }
373
        }
368
        $context = $ctx ? context::instance_by_id($ctx) : context_system::instance();
374
        $context = $ctx ? context::instance_by_id($ctx) : context_system::instance();