More fixes for rallye prices
authorRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2009 13:57:54 +0000 (13:57 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2009 13:57:54 +0000 (13:57 +0000)
inc/functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_rallye_prices.php
templates/de/html/admin/admin_list_rallye_prices.tpl
templates/de/html/admin/admin_list_rallye_prices_row.tpl

index 6848f87..827cdb9 100644 (file)
@@ -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 = '<br /><span class=\\"guest_failed\\">{--TEMPLATE_404--}</span><br />
+               } elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
+                       // Only admins shall see this warning or when installation mode is active
+                       $ret = '<br /><span class=\\"guest_failed\\">{--TEMPLATE_404--}</span><br />
 (' . $template . ')<br />
 <br />
 {--TEMPLATE_CONTENT--}
 <pre>' . print_r($content, true) . '</pre>
 {--TEMPLATE_DATA--}
 <pre>' . print_r($DATA, true) . '</pre>
-<br /><br />\";';
+<br /><br />';
+               } 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 .= "    <select name=\"" . $prefix."\" class=\"register_select\" size=\"1\">\n";
+               $OUT .= "    <select name=\"" . $prefix."\" class=\"" . $class . "\" size=\"1\">\n";
        } else {
                // Begin with regular selection box here
                if (!empty($prefix)) $prefix .= "_";
                $type2 = $type;
                if ($id > 0) $type2 .= "[" . $id."]";
-               $OUT .= "    <select name=\"".strtolower($prefix . $type2)."\" class=\"register_select\" size=\"1\">\n";
+               $OUT .= "    <select name=\"".strtolower($prefix . $type2)."\" class=\"" . $class . "\" size=\"1\">\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 = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
-
-       // 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 = "<a href=\"".generateEmailLink(getAdminEmail($adminId), 'admins')."\">" . $login."</a>";
-                       } else {
-                               // Extension not found
-                               $admin = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins');
-                       }
-               } else {
-                       // Maybe deleted?
-                       $admin = "<div class=\"admin_note\">".sprintf(getMessage('ADMIN_ID_404'), $adminId)."</div>";
-               }
-       } // END - if
-
-       // Return result
-       return $admin;
-}
-
 // Compile characters which are allowed in URLs
 function compileUriCode ($code, $simple = true) {
        // Compile constants
index a7d42b8..426440e 100644 (file)
@@ -1320,5 +1320,35 @@ function adminCreateUserLink ($userid) {
        return '{?URL?}/modules.php?module=admin&amp;what=list_user';
 }
 
+// Generate a "link" for the given admin id (admin_id)
+function generateAdminLink ($adminId) {
+       // No assigned admin is default
+       $adminLink = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
+
+       // 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 = "<a href=\"".generateEmailLink(getAdminEmail($adminId), 'admins')."\">" . $login."</a>";
+                       } else {
+                               // Extension not found
+                               $adminLink = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins');
+                       }
+               } else {
+                       // Maybe deleted?
+                       $adminLink = "<div class=\"admin_note\">".sprintf(getMessage('ADMIN_ID_404'), $adminId)."</div>";
+               }
+       } // END - if
+
+       // Return result
+       return $adminLink;
+}
+
 // [EOF]
 ?>
index 96cefc7..7b606ec 100644 (file)
@@ -247,17 +247,13 @@ ORDER BY
                // List found rallyes
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
-                       $select = "<input type=\"checkbox\" name=\"sel[".$content['id']."]\" class=\"admin_normal\" value=\"1\">";
-                       if ($content['is_active'] == 'Y') $select = "<div class=\"big\">".$content['id']."</div>";
-
                        // 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),
index b639921..b12776a 100644 (file)
@@ -1,12 +1,11 @@
 <div align="center">
-<form accept-charset="utf-8" action="{?URL?}/modules.php?module=admin&amp;what=config_rallye_prices" method="post" style="margin-bottom: 0px">
 <table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
        <tr>
-               <td colspan="5" align="center" class="admin_title" height="30"><strong>{--RALLYE_EDIT_DEL_RALLYES--}:</strong>
+               <td colspan="5" align="center" class="admin_title" height="30">
+                       <strong>{--ADMIN_LIST_RALLYES_PRICING--}:</strong>
                </td>
        </tr>
        <tr>
-               <td align="center" width="10" class="admin_title bottom2 right2"><strong>{--ID_SELECT--}</strong></td>
                <td align="center" width="100" class="admin_title bottom2 right2"><strong>{--RALLYE_TITLE--}:</strong></td>
                <td align="center" width="70" class="admin_title bottom2 right2"><strong>{--RALLYE_ADMIN_ID--}:</strong></td>
                <td align="center" width="200" class="admin_title bottom2 right2"><strong>{--RALLYE_TSTART--}:</strong></td>
        </tr>
        $content
        <tr>
-               <td colspan="5" class="admin_footer">
-                       <input type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}" />
-                       <input type="submit" name="edit" class="admin_submit" value="{--RALLYE_EDIT_ADMIN--}" />
-                       <input type="submit" name="del" class="admin_delete" value="{--RALLYE_DELETE_ADMIN--}" />
-               </td>
+               <td colspan="5" class="admin_footer">&nbsp;</td>
        </tr>
 </table>
-</form>
 
 <div class="admin_note">
-       {--RALLYE_EDIT_DEL_NOTE--}
+       {--ADMIN_RALLYE_PRICES_NOTE--}
 </div>
 </div>
index 581c28e..8ae5570 100644 (file)
@@ -1,7 +1,6 @@
 <tr>
-       <td align="center" class="switch_sw$content[sw] bottom2 right2">$content[select]</td>
        <td align="center" class="switch_sw$content[sw] bottom2 right2"><a href="{?URL?}/modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye=$content[id]">$content[title]</a></td>
-       <td align="center" class="switch_sw$content[sw] bottom2 right2"><a href="$content[email_link]">$content[login]</a></td>
+       <td align="center" class="switch_sw$content[sw] bottom2 right2">$content[admin_link]</td>
        <td align="center" class="switch_sw$content[sw] bottom2 right2">$content[start]</td>
        <td align="center" class="switch_sw$content[sw] bottom2">$content[end]</td>
 </tr>