Example #1
0
function MenuAdmin()
{
    $def = -1;
    if (isset($_REQUEST['UID'])) {
        $def = 0;
    }
    if (isset($_REQUEST['action'])) {
        switch ($_REQUEST['action']) {
            case 'user_mgt':
                $def = 0;
                break;
            case 'dossier_mgt':
                $def = 1;
                break;
            case 'modele_mgt':
                $def = 2;
                break;
            case 'audit_log':
                $def = 4;
                break;
            case 'restore':
                $def = 3;
                break;
        }
    }
    if (!defined("MULTI") || defined("MULTI") && MULTI == 1) {
        $item = array(array("admin_repo.php?action=user_mgt", _("Utilisateurs"), _('Gestion des utilisateurs'), 0), array("admin_repo.php?action=dossier_mgt", _("Dossiers"), _('Gestion des dossiers'), 1), array("admin_repo.php?action=modele_mgt", _("Modèles"), _('Gestion des modèles'), 2), array("admin_repo.php?action=restore", _("Restaure"), _("Restaure une base de données"), 3), array("admin_repo.php?action=audit_log", _("Audit"), _("Utilisateurs qui se sont connectés"), 4), array("login.php", _("Accueil")));
    } else {
        $item = array(array("admin_repo.php?action=user_mgt", _("Utilisateurs"), _('Gestion des utilisateurs'), 0), array("admin_repo.php?action=audit_log", _("Audit"), _("Utilisateurs qui se sont connectés"), 4), array("login.php", _("Accueil")));
    }
    $menu = ShowItem($item, 'H', "mtitle", "mtitle", $def, ' style="width:80%;margin-left:10%" ');
    return $menu;
}
 function Show()
 {
     $metadata_guid = $this->guid();
     $metadata_vers = $this->vers();
     $created = $this->created();
     $metadata_name = $this->name();
     $metadata_value = $this->value();
     $metadata_type = $this->type();
     echo "<table align=center cellpadding=2 cellspacing=2 border=1>\n";
     ShowItem("GUID", "{$metadata_guid}/{$metadata_vers}");
     ShowItem("Name", $metadata_name);
     if (ISADMIN() && isset($metadata_type)) {
         ShowItem("Type", $metadata_type);
     }
     ShowItem("Created", $created);
     if (!is_null($this->template)) {
         $template_guid = $template->guid();
         $template_vers = $template->vers();
         ShowItem("Template", MakeLink("template", "guid={$template_guid}&version={$template_vers}", "{$template_guid}/{$template_vers}"));
     }
     if ($this->parent_guid()) {
         $parent_guid = $this->parent_guid();
         $parent_vers = $this->parent_vers();
         ShowItem("Parent Version", MakeLink("metadata", "action=show&guid={$parent_guid}" . "&version={$parent_vers}", "{$parent_guid}/{$parent_vers}"));
     }
     echo "<tr>\n                  <td align=center colspan=2>\n                   Metadata Value\n                  </td>\n              </tr>\n              <tr>\n                  <td colspan=2 align=center class=left>\n                      <textarea readonly\n                        rows=10 cols=80>" . str_replace("\r", "", $metadata_value) . "</textarea>\n                  </td>\n              </tr>\n";
     echo "</table>\n";
 }