Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 40... Línea 40...
40
    public const MENUEMPTY = 'empty';
40
    public const MENUEMPTY = 'empty';
Línea 41... Línea 41...
41
 
41
 
42
    /** @var string force a null action menu. */
42
    /** @var string force a null action menu. */
Línea -... Línea 43...
-
 
43
    public const MENUNULL = 'null';
-
 
44
 
-
 
45
    /** @var int The itemid to use to simulate disabled component. */
43
    public const MENUNULL = 'null';
46
    public const DISABLEDITEMID = 999;
44
 
47
 
45
    /**
48
    /**
46
     * @var string|null Status to define which action menu to return when calling get_section_action_menu().
49
     * @var string|null Status to define which action menu to return when calling get_section_action_menu().
47
     * Alternatively, different testing classes could be created, but it wasn't worth it for this case.
50
     * Alternatively, different testing classes could be created, but it wasn't worth it for this case.
Línea 112... Línea 115...
112
            case self::MENUNULL:
115
            case self::MENUNULL:
113
            default:
116
            default:
114
                return null;
117
                return null;
115
        }
118
        }
116
    }
119
    }
-
 
120
 
-
 
121
    /**
-
 
122
     * Check if the delegate is enabled.
-
 
123
     *
-
 
124
     * To simulate a disabled component, the itemid is set to DISABLEDITEMID.
-
 
125
     *
-
 
126
     * @return bool
-
 
127
     */
-
 
128
    public function is_enabled(): bool {
-
 
129
        if ($this->sectioninfo->itemid === self::DISABLEDITEMID) {
-
 
130
            return false;
-
 
131
        }
-
 
132
        return true;
-
 
133
    }
117
}
134
}