2
/* $Id: catsel.php,v 1.22.2.3 2008/02/08 04:27:05 cknudsen Exp $ */
3
include_once 'includes/init.php';
5
// load user and global cats
6
load_user_categories ();
8
$catList = $catNames = $error = '';
10
if ( $CATEGORIES_ENABLED == 'N' )
13
$cats = getGetValue ( 'cats' );
14
$form = getGetValue ( 'form' );
16
$eventcats = explode ( ',', $cats );
18
$availCatStr = translate ( 'AVAILABLE CATEGORIES' );
19
$availCatFiller = str_repeat( ' ', ( 30 - strlen ( $availCatStr ) ) / 2 );
20
if ( strlen ( $availCatStr ) < 30 )
21
$availCatStr = $availCatFiller . $availCatStr . $availCatFiller ;
23
$entryCatStr = translate ( 'ENTRY CATEGORIES' );
24
$entryCatFiller = str_repeat( ' ', ( 30 - strlen ( $entryCatStr ) ) / 2 );
25
if ( strlen ( $entryCatStr ) < 30 )
26
$entryCatStr = $entryCatFiller . $entryCatStr . $entryCatFiller ;
28
print_header ( array ( 'js/catsel.php/false/' . $form ),
29
'', '', true, false, true );
34
<table align="center" border="0" width="90%">
36
<th colspan="3">' . translate ( 'Categories' ) . '</th>
38
<form action="" method="post" name="editCategories" '
39
. 'onSubmit="sendCats( this )">
43
if ( ! empty ( $categories ) ) {
45
<select name="cats[]" size="10">
46
<option disabled>' . $availCatStr . '</option>';
48
foreach ( $categories as $K => $V ) {
49
// None is index -1 and needs to be ignored
50
if ( $K > 0 && ( $V['cat_owner'] == $login || $is_admin ||
51
substr ( $form, 0, 4 ) == 'edit' ) ) {
52
$tmpStr = $K . '" name="' . $V['cat_name'] . '">' . $V['cat_name'];
54
<option value="' . ( empty ( $V['cat_owner'] )
55
? "-$tmpStr" . '<sup>*</sup>' : $tmpStr ) . '</option>';
63
<td valign="center"><input type="button" value=">>" onclick="selAdd()"'
65
<td align="center" valign="top">
66
<select name="eventcats[]" size="9" multiple>
67
<option disabled>' . $entryCatStr . '</option>';
69
if ( strlen ( $cats ) ) {
70
foreach ( $eventcats as $K ) {
71
// disable if not creator and category is Global
73
$disabled = ( empty ( $categories[abs ( $K )]['cat_owner'] ) &&
74
substr ( $form, 0, 4 ) != 'edit' ? 'disabled' : '' );
75
if ( empty ( $categories[abs ( $K )]['cat_owner'] ) ) {
79
<option value="' . "$K\" $disabled>"
80
. $categories[abs ( $K )]['cat_name'] . $show_ast . '</option>';
88
<input type="button" value="' . translate ( 'Remove' )
89
. '" onclick="selRemove()" />
93
<td valign="top" align="right">*' . translate ( 'Global Category' )
94
. ' <input type="button" value="' . translate ( 'OK' )
95
. '" onclick="sendCats()" /></td>
96
<td colspan="2" align="left"> <input type="button" value="'
97
. translate ( 'Cancel' ) . '" onclick="window.close()" /></td>
101
' . print_trailer ( false, true, true );