buildURLQueryByFilter() public static method

Build a query for the URL based on the filter
public static buildURLQueryByFilter ( array $filter ) : string
$filter array The filter.
return string
Exemplo n.º 1
0
 /**
  * Sets the filter based on the $_GET array.
  */
 private function setFilter()
 {
     $this->filter['language'] = $this->getParameter('language', 'array') != '' ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();
     $this->filter['application'] = $this->getParameter('application');
     $this->filter['module'] = $this->getParameter('module');
     $this->filter['type'] = $this->getParameter('type', 'array');
     $this->filter['name'] = $this->getParameter('name');
     $this->filter['value'] = $this->getParameter('value');
     $this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);
 }
Exemplo n.º 2
0
 /**
  * Sets the filter based on the $_GET array.
  */
 private function setFilter()
 {
     // if no language is selected, set the working language as the selected
     if ($this->getParameter('language', 'array') == null) {
         $_GET['language'] = array(BL::getWorkingLanguage());
         $this->parameters['language'] = array(BL::getWorkingLanguage());
     }
     // if no type is selected, set labels as the selected type
     if ($this->getParameter('type', 'array') == null) {
         $_GET['type'] = array('lbl');
         $this->parameters['type'] = array('lbl', 'act', 'err', 'msg');
     }
     // set filter
     $this->filter['application'] = $this->getParameter('application', 'string', null);
     $this->filter['module'] = $this->getParameter('module', 'string', null);
     $this->filter['type'] = $this->getParameter('type', 'array');
     $this->filter['language'] = $this->getParameter('language', 'array');
     $this->filter['name'] = $this->getParameter('name') == null ? '' : $this->getParameter('name');
     $this->filter['value'] = $this->getParameter('value') == null ? '' : $this->getParameter('value');
     // only allow values from our types checkboxes to be set
     $this->filter['type'] = array_filter($this->filter['type'], function ($type) {
         return array_key_exists($type, BackendLocaleModel::getTypesForMultiCheckbox());
     });
     // only allow languages from our language checkboxes to be set
     $isGod = $this->isGod;
     $this->filter['language'] = array_filter($this->filter['language'], function ($language) use($isGod) {
         return array_key_exists($language, BackendLocaleModel::getLanguagesForMultiCheckbox($isGod));
     });
     // build query for filter
     $this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);
 }