Profile::dropdownNoneReadWrite PHP Method

dropdownNoneReadWrite() static public method

Make a select box for a None Read Write choice
static public dropdownNoneReadWrite ( $name, $value, $none = 1, $read = 1, $write = 1 ) : nothing
$name select name
$value preselected value.
$none display none choice ? (default 1)
$read display read choice ? (default 1)
$write display write choice ? (default 1)
return nothing (print out an HTML select box) \deprecated since version 0.84 use dropdownRight instead
    static function dropdownNoneReadWrite($name, $value, $none = 1, $read = 1, $write = 1)
    {
        return self::dropdownRight($name, array('value' => $value, 'nonone' => !$none, 'noread' => !$read, 'nowrite' => !$write));
    }

Usage Example

Exemplo n.º 1
0
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     $profile = new Profile();
     $found_profiles = $profile->find();
     $fields_profile = new self();
     echo "<form name='form' method='post' action='" . $fields_profile->getFormURL() . "'>";
     echo "<div class='spaced' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='2'>" . _n("Profile", "Profiles", 2) . "</th></tr>";
     foreach ($found_profiles as $profile_item) {
         //get right for current profile
         $found = $fields_profile->find("`profiles_id` = '" . $profile_item['id'] . "'\n                         AND `plugin_fields_containers_id` = '" . $item->fields['id'] . "'");
         $first_found = array_shift($found);
         //display right
         echo "<tr>";
         echo "<td>" . $profile_item['name'] . "</td>";
         echo "<td>";
         Profile::dropdownNoneReadWrite("rights[" . $profile_item['id'] . "]", $first_found['right']);
         echo "</td>";
         echo "<tr>";
     }
     echo "<ul>";
     echo "<tr><td class='tab_bg_2 center' colspan='2'>";
     echo "<input type='hidden' name='plugin_fields_containers_id' value='" . $item->fields['id'] . "' />";
     echo "<input type='submit' name='update' value=\"" . _sx("button", "Save") . "\" class='submit'>";
     echo "</td>";
     echo "</tr>";
     echo "</table></div>";
     Html::closeForm();
 }
All Usage Examples Of Profile::dropdownNoneReadWrite