Exemple #1
0
 function showForm()
 {
     $l = dibi::fetch("SELECT * FROM article WHERE id_node=%i", $_GET['id_modul']);
     MT::addTemplate(dirname(__FILE__) . '/adminArticle.phtml', 'article');
     MT::addVar('article', 'l', $l);
     $f = new FilesNode(self::MODULE_NAME, $_GET['id_modul']);
     $f->type = 'all';
     MT::addVar('article', 'showMultiupload', $f->render());
     //    Admin_Comment::action(false);
     //    MT::addVar('article', 'comments', Admin_Comment::getCommentListForArticle($_GET['id_modul']));
 }
Exemple #2
0
 function showForm()
 {
     $l = dibi::fetch("SELECT * FROM [module_product] WHERE id_node=%i", $_GET['id_modul']);
     MT::addTemplate(dirname(__FILE__) . '/adminProduct.phtml', 'product');
     MT::addVar('product', 'l', $l);
     $f = new FilesNode(self::MODULE_NAME, $_GET['id_modul']);
     $f->type = 'all';
     $f->allowedExtensions = array('jpg', 'pdf', 'png');
     MT::addVar('product', 'showMultiupload', $f->render());
     //    $g = new Admin_GalleryMultiuploadControl();
     //    $g->action();
     //    $g->showForm($withOptions = false);
 }
 /**
  * @access public
  */
 public function showForm($withOptions = true)
 {
     MT::addTemplate(dirname(__FILE__) . "/show_form.phtml", 'gallery');
     $id_node = $_GET['id_modul'];
     $form = new NForm('saveGalleryForm');
     $form->getElementPrototype()->id = "formGallery";
     $form->addGroup('Nastavenie galérie');
     $form->addText('name', 'Názov');
     $form->addText('th_width', 'Šírka náhľadov');
     $form->addText('th_height', 'Výška náhľadov');
     $form->addText('width', 'Šírka obrázka');
     $form->addText('height', 'Výška obrázka');
     $form->addSelect('open_in_window', 'Otvárať do nového okna', array(1 => 'áno', 0 => 'nie'));
     $form->addSelect('type', 'Typ zobrazenia galérie', (array) NEnvironment::getConfig('gallery')->type);
     $form->addSubmit('saveGallery', 'Ulož');
     $form->onSubmit[] = array($this, 'save');
     $form->fireEvents();
     $defaults = self::get($id_node);
     if ($defaults != NULL) {
         $form->setDefaults($defaults);
     }
     $f = new FilesNode(self::MODULE_NAME, $_GET['id_modul']);
     MT::addVar('gallery', 'showMultiupload', $f->render());
     MT::addVar('gallery', 'galleryOptionsForm', $form);
     MT::addVar('gallery', 'withOptions', $withOptions);
     MT::addVar('gallery', 'gallery', self::get($_GET['id_modul']));
     MT::addVar('gallery', 'list', self::getAllFiles(self::MODULE_NAME, $_GET['id_modul']));
 }
Exemple #4
0
 function showChangeMenuItem($id_menu_item)
 {
     $l = dibi::fetch("SELECT * FROM menu_item WHERE id_menu_item=%i", $id_menu_item);
     if (!$l) {
         throw new Exception("Polozka v menu neexistuje");
     }
     MT::addTemplate(APP_DIR . '/templates/admin/menu/menuChangeItem.phtml', 'changeMenu');
     //----zistenie deti + priradenie do pomocnej pre sql dotaz
     $this->checkChild($id_menu_item);
     $id_menu_item_to_sql = "";
     $count_child = count($this->childs) - 1;
     foreach ($this->childs as $i => $child) {
         $id_menu_item_to_sql .= " AND ";
         $id_menu_item_to_sql .= " id_menu_item!='" . $child . "'";
     }
     $this->doTreeSelect = '';
     $this->doTreeSelect(0, 0, $l['parent'], $id_menu_item_to_sql);
     $f = new FilesNode('menu', $l['id_menu_item']);
     MT::addVar('changeMenu', 'showMultiupload', $f->render());
     MT::addVar('changeMenu', 'l', $l);
     MT::addVar('changeMenu', 'doTreeSelect', $this->doTreeSelect);
 }