/*
toolbars()

This filter allowsyou to customize the WYSIWYG toolbars

@param	$toolbars - an array of toolbars

@return	$toolbars - the modified $toolbars

@type	filter
@since	3.6
@date	23/01/13
168890
function toolbars( $toolbars ) {
   		
   		// global
   		global $wp_version;
   		
   		
   		// vars
   		$editor_id = 'acf_settings';
   		
   		
   		if( version_compare($wp_version, '3.9', '>=' ) ) {
   		
   			// Full
	   		$toolbars['Full'] = array(
	   			
	   			1 => apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id ),
	   			
	   			2 => apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help', 'code' ), $editor_id ),
	   			
	   			3 => apply_filters('mce_buttons_3', array(), $editor_id),
	   			
	   			4 => apply_filters('mce_buttons_4', array(), $editor_id),
	   			
	   		);
	   		
	   		
	   		// Basic
	   		$toolbars['Basic'] = array(
	   			
	   			1 => apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id ),
	   			
	   		);
	   		  		
   		} else {
	   		
	   		// Full
	   		$toolbars['Full'] = array(
	   			
	   			1 => apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'justifyleft', 'justifycenter', 'justifyright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id ),
	   			
	   			2 => apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', 'pastetext', 'pasteword', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help', 'code' ), $editor_id ),
	   			
	   			3 => apply_filters('mce_buttons_3', array(), $editor_id),
	   			
	   			4 => apply_filters('mce_buttons_4', array(), $editor_id),
	   			
	   		);

	   		
	   		// Basic
	   		$toolbars['Basic'] = array(
	   			
	   			1 => apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id ),
	   			
	   		);
	   		
   		}
   		
   		
   		
   		// Custom - can be added with acf/fields/wysiwyg/toolbars filter
   	
   		
	   	return $toolbars;
   	}
732151
def filter_toolboxes(plots):
    
    if isinstance(plots, list):
        plots = [filter_toolboxes(plot) for plot in plots]
    elif hasattr(plots, 'children'):
        plots.children = [filter_toolboxes(child) for child in plots.children
                          if not isinstance(child, ToolbarBox)]
    return plots
1039024
public function addFilters(array $filters)
    {
        foreach ($filters as $filter) {
            if ($filter === null) {
                continue;
            }

            $this->addFilter($filter);
        }

        return $this;
    }
53402
public function templates($templates = null)
    {
        deprecationWarning(
            'StringTemplateTrait::templates() is deprecated. ' .
            'Use setTemplates()/getTemplates() instead.'
        );

        if ($templates === null || is_string($templates)) {
            return $this->templater()->get($templates);
        }

        $this->templater()->add($templates);

        return $this;
    }
1161840
protected function renderCustomTools($tools)
    {
        if ($this->form->isCreating()) {
            $this->disableView();
            $this->disableDelete();
        }

        if (empty($tools)) {
            return '';
        }

        return $tools->map(function ($tool) {
            if ($tool instanceof Renderable) {
                return $tool->render();
            }

            if ($tool instanceof Htmlable) {
                return $tool->toHtml();
            }

            return (string) $tool;
        })->implode(' ');
    }
771956
public function create(array $parameters) {
        $toolbarItem = new ButtonToolbarItem($parameters['label'], $parameters['action']);
        unset($parameters['label'], $parameters['action']);
        foreach($parameters as $key => $value) {
            $toolbarItem->$key = $value;
        }
        return $toolbarItem;
    }
322239
public function rawFilter($filters = [])
    {
        $filters = is_array($filters) ? $filters : func_get_args();

        foreach ($filters as $filter) {
            $this->filters['raw'][] = $filter;
        }

        return $this;
    }
1140916
def handlebars(*args, &block)
      filter(Rake::Pipeline::Web::Filters::HandlebarsFilter, *args, &block)
    end
636388
public function getFilters()
    {
        if (is_array($this->filters)) {
            return $this->filters;
        }

        $request = $this->getRequest();
        $toolbarFilters = $request->getPost('toolbarFilters', $request->getQuery('toolbarFilters'));
        $filters = [];
        if (($request->isPost() === true || $request->isGet() === true) &&
            null !== $toolbarFilters
        ) {
            foreach ($toolbarFilters as $uniqueId => $value) {
                if ($value != '') {
                    foreach ($this->getColumns() as $column) {
                        /* @var $column \ZfcDatagrid\Column\AbstractColumn */
                        if ($column->getUniqueId() == $uniqueId) {
                            $filter = new \ZfcDatagrid\Filter();
                            $filter->setFromColumn($column, $value);

                            $filters[] = $filter;

                            $column->setFilterActive($filter->getDisplayColumnValue());
                        }
                    }
                }
            }
        }

        if (! empty($filters)) {
            $this->filters = $filters;
        } else {
            // No user sorting -> get default sorting
            $this->filters = $this->getFiltersDefault();
        }

        return $this->filters;
    }
735246
public static function createToolbar(array $attributes = array(), $fromFieldset = false)
    {
        $toolbar = new Toolbar();
        static::applyAttributes($toolbar, $attributes, $fromFieldset);

        return $toolbar;
    }
1285672
public function addFilter($filters)
    {
        $filters = (array) AnConfig::unbox($filters);

        foreach ($filters as $filter) {
            if (!($filter instanceof LibBaseTemplateFilterInterface)) {
                $filter = $this->getFilter($filter);
            }
            
            //Enqueue the filter in the command chain
            $this->getCommandChain()->enqueue($filter);
            
            //Store the filter
            $this->_filters[$filter->getIdentifier()->name] = $filter;
        }
        
        return $this;
    }
116822
protected function renderCustomTools($tools)
    {
        return $tools->map(function ($tool) {
            if ($tool instanceof Renderable) {
                return $tool->render();
            }

            if ($tool instanceof Htmlable) {
                return $tool->toHtml();
            }

            return (string) $tool;
        })->implode(' ');
    }
271810
public function setFilters(array $filters)
    {
        if (empty($this->filters)) {
            $this->filters = $this->getDefaultFilters();
        }

        $this->filters = array_merge(
            $this->filters, $filters
        );

        return $this;
    }
487993
protected function setupSidebars($sidebars)
    {
        // load current widget condig
        $active_widgets = get_option('sidebars_widgets');

        // collect widgets to be added to sidebars
        foreach ($sidebars as $sidebar => $widgets) {
            $new_widgets = [];
            foreach ($widgets as $type => $data) {
                // load all widgets for this type
                $widget = get_option('widget_' . $type);

                // add a new widget and retrieve id
                $widget[] = $data;
                end($widget);
                $id = key($widget);

                // save the widgets back to db
                update_option('widget_' . $type, $widget);

                // add the new widget id to active widgets
                $new_widgets[] = $type . '-' . $id;
            }
            // set active widgets for sidebar
            $active_widgets[$sidebar] = $new_widgets;
        }
        // save sidebars with widgets
        update_option('sidebars_widgets', $active_widgets);
    }
851785
public function setFilters($filters = []) {
		if ($filters) {
			foreach ($filters as $key => $value) {
				$this->setFilter($key, $value);
			}
		}

		return $this;
	}
422965
public static function SetTemplates ($templates = []) {
		if (gettype(static::$templates) == 'array') {
			static::$templates = (array) $templates;
		} else {
			static::$templates = (object) $templates;
		}
		return static::$templates;
	}
948408
public function getToolbar($type = 'actionbar')
    {
        $result = null;

        if(isset($this->__toolbars[$type])) {
            $result = $this->__toolbars[$type];
        }

        return $result;
    }