SQL_FREERESULT($result);
}
//
-function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false)
-{
- global $_POST, $_CONFIG;
+function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) {
$OUT = "";
// Guests are mostly not interested in how many members has
// Admins are allowed to see every category...
if (IS_ADMIN()) $AND = "";
$result = SQL_QUERY("SELECT id, cat, visible FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort`", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0)
- {
+ if (SQL_NUMROWS($result) > 0) {
// List alle visible modules (or all to the admin)
$SW = 2;
$OUT .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n";
- while (list($id, $cat, $visible) = SQL_FETCHROW($result))
- {
+ while (list($id, $cat, $visible) = SQL_FETCHROW($result)) {
if (empty($_POST['cat'][$id])) $_POST['cat'][$id] = "";
// Prepare array for the template
$content = array(
// Free memory
SQL_FREERESULT($result);
- }
- else
- {
+ } else {
// No categories setted up so far...
- $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, NO_CATEGORIES_VISIBLE);
+ $OUT .= LOAD_TEMPLATE("admin_settings_saved", true, getMessage('NO_CATEGORIES_VISIBLE'));
}
- if ($return)
- {
+ if ($return) {
// Return generated HTML code
return $OUT;
- }
- else
- {
+ } else {
// Output directly (default)
OUTPUT_HTML($OUT);
}