Esempio n. 1
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->content = $this->pages->where('code', $this->actual)->fetch();
     $this->template->setFile(__DIR__ . "/Page.latte");
     $this->template->render();
 }
Esempio n. 2
0
 public function render($args = NULL)
 {
     parent::render($args);
     $template = $this->template;
     $template->setFile(__DIR__ . '/PhotosControl.latte');
     $template->render();
 }
Esempio n. 3
0
 function createComponent($name)
 {
     switch ($name) {
         case 'loginForm':
             $form = new NAppForm();
             $form->getElementPrototype()->addClass('ajax');
             $form->addText('login', _('Prihlasovacie meno'))->addRule(NFORM::FILLED, _('Prihlasovacie meno musí byť vyplnené'));
             $form->addPassword('password', 'Heslo')->addRule(NFORM::FILLED, _('Heslo musí byť vyplnené.'));
             $form->addSubmit('btn_submit', _('Prihlásiť sa'));
             $form->addHidden('backlink');
             $form->onSuccess[] = array($this, 'onSubmitAuthenticate');
             $this->addComponent($form, $name);
             break;
         case 'cartLoginForm':
             $form = new NAppForm();
             $form->getElementPrototype()->addClass('ajax');
             $form->addText('login', _('Prihlasovacie meno'))->addRule(NFORM::FILLED, _('Prihlasovacie meno musí byť vyplnené'));
             $form->addPassword('password', 'Heslo')->addRule(NFORM::FILLED, _('Heslo musí byť vyplnené.'));
             $form->addSubmit('btn_submit', _('Prihlásiť sa'));
             $form->addHidden('backlink');
             $form->onSuccess[] = array($this, 'onSubmitAuthenticate');
             //				dump($form);exit;
             $this->addComponent($form, $name);
             break;
         default:
             return parent::__construct();
             break;
     }
 }
Esempio n. 4
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->setFile(__DIR__ . "/TagsControl.latte");
     $this->template->tags = $args;
     $this->template->render();
 }
Esempio n. 5
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->value = $this->value;
     $this->value++;
     $this->template->render();
 }
Esempio n. 6
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->controls = $this->controls;
     $this->template->setFile(__DIR__ . "/EventsTable.latte");
     $this->template->render();
 }
Esempio n. 7
0
 public function render($args = NULL)
 {
     parent::render($args);
     // TODO: Change the autogenerated stub
     $this->template->setFile(__DIR__ . "/NewsletterControl.basic.latte");
     $this->template->render();
 }
Esempio n. 8
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->id = (int) $args['id'];
     $this['termsForm']['event_id']->setValue($this->id);
     $event = $this->context->createServiceEvents()->get($this->id);
     if ($event) {
         $times = $this->context->createServiceTerms()->where('event_id', $this->id);
         if ($times->count() > 0) {
             foreach ($times as $value) {
                 $terms['terms'][$value->id]['time_id'] = $value->id;
                 $df = date_create_from_format("Y-m-d", substr($value->date_from, 0, 10));
                 if ($df) {
                     $terms['terms'][$value->id]['date_from'] = $df->format('d. m. Y');
                 }
                 $df = date_create_from_format("Y-m-d", substr($value->date_to, 0, 10));
                 if ($df) {
                     $terms['terms'][$value->id]['date_to'] = $df->format('d. m. Y');
                 }
                 $terms['terms'][$value->id]['time_from'] = $value->time_from;
                 $terms['terms'][$value->id]['time_to'] = $value->time_to;
                 $terms['terms'][$value->id]['visible'] = $value->visible;
                 if ($value->every_monday) {
                     $terms['terms'][$value->id]['every_monday'] = 1;
                 }
                 if ($value->every_tuesday) {
                     $terms['terms'][$value->id]['every_tuesday'] = 1;
                 }
                 if ($value->every_wednesday) {
                     $terms['terms'][$value->id]['every_wednesday'] = 1;
                 }
                 if ($value->every_thursday) {
                     $terms['terms'][$value->id]['every_thursday'] = 1;
                 }
                 if ($value->every_friday) {
                     $terms['terms'][$value->id]['every_friday'] = 1;
                 }
                 if ($value->every_saturday) {
                     $terms['terms'][$value->id]['every_saturday'] = 1;
                 }
                 if ($value->every_sunday) {
                     $terms['terms'][$value->id]['every_sunday'] = 1;
                 }
                 if ($value->repeat) {
                     $terms['terms'][$value->id]['repeat'] = 1;
                 }
             }
             $this['termsForm']->setDefaults($terms);
             $this['termsForm']['terms']->remove($this['termsForm']['terms'][0]);
         }
         $this->template->event = $event;
         $this->template->setFile(__DIR__ . "/EventTermsControl.latte");
         $this->template->id = $args['id'];
         $this->template->new = $this->new;
         $this->template->render();
     } else {
         throw new Exception('There is no event with ID #' . $this->id);
     }
 }
Esempio n. 9
0
 function Render()
 {
     $text = $this->Text;
     parent::Render();
     //$text != null ? $text = "value='$this->Text'" : '';
     $strtextbox = "<label {$this->Attributes}>{$text}</label>";
     return $strtextbox;
 }
Esempio n. 10
0
 protected function createComponent($name)
 {
     switch ($name) {
         default:
             return parent::createComponent($name);
             break;
     }
 }
Esempio n. 11
0
 function Render()
 {
     $text = $this->Text;
     parent::Render();
     $text != null ? $text = "value='{$this->Text}' " : '';
     $strtextbox = "<input type='hidden' {$this->Attributes} {$text}>";
     return $strtextbox;
 }
Esempio n. 12
0
 public function __construct()
 {
     parent::__construct();
     Language::read('member_chat');
     if (strtoupper(CHARSET) == 'GBK') {
         $_GET = Language::getGBK($_GET);
         $_POST = Language::getGBK($_POST);
     }
 }
Esempio n. 13
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->files = $this->context->createServiceFiles()->where('isImage', '1')->where('imageSizeX > 150')->where('imageSizeY > 150')->where('delete', '0')->limit(10)->order('first DESC, file.created DESC')->group(':subject_x_file.subject_id');
     //$this->template->subjects = $this->context->createServicePlaces()->fetchVisible();
     $this->template->setFile(__DIR__ . "/PhotoStream.latte");
     //		$this->template->setTranslator($this->context->translator);
     $this->template->render();
 }
Esempio n. 14
0
 public function __construct(SpravceAkci $spravceAkci)
 {
     parent::__construct();
     //        $this->akceRepository = $akceRepository;
     $this->mesic = date('m');
     $this->rok = date('Y');
     $this->currentDay = date('j');
     $this->spravceAkci = $spravceAkci;
 }
Esempio n. 15
0
 function Render()
 {
     $text = $this->Text;
     parent::Render();
     $text != null ? $text = "value='{$this->Text}' " : '';
     $issubmit = $this->IsSubmit == true ? "Submit" : "Button";
     $caption = $this->ShowCaption == true ? "<label for='{$this->Name}'>" . $this->Caption . "</label>" : "";
     $strtextbox = "{$caption}<input type='{$issubmit}' {$this->Attributes} {$text}>";
     return $strtextbox;
 }
Esempio n. 16
0
 public function render($args = NULL)
 {
     parent::render($args);
     if ($args) {
         $this->template->setFile(__DIR__ . "/FlashMessages.latte");
         $this->template->flashes = $args;
         $this->template->grid = $this->withGrid;
         $this->template->top = $this->top;
         $this->template->render();
     }
 }
Esempio n. 17
0
 public function render($args = NULL)
 {
     parent::render($args);
     if (isset($args['id'])) {
         $this->template->item = $this->context->createServiceEvents()->get($args['id']);
     } elseif (isset($args['item'])) {
         $this->template->item = $args['item'];
     }
     $this->template->setFile(__DIR__ . "/EventItemControl.latte");
     $this->template->render();
 }
Esempio n. 18
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->articles = $this->articles->order('created DESC')->limit($this->count);
     $f = $this->template->getFile();
     if (!isset($f)) {
         $this->template->setFile(__DIR__ . "/Competitions.latte");
     }
     $this->template->headline = $this->headline;
     $this->template->render();
 }
Esempio n. 19
0
 function Render()
 {
     $checked = $this->Checked;
     parent::Render();
     $checked != null ? $checked = "checked='{$this->Checked}' " : '';
     $length = $this->Length != null ? "size='{$this->Length}' " : "";
     $value = $this->Value != null ? "value='{$this->Value}' " : "";
     $caption = $this->ShowCaption == true ? "<label for='{$this->ID}'>" . $this->Caption . "</label>" : "";
     $strtextbox = "<input type='radio' {$length} {$value} {$this->Attributes} {$checked}> {$caption}";
     return $strtextbox;
 }
Esempio n. 20
0
 function Render()
 {
     $text = $this->Text;
     parent::Render();
     $text != null ? $text = "value='{$this->Text}' " : '';
     $length = $this->Length != null ? "maxlength='{$this->Length}' " : "";
     $password = $this->Password == true ? "password" : "text";
     $caption = $this->ShowCaption == true ? "<label for='{$this->Name}'>" . $this->Caption . "</label>" : "";
     $strtextbox = "{$caption}<input type='{$password}' {$length} {$this->Attributes} {$text}>";
     return $strtextbox;
 }
Esempio n. 21
0
 /**
  * (non-phpDoc)
  *
  * @see Nette\Application\Control#render()
  */
 public function render($args = NULL)
 {
     parent::render($args);
     $tmp = $this->context->createServiceTimes()->fetchPublic()->where('DATEDIFF(event_time.date_from, CURDATE()) >= 0')->where('prefered', 1)->order('event_time.date_from ')->group('event_time.event_id')->limit(4);
     if ($tmp->count() == 0) {
         $tmp = $this->context->createServiceTimes()->fetchPublic()->where('DATEDIFF(event_time.date_from, CURDATE()) >= 0')->order('event_time.date_from ')->group('event_time.event_id')->limit(4);
     }
     $this->template->events = $tmp;
     $this->template->setFile(__DIR__ . "/HomepageCalendarControl.latte");
     $this->template->setTranslator($this->translator);
     $this->template->render();
 }
Esempio n. 22
0
 public function __construct($vysledky, $sport, $typ, $vypisovane_naradi = null)
 {
     parent::__construct();
     dd($vysledky, 'vysledky');
     $this->vysledky = $vysledky;
     $this->sport = $sport;
     $this->typ = $typ;
     dd($vypisovane_naradi, 'naradi');
     if ($vypisovane_naradi) {
         $this->vypisovane_naradi = $vypisovane_naradi;
     }
 }
Esempio n. 23
0
 /**
  * @param null $args
  */
 public function render($args = NULL)
 {
     parent::render($args);
     // TODO: Change the autogenerated stub
     $articles = $this->articles->where('published < NOW()')->order('created DESC')->limit(10)->fetchPairs('created');
     $venues = $this->venues->fetchVisible()->order('created DESC')->limit(10)->fetchPairs('created');
     $competitions = $this->competitions->order('created DESC')->limit(10)->fetchPairs('created');
     $output = $articles + $venues + $competitions;
     krsort($output);
     $this->template->items = $output;
     $this->template->setFile(__DIR__ . "/StreamControl.basic.latte");
     $this->template->render();
 }
Esempio n. 24
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this->template->database = $this->context->database;
     $this->template->subjects = $this->subjects->fetchAd($this->strict);
     $this->template->type = $this->type;
     $this->template->setFile(__DIR__ . "/BannerSubjects.latte");
     dibi::begin();
     foreach ($this->subjects as $key => $value) {
         dibi::query('update subject set ad_show_count=ad_show_count+1 where id=' . $key);
     }
     dibi::commit();
     $this->template->render();
 }
Esempio n. 25
0
 function createComponent($name)
 {
     switch ($name) {
         case 'order':
             $orderSession = $this->getSession();
             $f = new MyForm();
             $f->getElementPrototype()->class = 'ajax';
             $f->addSelect('order_select', 'Zoradenie podľa: ', $this->getOrderFilterArray())->getControlPrototype()->class = 'orderBy';
             $f->onSuccess[] = array($this, 'handleChangeOrder');
             $f->setDefaults(array('order_select' => $orderSession['order']));
             return $f;
             break;
         default:
             return parent::createComponent($name);
             break;
     }
 }
Esempio n. 26
0
 public function render($args = NULL)
 {
     parent::render($args);
     if (($this->presenter->name == 'Calendar' || $this->presenter->name == 'Catalog') && $this->presenter->action == 'detail' && isset($this->presenter->template->item->id)) {
         $item = $this->presenter->template->item;
         $id = $item->id;
         $this->template->id = $id;
         $this->template->backlink = $this->presenter->storeRequest();
         if ($this->parent->user->id === $item->user_id || $this->parent->user->isInRole('administrator')) {
             if ($this->parent instanceof CalendarPresenter) {
                 $this->template->setFile(__DIR__ . "/RemoteControl.event.latte");
             } elseif ($this->parent instanceof CatalogPresenter) {
                 $this->template->setFile(__DIR__ . "/RemoteControl.place.latte");
             }
             if ($this->template->getFile() !== null) {
                 $this->template->render();
             }
         }
     }
 }
Esempio n. 27
0
 public function render($args = NULL)
 {
     parent::render($args);
     if (is_array($args)) {
         $this->id = (int) $args['id'];
     } elseif (is_int($args)) {
         $this->id = $args;
     }
     $this->user = $this->presenter->user;
     $place = $this->context->createServicePlaces()->get($this->id);
     $this['toolsForm']->setDefaults($place);
     if ($place) {
         $this->template->setFile(__DIR__ . "/AdminToolsPlaceControl.latte");
         $this->template->place = $place;
         $this->template->id = $this->id;
         $this->template->render();
     } else {
         throw new \Nette\InvalidStateException('There is no place with ID #' . $this->id);
     }
 }
Esempio n. 28
0
 public function render($args = NULL)
 {
     parent::render($args);
     $this['fileUploadForm']['id']->setValue((string) $args['id']);
     $this['fileUploadForm']['type']->setValue($args['type']);
     $this->template->setFile(__DIR__ . "/ManagePhotosControl.latte");
     $this->template->id = $args['id'];
     $this->template->type = $args['type'];
     if (isset($args['backbutton'])) {
         $this->template->backbutton = $args['backbutton'];
     } else {
         $this->template->backbutton = true;
     }
     if ($args['type'] == 'event') {
         $this->template->placeFiles = $this->context->createServiceFiles()->where(':subject_x_file.subject_id', $this->context->createService('events')->get($args['id'])->subject_id);
     }
     if ($args['type'] == 'place') {
         $places = $this->context->createService('events')->where('subject_id', $args['id'])->fetchAll();
         $this->template->eventFiles = $this->context->createServiceFiles()->where(':event_x_file.event_id', array_keys($places));
     }
     $this->template->userFiles = $this->context->createServiceFiles()->where('user_id', $this->getPresenter()->user->id);
     $this->template->render();
 }
Esempio n. 29
0
 function createComponent($name)
 {
     switch ($name) {
         case 'baseForm':
             $form = new NAppForm();
             $form->getElementPrototype()->addClass('ajax');
             $form->addText('login', _('Prihlasovacie meno'))->addRule(NFORM::FILLED, _('Prihlasovacie meno musí byť vyplnené'));
             /*
              * todo nejaky problem pri odhlaseny
              */
             //				$form->addProtection(_('Bohužial Váš formulár expiroval. Prosím odošlite formulár znovu.') );
             $renderer = $form->getRenderer();
             $renderer->wrappers['controls']['container'] = NULL;
             $renderer->wrappers['pair']['container'] = 'div';
             $renderer->wrappers['label']['container'] = NULL;
             $renderer->wrappers['control']['container'] = NULL;
             $form->addPassword('password', 'Heslo')->addRule(NFORM::FILLED, _('Heslo musí byť vyplnené.'));
             $form->addSubmit('btn_submit', _('Prihlásiť'));
             $form->addHidden('backlink');
             return $form;
             break;
         case 'loginForm':
             $form = $this->createComponent('baseForm');
             $form->onSuccess[] = array($this, 'onSubmitAuthenticate');
             $this->addComponent($form, $name);
             break;
         case 'classicLoginForm':
             $form = $this->createComponent('baseForm');
             $form->onSuccess[] = array($this, 'onSubmitAuthenticate');
             $this->addComponent($form, $name);
             break;
         default:
             return parent::createComponent($name);
             break;
     }
 }
Esempio n. 30
0
 public function __construct($clanky, $class)
 {
     parent::__construct();
     $this->clanky = $clanky;
     $this->class = $class;
 }