#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Or read it online: http://www.gnu.org/licenses/licenses.html#GPL
#-------------------------------------------------------------------------
if (!is_object(@cmsms())) {
    exit;
}
if (!$this->CheckAccess()) {
    exit;
}
$aeform = new fbForm($this, $params, true);
$srcIndex = $aeform->GetFieldIndexFromId($params['field_id']);
if ($params['fbrp_dir'] == 'up') {
    $destIndex = $srcIndex - 1;
} else {
    $destIndex = $srcIndex + 1;
}
$aeform->SwapFieldsByIndex($srcIndex, $destIndex);
// force reload of form, this is kinda hackish but cant think of anything else ;)
$aeform = new fbForm($this, $params, true);
$tab = $this->GetActiveTab($params);
echo $aeform->AddEditForm($id, $returnid, $tab, $this->ShowMessage($this->Lang('field_order_updated')));
#
# EOF
#