X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_surfbar_urls.php;h=02943e89dfcc1dd9e1741000d968fb91a517ee96;hp=f486a47d3ce81d4f74dbbc3ab127efe7ea1429ce;hb=596c8ab32594401ca84abfbfe35513ddfff31bec;hpb=e2148142f8b1a8f40fd6e7ca32185569c5a9083e diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index f486a47d3c..02943e89df 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -14,11 +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 * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 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 * @@ -42,143 +41,67 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // By default show the list... -$show = true; +$show = TRUE; -// Check for 'id' element -if ((countRequestPost() > 0) && ((!isPostRequestElementSet('id')) || (!is_array(postRequestElement('id'))) || (count(postRequestElement('id')) == '0'))) { +// Check for 'url_id' element +if ((countRequestPost() > 0) && (!ifPostContainsSelections('url_id'))) { // Not found so output message - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS')); + displayMessage('{--ADMIN_SURFBAR_NO_SELECTIONS--}'); // Abort here return; } // END - if // Edit or delete button hit? -if (isPostRequestElementSet('edit')) { +if (isFormSent('edit')) { // Show entries for editing - adminEditEntriesConfirm( - postRequestElement('id'), - 'surfbar_urls', - array('id', 'userid', 'url'), - array('bigintval', 'addMemberSelectionBox', ''), - array('', array(false, true, true), '') - ); - $show = false; -} elseif (isPostRequestElementSet('do_edit')) { + showEntriesByXmlCallback('admin_edit_show_surfbar_urls'); + + // Do not show the list of URLs after this template + $show = FALSE; +} elseif (isFormSent('do_edit')) { // Change data of entries - adminEditEntriesConfirm( - postRequestElement('id'), - 'surfbar_urls', - array(), - array(), - array(), - true - ); -} elseif (isPostRequestElementSet('delete')) { + showEntriesByXmlCallback('admin_edit_do_surfbar_urls'); +} elseif (isFormSent('delete')) { // Show entries for deletion - adminDeleteEntriesConfirm( - postRequestElement('id'), - 'surfbar_urls', - array('id', 'userid', 'url', 'registered'), - array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', ''), - array('', '', '', '') - ); - $show = false; -} elseif (isPostRequestElementSet('do_delete')) { + showEntriesByXmlCallback('admin_delete_show_surfbar_urls'); + + // Do not show the list of URLs after this template + $show = FALSE; +} elseif (isFormSent('do_delete')) { // Remove entries from database - adminDeleteEntriesConfirm(postRequestElement('id'), 'surfbar_urls', array(), array(), array(), true); -} elseif (isPostRequestElementSet('lock')) { + showEntriesByXmlCallback('admin_delete_do_surfbar_urls'); +} elseif (isFormSent('lock')) { // Un-/lock selected URLs. This does not work for pending URLs - adminLockEntriesConfirm( - postRequestElement('id'), - 'surfbar_urls', - array('id', 'userid', 'url', 'registered', 'status'), - array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', '', 'translateSurfbarUrlStatus'), - array('', '', '', '', '') - ); - $show = false; -} elseif (isPostRequestElementSet('do_lock')) { + showEntriesByXmlCallback('admin_lock_show_surfbar_urls'); + + // Do not show the list of URLs after this template + $show = FALSE; +} elseif (isFormSent('do_lock')) { // Un-/lock selected URLs. This does not work for pending URLs - adminLockEntriesConfirm( - postRequestElement('id'), - 'surfbar_urls', - array(), - array(), - array(), - array('status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')), - true - ); -} elseif (isPostRequestElementSet('undelete')) { + showEntriesByXmlCallback('admin_lock_do_surfbar_urls'); +} elseif (isFormSent('undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) - adminUndeleteEntriesConfirm( - postRequestElement('id'), - 'surfbar_urls', - array('id', 'userid', 'url', 'registered', 'status'), - array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', '', 'translateSurfbarUrlStatus'), - array('', '', '', '', '') - ); - $show = false; -} elseif (isPostRequestElementSet('do_undelete')) { + showEntriesByXmlCallback('admin_undelete_show_surfbar_urls'); + + // Do not show the list of URLs after this template + $show = FALSE; +} elseif (isFormSent('do_undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) - adminUndeleteEntriesConfirm( - postRequestElement('id'), - 'surfbar_urls', - array(), - array(), - array(), - array('status' => array('DELETED' => 'ACTIVE')), - true - ); + 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 - `id`, `userid`, `url`, `views_total`, `status`, - UNIX_TIMESTAMP(`registered`) AS registered, - UNIX_TIMESTAMP(`last_locked`) AS last_locked, - `lock_reason` -FROM - `{?_MYSQL_PREFIX?}_surfbar_urls` -ORDER BY - `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['userid'] = generateUserProfileLink($content['userid']); - $content['url'] = generateFrametesterUrl($content['url']); - $content['views_total'] = translateComma($content['views_total']); - $content['status'] = translateSurfbarUrlStatus($content['status']); - $content['registered'] = generateDateTime($content['registered'], 2); - $content['last_locked'] = generateDateTime($content['last_locked'], 2); - if (empty($content['lock_reason'])) $content['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] ?>