getLanguagesForMultiCheckbox() public static method

Get the languages for a multicheckbox.
public static getLanguagesForMultiCheckbox ( boolean $includeInterfaceLanguages = false ) : array
$includeInterfaceLanguages boolean Should we also get the interfacelanguages?
return array
Exemplo n.º 1
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);
 }