Exemple #1
0
 public function getCompassFilterOptions($dc)
 {
     $options = array();
     $filter = FilterModel::findBy('type', 'compass', array('order' => 'type'));
     if ($filter) {
         while ($filter->next()) {
             $label = $GLOBALS['TL_LANG']['assetic'][$filter->type] ?: $filter->type;
             if ($filter->note) {
                 $label .= ' [' . $filter->note . ']';
             }
             $GLOBALS['TL_LANG']['assetic']['filter:' . $filter->id] = $label;
             $options[] = 'filter:' . $filter->id;
         }
     }
     return $options;
 }
 /**
  * @param int $id
  *
  * @return \Assetic\Filter\FilterInterface|null
  */
 public function createFilterById($id, $debug = null)
 {
     if ($debug === null) {
         $debug = $GLOBALS['TL_CONFIG']['debugMode'];
     }
     $options = array();
     if ($debug) {
         $options['column'] = 'notInDebug=?';
         $options['value'] = '';
     }
     $filter = FilterModel::findActiveByPk($id, $options);
     if ($filter) {
         return static::createFilter($filter->row());
     }
     return null;
 }
 public function getFilterOptions($dc)
 {
     $options = array();
     $filter = FilterModel::findAll(array('order' => 'type'));
     if ($filter) {
         while ($filter->next()) {
             if (!in_array($filter->type, $GLOBALS['ASSETIC'][$dc->activeRecord->type])) {
                 continue;
             }
             $label = $GLOBALS['TL_LANG']['assetic'][$filter->type] ?: $filter->type;
             if ($filter->note) {
                 $label .= ' [' . $filter->note . ']';
             }
             $GLOBALS['TL_LANG']['assetic']['filter:' . $filter->id] = $label;
             $options[] = 'filter:' . $filter->id;
         }
     }
     return $options;
 }
Exemple #4
0
 protected function buildAsseticFilterOptions($type)
 {
     $this->loadLanguageFile('assetic');
     $options = [];
     $filterChain = FilterChainModel::findBy('type', $type, ['order' => 'type']);
     if ($filterChain) {
         while ($filterChain->next()) {
             $label = '[';
             $label .= $GLOBALS['TL_LANG']['tl_assetic_filter_chain']['types'][$filterChain->type] ?: $filterChain->type;
             $label .= '] ';
             $label .= $filterChain->name;
             $GLOBALS['TL_LANG']['assetic']['chain:' . $filterChain->id] = $label;
             $options['chain'][] = 'chain:' . $filterChain->id;
         }
     }
     $filter = FilterModel::findAll(['order' => 'type']);
     if ($filter) {
         while ($filter->next()) {
             if (!in_array($filter->type, $GLOBALS['ASSETIC'][$type])) {
                 continue;
             }
             $label = $GLOBALS['TL_LANG']['assetic'][$filter->type] ?: $filter->type;
             if ($filter->note) {
                 $label .= ' [' . $filter->note . ']';
             }
             $GLOBALS['TL_LANG']['assetic']['filter:' . $filter->id] = $label;
             $options['filter'][] = 'filter:' . $filter->id;
         }
     }
     return $options;
 }