Esempio n. 1
0
 public function __construct($name, $label)
 {
     $this->monitor('Drahak\\Tables\\Table');
     parent::__construct(NULL, $name);
     $this->cellPrototype = Html::el('td');
     $this->labelPrototype = Html::el('th');
     $this->labelPrototype->add(Html::el('a', $label));
     $this->column = $name;
 }
Esempio n. 2
0
 /**
  * Should the element has an icon?
  * @param  Html            $el
  * @param  string|null     $icon
  * @param  string          $name
  * @return void
  */
 public function tryAddIcon($el, $icon, $name)
 {
     if ($icon) {
         $el->add(Html::el('span')->class(DataGrid::$icon_prefix . $icon));
         if (strlen($name)) {
             $el->add(' ');
         }
     }
 }
Esempio n. 3
0
 public function render()
 {
     if (empty($this->dotaz)) {
         throw new \Flame\Ares\AresException('Vyplň alespoň jeden IČ.');
     }
     foreach ($this->dotaz as $key => $val) {
         $this->xml->add('<Dotaz><Pomocne_ID>' . $key . '</Pomocne_ID><ICO>' . $val . '</ICO></Dotaz>');
     }
     $this->xml->__set('dotaz_pocet', $this->count);
     return $this->xml->render();
 }
Esempio n. 4
0
 public static function input(Html $input, BaseControl $control)
 {
     $name = $input->getName();
     if ($name === 'select' || $name === 'textarea' || $name === 'input' && !in_array($input->type, array('radio', 'checkbox', 'file', 'hidden', 'range', 'image', 'submit', 'reset'))) {
         $input->addClass('form-control');
     } elseif ($name === 'input' && ($input->type === 'submit' || $input->type === 'reset')) {
         $input->setName('button');
         $input->add($input->value);
         $input->addClass('btn');
     }
     return $input;
 }
Esempio n. 5
0
 private function buildFooter(Html $output)
 {
     $footer = new Footer($this->paginator);
     $footerObject = $footer->render();
     $output->add($footerObject);
 }
Esempio n. 6
0
 /**
  * @param string $operationName
  * @param Html $menu
  * @param string $mediaTrigger
  */
 private function _addOperationToMenu($operationName, &$menu, $mediaTrigger)
 {
     switch ($operationName) {
         case 'newFolder':
             $menu->add($this->createNewFolderMenuItem());
             break;
         case 'newGallery':
             $menu->add($this->createNewGalleryMenuItem());
             break;
         case 'loadFiles':
             $menu->add($this->createLoadFilesMenuItem());
             break;
         case 'loadImages':
             $menu->add($this->createLoadImagesMenuItem());
             break;
         case 'insertGallery':
             $menu->add($this->createInsertGalleryMenuItem($mediaTrigger));
             break;
         case 'insertFile':
             $menu->add($this->createInsertFileMenuItem($mediaTrigger));
             break;
     }
 }
Esempio n. 7
0
 private function buildPaginatorPages(Html $unorderedList)
 {
     $actualPage = $this->paginator->page;
     for ($i = 1; $i <= $this->paginator->pageCount; $i++) {
         if ($this->shouldSkipThisPaginationPage($i)) {
             continue;
         }
         $httpService = new HttpService();
         $paginationUrl = $httpService->getUrlWithPaginator($i);
         $listItem = $this->html->el('li');
         $anchor = $this->html->el('a')->addAttributes(array('href' => $paginationUrl))->setText($i);
         if ($actualPage == $i) {
             $listItem->addAttributes(array('class' => 'active'));
         }
         $listItem->add($anchor);
         $unorderedList->add($listItem);
     }
 }