X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_surfbar_urls.php;h=d06b8285a749e9757b66759fae1e06b1cf607ce1;hp=3f739df7892e7af2241facb6c686539d91423073;hb=63f159414369b5ea19a8ca75d8cd8033c45d8341;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index 3f739df789..d06b8285a7 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -1,7 +1,7 @@ 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), '') - ); + showEntriesByXmlCallback('admin_edit_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestElementSet('do_edit')) { +} 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('', '', '', '') - ); + showEntriesByXmlCallback('admin_delete_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestElementSet('do_delete')) { +} 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('', '', '', '', '') - ); + showEntriesByXmlCallback('admin_lock_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestElementSet('do_lock')) { +} 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('', '', '', '', '') - ); + showEntriesByXmlCallback('admin_undelete_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestElementSet('do_undelete')) { +} 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] ?>