예제 #1
0
 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     $image = new CImg('map.php?noedit=1&sysmapid=' . $this->screenitem['resourceid'] . '&width=' . $this->screenitem['width'] . '&height=' . $this->screenitem['height'] . '&curtime=' . time());
     $image->setAttribute('id', 'map_' . $this->screenitem['screenitemid']);
     if ($this->mode == SCREEN_MODE_PREVIEW) {
         $sysmap = API::Map()->get(array('sysmapids' => $this->screenitem['resourceid'], 'output' => API_OUTPUT_EXTEND, 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'expandUrls' => true, 'nopermissions' => true, 'preservekeys' => true));
         $sysmap = reset($sysmap);
         $image->setSrc($image->getAttribute('src') . '&severity_min=' . $sysmap['severity_min']);
         $actionMap = getActionMapBySysmap($sysmap, array('severity_min' => $sysmap['severity_min']));
         $image->setMap($actionMap->getName());
         $output = array($actionMap, $image);
     } elseif ($this->mode == SCREEN_MODE_EDIT) {
         $output = array($image, BR(), new CLink(_('Change'), $this->action));
     } else {
         $output = array($image);
     }
     $this->insertFlickerfreeJs();
     $div = new CDiv($output, 'map-container flickerfreescreen', $this->getScreenId());
     $div->setAttribute('data-timestamp', $this->timestamp);
     $div->addStyle('position: relative;');
     return $div;
 }