static function save($option, $pkg) { $database = JFactory::getDBO(); $row = new facileFormsMenus($database); jimport('joomla.version'); $version = new JVersion(); if (version_compare($version->getShortVersion(), '3.0', '>=')) { unset($_POST['ordering']); unset($row->ordering); } // bind it to the table if (!$row->bind($_POST)) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } // if // store it in the db if (!$row->store()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } // if $row->reorder('parent=' . $row->parent); $result = updateComponentMenus(); $type = 'message'; $msg = BFText::_('COM_BREEZINGFORMS_MENUS_SAVED'); if ($result != '') { $msg = $result; $type = 'error'; } JFactory::getApplication()->redirect("index.php?option={$option}&act=managemenus&pkg={$pkg}", $msg, $type); }
function emitCompmenu() { global $database; $database = JFactory::getDBO(); // sanity check if ($this->hasErrors()) return; if (!array_key_exists('emitted', $this->params[1])) { // save new row $row = new facileFormsMenus($database); $database->setQuery("select max(ordering)+1 from #__facileforms_compmenus"); $row->ordering = $database->loadResult(); $row->published = $this->getInt(1, 'published', 1); $row->package = $this->getText(1, 'package'); $row->img = $this->getText(1, 'img'); $row->title = $this->getText(1, 'title', BFText::_('COM_BREEZINGFORMS_INSTALLER_UNKNOWN')); $row->name = $this->getText(1, 'name'); $row->page = $this->getInt(1, 'page', 1); $row->frame = $this->getInt(1, 'frame'); $row->border = $this->getInt(1, 'border'); $row->params = $this->getText(1, 'params'); if (!$row->store()) { $this->setError($row->getError(), true); return; } // if $this->menus[] = $row->id; if ($row->published) $this->pubmenus++; // final tasks $this->params[1]['menu_id'] = $row->id; $this->params[1]['submenu_ord'] = 0; $this->params[1]['emitted'] = true; } // if } // emitCompmenu
function save($option, $pkg) { $database = JFactory::getDBO(); $row = new facileFormsMenus($database); // bind it to the table if (!$row->bind($_POST)) { echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n"; exit(); } // if // store it in the db if (!$row->store()) { echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n"; exit(); } // if $row->reorder('parent='.$row->parent); $result = updateComponentMenus(); $type = 'message'; $msg = BFText::_('COM_BREEZINGFORMS_MENUS_SAVED'); if($result != ''){ $msg = $result; $type = 'error'; } JFactory::getApplication()->redirect("index.php?option=$option&act=managemenus&pkg=$pkg",$msg, $type ); } // save