Adds Filters section in Settings
322305
function settings_actions($args)
    {
        $this->load_config();

        $vacation_mode = (int) $this->rc->config->get('managesieve_vacation');

        // register Filters action
        if ($vacation_mode != 2) {
            $args['actions'][] = array(
                'action' => 'plugin.managesieve',
                'class'  => 'filter',
                'label'  => 'filters',
                'domain' => 'managesieve',
                'title'  => 'filterstitle',
            );
        }

        // register Vacation action
        if ($vacation_mode > 0) {
            $args['actions'][] = array(
                'action' => 'plugin.managesieve-vacation',
                'class'  => 'vacation',
                'label'  => 'vacation',
                'domain' => 'managesieve',
                'title'  => 'vacationtitle',
            );
        }

        return $args;
    }
62264
def add_filter(filter)
      @filters = (@filters << filter).sort_by do |f|
        f.respond_to?(:weight) ? f.weight : DEFAULT_WEIGHT
      end.reverse!
    end
951652
function _fnFilterCustom( oSettings )
	{
		var afnFilters = DataTable.ext.search;
		var aiFilterColumns = _fnGetColumns( oSettings, 'bSearchable' );
	
		for ( var i=0, iLen=afnFilters.length ; i<iLen ; i++ )
		{
			var iCorrector = 0;
			for ( var j=0, jLen=oSettings.aiDisplay.length ; j<jLen ; j++ )
			{
				var iDisIndex = oSettings.aiDisplay[j-iCorrector];
				var bTest = afnFilters[i](
					oSettings,
					_fnGetRowData( oSettings, iDisIndex, 'filter', aiFilterColumns ),
					iDisIndex
				);
	
				/* Check if we should use this row based on the filtering function */
				if ( !bTest )
				{
					oSettings.aiDisplay.splice( j-iCorrector, 1 );
					iCorrector++;
				}
			}
		}
	}
107591
private function applyFilters()
    {
        // Manage filters
        // Filter values come either from the form (GET)
        // Or from session
        $form = $this->getFiltersForm();

        if (!$form) {
            // No filters are configured for this admin
            return;
        }

        $this->loadFilterValues();
        // Init form with current data if any
        $form->setData($this->filterValues);

        $form->handleRequest($this->request);

        if ($form->isSubmitted()) {

            if ($form->get('reset')->isClicked()) {
                // Submitted for reset
                // Reset stored content
                $this->clearFilterValues();
                // Reset displayed values by rebuilding the form
                // yes, it's a pity we cannot simply change content of it
                $this->getFiltersForm(true);
            }
            else {
                // Submitted for filtering
                // Overwrite any stored values with the submitted ones
                // Update storage for subsequent requests
                $this->storeFilterValues($form->getData());
            }
        }

        // Map values, if any, to filters
        if (is_array($this->filterValues)) {
            foreach ($this->filters as $filter) {
                if (array_key_exists($filter->getName(), $this->filterValues)) {
                    $filter->setValue($this->filterValues[$filter->getName()]);
                }
            }
        }
    }
928247
private function applyFilters() {

		// handle default and pre-configured filters first

		foreach($this->defaultFilters as $f) {
			$f->apply($this->contents);
		}

		// handle added custom filters last

		foreach($this->filters as $f) {
			$f->apply($this->contents);
		}

	}
742379
protected function initFilters()
    {
        if (!empty($this->filters)) {
            foreach ($this->filters as $name => $handler) {
                $this->addFilter($name, $handler);
            }
        }
    }
235490
private function filters() {
            // Override request for plugin information
            add_filter( 'plugins_api', array( &$this, 'plugins_api_filter' ), 10, 3 );

            $this->add_transient_filters();

            /**
             * If user has the premium plugin's code but do NOT have an active license,
             * encourage him to upgrade by showing that there's a new release, but instead
             * of showing an update link, show upgrade link to the pricing page.
             *
             * @since 1.1.6
             *
             */
            // WP 2.9+
            add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
                &$this,
                'catch_plugin_update_row'
            ), 9 );
            add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
                &$this,
                'edit_and_echo_plugin_update_row'
            ), 11, 2 );

            add_action( 'admin_head', array( &$this, 'catch_plugin_information_dialog_contents' ) );

            if ( ! WP_FS__IS_PRODUCTION_MODE ) {
                add_filter( 'http_request_host_is_external', array(
                    $this,
                    'http_request_host_is_external_filter'
                ), 10, 3 );
            }

            if ( $this->_fs->is_premium() ) {
                if ( ! $this->is_correct_folder_name() ) {
                    add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
                }

                add_filter( 'upgrader_pre_install', array( 'FS_Plugin_Updater', '_store_basename_for_source_adjustment' ), 1, 2 );
                add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );

                if ( ! $this->_fs->has_any_active_valid_license() ) {
                    add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
                }
            }
        }
383745
protected function add_soft_filter()
	{
		if ($this->_col_name !== null)
		{
			// Capture any filtering that has already been added
			$current_where = $this->where;

			// If there is no filtering then we don't need to add any special organization
			if ( ! empty($current_where))
			{
				$this->where = array();

				// Make sure the existing filtering is wrapped safely
				$this->and_where_open();
				$this->where = array_merge($this->where, $current_where);
				$this->and_where_close();
			}

			// Finally add the soft delete filtering
			$this->where($this->_col_name, null);
		}
	}
1111253
def add_module_plugin_filters(self, module_plugin_filters):
        
        module_plugin_filters = util.return_list(module_plugin_filters)
        self.module_plugin_filters.extend(module_plugin_filters)
109061
public void addFilter(AbstractLogFilter<E> filter) {
                Validate.notNull(filter);
                filters.add(filter);
                uptodate = false;
                filter.addObserver(this);
        }
283067
def _apply_filter_settings(self):
        """"""
        # TODO: Allow easy customization of filters
        if self.mipmap:
            gl.glTexParameterf(self.target, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR_MIPMAP_LINEAR)
        else:
            gl.glTexParameterf(self.target, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR)
        gl.glTexParameterf(self.target, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR)

        gl.glTexParameterf(self.target, gl.GL_TEXTURE_WRAP_S, gl.GL_CLAMP_TO_EDGE)
        gl.glTexParameterf(self.target, gl.GL_TEXTURE_WRAP_T, gl.GL_CLAMP_TO_EDGE)
191789
def add_filter_set(self, filter_name, filter_set, cached=True):
        
        try:
            hash(filter_name)
        except TypeError as err:
            raise ValueError('Filter set name must be as instance of hashable type: %s' % str(err))

        if not isinstance(filter_set, list):
            raise ValueError('Filters must be a list.')

        if len(filter_set) == 0:
            raise ValueError('Filters count must be greater than 0.')

        for filter_instance in filter_set:
            if not isinstance(filter_instance, ImagineFilterInterface):
                raise ValueError('All filters must implement of ImagineFilterInterface.')

        if not isinstance(cached, bool):
            raise ValueError('Cached parameter must be a bool.')

        filter_config = {
            'filters': filter_set,
            'cached': cached
        }

        if filter_name not in self._filter_sets:
            self._filter_sets.update({filter_name: filter_config})
        else:
            raise ValueError('Duplicate filter set name.')
917071
public void addFilter(String filter) {

        if (CmsStringUtil.isNotEmpty(filter)) {
            filter = filter.trim().toLowerCase();
            if (FILTERS.contains(filter)) {
                m_filters.add(filter);
            }
        }
    }
323741
def _handle_filter_sets(self, app):
        
        if 'IMAGINE_FILTER_SETS' in app.config and isinstance(app.config['IMAGINE_FILTER_SETS'], dict):
            for filter_name, filters_settings in app.config['IMAGINE_FILTER_SETS'].items():
                filter_set = []
                if isinstance(filters_settings, dict) and 'filters' in filters_settings:
                    for filter_type, filter_settings in filters_settings['filters'].items():
                        if filter_type in self._filters:
                            filter_item = self._filters[filter_type](**filter_settings)
                            if isinstance(filter_item, ImagineFilterInterface):
                                filter_set.append(filter_item)
                            else:
                                raise ValueError('Filter must be implement ImagineFilterInterface')
                        else:
                            raise ValueError('Unknown filter type: %s' % filter_type)

                    filter_config = {'filters': filter_set}
                    if 'cached' in filters_settings:
                        filter_config['cached'] = filters_settings['cached']
                    else:
                        filter_config['cached'] = app.config['IMAGINE_CACHE_ENABLED']

                    self._filter_sets.update({filter_name: filter_config})
                else:
                    raise ValueError('Wrong settings for filter: %s' % filter_name)
        else:
            raise ValueError('Filters configuration does not present')
1369422
public void setFilter(Filter filter)
    {
        if (this.filter == null)
        {
            this.filter = new FilterList();
        }
        if (filter != null)
        {
            this.filter.addFilter(filter);
        }
    }
261184
function add_taxonomy_filters() {

        global $typenow;
        global $wp_query;

        // Must set this to the post type you want the filter(s) displayed on.
        if ( $typenow == $this->post_type_name ) {

            // if custom filters are defined use those
            if ( is_array( $this->filters ) ) {

                $filters = $this->filters;

            // else default to use all taxonomies associated with the post
            } else {

                $filters = $this->taxonomies;
            }

            if ( ! empty( $filters ) ) {

                // Foreach of the taxonomies we want to create filters for...
                foreach ( $filters as $tax_slug ) {

                    // ...object for taxonomy, doesn't contain the terms.
                    $tax = get_taxonomy( $tax_slug );

                    // Get taxonomy terms and order by name.
                    $args = array(
                        'orderby' => 'name',
                        'hide_empty' => false
                    );

                    // Get taxonomy terms.
                    $terms = get_terms( $tax_slug, $args );

                    // If we have terms.
                    if ( $terms ) {

                        // Set up select box.
                        printf( ' &nbsp;<select name="%s" class="postform">', $tax_slug );

                        // Default show all.
                        printf( '<option value="0">%s</option>', sprintf( __( 'Show all %s', $this->textdomain ), $tax->label ) );

                        // Foreach term create an option field...
                        foreach ( $terms as $term ) {

                            // ...if filtered by this term make it selected.
                            if ( isset( $_GET[ $tax_slug ] ) && $_GET[ $tax_slug ] === $term->slug ) {

                                printf( '<option value="%s" selected="selected">%s (%s)</option>', $term->slug, $term->name, $term->count );

                            // ...create option for taxonomy.
                            } else {

                                printf( '<option value="%s">%s (%s)</option>', $term->slug, $term->name, $term->count );
                            }
                        }
                        // End the select field.
                        print( '</select>&nbsp;' );
                    }
                }
            }
        }
    }
1249078
def add_section(self, section):
        """"""
        section, _, _ = self._validate_value_types(section=section)
        super(ConfigParser, self).add_section(section)