static public openArrowMassives ( $formname, $fixed = false, $ontop = false, $onright = false ) | ||
$formname | string | |
$fixed | boolean used tab_cadre_fixe in both tables (false by default) | |
$ontop | display on top of the list (false by default) | |
$onright | display on right of the list (false by default) \deprecated since 0.84 |
static function openArrowMassives($formname, $fixed = false, $ontop = false, $onright = false)
{
global $CFG_GLPI;
if ($fixed) {
echo "<table class='tab_glpi' width='950px'>";
} else {
echo "<table class='tab_glpi' width='80%'>";
}
echo "<tr>";
if (!$onright) {
echo "<td><img src='" . $CFG_GLPI["root_doc"] . "/pics/arrow-left" . ($ontop ? '-top' : '') . ".png'\n alt=''></td>";
} else {
echo "<td class='left' width='80%'></td>";
}
echo "<td class='center' style='white-space:nowrap;'>";
echo "<a onclick= \"if ( markCheckboxes('{$formname}') ) return false;\"\n href='#'>" . __('Check all') . "</a></td>";
echo "<td>/</td>";
echo "<td class='center' style='white-space:nowrap;'>";
echo "<a onclick= \"if ( unMarkCheckboxes('{$formname}') ) return false;\"\n href='#'>" . __('Uncheck all') . "</a></td>";
if ($onright) {
echo "<td><img src='" . $CFG_GLPI["root_doc"] . "/pics/arrow-right" . ($ontop ? '-top' : '') . ".png'\n alt=''>";
} else {
echo "<td class='left' width='80%'>";
}
}
function showForm($target) { global $DB; $rand = mt_rand(); $query = "SELECT *\n FROM `" . $this->getTable() . "`\n ORDER BY `states_id` ASC "; if ($result = $DB->query($query)) { $number = $DB->numrows($result); if ($number != 0) { echo "<div align='center'><form method='post' name='massiveaction_form{$rand}' id='massiveaction_form{$rand}' action=\"{$target}\">"; echo "<table class='tab_cadre_fixe' cellpadding='5'>"; echo "<tr>"; echo "<th></th><th>" . _n('Status', 'Statuses', 2) . "</th>"; echo "</tr>"; while ($ligne = $DB->fetch_array($result)) { $ID = $ligne["id"]; echo "<tr class='tab_bg_1'>"; echo "<td width='10' class='center'>"; echo "<input type='hidden' name='id' value='{$ID}'>"; echo "<input type='checkbox' name='item[{$ID}]' value='1'>"; echo "</td>"; echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>"; echo "</tr>"; } Html::openArrowMassives("massiveaction_form{$rand}", true); Html::closeArrowMassives(array('delete_state' => __('Delete permanently'))); echo "</table>"; Html::closeForm(); echo "</div>"; } } }