Example #1
0
	function copy($option, $pkg, $ids)
	{
		$database = JFactory::getDBO();
		$total = count($ids);
		$row = new facileFormsPieces($database);
		if (count($ids)) foreach ($ids as $id) {
			$row->load(intval($id));
			$row->id       = NULL;
			$row->store();
		} // foreach
		$msg = $total.' '.BFText::_('COM_BREEZINGFORMS_PIECES_SUCCOPIED');
		JFactory::getApplication()->redirect("index.php?option=$option&act=managepieces&pkg=$pkg&mosmsg=$msg");
	} // copy
Example #2
0
	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