X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_surfbar_urls.php;h=e8bed5d2294295f85ce25c9fd46aa436526321b5;hp=248d360c8103b02bd6ab4059df9c1b1a4e9f4114;hb=fb573d4c3d981d52fd969a6d7167d8dc839be688;hpb=42d36ab276be084305ebdb57feb4e60c6b3ec916 diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index 248d360c81..e8bed5d229 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -14,12 +14,10 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -43,15 +41,15 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // By default show the list... $show = true; // Check for 'url_id' element -if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('url_id')) || (!is_array(postRequestParameter('url_id'))) || (count(postRequestParameter('url_id')) == 0))) { +if ((countRequestPost() > 0) && ((!isPostRequestElementSet('url_id')) || (!is_array(postRequestElement('url_id'))) || (count(postRequestElement('url_id')) == 0))) { // Not found so output message - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS')); + displayMessage('{--ADMIN_SURFBAR_NO_SELECTIONS--}'); // Abort here return; @@ -60,147 +58,50 @@ if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('url_id')) || (!is_ // Edit or delete button hit? if (isFormSent('edit')) { // Show entries for editing - adminEditEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array('url_id', 'url_userid', 'url'), - array('bigintval', 'addMemberSelectionBox', ''), - array('', array(false, true, true, 'url_userid[]'), ''), - false, - 'url_id', - 'url_userid', - 'url_userid' - ); + showEntriesByXmlCallback('admin_edit_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestParameterSet('do_edit')) { +} elseif (isFormSent('do_edit')) { // Change data of entries - adminEditEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array(), - array(), - array(), - true, - 'url_id', - 'url_userid', - 'url_userid' - ); -} elseif (isPostRequestParameterSet('delete')) { + showEntriesByXmlCallback('admin_edit_do_surfbar_urls'); +} elseif (isFormSent('delete')) { // Show entries for deletion - adminDeleteEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array('url_id', 'url_userid', 'url', 'url_registered'), - array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', ''), - array('', '', '', ''), - false, - 'url_id', - 'url_userid', - 'url_userid' - ); + showEntriesByXmlCallback('admin_delete_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestParameterSet('do_delete')) { +} elseif (isFormSent('do_delete')) { // Remove entries from database - adminDeleteEntriesConfirm(postRequestParameter('url_id'), 'surfbar_urls', array(), array(), array(), true, 'url_id'); + showEntriesByXmlCallback('admin_delete_do_surfbar_urls'); } elseif (isFormSent('lock')) { // Un-/lock selected URLs. This does not work for pending URLs - adminLockEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array('url_id', 'url_userid', 'url', 'url_registered', 'url_status'), - array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'), - array('', '', '', '', ''), - false, - 'url_id', - 'url_userid', - 'url_userid' - ); + showEntriesByXmlCallback('admin_lock_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestParameterSet('do_lock')) { +} elseif (isFormSent('do_lock')) { // Un-/lock selected URLs. This does not work for pending URLs - adminLockEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array(), - array(), - array(), - array('url_status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')), - true, - 'url_id', - 'url_userid', - 'url_userid' - ); -} elseif (isPostRequestParameterSet('undelete')) { + showEntriesByXmlCallback('admin_lock_do_surfbar_urls'); +} elseif (isFormSent('undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) - adminUndeleteEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array('url_id', 'url_userid', 'url', 'url_registered', 'url_status'), - array('bigintval', 'generateUserProfileLink', 'generateFrametesterUrl', '', 'translateSurfbarUrlStatus'), - array('', '', '', '', ''), - false, - 'url_id', - 'url_userid', - 'url_userid' - ); + showEntriesByXmlCallback('admin_undelete_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestParameterSet('do_undelete')) { +} elseif (isFormSent('do_undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) - adminUndeleteEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array(), - array(), - array(), - array('url_status' => array('DELETED' => 'ACTIVE')), - true, - 'url_id', - 'url_userid', - 'url_userid' - ); + showEntriesByXmlCallback('admin_undelete_do_surfbar_urls'); } // Show entries? -if ($show === false) return false; +if ($show === false) { + // No, a form has already been show + return false; +} // END - if // List all URLs -$result = SQL_QUERY("SELECT - `url_id`, `url_userid`, `url`, `url_views_total`, `url_status`, - UNIX_TIMESTAMP(`url_registered`) AS `url_registered`, - UNIX_TIMESTAMP(`url_last_locked`) AS `url_last_locked`, - `url_lock_reason` -FROM - `{?_MYSQL_PREFIX?}_surfbar_urls` -ORDER BY - `url_id` ASC", __FILE__, __LINE__); - -// Do we have some URLs left? -if (SQL_NUMROWS($result) > 0) { - // List all URLs - $OUT = ''; $SW = 2; - while ($content = SQL_FETCHARRAY($result)) { - // "Translate"/add content - $content['sw'] = $SW; - $content['url_registered'] = generateDateTime($content['url_registered'], 2); - $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2); - if (empty($content['url_lock_reason'])) $content['url_lock_reason'] = '---'; - - // Load row template - $OUT .= loadTemplate('admin_list_surfbar_urls_row', true, $content); - - // Switch color - $SW = 3 - $SW; - } // END - while - - // Load main template - loadTemplate('admin_list_surfbar_urls', false, $OUT); -} else { - // No URLs in surfbar - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_URLS_FOUND')); -} - -// Free result -SQL_FREERESULT($result); +showEntriesByXmlCallback('admin_list_surfbar_urls'); // [EOF] ?>