Ejemplo n.º 1
0
function getProfilPackages($mds, $profil, $block)
{
    setMickaLog("mds={$mds}, profil={$profil}, package={$block}", 'DEBUG', 'micka_lib.getProfilPackages');
    //echo "getProfilPackages(mds=$mds, profil=$profil, package=$block)";
    $rs = array();
    $rs['profil'] = -1;
    $rs['package'] = -1;
    $yes_profil = FALSE;
    switch ($mds) {
        case 0:
            if ($profil > 0 && $profil < 100) {
                $yes_profil = TRUE;
            }
        case 10:
            if ($mds == 10 && $profil < 100) {
                $profil = $profil + 100;
            }
            if ($mds == 10 && $profil > 100) {
                $yes_profil = TRUE;
            }
            $packages = getMdPackages(MICKA_LANG, $mds, $profil);
            if (count($packages) > 0 && $block > -1) {
                if ($yes_profil === TRUE) {
                    $rs['profil'] = $profil;
                    $rs['package'] = $block;
                } else {
                    $rs['package'] = $block;
                }
            } else {
                $rs['profil'] = $profil;
            }
            break;
    }
    return $rs;
}
Ejemplo n.º 2
0
    $recordTitle = $template->label_sd;
} elseif ($ak == 'edit') {
    //$template->form_public = $form_public;
    $template->publisher = $record['publisher'];
    $template->saver = $record['saver'];
    $template->edit_group = $record['data']['md']['EDIT_GROUP'];
    $template->view_group = $record['data']['md']['VIEW_GROUP'];
    $template->groups = getMsGroups('get_groups', $record['data']['md']['EDIT_GROUP'] . '|' . $record['data']['md']['VIEW_GROUP']);
    $template->hierarchy = isset($record['hierarchy']) ? $record['hierarchy'] : '';
    $template->mds = $record['data']['md']['MD_STANDARD'];
    $template->recno = $record['data']['md']['RECNO'];
    $template->uuid = $record['data']['md']['UUID'];
    $template->dataType = $record['data']['md']['DATA_TYPE'];
    $template->MdDataTypes = getMdDataType($template->label);
    $template->formData = isset($record['data']['md_values']) ? $record['data']['md_values'] : '';
    $template->keywordsDataUri = $record['data']['keywords_uri'];
    $template->formEnd = isset($record['data']['md_values_end']) ? $record['data']['md_values_end'] : '';
    $template->profils = getMdProfils(MICKA_LANG, $record['data']['md']['MD_STANDARD']);
    $template->packages = getMdPackages(MICKA_LANG, $record['data']['md']['MD_STANDARD'], $record['data']['profil']);
    $template->selectProfil = $record['data']['profil'];
    $template->langs = $record['data']['md']['LANG'];
    $template->selectPackage = isset($record['data']['package']) && $record['data']['package'] > -1 ? $record['data']['package'] : 1;
    $template->title = $record['data']['md']['TITLE'];
    $template->titleProfil = getLabelProfil($record['data']['profil']);
    //$template->control = '';
    $template->mdControl = $record['data']['md']['MD_STANDARD'] == 0 || ($record['data']['md']['MD_STANDARD'] = 10) ? mdControl($record['data']['md']['PXML']) : array();
    $recordTitle = $record['data']['md']['TITLE'];
}
$template->pageTitle = mainPageTitle($template->navigation, $recordTitle);
dibi::disconnect();
$template->render();