// List already existing categories for editing
while ($content = SQL_FETCHARRAY($result)) {
// Put cat descriptions into variable for the selection box
- $cat = $content['cat'];
- if (strlen($cat) > 40) $cat = substr($cat, 0, 37) . '...';
- $CATS .= '<option value="' . $content['sort'] . '">' . $cat . '</option>';
+ if (strlen($content['cat']) > 40) $content['cat'] = substr($content['cat'], 0, 37) . '...';
+ $CATS .= '<option value="' . $content['sort'] . '">' . $content['cat'] . '</option>';
// Load row template and switch color
$OUT .= loadTemplate('admin_list_cats_row', TRUE, $content);