* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * 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 *
array(postRequestElement('catname')), __FILE__, __LINE__);
if (SQL_HASZERONUMS($result)) {
// Category does not exists, we simply add it...
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`,`visible`,`sort`) VALUES ('%s','%s','%s')",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`, `visible`, `sort`) VALUES ('%s','%s','%s')",
array(
postRequestElement('catname'),
postRequestElement('visible'),
$content = '{--CATEGORY_ADDED--}';
} else {
// Category does already exists
- $content = '<span class="notice">{--CATEGORY_ALREADY_EXISTS--}</span>';
+ $content = '<span class="bad">{--CATEGORY_ALREADY_EXISTS--}</span>';
}
// Free memory
// Display message
displayMessage($content);
-} elseif ((isFormSent()) && (isPostRequestElementSet('id')) && (is_array(postRequestElement('id')))) {
+} elseif ((isFormSent()) && (ifPostContainsSelections('id'))) {
// Change or delete categories...
$TEXT = '';
foreach (postRequestElement('id') as $id => $cat) {
$OUT = '';
foreach (postRequestElement('sel') as $id => $value) {
// Load row template and switch colors
- $OUT .= loadTemplate('admin_delete_cats_row', true, $id);
+ $OUT .= loadTemplate('admin_delete_cats_row', TRUE, $id);
} // END - foreach
// Load main template
- loadTemplate('admin_delete_cats', false, $OUT);
+ loadTemplate('admin_delete_cats', FALSE, $OUT);
} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit categories
$OUT = '';
foreach (postRequestElement('sel') as $id => $value) {
// Load data from the category
- $result = SQL_QUERY_ESC("SELECT `id`,`visible`,`sort` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
$content = SQL_FETCHARRAY($result);
$content['visible_selection'] = addSelectionBox('yn', $content['visible'], 'visible', $content['id']);
// Load row template and switch colors
- $OUT .= loadTemplate('admin_edit_cats_row', true, $content);
+ $OUT .= loadTemplate('admin_edit_cats_row', TRUE, $content);
} // END - foreach
// Load main template
- loadTemplate('admin_edit_cats', false, $OUT);
+ loadTemplate('admin_edit_cats', FALSE, $OUT);
} else {
// Init variable here
$CATS = '';
// Load all categories
- $result = SQL_QUERY("SELECT `id`,`cat`,`visible`,`sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// Init variables
$OUT = '';
$CATS .= '<option value="' . $content['sort'] . '">' . $cat . '</option>';
// Load row template and switch color
- $OUT .= loadTemplate('admin_list_cats_row', true, $content);
+ $OUT .= loadTemplate('admin_list_cats_row', TRUE, $content);
} // END - while
// Free memory
SQL_FREERESULT($result);
// Load main template
- loadTemplate('admin_list_cats', false, $OUT);
+ loadTemplate('admin_list_cats', FALSE, $OUT);
} // END - if
// Remember in array
$content['cats'] = $CATS;
// Form to add a new category
- loadTemplate('admin_add_cat', false, $content);
+ loadTemplate('admin_add_cat', FALSE, $content);
}
// [EOF]