Ajax/common/Widget.php
public function addInToolbar($element,$callback=NULL){
		$tb=$this->getToolbar();
		if($element instanceof BaseWidget){
			if($element->getIdentifier()===""){
				$element->setIdentifier("tb-item-".$this->identifier."-".$tb->count());
			}
		}
		if(isset($callback)){
			if(\is_callable($callback)){
				$callback($element);
			}
		}
		return $tb->addItem($element);
	}
public function addInToolbar($element,$callback=NULL){
		$tb=$this->getToolbar();
		if($element instanceof BaseWidget){
			if($element->getIdentifier()===""){
				$element->setIdentifier("tb-item-".$this->identifier."-".$tb->count());
			}
		}
		if(isset($callback)){
			if(\is_callable($callback)){
				$callback($element);
			}
		}
		return $tb->addItem($element);
	}
public function addInToolbar ( $ element , $ callback = NULL ) { $ tb = $ this -> getToolbar ( ) ; if ( $ element instanceof BaseWidget ) { if ( $ element -> getIdentifier ( ) === "" ) { $ element -> setIdentifier ( "tb-item-" . $ this -> identifier . "-" . $ tb -> count ( ) ) ; } } if ( isset ( $ callback ) ) { if ( \ is_callable ( $ callback ) ) { $ callback ( $ element ) ; } } return $ tb -> addItem ( $ element ) ; }
Adds a new element in toolbar
@param mixed $element
@param callable $callback function to call on $element
@return \Ajax\common\html\HtmlDoubleElement
Adds a new element in toolbar