Add menu.

@param array $buttons
@param array $matchRule

@return mixed
322670
public function create(array $buttons, array $matchRule = [])
    {
        if (!empty($matchRule)) {
            return $this->httpPostJson('cgi-bin/menu/addconditional', [
                'button' => $buttons,
                'matchrule' => $matchRule,
            ]);
        }

        return $this->httpPostJson('cgi-bin/menu/create', ['button' => $buttons]);
    }
96051
public function mergeRules(array $rules)
    {
        $this->extendedRules = array_merge($this->extendedRules, $rules);
        $this->parsedRules = null;
        return $this;
    }
80430
public function merge(SimpleXmlElement $element, $replace = true, $rule = null)
    {
        foreach ($element->children() as $name => $child) {
            $affected = null;
            $currentpath = $child->getPath();
            $action = $this->_getMergeRule($child, $affected, $rule);

            if ($action == self::MERGE_APPEND) {
                $affected = $this->addChild($name, (string)$child);
            }

            if (!$affected instanceof SimpleXmlElement) {
                continue;
            }

            $affected->mergeAttributes($child, $replace);

            if ($child->hasChildren()) {
                $affected->merge($child, $replace, $rule);
                continue;
            } else if ($replace) {
                $affected[0] = (string)$child;
            }
        }

        return $this;
    }
682704
public function addButtonDelete($link = '#', $binds = [], $is_remote = true, $method = 'delete')
    {
        $c = new Column\Button(configurator()->get('button.delete.name'), configurator()->get('button.delete.label'), $link, $binds);
        $c->setOptionAsDanger();
        $c->icon(configurator()->get('button.delete.icon'));
        if ($is_remote) {
            $c->enableRemote($method);
        }
        $this->addColumn($c);
        return $c;
    }
23527
public function buttons(array $buttons = [])
    {
        if (count($buttons) > 3) {
            throw CouldNotCreateMessage::messageButtonsLimitExceeded();
        }

        $this->buttons = $buttons;

        return $this;
    }
966655
public function addMatcher($name, MatcherInterface $rule)
    {
        if ($rule->hasValue()) {
            $this->rules[$name][] = $rule;
        }
    }
516033
public function add(MergeRuleInterface $rule, $name = null)
	{
	    if (!empty($name)) {
	    	$this->_items[$name] = $rule;
	    } else {
	    	$this->_items[] = $rule;
	    }

	    return $this;
	}
394470
public function setButtons(array $buttons): self
    {
        $this->isValidArray($buttons, 1);

        $this->buttons = $buttons;

        return $this;
    }
80690
public function addButton($button)
    {
        $buttons = $this->buttons;

        // If buttons isn't an array, set it
        if (!is_array($buttons)) {
            $buttons = array();
        }

        $buttons[] = $button;

        $this->buttons = $buttons;

        return $this;
    }
285410
public function addButtons()
    {
        $this->save = $this->addSubmit('Save');
        $this->reset = $this->addSubmit('Reset');

        return $this;
    }
1337278
public function matchAction($matchAction = null)
    {
        if ($matchAction === null) {
            return $this->_matchAction;
        }
        $this->_matchAction = $matchAction;

        return $this;
    }
234847
public function addMatchers(array $matchers)
    {
        $this->matchers = \array_merge($this->matchers, $matchers);

        if (isset($this->autoCompleter)) {
            $this->addMatchersToAutoCompleter($matchers);
        }
    }
778809
public function addRules($rules)
    {
        foreach ($rules as $rule) {
            $this->addrule($rule[0], $rule[1], $rule[2], isset($rule[3])?$rule[3]:null);
        }
    }
284127
public function addButtonsToLine() {
		$inserts = func_get_args();
		$line = array_shift($inserts);
		if (is_array($inserts[0])) $inserts = $inserts[0];

		foreach ($inserts as $button) {
			$this->buttons[$line][] = $button;
		}
		return $this;
	}
1267674
public function addRules(Rule ...$rules): MutableQuery
    {
        $cloned = clone $this;

        $activeRules = iterator_to_array($this->rules);
        $activeRules = array_merge($activeRules, $rules);

        $cloned->rules = new RuleCollection($this->rules->getJoinKeyword(), ...$activeRules);

        return $cloned;
    }
761934
public function addButton($label, $class = 'Button')
    {
        if (!$this->buttonset) {
            $this->buttonset = $this->add('ButtonSet', null, 'grid_buttons')->setClass('atk-actions');
        }

        return $this->buttonset
            ->add($class, 'gbtn'.count($this->elements))
            ->set($label);
    }
494396
protected function addButtons(\Gems_Menu_MenuList $menuList)
    {
        if ($this->addCurrentParent) {
            $menuList->addCurrentParent($this->_('Cancel'));
        }
        if ($this->addCurrentSiblings) {
            $menuList->addCurrentSiblings($this->anyParameterSiblings);
        }
        if ($this->addCurrentChildren) {
            $menuList->addCurrentChildren();
        }
        // \MUtil_Echo::track($this->addCurrentParent, $this->addCurrentSiblings, $this->addCurrentChildren, count($menuList));
    }