function redirectInfo($url, $title, $info = "") { if (!$url || !AnwUtils::isSafeUrl($url)) { $url = AnwUtils::link(self::globalCfgHomePage()); } $this->title = $title; $this->headJsOnload("setTimeout(function(){window.location.href='" . AnwUtils::escapeApostrophe($url) . "';},2000);"); //render head $this->renderHeadForOutput(); $this->out = $this->tpl()->globalBodyRedirectInfo($url, $title, $info); $this->out = $this->tpl()->globalHtml(self::g_("local_html_lang", array(), self::getActionLang()), self::g_("local_html_dir", array(), self::getActionLang()), $this->title, $this->head, $this->out); $this->printOutput(); }
/** * Render all instances of a multiple contentfield. */ function doRenderEditInputs($oContentField, $amValues, $sSuffix) { //special case for _renderedAsMultiple if ($oContentField instanceof AnwStructuredContentField_renderedAsMultiple) { //same code as multiplicity_single if ($oContentField instanceof AnwStructuredContentField_composed) { $sSuffix = $oContentField->updateSuffix($sSuffix); //update suffix } $HTML = $oContentField->getRenderedEditInput($amValues, $sSuffix, 0); return $HTML; } $sDivId = "instance_" . $oContentField->getInputName($sSuffix); $sContentFieldName = $oContentField->getName(); $sInstancesClass = "instance_" . $oContentField->getInputName($sSuffix); $sIsSortable = $this->isSortable() ? 'true' : 'false'; $JS = <<<EOF new AnwContentFieldMultiple('{$sInstancesClass}', {$this->nMin}, {$this->nMax}, \$('{$sDivId}'), '{$sSuffix}', '{$sContentFieldName}', {$sIsSortable}); EOF; $sHtmlRenderedInstances = ""; foreach ($amValues as $i => $sValue) { $sHtmlRenderedInstances .= $oContentField->renderEditInputN($sSuffix, $sValue, $i); } $HTML = ""; if (!$oContentField->isCollapsedChild()) { $sFieldName = AnwUtils::escapeApostrophe($oContentField->getName()); $sTranslationAddButton = AnwComponent::g_editcontent("contentmultiplicity_multiple_contentfield_add", array('fieldname' => $oContentField->getFieldLabelSingle())); $HTML .= <<<EOF <div class="contentfield_multiple"> \t<div id="{$sDivId}" class="contentfield_multiple_instances"> \t\t{$sHtmlRenderedInstances} \t</div> \t<a class="contentmultiplicity_add" href="#" onclick="AnwContentFieldMultiple.get('{$sInstancesClass}').addInstance(); return false;">{$sTranslationAddButton}</a> </div> <!-- end contentfield_multiple --> <script type="text/javascript">{$JS}</script> EOF; } else { $HTML = $sHtmlRenderedInstances; } return $HTML; }
static function escapeQuoteApostrophe($sString) { return AnwUtils::xQuote(AnwUtils::escapeApostrophe($sString)); }