Html::jsShow PHP Method

jsShow() static public method

Get javascript code for hide an item
static public jsShow ( $id ) : String
$id string id of the dom element
return String
    static function jsShow($id)
    {
        return self::jsGetElementbyID($id) . ".show();\n";
    }

Usage Example

 /**
  * @since version 0.84
  *
  * @warning note the difference between getHTMLTableCellForItem and getHTMLTableCellsForItem
  *
  * @param $row                HTMLTableRow object
  * @param $item               CommonDBTM object (default NULL)
  * @param $father             HTMLTableCell object (default NULL)
  * @param $options   array
  **/
 function getHTMLTableCellForItem(HTMLTableRow $row = NULL, CommonDBTM $item = NULL, HTMLTableCell $father = NULL, array $options = array())
 {
     global $CFG_GLPI;
     $this_type = $this->getType();
     if (isset($options['dont_display'][$this_type])) {
         return $father;
     }
     if (static::canView()) {
         $content = $this->getLink();
     } else {
         $content = $this->getName();
     }
     if ($options['canedit']) {
         $field_name = 'quantity_' . $this->getType() . '_' . $this->getID();
         $content .= "&nbsp;<img title='" . __s('Add') . "' alt='" . __s('Add') . "'\n                      onClick=\"" . Html::jsShow($field_name) . "\"\n                      class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
         $content .= "<span id='{$field_name}' style='display:none'><br>";
         $content .= __('Add') . "&nbsp;";
         $content = array($content, array('function' => 'Dropdown::showInteger', 'parameters' => array($field_name, 0, 0, 10)), "</span>");
     }
     $linktype = static::getItem_DeviceType();
     if (in_array($item->getType(), $linktype::itemAffinity())) {
         $cell = $row->addCell($row->getHeaderByName('common', 'device'), $content, $father, $this);
     } else {
         $cell = $father;
     }
     return $cell;
 }
All Usage Examples Of Html::jsShow
Html