Example #1
0
 /**
  * @param string|null $content
  * @param string|null $link
  */
 public function __construct(string $content = null, string $link = null)
 {
     parent::__construct('<a>', $content);
     if ($link) {
         $this->setHref($link);
     }
 }
Example #2
0
 /**
  * @param string $type
  * @param string $title
  * @param string $content
  */
 public function __construct(string $type = self::TYPE_DEFAULT, string $title = null, string $content = null)
 {
     parent::__construct('<div>', $content);
     $this->addClass(['panel', $type]);
     $this->container = new Container();
     $this->title = $title;
 }
Example #3
0
 /**
  * @param string $legend
  */
 public function __construct(string $legend = null)
 {
     parent::__construct('<fieldset>');
     if ($legend) {
         $this->add(new HtmlElement('<legend>', $legend));
     }
 }
Example #4
0
 /**
  * @param array $keyValue
  */
 public function __construct(array $keyValue = [])
 {
     parent::__construct('<dl>');
     foreach ($keyValue as $key => $value) {
         $this->addDescription($key, $value);
     }
 }
Example #5
0
 /**
  * @param string $stateId
  */
 public function __construct(string $stateId = null)
 {
     $this->stateId = $stateId;
     // default callback to get query param
     $this->argsCallback = function ($item, $arg = null) {
         $query = $this->stateId ? $this->stateId . '_' : '';
         if ($item instanceof Pagination) {
             $query .= Pagination::QUERY_PAGE;
         } elseif ($item instanceof Column) {
             $query .= Table::QUERY_SORT;
         } elseif (is_string($item)) {
             $query .= $item;
         }
         if ($arg) {
             return self::request()->getUri()->addQuery($query, (string) $arg)->get();
         } else {
             return self::request()->getUri()->getQuery($query);
         }
     };
     parent::__construct('<div>');
     $this->addClass('cawa-grid');
     $this->addClass('grid-table');
     self::translator()->addFile(__DIR__ . '/../../lang/global', 'bootstrap');
     $this->navbar = (new Navbar())->setInverse();
     $this->add($this->navbar);
     $this->options = new Dropdown('<i class="fa fa-adjust"></i> ' . self::trans('bootstrap.grid/options'));
     // refresh
     $this->options->add(new Link('<i class="glyphicon glyphicon-refresh"></i> ' . self::trans('bootstrap.grid/refresh'), self::request()->getUri()->get()));
     $ul = new HtmlContainer('<ul>');
     $ul->add($this->options->toNavbar());
     $this->navbar->add($ul);
     $this->table = new Table();
     $this->table->setArgsCallback($this->argsCallback);
     $this->add($this->table);
 }
Example #6
0
 /**
  * @param string $content
  * @param string $tag
  * @param string $type
  */
 public function __construct(string $content = null, $tag = '<li>', string $type = null)
 {
     parent::__construct($tag, $content);
     $this->addClass('list-group-item');
     if ($type) {
         $this->addClass($type);
     }
 }
Example #7
0
 /**
  * @param string $id
  * @param string $name
  */
 public function __construct(string $id, $name = null)
 {
     parent::__construct('<th>');
     $this->id = $id;
     if ($name) {
         $this->setContent($name);
     }
 }
Example #8
0
 /**
  * {@inheritdoc}
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('cawa-google-map');
     $this->add(new HtmlElement('<div>'));
     $this->widgetOptions = new WidgetOption(['key' => DI::config()->get('googleMaps/apikey')]);
     $this->setZoom(15);
 }
Example #9
0
 /**
  * @param string $class
  */
 public function __construct(string $class = null)
 {
     parent::__construct('<span>');
     $this->addClass('input-group-addon');
     $element = new HtmlElement('<i>');
     $element->addClass($class);
     $this->add($element);
 }
Example #10
0
 /**
  * @param string|null $label
  */
 public function __construct(string $label = null)
 {
     parent::__construct('<div>');
     $this->container = new HtmlContainer('<div>');
     $this->elements[] = $this->container;
     if ($label) {
         $this->setLabel($label);
     }
 }
Example #11
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<html>');
     $this->head = new HtmlContainer('<head>');
     $this->add($this->head);
     $this->footer = new Container();
     $this->body = new HtmlContainer('<body>');
     $this->add($this->body);
 }
Example #12
0
 /**
  * @param string $size
  */
 public function __construct(string $size = null)
 {
     parent::__construct('<div>');
     $this->addClass('btn-group');
     $this->addAttribute('role', 'group');
     if ($size) {
         $this->addClass($size);
     }
 }
Example #13
0
 /**
  *
  */
 public function __construct()
 {
     self::translator()->addFile(__DIR__ . '/../../lang/global', 'html');
     parent::__construct('<table>');
     $this->thead = new HtmlContainer('<thead>');
     $this->tbody = new HtmlContainer('<tbody>');
     $this->elements[] = $this->thead;
     $this->elements[] = $this->tbody;
 }
Example #14
0
 /**
  * @param array|string $class
  */
 public function __construct($class = null)
 {
     parent::__construct('<div>');
     if ($class) {
         $this->addClass($class);
     }
 }
Example #15
0
 /**
  * @param string $tag
  */
 public function __construct($tag = '<ul>')
 {
     parent::__construct($tag);
     $this->addClass('list-group');
 }
Example #16
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<form>');
     $this->addAttributes(['role' => 'form', 'method' => 'POST']);
 }
Example #17
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('cawa-collapse panel-group')->addAttributes(['role' => 'tablist', 'aria-multiselectable' => 'true']);
 }
Example #18
0
 /**
  * {@inheritdoc}
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('cawa-carousel');
     $this->widgetOptions = new WidgetOption();
 }
Example #19
0
 /**
  * @param string $title
  */
 public function __construct(string $title)
 {
     parent::__construct('<div>');
     $this->addClass('tab-pane');
     $this->title = $title;
 }
Example #20
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('row');
 }