[TEP-COMMIT] [CVS admin] fix the form edit name
hpdl-OfajU3CKLf1/[email protected] 29 Nov 2004 14:22:14 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>admin/admin/templates/pages</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">languages.php</a></tt></td><td align="right" id="added">+40</td><td align="right" id="removed">-169</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/languages.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/languages.php.diff?r1=1.1&r2=1.2">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/languages.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a></td></tr>
</table>
<pre class="comment">
fix the form edit name
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates">templates</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages">pages</a><br /></span>
<div class="fileheader"><big><b>languages.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/languages.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/languages.php.diff?r1=1.1&r2=1.2">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/languages.php?rev=1.2&content-type=text/vnd.viewcvs-markup">1.2</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.1 -r1.2
--- languages.php 2004/07/22 23:29:10 1.1
+++ languages.php 2004/11/29 14:22:11 1.2
@@ -9,182 +9,53 @@
</small></pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff" id="removed">-?>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">-<h1><?php echo HEADING_TITLE; ?></h1>
</pre><pre class="diff" id="added">+ require('includes/application_top.php');
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">-<div id="infoBox_lDefault" <?php if (!empty($action)) { echo 'style="display: none;"'; } ?>>
- <table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">
- <thead>
- <tr>
- <th><?php echo TABLE_HEADING_LANGUAGE_NAME; ?></th>
- <th><?php echo TABLE_HEADING_LANGUAGE_CODE; ?></th>
- <th><?php echo TABLE_HEADING_ACTION; ?></th>
- </tr>
- </thead>
- <tbody>
-<?php
- $Qlanguages = $osC_Database->query('select languages_id, name, code, image, directory, sort_order from :table_languages order by sort_order, name');
- $Qlanguages->bindTable(':table_languages', TABLE_LANGUAGES);
- $Qlanguages->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
- $Qlanguages->execute();
-
- while ($Qlanguages->next()) {
- if (!isset($lInfo) && (!isset($_GET['lID']) || (isset($_GET['lID']) && ($_GET['lID'] == $Qlanguages->valueInt('languages_id'))))) {
- $lInfo = new objectInfo($Qlanguages->toArray());
- }
</pre><pre class="diff" id="added">+ $selected_box = 'localization';
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (isset($lInfo) && ($Qlanguages->valueInt('languages_id') == $lInfo->languages_id)) {
- echo ' <tr class="selected">' . "\n";
- } else {
- echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="document.location.href=\'' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $Qlanguages->valueInt('languages_id')) . '\';">' . "\n";
- }
</pre><pre class="diff" id="added">+ $action = (isset($_GET['action']) ? $_GET['action'] : '');
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- if (DEFAULT_LANGUAGE == $Qlanguages->value('code')) {
- echo ' <td><b>' . $Qlanguages->value('name') . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
- } else {
- echo ' <td>' . $Qlanguages->value('name') . '</td>' . "\n";
- }
-?>
- <td><?php echo $Qlanguages->value('code'); ?></td>
- <td align="right">
-<?php
- if (isset($lInfo) && ($Qlanguages->valueInt('languages_id') == $lInfo->languages_id)) {
- echo '<a href="#" onClick="toggleInfoBox(\'lEdit\');">' . tep_image('templates/' . $template . '/images/icons/16x16/configure.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;' .
- '<a href="#" onClick="toggleInfoBox(\'lDelete\');">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
- } else {
- echo '<a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $Qlanguages->valueInt('languages_id') . '&action=lEdit') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/configure.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;' .
- '<a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $Qlanguages->valueInt('languages_id') . '&action=lDelete') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
- }
-?>
- </td>
- </tr>
-<?php
</pre><pre class="diff" id="added">+ if (!isset($_GET['page']) || (isset($_GET['page']) && !is_numeric($_GET['page']))) {
+ $_GET['page'] = 1;
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">-?>
- </tbody>
- </table>
-
- <table border="0" width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td class="smallText"><?php echo $Qlanguages->displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_LANGUAGES); ?></td>
- <td class="smallText" align="right"><?php echo $Qlanguages->displayBatchLinksPullDown(); ?></td>
- </tr>
- </table>
-
- <p align="right"><?php echo '<input type="button" value="' . IMAGE_INSERT . '" onClick="toggleInfoBox(\'lNew\');" class="infoBoxButton">'; ?></p>
-</div>
-
-<div id="infoBox_lNew" <?php if ($action != 'lNew') { echo 'style="display: none;"'; } ?>>
- <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/new.png', IMAGE_INSERT, '16', '16') . ' ' . TEXT_INFO_HEADING_NEW_LANGUAGE; ?></div>
- <div class="infoBoxContent">
- <?php echo tep_draw_form('lNew', FILENAME_LANGUAGES, 'action=save'); ?>
-
- <p><?php echo TEXT_INFO_INSERT_INTRO; ?></p>
-
- <table border="0" width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_NAME . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('name', '', 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_CODE . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('code', '', 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_IMAGE . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('image', '', 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_DIRECTORY . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('directory', '', 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('sort_order', '', 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_SET_DEFAULT . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_checkbox_field('default'); ?></td>
- </tr>
- </table>
-
- <p align="center"><?php echo '<input type="submit" value="' . IMAGE_SAVE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'lDefault\');" class="operationButton">'; ?></p>
-
- </form>
- </div>
-</div>
-
-<?php
- if (isset($lInfo)) {
-?>
-
-<div id="infoBox_lEdit" <?php if ($action != 'lEdit') { echo 'style="display: none;"'; } ?>>
- <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/configure.png', IMAGE_EDIT, '16', '16') . ' ' . $lInfo->name; ?></div>
- <div class="infoBoxContent">
- <?php echo tep_draw_form('lNew', FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=save'); ?>
-
- <p><?php echo TEXT_INFO_EDIT_INTRO; ?></p>
-
- <table border="0" width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_NAME . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('name', $lInfo->name, 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_CODE . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('code', $lInfo->code, 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_IMAGE . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('image', $lInfo->image, 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_DIRECTORY . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('directory', $lInfo->directory, 'style="width: 100%"'); ?></td>
- </tr>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_input_field('sort_order', $lInfo->sort_order, 'style="width: 100%"'); ?></td>
- </tr>
-<?php
- if (DEFAULT_LANGUAGE != $lInfo->code) {
-?>
- <tr>
- <td class="smallText" width="40%"><?php echo '<b>' . TEXT_SET_DEFAULT . '</b>'; ?></td>
- <td class="smallText" width="60%"><?php echo osc_draw_checkbox_field('default'); ?></td>
- </tr>
-<?php
- }
-?>
- </table>
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- <p align="center"><?php echo ((DEFAULT_LANGUAGE == $lInfo->code) ? osc_draw_hidden_field('is_default', 'true') : '') . '<input type="submit" value="' . IMAGE_SAVE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'lDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff" id="added">+ if (!empty($action)) {
+ switch ($action) {
+ case 'save':
+ $default = (isset($_POST['default']) && ($_POST['default'] == 'on')) ? true : false;
+
+ if (isset($_GET['lID']) && is_numeric($_GET['lID'])) {
+ $result = $osC_Language->update($_GET['lID'], $_POST, $default);
+ } else {
+ $result = $osC_Language->insert($_POST, $default);
+ }
+
+ if ($result === true) {
+ $osC_MessageStack->add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
+ } else {
+ $osC_MessageStack->add_session('header', ERROR_DB_ROWS_NOT_UPDATED, 'error');
+ }
+
+ tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page']));
+ break;
+ case 'deleteconfirm':
+ if (isset($_GET['lID']) && is_numeric($_GET['lID'])) {
+ if ($osC_Language->remove($_GET['lID'])) {
+ $osC_MessageStack->add_session('header', SUCCESS_DB_ROWS_UPDATED, 'success');
+ } else {
+ $osC_MessageStack->add_session('header', ERROR_DB_ROWS_NOT_UPDATED, 'error');
+ }
+ }
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- </form>
- </div>
-</div>
-
-<div id="infoBox_lDelete" <?php if ($action != 'lDelete') { echo 'style="display: none;"'; } ?>>
- <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . ' ' . $lInfo->name; ?></div>
- <div class="infoBoxContent">
-<?php
- if (DEFAULT_LANGUAGE == $lInfo->code) {
-?>
- <p><?php echo '<b>' . TEXT_INFO_DELETE_PROHIBITED . '</b>'; ?></p>
- <p align="center"><?php echo '<input type="button" value="' . IMAGE_BACK . '" onClick="toggleInfoBox(\'lDefault\');" class="operationButton">'; ?></p>
-<?php
- } else {
-?>
- <p><?php echo TEXT_INFO_DELETE_INTRO; ?></p>
- <p><?php echo '<b>' . $lInfo->name . '</b>'; ?></p>
- <p align="center"><?php echo '<input type="button" value="' . IMAGE_DELETE . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=deleteconfirm') . '\';" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'lDefault\');" class="operationButton">'; ?></p>
-<?php
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page']));
+ break;
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">-?>
- </div>
-</div>
-
-<?php
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="added">+
+ $page_contents = 'languages.php';
+
+ require('templates/default.php');
+
+ require('includes/application_bottom.php');
</pre><pre class="diff" id="context"> ?>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/