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);
 }
示例#2
0
	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