public static function get_definition_actions(context $context, array $definition) {
        if (has_capability('moodle/site:config', $context)) {
            $actions = array();
            // Edit mappings.
            $actions[] = array(
                'text' => get_string('editmappings', 'cache'),
                'url' => new moodle_url('/cache/admin.php', array('action' => 'editdefinitionmapping', 'sesskey' => sesskey()))
            );
            // Edit sharing.
            if (count($definition['sharingoptions']) > 1) {
                $actions[] = array(
                    'text' => get_string('editsharing', 'cache'),
                    'url' => new moodle_url('/cache/admin.php', array('action' => 'editdefinitionsharing', 'sesskey' => sesskey()))
                );
            }
            // Purge.
            $actions[] = array(
                'text' => get_string('purge', 'cache'),
                'url' => new moodle_url('/cache/admin.php', array('action' => 'purgedefinition', 'sesskey' => sesskey()))
            );
            return $actions;
        }
        return array();
    }