/**
* Init the Image paste System for tiny mce
*
* @since version 0.85
*
* @param $name name of the html textarea to use
* @param $rand rand of the html textarea to use
*
* @return nothing
**/
static function initImagePasteSystem($name, $rand)
{
global $CFG_GLPI;
echo Html::imagePaste(array('rand' => $rand));
$params = array('name' => $name, 'filename' => self::generateImageName(), 'root_doc' => $CFG_GLPI['root_doc'], 'rand' => $rand, 'showfilesize' => 1, 'lang' => array('pasteimage' => _sx('button', 'Drag and drop or paste image'), 'itemnotfound' => __('Item not found'), 'toolarge' => __('Item is too large'), 'save' => _sx('button', 'Save'), 'cancel' => _sx('button', 'Cancel')));
return html::scriptBlock("if (!tinyMCE.isIE) { // Chrome, Firefox plugin\n tinyMCE.imagePaste = \$(document).imagePaste(" . json_encode($params) . ");\n } else { // IE plugin\n tinyMCE.imagePaste = \$(document).IE_support_imagePaste(" . json_encode($params) . ");\n }\n uploadFile{$rand}();");
}