/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { // Load the modal behavior script. JHtml::_('behavior.modal', 'a.modal'); // Build the script. $script = array(); $script[] = ' function onArrowsSelect(data){'; $script[] = ' UniteAdmin.onArrowsChange(data);'; $script[] = ' SqueezeBox.close();'; $script[] = ' }'; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Setup variables for display. $html = array(); $link = 'index.php?option=' . GlobalsUniteHCar::COMPONENT_NAME . '&view=slider&layout=arrows&tmpl=component&settingid=' . $this->id; $buttonType = $this->value; $arrArrowSet = HelperUniteHCar::getArrowSet($buttonType); $arrowName = $arrArrowSet["name"]; $html[] = '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . $this->value . '" />'; $buttonID = $this->id . "-btn"; $desc = UniteFunctionsHCar::getVal($this->element, "description"); // The the arrow $imageArrow = $arrArrowSet["url_right"]; $html[] = '<span class="chooser-image-wrapper"><img id="' . $this->id . '-img" title="' . $arrowName . '" src="' . $imageArrow . '"></span>'; //put select button $html[] = ' <a id="' . $buttonID . '" class="modal button-secondary button-chooser" href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 900, y: 450}}">Change</a>'; $html = implode("\n", $html); return $html; }
/** * * put arrows css */ private function putCss_arrows() { $params = $this->params; $showArrows = $params->get("show_arrows", "true") == "true" ? true : false; if ($showArrows == false) { return false; } $arrowType = $params->get("arrow_type"); $arrowSet = HelperUniteHCar::getArrowSet($arrowType); $hasHover = $arrowSet["has_hover"]; $arrowWidth = $arrowSet["options"]["width"]; $arrowHeight = $arrowSet["options"]["height"]; $arrowsPaddingSide = $params->get("arrows_padding_sides", 5); $verticalTuning = $params->get("arrows_vertical_tuning", 0); $imageLeft = $arrowSet["url_left"]; $imageRight = $arrowSet["url_right"]; $posLeft = -$arrowWidth - $arrowsPaddingSide; $posRight = $posLeft; $posVertCenter = floor(($this->height - $arrowHeight) / 2); $posVertCenter += $verticalTuning; ?> #left_arrow_<?php echo $this->sliderJSID; ?> { width:<?php echo $arrowWidth; ?> px; height:<?php echo $arrowHeight; ?> px; background:url('<?php echo $imageLeft; ?> '); border:none; display:block; position:absolute; left:<?php echo $posLeft; ?> px; top:<?php echo $posVertCenter; ?> px; z-index:1000; } #right_arrow_<?php echo $this->sliderJSID; ?> { width:<?php echo $arrowWidth; ?> px; height:<?php echo $arrowHeight; ?> px; background:url('<?php echo $imageRight; ?> '); display:block; border:none; position:absolute; top:<?php echo $posVertCenter; ?> px; right:<?php echo $posRight; ?> px; z-index:1001; } <?php if ($hasHover == true) { ?> #left_arrow_<?php echo $this->sliderJSID; ?> :hover{ background:url('<?php echo $arrowSet["url_left_hover"]; ?> '); } #right_arrow_<?php echo $this->sliderJSID; ?> :hover{ background:url('<?php echo $arrowSet["url_right_hover"]; ?> '); } <?php } }