]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_surfbar_urls.php
Code style changed, ext-user continued:
[mailer.git] / inc / modules / admin / what-list_surfbar_urls.php
index 0852fc1d5be3cafc2a1476a75679c53929790f5d..02943e89dfcc1dd9e1741000d968fb91a517ee96 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * 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 *
@@ -44,12 +44,12 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 // By default show the list...
-$show = true;
+$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) && (!ifPostContainsSelections('url_id'))) {
        // Not found so output message
-       loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_NO_SELECTIONS--}');
+       displayMessage('{--ADMIN_SURFBAR_NO_SELECTIONS--}');
 
        // Abort here
        return;
@@ -61,163 +61,47 @@ if (isFormSent('edit')) {
        showEntriesByXmlCallback('admin_edit_show_surfbar_urls');
 
        // Do not show the list of URLs after this template
-       $show = false;
+       $show = FALSE;
 } elseif (isFormSent('do_edit')) {
        // Change data of entries
        showEntriesByXmlCallback('admin_edit_do_surfbar_urls');
 } elseif (isFormSent('delete')) {
        // Show entries for deletion
-       showEntriesByXmlCallback('admin_del_show_surfbar_urls');
+       showEntriesByXmlCallback('admin_delete_show_surfbar_urls');
 
        // Do not show the list of URLs after this template
-       $show = false;
+       $show = FALSE;
 } elseif (isFormSent('do_delete')) {
        // Remove entries from database
-       showEntriesByXmlCallback('admin_del_do_surfbar_urls');
+       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;
+       $show = FALSE;
 } 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'
-       );
+       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'
-       );
-       $show = false;
+       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(
-               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) {
+if ($show === FALSE) {
        // No, a form has already been show
-       return false;
+       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_HASZERONUMS($result)) {
-       // List all URLs
-       $OUT = '';
-       while ($content = SQL_FETCHARRAY($result)) {
-               // "Translate"/add content
-               $content['url_registered']  = generateDateTime($content['url_registered'], 2);
-               $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
-
-               // Load row template
-               $OUT .= loadTemplate('admin_list_surfbar_urls_row', true, $content);
-       } // END - while
-
-       // Load main template
-       loadTemplate('admin_list_surfbar_urls', false, $OUT);
-} else {
-       // No URLs in surfbar
-       loadTemplate('admin_settings_saved', false, '{--ADMIN_SURFBAR_NO_URLS_FOUND--}');
-}
-
-// Free result
-SQL_FREERESULT($result);
+showEntriesByXmlCallback('admin_list_surfbar_urls');
 
 // [EOF]
 ?>