protected function getExtraButtons($index, $item)
    {
        if (!$this->extraButtons) {
            return '';
        }

        if (is_callable($this->extraButtons)) {
            $content = call_user_func($this->extraButtons, $item, $index, $this->context);
        } else {
            $content = $this->extraButtons;
        }

        if (!is_string($content)) {
            throw new InvalidParamException('Property "extraButtons" must return string.');
        }

        return $content;
    }