public static function sendConfirmationNotificationBe(\DataContainer $objDc)
 {
     if (($objSubmission = static::findByPk($objDc->id)) !== null) {
         static::sendConfirmationNotification($objSubmission->id);
         \Message::addConfirmation($GLOBALS['TL_LANG']['MSC']['confirmationNotificationSent']);
         \Controller::redirect(Url::addQueryString('id=' . $objSubmission->pid, Url::removeQueryString(array('key'))));
     }
 }
 public function sendConfirmation($row, $href, $label, $title, $icon, $attributes)
 {
     if (($objSubmission = \HeimrichHannot\Submissions\SubmissionModel::findByPk($row['id'])) !== null) {
         if (($objSubmissionArchive = $objSubmission->getRelated('pid')) !== null && $objSubmissionArchive->nc_confirmation) {
             $href = $this->addToUrl($href);
             $href = \HeimrichHannot\Haste\Util\Url::addQueryString('id=' . $row['id'], $href);
             return '<a href="' . $href . '" title="' . specialchars($title) . '"' . $attributes . '>' . \Image::getHtml($icon, $label) . '</a> ';
         }
     }
 }
 /**
  * Generate a link to the relation submission form page
  *
  * @param \PageModel $objPage
  * @param \Model     $objEntity
  * @param array      $arrRelation
  *
  * @return string The url to the relation submission page
  */
 public function getRelationLink(\PageModel $objPage, \Model $objEntity, array $arrRelation)
 {
     $objPage = \PageModel::findWithDetails($objPage->id);
     $strParam = $arrRelation['request_parameter'] ?: $arrRelation['submissionField'];
     if (\Config::get('useAutoItem') && $arrRelation['useAutoItem']) {
         $varPath = !\Config::get('disableAlias') ? '/' : '/' . $strParam . '/';
         $varValue = !\Config::get('disableAlias') && $objEntity->alias ? $objEntity->alias : $objEntity->id;
         return \Controller::generateFrontendUrl($objPage->row(), $varPath . $varValue, $objPage->language, true);
     }
     $strQuery = $strParam . '=' . (!\Config::get('disableAlias') && $objEntity->alias ? $objEntity->alias : $objEntity->id);
     return Url::addQueryString($strQuery, \Controller::generateFrontendUrl($objPage->row(), null, $objPage->language, true));
 }
 protected function linkToPage($intPage)
 {
     $strUrl = ampersand($this->strUrl);
     if ($intPage <= 1 && !$this->blnForceParam) {
         if ($this->intRandomSeed) {
             $strUrl = Url::addQueryString(FormHybridList::PARAM_RANDOM . '=' . $this->intRandomSeed, $strUrl);
         }
         return $strUrl;
     } else {
         $strUrl = Url::addQueryString($this->strParameter . '=' . $intPage, $strUrl);
         if ($this->intRandomSeed) {
             $strUrl = Url::addQueryString(FormHybridList::PARAM_RANDOM . '=' . $this->intRandomSeed, $strUrl);
         }
         return $strUrl;
     }
 }
 public function generate(array $arrOptions = array())
 {
     $this->arrOptions = array_merge($this->arrOptions, $arrOptions);
     $arrData = $this->getData($this->arrOptions);
     if (!$arrOptions['dlh_googlemap_nocss']) {
         \delahaye\googlemaps\Googlemap::CssInjection();
     }
     $this->arrOptions['staticMap'] = $this->generateStatic($this->arrOptions);
     $objTemplate = new \FrontendTemplate($this->arrOptions['dlh_googlemap_template']);
     if (!isset($GLOBALS['TL_JAVASCRIPT']['googlemaps'])) {
         $strUrl = '//maps.google.com/maps/api/js';
         $strUrl = Url::addQueryString('language=' . $this->arrOptions['language'], $strUrl);
         global $objPage;
         if (($objRootPage = \PageModel::findPublishedById($objPage->rootId)) !== null && $objRootPage->dlh_googlemaps_apikey) {
             $strUrl = Url::addQueryString('key=' . $objRootPage->dlh_googlemaps_apikey, $strUrl);
         }
         $GLOBALS['TL_JAVASCRIPT']['googlemaps'] = $strUrl;
     }
     $objTemplate->map = $arrData;
     $objTemplate->tabs = $arrData['dlh_googlemap_tabs'];
     $objTemplate->labels = $GLOBALS['TL_LANG']['dlh_googlemaps']['labels'];
     return $objTemplate->parse();
 }
 public function getYoutubeSrc()
 {
     if (!$this->init()) {
         return '';
     }
     $strUrl = $this->getConfigData('youtubePrivacy') ? static::$privacyEmbedSrc : static::$defaultEmbedSrc;
     $strUrl .= $this->youtube;
     $strUrl = \HeimrichHannot\Haste\Util\Url::addQueryString('rel=' . ($this->ytShowRelated ? 1 : 0), $strUrl);
     $strUrl = \HeimrichHannot\Haste\Util\Url::addQueryString('modestbranding=' . ($this->ytModestBranding ? 1 : 0), $strUrl);
     $strUrl = \HeimrichHannot\Haste\Util\Url::addQueryString('showinfo=' . ($this->ytShowInfo ? 1 : 0), $strUrl);
     if ($this->autoplay || $this->getConfigData('autoplay')) {
         $strUrl = \HeimrichHannot\Haste\Util\Url::addQueryString('autoplay=1', $strUrl);
     }
     return $strUrl;
 }
 protected function redirectAfterSubmission()
 {
     global $objPage;
     $blnRedirect = false;
     $strUrl = \Controller::generateFrontendUrl($objPage->row());
     if (($objTarget = \PageModel::findByPk($this->jumpTo)) !== null) {
         $blnRedirect = true;
         $strUrl = \Controller::generateFrontendUrl($objTarget->row(), null, null, true);
     }
     $arrPreserveParams = trimsplit(',', $this->jumpToPreserveParams);
     foreach ($arrPreserveParams as $strParam) {
         $varValue = \Input::get($strParam);
         if ($varValue === null) {
             continue;
         }
         switch ($strParam) {
             case 'token':
                 if ($this->deactivateTokens) {
                     break;
                 }
                 $strUrl = Url::addQueryString($strParam . '=' . \RequestToken::get(), $strUrl);
                 break;
             default:
                 $strUrl = Url::addQueryString($strParam . '=' . $varValue, $strUrl);
         }
     }
     if ($blnRedirect) {
         \HeimrichHannot\StatusMessages\StatusMessage::reset($this->objModule->id);
     }
     if ($this->async) {
         if ($blnRedirect) {
             $objResponse = new ResponseRedirect();
             $objResponse->setUrl($strUrl);
             $objResponse->output();
         }
         return;
     }
     if (!$blnRedirect) {
         if ($this->getReset()) {
             $this->reset(true);
         }
         return;
     }
     \Controller::redirect($strUrl);
 }
 public function addItemColumns($objItem, &$arrItem)
 {
     parent::addItemColumns($objItem, $arrItem);
     global $objPage;
     // edit
     if ($this->addEditCol) {
         $arrItem['addEditCol'] = true;
         $strUrl = $this->addAjaxPagination ? Url::getCurrentUrlWithoutParameters() : Url::getUrl();
         if (($objPageJumpTo = \PageModel::findByPk($this->jumpToEdit)) !== null && $this->jumpToEdit != $objPage->id) {
             $strUrl = \Controller::generateFrontendUrl($objPageJumpTo->row(), null, null, true);
         }
         $arrItem['editUrl'] = Url::addQueryString($this->formHybridIdGetParameter . '=' . $objItem->id . (!$this->deactivateTokens ? '&token=' . \RequestToken::get() : ''), $strUrl);
     }
     // delete url
     if ($this->addDeleteCol) {
         $arrItem['addDeleteCol'] = true;
         $arrItem['deleteUrl'] = Url::addQueryString($this->formHybridIdGetParameter . '=' . $objItem->id . '&act=delete' . (!$this->deactivateTokens ? '&token=' . \RequestToken::get() : ''), $this->addAjaxPagination ? Url::getCurrentUrlWithoutParameters() : Url::getUrl());
     }
     // publish url
     if ($this->addPublishCol) {
         $arrItem['addPublishCol'] = true;
         $arrItem['publishUrl'] = Url::addQueryString($this->formHybridIdGetParameter . '=' . $objItem->id . '&act=publish' . (!$this->deactivateTokens ? '&token=' . \RequestToken::get() : ''), $this->addAjaxPagination ? Url::getCurrentUrlWithoutParameters() : Url::getUrl());
     }
 }
 public function addShareColumn($objItem, &$arrItem)
 {
     global $objPage;
     if (($objPageJumpTo = \PageModel::findByPk($this->jumpToShare)) !== null || ($objPageJumpTo = $objPage)) {
         $strShareUrl = \Environment::get('url') . '/' . \Controller::generateFrontendUrl($objPageJumpTo->row());
         $strUrl = Url::addQueryString('act=share', Url::getCurrentUrlWithoutParameters());
         $strUrl = Url::addQueryString('url=' . urlencode($strShareUrl), $strUrl);
         $strUrl = Url::addQueryString($this->formHybridIdGetParameter . '=' . $objItem->id, $strUrl);
         $arrItem['shareUrl'] = $strUrl;
     }
 }