- Timestamp:
- Nov 26, 2004, 5:10:17 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_modify.php
r622 r623 171 171 } 172 172 173 /*174 // can the parent category be changed ? (is the category virtual ?)175 if ( $row['dir'] == '' )176 {177 $vtp->addSession( $sub, 'parent' );178 // We only show a List Of Values if the number of categories is less than179 // $conf['max_LOV_categories']180 $query = 'SELECT COUNT(id) AS nb_total_categories';181 $query.= ' FROM '.CATEGORIES_TABLE;182 $query.= ';';183 $countrow = mysql_fetch_array( pwg_query( $query ) );184 if ( $countrow['nb_total_categories'] < $conf['max_LOV_categories'] )185 {186 $vtp->addSession( $sub, 'associate_LOV' );187 $vtp->addSession( $sub, 'associate_cat' );188 $vtp->setVar( $sub, 'associate_cat.value', '-1' );189 $vtp->setVar( $sub, 'associate_cat.content', '' );190 $vtp->closeSession( $sub, 'associate_cat' );191 $page['plain_structure'] = get_plain_structure( true );192 $structure = create_structure( '', array() );193 display_categories( $structure, ' ', $row['id_uppercat'],$row['id'] );194 $vtp->closeSession( $sub, 'associate_LOV' );195 }196 // else, we only display a small text field, we suppose the administrator197 // knows the id of its category198 else199 {200 $vtp->addSession( $sub, 'associate_text' );201 $vtp->setVar( $sub, 'associate_text.value', $row['id_uppercat'] );202 $vtp->closeSession( $sub, 'associate_text' );203 }204 $vtp->closeSession( $sub, 'parent' );205 }206 */207 173 //----------------------------------------------------------- sending html code 208 174 $template->assign_var_from_handle('ADMIN_CONTENT', 'categories'); -
trunk/admin/group_list.php
r593 r623 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 include_once( './admin/include/isadmin.inc.php' ); 28 //----------------------------------------------------- template initialization 29 $sub = $vtp->Open( './template/'.$user['template'].'/admin/group_list.vtp' ); 30 $tpl = array( 'group_add','add','listuser_permission','delete', 31 'group_confirm','yes','no','group_list_title' ); 32 templatize_array( $tpl, 'lang', $sub ); 33 $vtp->setGlobalVar( $sub, 'user_template', $user['template'] ); 27 if( !defined("PHPWG_ROOT_PATH") ) 28 { 29 die ("Hacking attempt!"); 30 } 31 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 32 34 33 //-------------------------------------------------------------- delete a group 35 34 $error = array(); 36 if ( isset ( $_GET['delete'] ) and is_numeric( $_GET['delete'] ))35 if ( isset( $_POST['delete'] ) && isset( $_POST['confirm_delete'] ) ) 37 36 { 38 $query = 'SELECT name'; 39 $query.= ' FROM '.PREFIX_TABLE.'groups'; 40 $query.= ' WHERE id = '.$_GET['delete']; 41 $query.= ';'; 42 $row = mysql_fetch_array( pwg_query( $query ) ); 43 // confirm group deletion ? 44 if ( !isset( $_GET['confirm'] ) or $_GET['confirm'] != 1 ) 45 { 46 $vtp->addSession( $sub, 'deletion' ); 47 $vtp->setVar( $sub, 'deletion.name', $row['name'] ); 48 $yes_url = './admin.php?page=group_list&delete='.$_GET['delete']; 49 $yes_url.= '&confirm=1'; 50 $vtp->setVar( $sub, 'deletion.yes_url', add_session_id( $yes_url ) ); 51 $no_url = './admin.php?page=group_list'; 52 $vtp->setVar( $sub, 'deletion.no_url', add_session_id( $no_url ) ); 53 $vtp->closeSession( $sub, 'deletion' ); 54 } 55 // group deletion confirmed 56 else 57 { 58 $vtp->addSession( $sub, 'confirmation' ); 59 $query = 'SELECT COUNT(*) AS nb_result'; 60 $query.= ' FROM '.PREFIX_TABLE.'groups'; 61 $query.= ' WHERE id = '.$_GET['delete']; 62 $query.= ';'; 63 $row2 = mysql_fetch_array( pwg_query( $query ) ); 64 if ( $row2['nb_result'] > 0 ) 65 { 66 delete_group( $_GET['delete'] ); 67 $vtp->setVar( $sub, 'confirmation.class', 'info' ); 68 $info = '"'.$row['name'].'" '.$lang['listuser_info_deletion']; 69 $vtp->setVar( $sub, 'confirmation.info', $info ); 70 } 71 else 72 { 73 $vtp->setVar( $sub, 'confirmation.class', 'erreur' ); 74 $vtp->setVar( $sub, 'confirmation.info', $lang['group_err_unknown'] ); 75 } 76 $vtp->closeSession( $sub, 'confirmation' ); 77 } 37 $query = 'DELETE FROM ' . USER_GROUP_TABLE; 38 $query.= ' WHERE group_id = '.$_POST['group_id']; 39 pwg_query( $query ); 40 41 $query = 'DELETE FROM ' . GROUPS_TABLE; 42 $query.= ' WHERE id = '.$_POST['group_id']; 43 $query.= ';'; 44 pwg_query( $query ); 78 45 } 79 46 //----------------------------------------------------------------- add a group 80 if ( isset( $_POST['submit'] ) )47 elseif ( isset( $_POST['new'] ) ) 81 48 { 82 if ( preg_match( "/'/", $_POST['name'] )83 or preg_match( '/"/', $_POST['n ame'] ) )49 if ( empty($_POST['newgroup']) || preg_match( "/'/", $_POST['newgroup'] ) 50 or preg_match( '/"/', $_POST['newgroup'] ) ) 84 51 { 85 52 array_push( $error, $lang['group_add_error1'] ); … … 88 55 { 89 56 // is the group not already existing ? 90 $query = 'SELECT id'; 91 $query.= ' FROM '.PREFIX_TABLE.'groups'; 92 $query.= " WHERE name = '".$_POST['name']."'"; 57 $query = 'SELECT id FROM '.GROUPS_TABLE; 58 $query.= " WHERE name = '".$_POST['newgroup']."'"; 93 59 $query.= ';'; 94 60 $result = pwg_query( $query ); … … 101 67 { 102 68 // creating the group 103 $query = ' INSERT INTO '. PREFIX_TABLE.'groups';104 $query.= " (name) VALUES ('".$_POST['n ame']."')";69 $query = ' INSERT INTO '.GROUPS_TABLE; 70 $query.= " (name) VALUES ('".$_POST['newgroup']."')"; 105 71 $query.= ';'; 106 72 pwg_query( $query ); 107 73 } 108 74 } 75 //--------------------------------------------------------------- user management 76 elseif ( isset( $_POST['add'] ) ) 77 { 78 $userdata = getuserdata($_POST['username']); 79 if (!$userdata) echo "Utilisateur inexistant"; 80 81 // create a new association between the user and a group 82 $query = 'INSERT INTO '.USER_GROUP_TABLE; 83 $query.= ' (user_id,group_id) VALUES'; 84 $query.= ' ('.$userdata['id'].','.$_POST['edit_group_id'].')'; 85 $query.= ';'; 86 pwg_query( $query ); 87 } 88 elseif (isset( $_POST['deny_user'] )) 89 { 90 $sql_in = ''; 91 $members = $_POST['members']; 92 for($i = 0; $i < count($members); $i++) 93 { 94 $sql_in .= ( ( $sql_in != '' ) ? ', ' : '' ) . intval($members[$i]); 95 } 96 $query = 'DELETE FROM ' . USER_GROUP_TABLE; 97 $query.= ' WHERE user_id IN ('.$sql_in; 98 $query.= ') AND group_id = '.$_POST['edit_group_id']; 99 pwg_query( $query ); 100 } 109 101 //-------------------------------------------------------------- errors display 110 102 if ( sizeof( $error ) != 0 ) 111 103 { 112 $ vtp->addSession( $sub, 'errors');104 $template->assign_block_vars('errors',array()); 113 105 for ( $i = 0; $i < sizeof( $error ); $i++ ) 114 106 { 115 $vtp->addSession( $sub, 'li' ); 116 $vtp->setVar( $sub, 'li.li', $error[$i] ); 117 $vtp->closeSession( $sub, 'li' ); 107 $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i])); 118 108 } 119 $vtp->closeSession( $sub, 'errors' );120 109 } 121 110 //----------------------------------------------------------------- groups list 122 $vtp->addSession( $sub, 'groups' );123 111 124 $query = 'SELECT id,name'; 125 $query.= ' FROM '.PREFIX_TABLE.'groups'; 126 $query.= ' ORDER BY id ASC'; 127 $query.= ';'; 112 $query = 'SELECT id,name FROM '.GROUPS_TABLE; 113 $query.= ' ORDER BY id ASC;'; 128 114 $result = pwg_query( $query ); 115 $groups_display = '<select name="group_id">'; 116 $groups_nb=0; 129 117 while ( $row = mysql_fetch_array( $result ) ) 130 118 { 131 $vtp->addSession( $sub, 'group' ); 132 $vtp->setVar( $sub, 'group.name', $row['name'] ); 133 $url = './admin.php?page=group_perm&group_id='.$row['id']; 134 $vtp->setVar( $sub, 'group.permission_url', add_session_id( $url ) ); 135 $url = './admin.php?page=group_list&delete='.$row['id']; 136 $vtp->setVar( $sub, 'group.deletion_url', add_session_id( $url ) ); 137 $vtp->closeSession( $sub, 'group' ); 119 $groups_nb++; 120 $selected = ''; 121 if (isset($_POST['group_id']) && $_POST['group_id']==$row['id']) 122 $selected = 'selected'; 123 $groups_display .= '<option value="' . $row['id'] . '" '.$selected.'>' . $row['name'] . '</option>'; 124 } 125 $groups_display .= '</select>'; 126 127 $action = PHPWG_ROOT_PATH.'admin.php?page=group_list'; 128 //----------------------------------------------------- template initialization 129 $template->set_filenames( array('groups'=>'admin/group_list.tpl') ); 130 $tpl = array( 'group_add','add','listuser_permission','delete', 131 'group_confirm','yes','no','group_list_title' ); 132 133 $template->assign_vars(array( 134 'S_GROUP_SELECT'=>$groups_display, 135 136 'L_GROUP_SELECT'=>$lang['group_list_title'], 137 'L_GROUP_CONFIRM'=>$lang['group_confirm_delete'], 138 'L_LOOK_UP'=>$lang['edit'], 139 'L_GROUP_DELETE'=>$lang['delete'], 140 'L_CREATE_NEW_GROUP'=>$lang['group_add'], 141 'L_GROUP_EDIT'=>$lang['group_edit'], 142 'L_USER_NAME'=>$lang['login'], 143 'L_USER_EMAIL'=>$lang['mail_address'], 144 'L_USER_SELECT'=>$lang['Select'], 145 'L_DENY_SELECTED'=>$lang['group_deny_user'], 146 'L_ADD_MEMBER'=>$lang['group_add_user'], 147 'L_FIND_USERNAME'=>$lang['Find_username'], 148 149 'S_GROUP_ACTION'=>add_session_id($action), 150 'U_SEARCH_USER' => add_session_id(PHPWG_ROOT_PATH.'admin/search.php') 151 )); 152 153 if ($groups_nb) 154 { 155 $template->assign_block_vars('select_box',array()); 138 156 } 139 157 140 $vtp->closeSession( $sub, 'groups' ); 141 //------------------------------------------------------- create new group form 142 $action = './admin.php?'.$_SERVER['QUERY_STRING']; 143 $vtp->setVar( $sub, 'form_action', $action ); 158 //----------------------------------------------------------------- add a group 159 if ( isset( $_POST['edit']) || isset( $_POST['add']) || isset( $_POST['deny_user'] )) 160 { 161 // Retrieving the group name 162 $query = 'SELECT id, name FROM '.GROUPS_TABLE; 163 $query.= " WHERE id = '".$_POST['group_id']."'"; 164 $query.= ';'; 165 $result = mysql_fetch_array(pwg_query( $query )); 166 $template->assign_block_vars('edit_group',array( 167 'GROUP_NAME'=>$result['name'], 168 'GROUP_ID'=>$result['id'] 169 )); 170 171 // Retrieving all the users 172 $query = 'SELECT id, username, mail_address'; 173 $query.= ' FROM ('.USERS_TABLE.' as u'; 174 $query.= ' LEFT JOIN '.USER_GROUP_TABLE.' as ug ON ug.user_id=u.id)'; 175 $query.= " WHERE ug.group_id = '".$_POST['group_id']."';"; 176 $result = pwg_query( $query ); 177 $i=0; 178 while ( $row = mysql_fetch_array( $result ) ) 179 { 180 $class = ($i % 2)? 'row1':'row2'; $i++; 181 $template->assign_block_vars('edit_group.user',array( 182 'ID'=>$row['id'], 183 'NAME'=>$row['username'], 184 'EMAIL'=>$row['mail_address'], 185 'T_CLASS'=>$class 186 )); 187 } 188 } 189 144 190 //----------------------------------------------------------- sending html code 145 $ vtp->Parse( $handle , 'sub', $sub);191 $template->assign_var_from_handle('ADMIN_CONTENT', 'groups'); 146 192 ?> -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r622 r623 120 120 $lang['title_waiting'] = 'Pictures waiting for validation'; 121 121 $lang['title_cat_options'] = 'Categories options'; 122 $lang['title_groups'] = 'Groups management'; 122 123 123 124 //Error messages … … 239 240 $lang['stats_global_graph_title'] = 'Pages seen by month'; 240 241 $lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour'; 242 243 // Users 244 245 // Groups 246 $lang['group_confirm_delete']= 'Confirm group deletion'; 247 $lang['group_add'] = 'Add a group'; 248 $lang['group_add_error1'] = 'The name of a group must not contain " or \' or be empty.'; 249 $lang['group_add_error2'] = 'This name is already used by another group.'; 250 $lang['group_list_title'] = 'List of existing groups'; 251 $lang['group_edit'] = 'Manage users of the group'; 252 $lang['group_deny_user'] = 'Deny selected'; 253 $lang['group_add_user']= 'Add user'; 241 254 242 255 $lang['menu_add_user'] = 'add'; … … 303 316 $lang['title_add'] = 'Add a user'; 304 317 $lang['title_modify'] = 'Modify a user'; 305 $lang['title_groups'] = 'Groups management';306 318 $lang['title_user_perm'] = 'Modify permission for user'; 307 319 $lang['title_cat_perm'] = 'Modify permissions for category'; 308 320 $lang['title_group_perm'] = 'Modify permissions for group'; 309 321 $lang['title_picmod'] = 'Modify informations about a picture'; 310 $lang['adduser_associate'] = 'Associate to group'; 311 $lang['group_add'] = 'Add a group'; 312 $lang['group_add_error1'] = 'The name of a group must not contain " or \''; 313 $lang['group_add_error2'] = 'This name is already used by another group'; 314 $lang['group_confirm'] = 'Are you sure you want to remove this group ?'; 315 $lang['group_list_title'] = 'List of existing groups'; 316 $lang['group_err_unknown'] = 'This group doesn\'t exist in the database'; 322 317 323 $lang['stats_pages_seen'] = 'pages seen'; 318 324 $lang['stats_visitors'] = 'guests'; -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r622 r623 122 122 $lang['title_upload'] = 'Sélectionner les catégories pour lesquelles l\'ajout d\'image est autorisé'; 123 123 $lang['title_cat_options'] = 'Options relatives aux catégories'; 124 $lang['title_groups'] = 'Gestion des groupes'; 124 125 125 126 //Error messages … … 214 215 //Update 215 216 $lang['update_missing_tn'] = 'Il manque la miniature pour'; 216 $lang['update_disappeared_tn'] = 'La miniature a disparu';217 $lang['update_disappeared'] = ' a disparu';217 $lang['update_disappeared_tn'] = 'La miniature n\'existe pas'; 218 $lang['update_disappeared'] = 'n\'existe pas'; 218 219 $lang['update_part_deletion'] = 'Suppression des images de la base qui n\'ont pas de thumbnail ou qui n\'existent pas'; 219 $lang['update_deletion_conclusion'] = 'images supprimées de la base de données';220 220 $lang['update_part_research'] = 'Recherche des nouvelles images dans les répertoires'; 221 221 $lang['update_research_added'] = 'ajouté'; 222 222 $lang['update_research_tn_ext'] = 'miniature en'; 223 $lang['update_research_conclusion'] = 'images ajoutées à la base de données'; 224 $lang['update_default_title'] = 'Choisir une option'; 225 $lang['update_only_cat'] = 'mettre à jour les catégories, mais pas les images'; 226 $lang['update_all'] = 'mettre tout à jour'; 227 $lang['update_sync_metadata_question'] = 'Utiliser les métadonnées des images pour la mise à jour'; 223 $lang['update_default_title'] = 'Type de mise à jour'; 228 224 $lang['update_nb_new_elements'] = 'élément(s) ajouté(s)'; 229 225 $lang['update_nb_del_elements'] = 'élément(s) effacé(s)'; 230 226 $lang['update_nb_new_categories'] = 'catégorie(s) ajoutée(s)'; 231 227 $lang['update_nb_del_categories'] = 'catégorie(s) effacée(s)'; 228 $lang['update_sync_files'] = 'Synchroniser la structure'; 229 $lang['update_sync_dirs'] = 'Seulement les catégories'; 230 $lang['update_sync_all'] = 'Catégories et fichiers'; 231 $lang['update_sync_metadata'] = 'Synchroniser les méta-donnnées'; 232 $lang['update_sync_metadata_new'] = 'Seulement sur les nouveaux éléments'; 233 $lang['update_sync_metadata_all'] = 'Sur tous les éléments'; 234 $lang['update_cats_subset'] = 'Limiter la synchronisation aux catégories suivantes'; 232 235 233 236 // History … … 239 242 $lang['stats_visitors_graph_title'] = 'Nombre de visiteurs par jour'; 240 243 241 //Users 244 // Users 245 246 247 // Groups 248 $lang['group_list_title'] = 'Liste des groupes existants'; 249 $lang['group_confirm_delete']= 'Confirmer la destruction du groupe'; 250 $lang['group_add'] = 'Ajouter un groupe'; 251 $lang['group_add_error1'] = 'Le nom du groupe ne doit pas comporter de " ou de \' et ne pas être vide.'; 252 $lang['group_add_error2'] = 'Ce nom de groupe est déjà utilisé.'; 253 $lang['group_edit'] = 'Edition des utilisateurs appartenant au groupe'; 254 $lang['group_deny_user'] = 'Supprimer la sélection'; 255 $lang['group_add_user']= 'Ajouter le membre'; 242 256 243 257 … … 306 320 $lang['title_add'] = 'Ajouter un utilisateur'; 307 321 $lang['title_modify'] = 'Modifier un utilisateur'; 308 $lang['title_groups'] = 'Gestion des groupes'; 322 309 323 $lang['title_user_perm'] = 'Modifier les permissions pour l\'utilisateur'; 310 324 $lang['title_cat_perm'] = 'Modifier les permissions pour la catégorie'; … … 312 326 $lang['title_picmod'] = 'Modifier les informations d\'une image'; 313 327 $lang['waiting_update'] = 'Les images validées ne seront visibles qu\'après mise à jour de la base d\'images.'; 314 $lang['adduser_associate'] = 'Associer au groupe';315 $lang['group_add'] = 'Ajouter un groupe';316 $lang['group_add_error1'] = 'Le nom du groupe ne doit pas comporter de " ou de \'';317 $lang['group_add_error2'] = 'Ce nom de groupe est déjà utilisé';318 $lang['group_confirm'] = 'Etes-vous sûr de vouloir supprimer le groupe';319 $lang['group_list_title'] = 'Liste des groupes existants';320 $lang['group_err_unknown'] = 'Ce groupe n\'existe pas dans la base de données';321 328 $lang['permuser_only_private'] = 'Seules les catégories privées sont représentées'; 322 329 -
trunk/language/fr_FR.iso-8859-1/common.lang.php
r621 r623 136 136 $lang['create_cookie'] = 'Créer un cookie'; 137 137 $lang['theme'] = 'Thème de l\'interface'; 138 $lang['mail_address'] = 'Adresse mail'; 138 139 $lang['periods_error'] = 'La période doit être entière.'; 139 140 $lang['maxwidth_error'] = 'La largeur maximum des images doit être un entier supérieur à 50'; … … 252 253 253 254 $lang['guest'] = 'visiteur'; 254 $lang['mail_address'] = 'adresse mail';255 255 $lang['add'] = 'ajouter'; 256 256 $lang['dissociate'] = 'dissocier'; -
trunk/template/default/default.css
r622 r623 1 1 /* BACKGROUND */ 2 2 3 body { background-color:#000000;} 3 4 .main, .throw, .admin { background-color:#3F3F3F;} … … 9 10 .bouton, .imgMenu a, #imgBarMenu { background-image: url(theme/button_bg.gif);} 10 11 12 /* FONT COLORS */ 13 14 .titreMenu, .titreMenu a, .info, .admin{ color:#FFF48E;} 15 .titrePage, .titreMenu a:hover { color:#E0E0E0;} 16 .comment{ color:#C6B78E;} 17 .commentDate { color:#999999;} 18 input,select,textarea { color:#FFFFCC;} 19 20 /* ANCHORS */ 21 22 a { text-decoration:none; color:#FFFFFF;} 23 a:hover { text-decoration:none; color:#FFF48E;} 24 a.none:hover { text-decoration:none;} 25 a.image:hover { text-decoration:none;} 26 a.thumbLink:hover { text-decoration:none;} 27 11 28 /* POSITION */ 12 29 #gauche,#droite … … 24 41 } 25 42 26 #droite 27 { 28 text-align:right; 29 } 30 31 #left 32 { 33 float:left; 34 } 35 36 #right 37 { 38 float:right; 39 } 43 #droite{text-align:right;} 44 #left {float:left; } 45 #right{float:right; } 40 46 41 47 /* MAIN STYLES */ … … 60 66 } 61 67 62 /* ANCHORS */ 63 64 a { text-decoration:none; color:#FFFFFF;} 65 a:hover { text-decoration:none; color:#FFF48E;} 66 a.none:hover { text-decoration:none;} 67 a.image:hover { text-decoration:none;} 68 a.thumbLink:hover { text-decoration:none;} 68 69 69 70 70 /* LAYOUT STYLE */ … … 93 93 line-height: 25px; 94 94 font-size:12px; 95 color:#E0E0E0;96 95 font-weight:600; 97 96 text-align:center; … … 266 265 font-weight:lighter; 267 266 text-align:right; 268 color:#999999;269 267 border-top: 1px solid #000000; 270 268 border-bottom: 1px solid #000000; 271 269 } 272 270 273 .comment{274 color:#C6B78E;275 }276 271 /* Form styles */ 277 272 … … 295 290 border: 1px solid #797979; 296 291 padding: 0; 297 color:#FFFFCC;298 292 } 299 293 … … 317 311 text-align: center; 318 312 padding:0px; 319 color : #FFF48E;320 313 } 321 314 322 315 /* Other styles */ 323 316 .info { 324 color:#FFF48E;325 317 margin:5px 0px 5px 0px; 326 318 white-space:nowrap;
Note: See TracChangeset
for help on using the changeset viewer.