Add about to disable sources and make sure each source is set

semantics-font
Svein-Tore Griff With 2015-04-13 19:58:41 +02:00
parent 868c06929d
commit 0b609e882d
1 changed files with 7 additions and 4 deletions

View File

@ -2351,18 +2351,21 @@ class H5PCore {
*/ */
public static function getDisable(&$sources) { public static function getDisable(&$sources) {
$disable = H5PCore::DISABLE_NONE; $disable = H5PCore::DISABLE_NONE;
if (!$sources['frame']) { if (!isset($sources['frame']) || !$sources['frame']) {
$disable |= H5PCore::DISABLE_FRAME; $disable |= H5PCore::DISABLE_FRAME;
} }
if (!$sources['download']) { if (!isset($sources['download']) || !$sources['download']) {
$disable |= H5PCore::DISABLE_DOWNLOAD; $disable |= H5PCore::DISABLE_DOWNLOAD;
} }
if (!$sources['copyright']) { if (!isset($sources['copyright']) || !$sources['copyright']) {
$disable |= H5PCore::DISABLE_COPYRIGHT; $disable |= H5PCore::DISABLE_COPYRIGHT;
} }
if (!$sources['embed']) { if (!isset($sources['embed']) || !$sources['embed']) {
$disable |= H5PCore::DISABLE_EMBED; $disable |= H5PCore::DISABLE_EMBED;
} }
if (!isset($sources['about']) || !$sources['about']) {
$disable |= H5PCore::DISABLE_ABOUT;
}
return $disable; return $disable;
} }