vendor/alnv/catalog-manager/library/alnv/CatalogInput.php line 11

Open in your IDE?
  1. <?php
  2. namespace CatalogManager;
  3. class CatalogInput extends CatalogController {
  4.     protected $strFormId;
  5.     public function __construct() {
  6.         parent::__construct();
  7.         $this->strFormId md5'tl_filter' );
  8.         $this->import'Input' );
  9.     }
  10.     protected function getPostCookie$strName ) {
  11.         $objSession \Session::getInstance();
  12.         $strActiveValue $this->Input->post$strName );
  13.         $arrEditingMode preg_grep '/^act(\d+)/i'array_keys$_GET ) );
  14.         $arrPagination preg_grep '/^page_e(\d+)/i'array_keys$_GET ) );
  15.         if ( $this->Input->post'FORM_SUBMIT' ) == $this->strFormId $objSession->set$strName$strActiveValue );
  16.         if ( !empty( $arrPagination ) || ( Toolkit::isEmpty$strActiveValue ) && !Toolkit::isEmpty$objSession->get$strName ) ) ) ) {
  17.             if ( TL_MODE == 'FE' ) {
  18.                 $strActiveValue $objSession->get$strName );
  19.             }
  20.         }
  21.         if ( !empty( $arrEditingMode ) ) {
  22.             $strActiveValue $this->Input->post$strName );
  23.         }
  24.         return $strActiveValue;
  25.     }
  26.     public function post$strName ) {
  27.         $strPostCookie $this->getPostCookie$strName );
  28.         if ( !is_null$strPostCookie ) && $strPostCookie != '' ) return $this->parseValue$strPostCookie );
  29.         return '';
  30.     }
  31.     
  32.     public function get$strName ) {
  33.         $strGet $this->Input->get$strName );
  34.         if ( !is_null$strGet ) && $strGet != '' ) return $this->parseValue$strGet );
  35.         return '';
  36.     }
  37.     public function getActiveValue$strName ) {
  38.         if ( $this->get$strName ) != '' ) return $this->get$strName );
  39.         
  40.         $strPost $this->post$strName );
  41.         if ( $strPost != '' ) return $strPost;
  42.         return '';
  43.     }
  44.     public function getValue$strName ) {
  45.         if ( $this->get$strName ) != '' ) return $this->get$strName );
  46.         $strPost $this->Input->post$strName );
  47.         if ( !Toolkit::isEmpty$strPost ) ) return $strPost;
  48.         return '';
  49.     }
  50.     protected function parseValue($varValues) {
  51.         if (is_array($varValues) && !empty($varValue)) {
  52.             foreach ($varValues as $intIndex => $strValue) {
  53.                 $varValues[$intIndex] = $strValue;
  54.             }
  55.             return $varValues;
  56.         }
  57.         if (is_string($varValues) && $varValues != '') {
  58.             return $varValues;
  59.         }
  60.         return $varValues;
  61.     }
  62. }