getTypeName() static public method

static public getTypeName ( $nb )
示例#1
0
 /**
  *  @see CommonGLPI::getMenuContent()
  *
  *   @since version 0.85
  **/
 static function getMenuContent()
 {
     global $CFG_GLPI;
     $menu = array();
     if (static::canView()) {
         $menu['title'] = _x('setup', 'General');
         $menu['page'] = '/front/config.form.php';
         $menu['options']['apiclient']['title'] = APIClient::getTypeName(Session::getPluralNumber());
         $menu['options']['apiclient']['page'] = '/front/config.form.php?forcetab=Config$8';
         $menu['options']['apiclient']['links']['search'] = '/front/config.form.php?forcetab=Config$8';
         $menu['options']['apiclient']['links']['add'] = '/front/apiclient.form.php';
     }
     if (count($menu)) {
         return $menu;
     }
     return false;
 }
示例#2
0
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include "../inc/includes.php";
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$client = new APIClient();
if (isset($_POST["add"])) {
    $client->check(-1, CREATE, $_POST);
    $client->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $client->check($_POST["id"], UPDATE);
        $client->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["purge"])) {
            $client->check($_POST["id"], PURGE);
            $client->delete($_POST);
            Html::redirect($CFG_GLPI["root_doc"] . "/front/config.form.php");
        } else {
            Html::header(APIClient::getTypeName(1), $_SERVER['PHP_SELF'], "config", "config", "apiclient");
            $client->display(array('id' => $_GET["id"]));
            Html::footer();
        }
    }
}