Пример #1
0
        if (!is_string($long_desc)) {
            $long_desc = "";
        }
        $content->setVariable("VALUE_DSC", h($long_desc));
    }
}
if (isset($values['access'])) {
    $access_default = (int) $values['access'];
} else {
    if (!isset($unit)) {
        $access_default = PERMISSION_PUBLIC;
    } else {
        $access_default = $unit->get_access_scheme();
    }
}
$access = units_homework::get_access_descriptions($owner);
if (is_array($access)) {
    $content->setCurrentBlock("BLOCK_ACCESS");
    $content->setVariable("LABEL_ACCESS", gettext("Access rights"));
    $content->setVariable("LABEL_ACCESS_INFO", gettext("Here you can decide who may have what kind of access to the document pool and its material. You have the following options:"));
    foreach ($access as $key => $array) {
        if ($key != PERMISSION_UNDEFINED || $access_default == PERMISSION_UNDEFINED) {
            $content->setCurrentBlock("ACCESS");
            $content->setVariable("LABEL", $array["summary_short"] . ": " . $array["label"]);
            $content->setVariable("VALUE", $key);
            if ($key == $access_default) {
                $content->setVariable("CHECK", "checked=\"checked\"");
            }
            $content->parse("ACCESS");
        }
    }