* @package de.inside.wcf.DownloadDatabase */ class DownloadDBDataSortAction extends AbstractAction { public $positions = array(); /** * @see Action::readParameters() */ public function readParameters() { parent::readParameters(); if (isset($_POST['positions']) && is_array($_POST['positions'])) $this->positions = $_POST['positions']; } /** * @see Action::execute() */ public function execute() { parent::execute(); reset($this->positions); while (list($key, $val) = each($this->positions)) { WCF::getDB()->sendQuery("UPDATE wcf".WCF_N."_dldb_data SET `sortOrder` = '".$val."' WHERE `dataID` = '".$key."'"); } // reset cache WCF::getCache()->clear(WCF_DIR.'cache/', 'cache.dldbData.php'); $this->executed(); // forward to list page header('Location: index.php?page=DownloadDBDataList&packageID='.PACKAGE_ID.SID_ARG_2ND_NOT_ENCODED); exit; } } ?>