protected function getInput() { jimport('joomla.filesystem.folder'); $bar = JToolBar::getInstance('toolbar_image'); $bar->addButtonPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'toolbar'); /* @var $bar JToolBar */ $bar->appendButton('Popup', 'new1', 'Add', ARoute::view(VIEW_IMAGES, null, null, array('tmpl' => 'component', 'type' => '1')), 800, 600); $bar->appendButton('ALink', 'delete', 'Delete', 'javascript:AImages.removeMain()', 'imageMainRemove'); $html[] = $bar->render(); $thumb = AImage::thumb(BookProHelper::getIPath($this->image), null, ADMIN_SET_IMAGES_WIDTH); $html[] = '<img src="' . $thumb . '" alt="" id="imageMainSource" class="thumb' . $thumb ? '' : ' blind' . '" />'; if (!$thumb) { $html[] = ADocument::addDomreadyEvent('AImages.hideRemoveMain()'); } $html[] = '<input type="hidden" name="image" id="imageMainHidden" value="' . $this->escape($this->image) . '" />'; return implode("\n", $html); }
/** * Set reservation box params as javascript object * * @param BookingBox $box */ function setBoxParams(&$box, $i, $useId2 = false) { $document =& JFactory::getDocument(); /* @var $document JDocument */ $vars = get_object_vars($box); $id = $vars['id'] = $useId2 ? $vars['id2'] : $vars['id']; unset($vars['id2']); foreach ($vars as $param => $value) { $boxes[] = $param . ' : "' . addslashes($value) . '"'; } $document->addScriptDeclaration('Calendars.boxes[' . $i++ . '] = {' . implode(', ', $boxes) . '}'); ADocument::addDomreadyEvent("\$('" . $id . "').addEvent('click',function(){Calendars.setCheckBox(\"" . $id . "\");});"); ADocument::addDomreadyEvent("\$('" . $id . "').addEvent('mouseover',function(){Calendars.highlightInterval(\"" . $id . "\");});"); ADocument::addDomreadyEvent("\$('" . $id . "').addEvent('mouseout',function(){Calendars.unhighlightInterval(\"" . $id . "\");});"); }