public function content_reorder($APP) { $APP->set('MODUL_ID', 53); $USER_RIGHTS = parent::checkUserModulRights($APP->get('MODUL_ID'), $APP->get('LOGIN_USER_RIGHTS')); if ($USER_RIGHTS == false) { $APP->get('CONSTRUCTR_LOG')->write('User ' . $APP->get('SESSION.username') . ' missing USER-RIGHTS for modul ' . $APP->get('MODUL_ID')); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/no-rights'); } $PAGE_ID = filter_var($APP->get('PARAMS.page_id'), FILTER_SANITIZE_NUMBER_INT); $APP->set('PAGE_ID', $PAGE_ID); $CONTENT_ID = filter_var($APP->get('PARAMS.content_id'), FILTER_SANITIZE_NUMBER_INT); $APP->set('CONTENT_ID', $CONTENT_ID); $METHOD = filter_var($APP->get('PARAMS.method'), FILTER_SANITIZE_FULL_SPECIAL_CHARS); $APP->set('METHOD', $METHOD); $APP->set('SELECT_CONTENT', $APP->get('DBCON')->exec(['SELECT * FROM constructr_content WHERE constructr_content_page_id=:PAGE_ID AND constructr_content_id=:CONTENT_ID LIMIT 1;'], [[':PAGE_ID' => $PAGE_ID, ':CONTENT_ID' => $CONTENT_ID]])); $APP->set('CONTENT_COUNTR', 0); $APP->set('CONTENT_COUNTR', count($APP->get('SELECT_CONTENT'))); if ($APP->get('CONTENT_COUNTR') == 1) { if ($METHOD == 'up') { $ACT_POSITION = $APP->get('SELECT_CONTENT.0.constructr_content_order'); $NEW_POSITION = $APP->get('SELECT_CONTENT.0.constructr_content_order') - 1; $APP->set('UPDATE_OLD_CONTENT', $APP->get('DBCON')->exec(['UPDATE constructr_content SET constructr_content_order=:TMP_ORDER WHERE constructr_content_page_id=:PAGE_ID AND constructr_content_order=:NEW_POSITION LIMIT 1;'], [[':PAGE_ID' => $PAGE_ID, ':NEW_POSITION' => $NEW_POSITION, ':TMP_ORDER' => 9999]])); $APP->set('UPDATE_NEW_CONTENT', $APP->get('DBCON')->exec(['UPDATE constructr_content SET constructr_content_order=(constructr_content_order-1) WHERE constructr_content_page_id=:PAGE_ID AND constructr_content_id=:CONTENT_ID LIMIT 1;'], [[':PAGE_ID' => $PAGE_ID, ':CONTENT_ID' => $CONTENT_ID]])); $APP->set('UPDATE_OLD_CONTENT2', $APP->get('DBCON')->exec(['UPDATE constructr_content SET constructr_content_order=:ACT_POSITION WHERE constructr_content_page_id=:PAGE_ID AND constructr_content_order=:TMP_ORDER LIMIT 1;'], [[':ACT_POSITION' => $ACT_POSITION, ':PAGE_ID' => $PAGE_ID, ':TMP_ORDER' => 9999]])); $APP->set('MOVE', 'success'); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/content/' . $PAGE_ID . '/?move=success'); } elseif ($METHOD == 'down') { $ACT_POSITION = $APP->get('SELECT_CONTENT.0.constructr_content_order'); $NEW_POSITION = $APP->get('SELECT_CONTENT.0.constructr_content_order') + 1; $APP->set('UPDATE_OLD_CONTENT', $APP->get('DBCON')->exec(['UPDATE constructr_content SET constructr_content_order=:TMP_ORDER WHERE constructr_content_page_id=:PAGE_ID AND constructr_content_order=:NEW_POSITION LIMIT 1;'], [[':PAGE_ID' => $PAGE_ID, ':NEW_POSITION' => $NEW_POSITION, ':TMP_ORDER' => 9999]])); $APP->set('UPDATE_NEW_CONTENT', $APP->get('DBCON')->exec(['UPDATE constructr_content SET constructr_content_order=(constructr_content_order+1) WHERE constructr_content_page_id=:PAGE_ID AND constructr_content_id=:CONTENT_ID LIMIT 1;'], [[':PAGE_ID' => $PAGE_ID, ':CONTENT_ID' => $CONTENT_ID]])); $APP->set('UPDATE_OLD_CONTENT2', $APP->get('DBCON')->exec(['UPDATE constructr_content SET constructr_content_order=:ACT_POSITION WHERE constructr_content_page_id=:PAGE_ID AND constructr_content_order=:TMP_ORDER LIMIT 1;'], [[':ACT_POSITION' => $ACT_POSITION, ':PAGE_ID' => $PAGE_ID, ':TMP_ORDER' => 9999]])); parent::clean_up_cache($APP); $APP->set('MOVE', 'success'); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/content/' . $PAGE_ID . '/?move=success'); } else { $APP->set('MOVE', 'no-success'); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/content/' . $PAGE_ID . '/?move=no-success'); } } else { $APP->set('MOVE', 'no-success'); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/content/' . $PAGE_ID . '/?move=no-success'); } }
public function mrCleaner($APP) { parent::clean_up_cache($APP); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/pagemanagement?mrcleaner=success'); }