From: Roland Häder Date: Mon, 11 Jul 2011 13:06:40 +0000 (+0000) Subject: Some fixes,re-orders and ext-surfbar actions are now XML-enabled X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a41aaa25ffabde1e6ec7f3951288569f4bd827b2;p=mailer.git Some fixes,re-orders and ext-surfbar actions are now XML-enabled --- diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index 2747189880..8ee9be6d9e 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -81,7 +81,8 @@ addMessages(array( 'ADMIN_LIST_SURFBAR_ACTIONS_TITLE' => "Mitglieder-Aktionen der Surfbar auflisten", // General admin text - 'ADMIN_SURFBAR_NO_URLS_FOUND' => "Es konnten keine URLs in der Surfbar gefunden werden.", + 'ADMIN_SURFBAR_URLS_404' => "Es konnten keine URLs in der Surfbar gefunden werden.", + 'ADMIN_SURFBAR_ACTIONS_404' => "Es konnten keine Mitgliederaktionen in der Surfbar gefunden werden.", 'ADMIN_SURFBAR_REWARD' => "Vergütung", 'ADMIN_SURFBAR_COSTS' => "Kosten", 'ADMIN_SURFBAR_PAYMENT' => "Payment", diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index b3aea55d43..739465d07d 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -733,7 +733,7 @@ function translateSurfbarLimit ($limit) { // Translate the URL status function translateSurfbarUrlStatus ($status) { // NULL must be handled carfefully - if (is_null($status)) { + if ((is_null($status)) || (trim($status) == '')) { // Is NULL, so return other language string return '{--SURFBAR_URL_STATUS_NONE--}'; } else { diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index db9353b4ef..5a23e398d0 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -1116,7 +1116,7 @@ function adminUndeleteEntriesConfirm ($IDs, $table, $columns=array(), $filterFun } // List all given rows (callback function from XML) -function adminListEntries ($tableTemplate, $rowTemplate, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters, $noEntryMessageId) { +function adminListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = array()) { // Verify that tableName and columns are not empty if (count($tableName) != 1) { // No tableName specified @@ -1184,11 +1184,11 @@ function adminListEntries ($tableTemplate, $rowTemplate, $tableName, $columns, $ } // END - if // Now handle all over to the inner function which will execute the listing - doAdminListEntries($SQL, $tableTemplate, $rowTemplate, $callbackColumns, $extraParameters, $noEntryMessageId); + doAdminListEntries($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = array()); } // Do the listing of entries -function doAdminListEntries($SQL, $tableTemplate, $rowTemplate, $callbackColumns, $extraParameters, $noEntryMessageId) { +function doAdminListEntries($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = array()) { // Run the SQL query $result = SQL_QUERY($SQL, __FUNCTION__, __LINE__); diff --git a/inc/modules/admin/what-list_surfbar_actions.php b/inc/modules/admin/what-list_surfbar_actions.php index ff95f1c494..c85ae51be8 100644 --- a/inc/modules/admin/what-list_surfbar_actions.php +++ b/inc/modules/admin/what-list_surfbar_actions.php @@ -43,39 +43,56 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { // Add description as navigation point addYouAreHereLink('admin', __FILE__); -// Load all actions -$result = SQL_QUERY("SELECT - `actions_id`, - `actions_status`, - `actions_action`, - `actions_new_status` -FROM - `{?_MYSQL_PREFIX?}_surfbar_actions` -ORDER BY - `actions_status` ASC, - `actions_action` ASC", __FILE__, __LINE__); +// By default show the list... +$show = true; -// Entries found? -if (!SQL_HASZERONUMS($result)) { - // List all entries - $OUT = ''; - while ($content = SQL_FETCHARRAY($result)) { - // "Translate" some data - $content['actions_action'] = '{--MEMBER_SURFBAR_ACTION_' . strtoupper($content['actions_action']) . '_SUBMIT--}', ; +// Edit or delete button hit? +if (isFormSent('edit')) { + // Show entries for editing + showEntriesByXmlCallback('admin_edit_show_surfbar_actions'); - // Load row template - $OUT .= loadTemplate('admin_list_surfbar_actions_row', true, $content); - } // END - while + // Do not show the list of URLs after this template + $show = false; +} elseif (isFormSent('do_edit')) { + // Change data of entries + showEntriesByXmlCallback('admin_edit_do_surfbar_actions'); +} elseif (isFormSent('delete')) { + // Show entries for deletion + showEntriesByXmlCallback('admin_delete_show_surfbar_actions'); - // Load main template - loadTemplate('admin_list_surfbar_actions', false, $OUT); -} else { - // No entries found, very bad! - displayMessage('{--ADMIN_SURFBAR_NO_ACTIONS--}'); + // Do not show the list of URLs after this template + $show = false; +} elseif (isFormSent('do_delete')) { + // Remove entries from database + showEntriesByXmlCallback('admin_delete_do_surfbar_actions'); +} elseif (isFormSent('lock')) { + // Un-/lock selected URLs. This does not work for pending URLs + showEntriesByXmlCallback('admin_lock_show_surfbar_actions'); + + // 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 + showEntriesByXmlCallback('admin_lock_do_surfbar_actions'); +} elseif (isFormSent('undelete')) { + // Undelete selected URLs. This does only work for deleted URLs... ;-) + showEntriesByXmlCallback('admin_undelete_show_surfbar_actions'); + + // 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... ;-) + showEntriesByXmlCallback('admin_undelete_do_surfbar_actions'); } -// Free result -SQL_FREERESULT($result); +// Show entries? +if ($show === false) { + // No, a form has already been show + return false; +} // END - if + +// List all URLs +showEntriesByXmlCallback('admin_list_surfbar_actions'); // [EOF] ?> diff --git a/templates/de/html/admin/admin_list_surfbar_actions_row.tpl b/templates/de/html/admin/admin_list_surfbar_actions_row.tpl index cf9d4659c1..d08d4d1c11 100644 --- a/templates/de/html/admin/admin_list_surfbar_actions_row.tpl +++ b/templates/de/html/admin/admin_list_surfbar_actions_row.tpl @@ -6,7 +6,7 @@ {%pipe,translateSurfbarUrlStatus=$content[actions_status]%} - $content[actions_action] + {%pipe,translateMemberSurfbarActionToSubmit=$content[actions_action]%} {%pipe,translateSurfbarUrlStatus=$content[actions_new_status]%} diff --git a/templates/xml/admin/admin_list_surfbar_actions.xml b/templates/xml/admin/admin_list_surfbar_actions.xml new file mode 100644 index 0000000000..7e231e1520 --- /dev/null +++ b/templates/xml/admin/admin_list_surfbar_actions.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/xml/admin/admin_list_surfbar_urls.xml b/templates/xml/admin/admin_list_surfbar_urls.xml index 03391becf7..dfe1d9050c 100644 --- a/templates/xml/admin/admin_list_surfbar_urls.xml +++ b/templates/xml/admin/admin_list_surfbar_urls.xml @@ -44,6 +44,10 @@ MA 02110-1301 USA //--> + + @@ -123,8 +127,4 @@ MA 02110-1301 USA - - diff --git a/templates/xml/admin_list_data_template.xml b/templates/xml/admin_list_data_template.xml index e47c537c8f..8fc22d2a10 100644 --- a/templates/xml/admin_list_data_template.xml +++ b/templates/xml/admin_list_data_template.xml @@ -47,6 +47,10 @@ MA 02110-1301 USA //--> + + @@ -176,8 +180,4 @@ MA 02110-1301 USA - -