Exemplo n.º 1
0
 public function prepare($name = "", $value = NULL)
 {
     try {
         switch ($name) {
             case "url":
                 $pageItem = LBoxConfigManagerStructure::getInstance()->getPageById(LBoxConfigManagerProperties::gpcn($this->configVarNameArticleRefPage));
                 return LBoxUtil::getURLWithParams(array($this->instance->getParamDirect("url")), $pageItem->url);
                 break;
             case "url_param":
                 return $this->instance->getParamDirect("url");
                 break;
             case "urlAbsolute":
                 return LBOX_REQUEST_URL_SCHEME . "://" . LBOX_REQUEST_URL_HOST . $this->prepare("url");
                 break;
             case "headingEntities":
                 return htmlentities($this->prepare("heading"));
                 break;
             case "publishedDate":
                 return date("j.n. Y", $this->instance->time_published);
                 break;
             case "published2":
                 return date("j.n.Y | H:i:s", $this->instance->time_published);
                 break;
             case "perex_raw":
                 return strip_tags($this->instance->perex);
                 break;
             default:
                 return parent::prepare($name, $value);
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 2
0
 /**
  * Vrati kompletni logout URL
  * @return string
  * @throws Exception
  */
 public function getURLLogout()
 {
     try {
         return LBoxUtil::getURLWithParams(array("logout-dbfree"), LBoxUtil::getURLWithoutParams(array("logout-dbfree")));
     } catch (Exception $e) {
         throw $e;
     }
 }
 public function process()
 {
     try {
         LBoxFront::reload(LBoxUtil::getURLWithParams(array("edit-" . $this->form->getName())));
     } catch (Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 4
0
 /**
  * Vrati kompletni logout URL
  * @return string
  * @throws Exception
  */
 public function getURLLogout()
 {
     try {
         return LBoxUtil::getURLWithParams(array(LBoxFront::getURLParamNameLogout()), LBoxUtil::getURLWithoutParams(array(LBoxFront::getURLParamNameLogout())));
     } catch (Exception $e) {
         throw $e;
     }
 }
 public function process()
 {
     try {
         $pid = $this->form->getControlByName("pid")->getValue();
         LBoxFront::reload(LBoxUtil::getURLWithParams(array("replyto-{$pid}"), LBoxUtil::getURLWithoutParamsByPattern(array("/" . $this->patternURLParamReplyTo . "/"))) . "#frm-discussion-{$pid}-post");
     } catch (Exception $e) {
         throw $e;
     }
 }
 public function process()
 {
     try {
         if (count($this->patternPropertyNames) < 1) {
             throw new LBoxExceptionFormProcessor(LBoxExceptionFormProcessor::MSG_INSTANCE_VAR_ARRAY_NOTNULL, LBoxExceptionFormProcessor::CODE_BAD_INSTANCE_VAR);
         }
         if (count($this->patternPropertyNames) < 2) {
             $patternDefault = LBoxConfigManagerProperties::gpcn(current($this->patternPropertyNames));
         }
         $patternPCRES = array();
         foreach ($this->patternPropertyNames as $patternPropertyName) {
             $patternPCRES[] = "/" . str_ireplace("<url_param>", "([\\w-_\\.\\/\\\\ěščřžýáíéůúřťňĚďŠČŘŽÝÁÍÉŮÚŘŤĎŇ]+)", LBoxConfigManagerProperties::gpcn($patternPropertyName)) . "/";
         }
         $reloadParams = array();
         foreach ($this->form->getControls() as $control) {
             if (count($this->patternPropertyNames) > 1 && !array_key_exists($control->getName(), $this->patternPropertyNames)) {
                 continue;
             }
             $pattern = "";
             $pattern = $patternDefault ? $patternDefault : LBoxConfigManagerProperties::gpcn($this->patternPropertyNames[$control->getName()]);
             switch (true) {
                 case $control instanceof LBoxFormControlMultiple:
                 case $control instanceof LBoxFormControlSpamDefense:
                     continue;
                     break;
                 default:
                     if ($control->getValue() && strlen(trim($control->getValue())) > 0) {
                         $reloadParams[] = str_replace("<url_param>", $control->getValue(), $pattern);
                     }
             }
         }
         if (count($reloadParams) > 0) {
             LBoxFront::reload(LBoxUtil::getURLWithParams($reloadParams, LBoxUtil::getURLWithoutParamsByPattern($patternPCRES)));
         } else {
             LBoxFront::reload(LBoxUtil::getURLWithoutParamsByPattern($patternPCRES));
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 7
0
 public function getParamDirect($name = "")
 {
     try {
         if (strlen($this->params[$name]) < 1) {
             $value = NULL;
             switch ($name) {
                 case "url":
                     $URLParamPattern = LBoxConfigSystem::getInstance()->getParamByPath("paging/url_param_pattern");
                     $URLParamPattern = str_replace("<paging_id>", $this->paging->getPagingID(), $URLParamPattern);
                     $URLParam = str_replace("<paging_page>", $this->number, $URLParamPattern);
                     $URLParamPattern = str_replace("<paging_page>", "(\\d+)", $URLParamPattern);
                     $URLParam = str_replace("/", "", $URLParam);
                     $URLParam = str_replace("\\", "", $URLParam);
                     if ($this->getNumber() > 1) {
                         $value = LBoxUtil::getURLWithParams(array($URLParam), LBoxUtil::getURLWithoutParamsByPattern($URLParamPattern));
                     } else {
                         $value = LBoxUtil::getURLWithoutParamsByPattern($URLParamPattern);
                     }
                     break;
                 default:
                     $value = NULL;
             }
             return $this->params[$name] = $value;
         } else {
             return $this->params[$name];
         }
     } catch (Exception $e) {
         throw $e;
     }
 }