public function GetEndScript() { $strToReturn = parent::GetEndScript(); if (QDateTime::$Translate) { $strShortNameArray = array(); $strLongNameArray = array(); $strDayArray = array(); $dttMonth = new QDateTime('2000-01-01'); for ($intMonth = 1; $intMonth <= 12; $intMonth++) { $dttMonth->Month = $intMonth; $strShortNameArray[] = '"' . $dttMonth->ToString('MMM') . '"'; $strLongNameArray[] = '"' . $dttMonth->ToString('MMMM') . '"'; } $dttDay = new QDateTime('Sunday'); for ($intDay = 1; $intDay <= 7; $intDay++) { $strDay = $dttDay->ToString('DDD'); $strDay = html_entity_decode($strDay, ENT_COMPAT, QApplication::$EncodingType); if (function_exists('mb_substr')) { $strDay = mb_substr($strDay, 0, 2); } else { // Attempt to account for multibyte day -- may not work if the third character is multibyte $strDay = substr($strDay, 0, strlen($strDay) - 1); } $strDay = QApplication::HtmlEntities($strDay); $strDayArray[] = '"' . $strDay . '"'; $dttDay->Day++; } $strArrays = sprintf('new Array(new Array(%s), new Array(%s), new Array(%s))', implode(', ', $strLongNameArray), implode(', ', $strShortNameArray), implode(', ', $strDayArray)); $strToReturn .= sprintf('qc.regCAL("%s", "%s", "%s", "%s", %s); ', $this->strControlId, $this->dtxLinkedControl->ControlId, QApplication::Translate('Today'), QApplication::Translate('Cancel'), $strArrays); } else { $strToReturn .= sprintf('qc.regCAL("%s", "%s", "%s", "%s", null); ', $this->strControlId, $this->dtxLinkedControl->ControlId, QApplication::Translate('Today'), QApplication::Translate('Cancel')); } return $strToReturn; }
public function GetEndScript() { $strId = $this->ControlId; $strJs = parent::GetEndScript(); $strJs .= ';'; $strJs .= "\$j('#{$strId}').change(function(event) {\n\t\t\tqcubed.setAdditionalPostVar('{$strId}_extra', {txt: \$j(this).val(), 'nullVal': null});\n\t\t\tqcubed.recordControlModification('{$strId}', 'Name', \$j(this).val());\n\t\t\t})"; return $strJs; }
public function GetEndScript() { $strToReturn = parent::GetEndScript(); $strUniqueHash = md5(microtime() . rand(0, 1000000)); if ($this->blnVisible && !$this->strFilePath) { $strToReturn .= sprintf('qc.regFUP("%s", "%s", "%s"); ', $this->strControlId, QApplication::$RequestUri, $strUniqueHash); } return $strToReturn; }
public function GetEndScript() { $strToReturn = parent::GetEndScript(); $strToReturn .= 'qc.regCAL("' . $this->strControlId . '","' . $this->dtxLinkedControl->ControlId . '"); '; return $strToReturn; }
public function GetEndScript() { $str = ''; if ($this->getJqControlId() !== $this->ControlId) { // #845: if the element receiving the jQuery UI events is different than this control // we need to clean-up the previously attached event handlers, so that they are not duplicated // during the next ajax update which replaces this control. $str = sprintf('jQuery("#%s").off(); ', $this->getJqControlId()); } $str .= $this->GetControlJavaScript(); if ($strParentScript = parent::GetEndScript()) { $str .= '; ' . $strParentScript; } return $str; }
public function GetEndScript() { $strToReturn = parent::GetEndScript(); $strControlId = $this->strLinkUrl ? $this->strControlId . '_img' : $this->strControlId; if ($this->blnVisible && $this->mixImageHover) { $strToReturn .= sprintf('$j("#%s").hover(function(){$j("#%s").attr("src", "%s"); }, function(){$j("#%s").attr("src", "%s"); });', $strControlId, $strControlId, $this->mixImageHover instanceof QImageBase ? $this->mixImageHover->RenderAsImgSrc(false) : $this->mixImageHover, $strControlId, $this->mixImageStandard instanceof QImageBase ? $this->mixImageStandard->RenderAsImgSrc(false) : $this->mixImageStandard); } return $strToReturn; }
public function GetEndScript() { $strToReturn = parent::GetEndScript(); // MOVE TARGETS if (count($this->objMovesControlsArray)) { // $strToReturn .= sprintf('qc.registerControlMoveHandle("%s"); ', $this->strControlId); $strToReturn .= sprintf('qc.regCMH("%s"); ', $this->strControlId); foreach ($this->objMovesControlsArray as $objControl) { // $strToReturn .= sprintf('qc.getWrapper("%s").registerMoveTarget("%s"); ', $this->strControlId, $objControl->ControlId); $strToReturn .= sprintf('qc.getW("%s").regMT("%s"); ', $this->strControlId, $objControl->ControlId); } } // DROP ZONES foreach ($this->objDropsControlsArray as $strKey => $blnIsDropZone) { if ($blnIsDropZone) { // $strToReturn .= sprintf('qc.getWrapper("%s").registerDropZone("%s"); ', $this->strControlId, $strKey); $strToReturn .= sprintf('qc.getW("%s").regDZ("%s"); ', $this->strControlId, $strKey); } } foreach ($this->objIsDropZoneFor as $strKey => $blnIsDropZone) { if ($blnIsDropZone) { $objControl = $this->objForm->GetControl($strKey); if ($objControl && $objControl->strRenderMethod) { // $strToReturn .= sprintf('qc.registerControlMoveHandle("%s"); qc.getWrapper("%s").registerDropZone("%s"); ', $strKey, $strKey, $this->strControlId); $strToReturn .= sprintf('qc.regCMH("%s"); qc.getW("%s").regDZ("%s"); ', $strKey, $strKey, $this->strControlId); } } } foreach ($this->objDropsGroupingsArray as $strKey => $blnIsDropZone) { if ($blnIsDropZone) { $strToReturn .= sprintf('qc.getW("%s").regDZG("%s");', $this->strControlId, $strKey); } } // ResizeHandle // regCRH is a shortcut for registerControlResizeHandle // setUC = setUpperControl // setLC = setLowerControl if ($this->strResizeHandleDirection == QResizeHandleDirection::Vertical || $this->strResizeHandleDirection == QResizeHandleDirection::Horizontal) { if ($this->strResizeHandleDirection == QResizeHandleDirection::Vertical) { $strToReturn .= sprintf('qc.regCRH("%s", true);', $this->strControlId); } else { $strToReturn .= sprintf('qc.regCRH("%s", false);', $this->strControlId); } foreach ($this->objUpperResizeControlsArray as $objBlockControl) { $strToReturn .= sprintf('qc.getW("%s").setUC("%s");', $this->strControlId, $objBlockControl->strControlId); } foreach ($this->objLowerResizeControlsArray as $objBlockControl) { $strToReturn .= sprintf('qc.getW("%s").setLC("%s");', $this->strControlId, $objBlockControl->strControlId); } if (!is_null($this->intResizeHandleMinimum)) { $strToReturn .= sprintf('qc.getW("%s").setReMi("%s");', $this->strControlId, $this->intResizeHandleMinimum); } else { $strToReturn .= sprintf('qc.getW("%s").setReMi(null);', $this->strControlId); } if (!is_null($this->intResizeHandleMaximum)) { $strToReturn .= sprintf('qc.getW("%s").setReMa("%s");', $this->strControlId, $this->intResizeHandleMaximum); } else { $strToReturn .= sprintf('qc.getW("%s").setReMa(null);', $this->strControlId); } } return $strToReturn; }
/** * @return string */ public function GetEndScript() { \QApplication::ExecuteControlCommand($this->ControlId, 'on', 'click', 'li', new \QJsClosure("qcubed.recordControlModification ('{$this->ControlId}', 'SelectedId', this.id); jQuery(this).trigger ('bsmenubarselect', this.id)"), \QJsPriority::High); return parent::GetEndScript(); }
/** * Returns the End Script of the Control which is sent to the client when the control's Render is complete * @return string The JS EndScript for the control */ public function GetEndScript() { $strToReturn = parent::GetEndScript(); // DROP ZONES foreach ($this->objDropsControlsArray as $strKey => $blnIsDropZone) { if ($blnIsDropZone) { $strToReturn .= sprintf('$j("#%s").droppable(); ', $strKey); } } foreach ($this->objIsDropZoneFor as $strKey => $blnIsDropZone) { if ($blnIsDropZone) { $objControl = $this->objForm->GetControl($strKey); if ($objControl && $objControl->strRenderMethod) { $strToReturn .= sprintf('$j("#%s").droppable("option", "accept", "#%s");', $this->strControlId, $strKey); } } } return $strToReturn; }
/** * Returns the script that attaches the JQueryUI widget to the html object. * * @return string */ public function GetEndScript() { $strId = $this->GetJqControlId(); $jqOptions = $this->makeJqOptions(); $strFunc = $this->getJqSetupFunction(); if ($strId !== $this->ControlId && QApplication::$RequestMode == QRequestMode::Ajax) { // If events are not attached to the actual object being drawn, then the old events will not get // deleted during redraw. We delete the old events here. This must happen before any other event processing code. QApplication::ExecuteControlCommand($strId, 'off', QJsPriority::High); } // Attach the javascript widget to the html object if (empty($jqOptions)) { QApplication::ExecuteControlCommand($strId, $strFunc, QJsPriority::High); } else { QApplication::ExecuteControlCommand($strId, $strFunc, $jqOptions, QJsPriority::High); } return parent::GetEndScript(); }
/** * Returns the End Script of the Control which is sent to the client when the control's Render is complete * @return string The JS EndScript for the control */ public function GetEndScript() { $strToReturn = parent::GetEndScript(); // DROP ZONES foreach ($this->objDropsControlsArray as $strKey => $blnIsDropZone) { if ($blnIsDropZone) { QApplication::ExecuteControlCommand($strKey, 'droppable'); } } foreach ($this->objIsDropZoneFor as $strKey => $blnIsDropZone) { if ($blnIsDropZone) { $objControl = $this->objForm->GetControl($strKey); if ($objControl && $objControl->strRenderMethod) { QApplication::ExecuteControlCommand($this->strControlId, 'droppable', 'option', 'accept', '#' . $strKey); } } } return $strToReturn; }
/** * Returns all Javscript that needs to be executed after rendering of this control * (It overrides the GetEndScript of the parent to handle specific case of QJsTimers) * @return string */ public function GetEndScript() { if ($this->objForm->CallType == QCallType::Server) { //this point is not reached on initial rendering if ($this->blnRestartOnServerAction && $this->intState === QJsTimer::Started) { $this->Start(); } else { $this->intState = QJsTimer::Stopped; } } return parent::GetEndScript(); }
public function GetEndScript() { $strToReturn = parent::GetEndScript(); if ($this->blnVisible && $this->mixImageHover) { $strToReturn .= sprintf('qc.regIR("%s", "%s", "%s", %s); ', $this->strControlId, $this->mixImageStandard instanceof QImageBase ? $this->mixImageStandard->RenderAsImgSrc(false) : $this->mixImageStandard, $this->mixImageHover instanceof QImageBase ? $this->mixImageHover->RenderAsImgSrc(false) : $this->mixImageHover, $this->strLinkUrl ? 'true' : 'false'); } return $strToReturn; }
public function GetEndScript() { $strToReturn = parent::GetEndScript(); $strToReturn .= sprintf('qc.registerTextBox("%s"); ', $this->strControlId); return $strToReturn; }