Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 23... Línea 23...
23
 * @category   output
23
 * @category   output
24
 * @copyright  2024 David Woloszyn <david.woloszyn@moodle.com>
24
 * @copyright  2024 David Woloszyn <david.woloszyn@moodle.com>
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 */
26
 */
27
class theme_usage {
27
class theme_usage {
28
 
-
 
29
    /** @var string The theme usage type for users. */
28
    /** @var string The theme usage type for users. */
30
    public const THEME_USAGE_TYPE_USER = 'user';
29
    public const THEME_USAGE_TYPE_USER = 'user';
Línea 31... Línea 30...
31
 
30
 
32
    /** @var string The theme usage type for courses. */
31
    /** @var string The theme usage type for courses. */
Línea 59... Línea 58...
59
        global $DB;
58
        global $DB;
60
        $cache = \cache::make('core', 'theme_usedincontext');
59
        $cache = \cache::make('core', 'theme_usedincontext');
61
        $isused = $cache->get($themename);
60
        $isused = $cache->get($themename);
Línea 62... Línea 61...
62
 
61
 
63
        if ($isused === false) {
-
 
64
 
62
        if ($isused === false) {
Línea 65... Línea 63...
65
            $sqlunions = [];
63
            $sqlunions = [];
66
 
64
 
67
            // For each context, check if the config is enabled and there is at least one use.
65
            // For each context, check if the config is enabled and there is at least one use.
Línea 117... Línea 115...
117
            }
115
            }
Línea 118... Línea 116...
118
 
116
 
119
            // Cache the result so we don't have to keep checking for this theme.
117
            // Cache the result so we don't have to keep checking for this theme.
120
            $cache->set($themename, $isused);
118
            $cache->set($themename, $isused);
121
            return $isused;
-
 
122
 
119
            return $isused;
123
        } else {
120
        } else {
124
            return $isused;
121
            return $isused;
125
        }
122
        }
126
    }
123
    }