static function save($option, $pkg) { $database = JFactory::getDBO(); $row = new facileFormsPieces($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 JFactory::getApplication()->redirect("index.php?option={$option}&act=managepieces&pkg={$pkg}"); }
function save($option, $pkg) { $database = JFactory::getDBO(); $row = new facileFormsPieces($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 JFactory::getApplication()->redirect( "index.php?option=$option&act=managepieces&pkg=$pkg", BFText::_('COM_BREEZINGFORMS_PIECES_SAVED')); } // save
function emitPiece() { global $database; $database = JFactory::getDBO(); // sanity check if ($this->hasErrors()) return; // save new row $row = new facileFormsPieces($database); $row->published = $this->getInt(1, 'published', 1); $row->package = $this->getText(1, 'package'); $row->name = $this->getText(1, 'name', BFText::_('COM_BREEZINGFORMS_INSTALLER_UNKNOWN')); $row->title = $this->getText(1, 'title', BFText::_('COM_BREEZINGFORMS_INSTALLER_UNKNOWN')); $row->description = $this->getText(1, 'description'); $row->type = $this->getText(1, 'type', 'Untyped'); $row->code = $this->getText(1, 'code'); if (!$row->store()) { $this->setError($row->getError(), true); return; } // if // remember me $this->pieces[] = $row->id; // add to crossreference if (array_key_exists('id', $this->params[1])) $this->xpieces[] = array($this->params[1]['id'], $row->id); } // emitPiece