/**
  * @param Element $element Element being mixed into
  * @param array $config Configuration options
  * @param number|null $config['tabIndex'] Tab index value. Use 0 to use default ordering, use -1 to
  *   prevent tab focusing, use null to suppress the `tabindex` attribute. (default: 0)
  */
 public function __construct(Element $element, array $config = array())
 {
     // Parent constructor
     $target = isset($config['tabIndexed']) ? $config['tabIndexed'] : $element;
     parent::__construct($element, $target, $config);
     // Initialization
     $this->setTabIndex(isset($config['tabIndex']) ? $config['tabIndex'] : 0);
 }
示例#2
0
 /**
  * @param Element $element Element being mixed into
  * @param array $config Configuration options
  * @param string $config['title'] Title. If not provided, the static property 'title' is used.
  */
 public function __construct(Element $element, array $config = array())
 {
     // Parent constructor
     $target = isset($config['titled']) ? $config['titled'] : $element;
     parent::__construct($element, $target, $config);
     // Initialization
     $this->setTitle(isset($config['title']) ? $config['title'] : (isset($element::$title) ? $element::$title : null));
 }
 /**
  * @param Element $element Element being mixed into
  * @param array $config Configuration options
  * @param string|string[] $config['flags'] Flags describing importance and functionality, e.g.
  *   'primary', 'safe', 'progressive', 'destructive' or 'constructive'
  */
 public function __construct(Element $element, array $config = array())
 {
     // Parent constructor
     $target = isset($config['flagged']) ? $config['flagged'] : $element;
     parent::__construct($element, $target, $config);
     // Initialization
     $this->setFlags(isset($config['flags']) ? $config['flags'] : null);
 }
 /**
  * @param Element $element Element being mixed into
  * @param array $config Configuration options
  * @param string $config['indicator'] Symbolic indicator name
  */
 public function __construct(Element $element, array $config = array())
 {
     // Parent constructor
     // FIXME 'indicatorElement' is a very stupid way to call '$indicator'
     $target = isset($config['indicatorElement']) ? $config['indicatorElement'] : new Tag('span');
     parent::__construct($element, $target, $config);
     // Initialization
     $this->target->addClasses(array('oo-ui-indicatorElement-indicator'));
     $this->setIndicator(isset($config['indicator']) ? $config['indicator'] : null);
 }
示例#5
0
 /**
  * @param Element $element Element being mixed into
  * @param array $config Configuration options
  * @param boolean $config['framed'] Render button with a frame (default: true)
  */
 public function __construct(Element $element, array $config = array())
 {
     // Parent constructor
     $target = isset($config['button']) ? $config['button'] : new Tag('a');
     parent::__construct($element, $target, $config);
     // Initialization
     $this->element->addClasses(array('oo-ui-buttonElement'));
     $this->target->addClasses(array('oo-ui-buttonElement-button'));
     $this->toggleFramed(isset($config['framed']) ? $config['framed'] : true);
     $this->target->setAttributes(array('role' => 'button'));
 }
示例#6
0
 /**
  * @param Element $element Element being mixed into
  * @param array $config Configuration options
  */
 public function __construct(Element $element, array $config = array())
 {
     // Parent constructor
     $target = isset($config['group']) ? $config['group'] : new Tag('div');
     parent::__construct($element, $target, $config);
 }