From: quix0r Date: Thu, 5 Nov 2009 13:57:54 +0000 (+0000) Subject: More fixes for rallye prices X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f2a8b20c4b6feeda4362d6b2c7c17839d23599a8;p=mailer.git More fixes for rallye prices --- diff --git a/inc/functions.php b/inc/functions.php index 6848f87e4f..827cdb9fd2 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -343,20 +343,20 @@ function loadTemplate ($template, $return=false, $content=array()) { // Eval the code eval($GLOBALS['template_eval'][$template]); - } else { - // No file! - $GLOBALS['template_eval'][$template] = '404'; - } - } elseif (((isAdmin()) || ((isInstalling()) && (!isInstalled()))) && ($GLOBALS['template_eval'][$template] == '404')) { - // Only admins shall see this warning or when installation mode is active - $ret = '
{--TEMPLATE_404--}
+ } elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) { + // Only admins shall see this warning or when installation mode is active + $ret = '
{--TEMPLATE_404--}
(' . $template . ')

{--TEMPLATE_CONTENT--}
' . print_r($content, true) . '
{--TEMPLATE_DATA--}
' . print_r($DATA, true) . '
-

\";'; +

'; + } else { + // No file! + $GLOBALS['template_eval'][$template] = '404'; + } } else { // Eval the code eval($GLOBALS['template_eval'][$template]); @@ -369,7 +369,7 @@ function loadTemplate ($template, $return=false, $content=array()) { // Return the HTML code return $ret; } else { - // Output direct + // Output directly outputHtml($ret); } } elseif (isDebugModeEnabled()) { @@ -1148,19 +1148,19 @@ function array_pk_sort (&$array, $a_sort, $primary_key = 0, $order = -1, $nums = } // -function addSelectionBox ($type, $default, $prefix = '', $id = 0) { +function addSelectionBox ($type, $default, $prefix = '', $id = 0, $class = 'register_select') { $OUT = ''; if ($type == 'yn') { // This is a yes/no selection only! if ($id > 0) $prefix .= "[" . $id."]"; - $OUT .= " \n"; } else { // Begin with regular selection box here if (!empty($prefix)) $prefix .= "_"; $type2 = $type; if ($id > 0) $type2 .= "[" . $id."]"; - $OUT .= " \n"; } switch ($type) { @@ -2737,36 +2737,6 @@ function getMessageFromErrorCode ($code) { return $message; } -// Generate a "link" for the given admin id (admin_id) -function generateAdminLink ($adminId) { - // No assigned admin is default - $admin = "{--ADMIN_NO_ADMIN_ASSIGNED--}"; - - // Zero? = Not assigned - if (bigintval($adminId) > 0) { - // Load admin's login - $login = getAdminLogin($adminId); - - // Is the login valid? - if ($login != '***') { - // Is the extension there? - if (isExtensionActive('admins')) { - // Admin found - $admin = "" . $login.""; - } else { - // Extension not found - $admin = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins'); - } - } else { - // Maybe deleted? - $admin = "
".sprintf(getMessage('ADMIN_ID_404'), $adminId)."
"; - } - } // END - if - - // Return result - return $admin; -} - // Compile characters which are allowed in URLs function compileUriCode ($code, $simple = true) { // Compile constants diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index a7d42b877d..426440e50d 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -1320,5 +1320,35 @@ function adminCreateUserLink ($userid) { return '{?URL?}/modules.php?module=admin&what=list_user'; } +// Generate a "link" for the given admin id (admin_id) +function generateAdminLink ($adminId) { + // No assigned admin is default + $adminLink = "{--ADMIN_NO_ADMIN_ASSIGNED--}"; + + // Zero? = Not assigned + if (bigintval($adminId) > 0) { + // Load admin's login + $login = getAdminLogin($adminId); + + // Is the login valid? + if ($login != '***') { + // Is the extension there? + if (isExtensionActive('admins')) { + // Admin found + $adminLink = "" . $login.""; + } else { + // Extension not found + $adminLink = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins'); + } + } else { + // Maybe deleted? + $adminLink = "
".sprintf(getMessage('ADMIN_ID_404'), $adminId)."
"; + } + } // END - if + + // Return result + return $adminLink; +} + // [EOF] ?> diff --git a/inc/modules/admin/what-config_rallye_prices.php b/inc/modules/admin/what-config_rallye_prices.php index 96cefc7879..7b606ece56 100644 --- a/inc/modules/admin/what-config_rallye_prices.php +++ b/inc/modules/admin/what-config_rallye_prices.php @@ -247,17 +247,13 @@ ORDER BY // List found rallyes $OUT = ''; $SW = 2; while ($content = SQL_FETCHARRAY($result)) { - $select = ""; - if ($content['is_active'] == 'Y') $select = "
".$content['id']."
"; - // Prepare data for the row template $content = array( 'sw' => $SW, 'id' => $content['id'], - 'select' => $select, 'title' => $content['title'], 'admin_id' => $content['admin_id'], - 'email_link' => generateEmailLink($content['admin_id']), + 'admin_link' => generateAdminLink($content['admin_id']), 'login' => $content['login'], 'start' => generateDateTime($content['start_time'], 3), 'end' => generateDateTime($content['end_time'], 3), diff --git a/templates/de/html/admin/admin_list_rallye_prices.tpl b/templates/de/html/admin/admin_list_rallye_prices.tpl index b6399216a2..b12776a107 100644 --- a/templates/de/html/admin/admin_list_rallye_prices.tpl +++ b/templates/de/html/admin/admin_list_rallye_prices.tpl @@ -1,12 +1,11 @@
-
- - @@ -14,16 +13,11 @@ $content - +
{--RALLYE_EDIT_DEL_RALLYES--}: + + {--ADMIN_LIST_RALLYES_PRICING--}:
{--ID_SELECT--} {--RALLYE_TITLE--}: {--RALLYE_ADMIN_ID--}: {--RALLYE_TSTART--}:
-
- {--RALLYE_EDIT_DEL_NOTE--} + {--ADMIN_RALLYE_PRICES_NOTE--}
diff --git a/templates/de/html/admin/admin_list_rallye_prices_row.tpl b/templates/de/html/admin/admin_list_rallye_prices_row.tpl index 581c28edd7..8ae557025f 100644 --- a/templates/de/html/admin/admin_list_rallye_prices_row.tpl +++ b/templates/de/html/admin/admin_list_rallye_prices_row.tpl @@ -1,7 +1,6 @@ - $content[select] $content[title] - $content[login] + $content[admin_link] $content[start] $content[end]