alert('Select a module to $action'); window.history.go(-1);\n"; exit; } mosArrayToInts( $cid ); $cids = 'id=' . implode( ' OR id=', $cid ); $query = "UPDATE #__modules" . "\n SET published = " . (int) $publish . "\n WHERE ( $cids )" . "\n AND ( checked_out = 0 OR ( checked_out = " . (int) $my->id . " ) )" ; $database->setQuery( $query ); if (!$database->query()) { echo "\n"; exit(); } if (count( $cid ) == 1) { $row = new mosModule( $database ); $row->checkin( $cid[0] ); } mosCache::cleanCache( 'com_content' ); $redirect = mosGetParam( $_REQUEST, 'redirect', 'index2.php?option='. $option .'&client='. $client ); mosRedirect( $redirect ); } /* * using custom function because the core function in com_modules doesn't * read id from $_GET */ function orderModule( $uid, $inc, $option, $client='admin' ){ global $database; $row = new mosModule( $database ); $row->load( (int)$uid ); if ($client == 'admin') { $where = "client_id = 1"; } else { $where = "client_id = 0"; } $row->move( $inc, "position = " . $database->Quote( $row->position ) . " AND ( $where )" ); mosCache::cleanCache( 'com_content' ); $redirect = mosGetParam( $_REQUEST, 'redirect', 'index2.php?option='. $option .'&client='. $client ); mosRedirect( $redirect ); }