Changeset 403 for trunk/admin
- Timestamp:
- Mar 31, 2004, 7:26:31 PM (20 years ago)
- Location:
- trunk/admin
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/admin_phpinfo.php
r394 r403 68 68 $output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="4" width="95%"', $output); 69 69 $output = preg_replace('#<tr class="v"><td>(.*?<a .*?</a>)(.*?)</td></tr>#s', '<tr class="throw"><td><table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td>\2</td><td>\1</td></tr></table></td></tr>', $output); 70 $output = preg_replace('#<td>#', '<td style=" {background-color: #9999cc;}">', $output);70 $output = preg_replace('#<td>#', '<td style="background-color: #444444;text-align:center;">', $output); 71 71 $output = preg_replace('#<th>#', '<th class="throw">', $output); 72 72 $output = preg_replace('#class="e"#', 'class="row1" nowrap="nowrap"', $output); -
trunk/admin/cat_list.php
r394 r403 221 221 { 222 222 223 if ($category[' status'] == 'private')223 if ($category['visible'] == 'false') 224 224 { 225 225 $category_image = '<img src="'.PHPWG_ROOT_PATH.'template/'.$user['template'].'/admin/images/icon_folder_lock.gif" … … 256 256 'U_MOVE_UP'=>add_session_id( $url.'up='.$category['id'] ), 257 257 'U_MOVE_DOWN'=>add_session_id( $url.'down='.$category['id'] ), 258 'U_CAT_EDIT'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='.$ row['id'] ),258 'U_CAT_EDIT'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='.$category['id'] ), 259 259 'U_CAT_DELETE'=>add_session_id( $url.'delete='.$category['id'] ), 260 'U_INFO_IMG'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=infos_images&cat_id='.$ row['id'] ),261 'U_CAT_UPDATE'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=update&update='.$ row['id'] )260 'U_INFO_IMG'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=infos_images&cat_id='.$category['id'] ), 261 'U_CAT_UPDATE'=>add_session_id( PHPWG_ROOT_PATH.'admin.php?page=update&update='.$category['id'] ) 262 262 )); 263 263 … … 270 270 $template->assign_block_vars('category.virtual' ,array()); 271 271 } 272 $url = add_session_id( './admin.php?page=cat_modify&cat='.$row['id'] );272 $url = add_session_id( PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat='.$row['id'] ); 273 273 if ( $category['nb_images'] > 0 ) 274 274 { -
trunk/admin/cat_modify.php
r394 r403 26 26 // +-----------------------------------------------------------------------+ 27 27 28 include_once( './admin/include/isadmin.inc.php' ); 29 //----------------------------------------------------- template initialization 30 $sub = $vtp->Open( './template/'.$user['template'].'/admin/cat_modify.vtp' ); 31 $tpl = array( 'remote_site','editcat_confirm','editcat_back','editcat_title1', 32 'editcat_name','editcat_comment','editcat_status', 33 'editcat_visible','editcat_visible_info', 'submit', 34 'editcat_uploadable','cat_virtual','cat_parent' ); 35 templatize_array( $tpl, 'lang', $sub ); 28 if( !defined("PHPWG_ROOT_PATH") ) 29 { 30 die ("Hacking attempt!"); 31 } 32 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 33 36 34 //---------------------------------------------------------------- verification 37 if ( !is_numeric( $_GET['cat'] ) ) 38 { 39 $_GET['cat'] = '-1'; 40 } 35 if ( !isset( $_GET['cat_id'] ) || !is_numeric( $_GET['cat_id'] ) ) 36 { 37 $_GET['cat_id'] = '-1'; 38 } 39 40 $template->set_filenames( array('categories'=>'admin/cat_modify.tpl') ); 41 41 42 //--------------------------------------------------------- form criteria check 42 43 if ( isset( $_POST['submit'] ) ) … … 45 46 // links for access rights 46 47 $query = 'SELECT status'; 47 $query.= ' FROM '. PREFIX_TABLE.'categories';48 $query.= ' WHERE id = '.$_GET['cat '];48 $query.= ' FROM '.CATEGORIES_TABLE; 49 $query.= ' WHERE id = '.$_GET['cat_id']; 49 50 $query.= ';'; 50 51 $row = mysql_fetch_array( mysql_query( $query ) ); 51 52 52 $query = 'UPDATE '.PREFIX_TABLE.'categories'; 53 53 $query = 'UPDATE '.CATEGORIES_TABLE; 54 54 $query.= ' SET name = '; 55 if ( $_POST['name'] == '')55 if ( empty($_POST['name'])) 56 56 $query.= 'NULL'; 57 57 else … … 59 59 60 60 $query.= ', comment = '; 61 if ( $_POST['comment'] == '')61 if ( empty($_POST['comment'])) 62 62 $query.= 'NULL'; 63 63 else … … 66 66 $query.= ", status = '".$_POST['status']."'"; 67 67 $query.= ", visible = '".$_POST['visible']."'"; 68 69 68 if ( isset( $_POST['uploadable'] ) ) 70 69 $query.= ", uploadable = '".$_POST['uploadable']."'"; … … 78 77 $query.= $_POST['associate']; 79 78 } 80 $query.= ' WHERE id = '.$_GET['cat '];79 $query.= ' WHERE id = '.$_GET['cat_id']; 81 80 $query.= ';'; 82 81 mysql_query( $query ); … … 86 85 // deletion of all access for groups concerning this category 87 86 $query = 'DELETE'; 88 $query.= ' FROM '. PREFIX_TABLE.'group_access';89 $query.= ' WHERE cat_id = '.$_GET['cat '];87 $query.= ' FROM '.GROUP_ACCESS_TABLE; 88 $query.= ' WHERE cat_id = '.$_GET['cat_id']; 90 89 mysql_query( $query ); 91 90 // deletion of all access for users concerning this category 92 91 $query = 'DELETE'; 93 $query.= ' FROM '. PREFIX_TABLE.'user_access';94 $query.= ' WHERE cat_id = '.$_GET['cat '];92 $query.= ' FROM '.USER_ACCESS_TABLE; 93 $query.= ' WHERE cat_id = '.$_GET['cat_id']; 95 94 mysql_query( $query ); 96 95 // resynchronize all users … … 107 106 check_favorites( $row['id'] ); 108 107 } 109 110 $vtp->addSession( $sub, 'confirmation' ); 111 $url = add_session_id( './admin.php?page=cat_list' ); 112 $vtp->setVar( $sub, 'confirmation.back_url', $url ); 113 $vtp->closeSession( $sub, 'confirmation' ); 114 } 115 //------------------------------------------------------------------------ form 116 $form_action = './admin.php?page=cat_modify&cat='.$_GET['cat']; 117 $vtp->setVar( $sub, 'form_action', add_session_id( $form_action ) ); 118 119 $query = 'SELECT a.id,name,dir,status,comment,uploadable'; 120 $query.= ',id_uppercat,site_id,galleries_url,visible'; 121 $query.= ' FROM '.PREFIX_TABLE.'categories as a, '.PREFIX_TABLE.'sites as b'; 122 $query.= ' WHERE a.id = '.$_GET['cat']; 108 $template->assign_block_vars('confirmation' ,array()); 109 } 110 111 $query = 'SELECT a.*, b.*'; 112 $query.= ' FROM '.CATEGORIES_TABLE.' as a, '.SITES_TABLE.' as b'; 113 $query.= ' WHERE a.id = '.$_GET['cat_id']; 123 114 $query.= ' AND a.site_id = b.id'; 124 115 $query.= ';'; 125 $row = mysql_fetch_array( mysql_query( $query ) ); 126 127 if ( !isset( $row['dir'] ) ) $row['dir'] = ''; 128 if ( !isset( $row['id_uppercat'] ) ) $row['id_uppercat'] = ''; 129 130 $result = get_cat_info( $row['id'] ); 131 // cat name 132 $cat_name = get_cat_display_name( $result['name'], ' - ' ); 133 $vtp->setVar( $sub, 'cat:name', $cat_name ); 134 // cat dir 135 if ( $row['dir'] != '' ) 136 { 137 $vtp->addSession( $sub, 'storage' ); 138 $vtp->setVar( $sub, 'storage.dir', $row['dir'] ); 139 $vtp->closeSession( $sub, 'storage' ); 140 } 141 else 142 { 143 $vtp->addSession( $sub, 'virtual' ); 144 $vtp->closeSession( $sub, 'virtual' ); 145 } 146 // remote site ? 147 if ( $row['site_id'] != 1 ) 148 { 149 $vtp->addSession( $sub, 'server' ); 150 $vtp->setVar( $sub, 'server.url', $row['galleries_url'] ); 151 $vtp->closeSession( $sub, 'server' ); 152 } 153 $vtp->setVar( $sub, 'name', $row['name'] ); 154 if ( !isset( $row['comment'] ) ) $row['comment'] = ''; 155 $vtp->setVar( $sub, 'comment', $row['comment'] ); 156 // status : public, private... 157 $options = get_enums( PREFIX_TABLE.'categories', 'status' ); 158 foreach ( $options as $option ) { 159 $vtp->addSession( $sub, 'status_option' ); 160 $vtp->setVar( $sub, 'status_option.option', $lang[$option] ); 161 $vtp->setVar( $sub, 'status_option.value', $option ); 162 if ( $option == $row['status'] ) 163 { 164 $vtp->setVar( $sub, 'status_option.checked', ' checked="checked"' ); 165 } 166 $vtp->closeSession( $sub, 'status_option' ); 167 } 168 // visible : true or false 169 $vtp->addSession( $sub, 'visible_option' ); 170 $vtp->setVar( $sub, 'visible_option.value', 'true' ); 171 $vtp->setVar( $sub, 'visible_option.option', $lang['yes'] ); 172 $checked = ''; 173 if ( $row['visible'] == 'true' ) 174 { 175 $checked = ' checked="checked"'; 176 } 177 $vtp->setVar( $sub, 'visible_option.checked', $checked ); 178 $vtp->closeSession( $sub, 'visible_option' ); 179 $vtp->addSession( $sub, 'visible_option' ); 180 $vtp->setVar( $sub, 'visible_option.value', 'false' ); 181 $vtp->setVar( $sub, 'visible_option.option', $lang['no'] ); 182 $checked = ''; 183 if ( $row['visible'] == 'false' ) 184 { 185 $checked = ' checked="checked"'; 186 } 187 $vtp->setVar( $sub, 'visible_option.checked', $checked ); 188 $vtp->closeSession( $sub, 'visible_option' ); 189 // uploadable : true or false 190 // a category can be uploadable if : 191 // 1. upload is authorized 192 // 2. category is not virtual 193 // 3. category is on the main site 194 if ( $conf['upload_available'] and $row['dir'] != '' and $row['site_id'] == 1 ) 195 { 196 $vtp->addSession( $sub, 'uploadable' ); 197 $vtp->addSession( $sub, 'uploadable_option' ); 198 $vtp->setVar( $sub, 'uploadable_option.value', 'true' ); 199 $vtp->setVar( $sub, 'uploadable_option.option', $lang['yes'] ); 200 $checked = ''; 201 if ( $row['uploadable'] == 'true' ) 202 { 203 $checked = ' checked="checked"'; 204 } 205 $vtp->setVar( $sub, 'uploadable_option.checked', $checked ); 206 $vtp->closeSession( $sub, 'uploadable_option' ); 207 $vtp->addSession( $sub, 'uploadable_option' ); 208 $vtp->setVar( $sub, 'uploadable_option.value', 'false' ); 209 $vtp->setVar( $sub, 'uploadable_option.option', $lang['no'] ); 210 $checked = ''; 211 if ( $row['uploadable'] == 'false' ) 212 { 213 $checked = ' checked="checked"'; 214 } 215 $vtp->setVar( $sub, 'uploadable_option.checked', $checked ); 216 $vtp->closeSession( $sub, 'uploadable_option' ); 217 $vtp->closeSession( $sub, 'uploadable' ); 218 } 116 $category = mysql_fetch_array( mysql_query( $query ) ); 117 118 // Navigation path 119 $current_category = get_cat_info($_GET['cat_id']); 120 $url = PHPWG_ROOT_PATH.'admin.php?page=cat_list&parent_id='; 121 $navigation = '<a class="" href="'.add_session_id(PHPWG_ROOT_PATH.'admin.php?page=cat_list').'">'; 122 $navigation.= $lang['gallery_index'].'</a>->'; 123 $navigation.= get_cat_display_name($current_category['name'], '->', $url); 124 125 $form_action = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='.$_GET['cat_id']; 126 $access = ($category['status']=='public')?'ACCESS_FREE':'ACCESS_RESTRICTED'; 127 $lock = ($category['visible']=='true')?'UNLOCKED':'LOCKED'; 128 129 //----------------------------------------------------- template initialization 130 131 $template->assign_vars(array( 132 'CATEGORIES_NAV'=>$navigation, 133 'CAT_NAME'=>$category['name'], 134 'CAT_COMMENT'=>$category['comment'], 135 'CATEGORY_DIR'=>$category['dir'], 136 'SITE_URL'=>$category['galleries_url'], 137 138 $access=>'checked="checked"', 139 $lock=>'checked="checked"', 140 141 'L_EDIT_CONFIRM'=>$lang['editcat_confirm'], 142 'L_EDIT_NAME'=>$lang['description'], 143 'L_STORAGE'=>$lang['storage'], 144 'L_EDIT_COMMENT'=>$lang['comment'], 145 'L_EDIT_STATUS'=>$lang['conf_general_access'], 146 'L_EDIT_STATUS_INFO'=>$lang['cat_access_info'], 147 'L_ACCESS_FREE'=>$lang['conf_general_access_1'], 148 'L_ACCESS_RESTRICTED'=>$lang['conf_general_access_2'], 149 'L_EDIT_LOCK'=>$lang['cat_lock'], 150 'L_EDIT_LOCK_INFO'=>$lang['cat_lock_info'], 151 'L_YES'=>$lang['yes'], 152 'L_NO'=>$lang['no'], 153 'L_SUBMIT'=>$lang['submit'], 154 155 'F_ACTION'=>add_session_id($form_action) 156 )); 157 158 if ( !empty($category['dir'])) 159 { 160 $template->assign_block_vars('storage' ,array()); 161 } 162 163 if ( $category['site_id'] != 1 ) 164 { 165 $template->assign_block_vars('storage' ,array()); 166 } 167 168 /* 219 169 // can the parent category be changed ? (is the category virtual ?) 220 170 if ( $row['dir'] == '' ) … … 224 174 // $conf['max_LOV_categories'] 225 175 $query = 'SELECT COUNT(id) AS nb_total_categories'; 226 $query.= ' FROM '. PREFIX_TABLE.'categories';176 $query.= ' FROM '.CATEGORIES_TABLE; 227 177 $query.= ';'; 228 178 $countrow = mysql_fetch_array( mysql_query( $query ) ); … … 249 199 $vtp->closeSession( $sub, 'parent' ); 250 200 } 201 */ 251 202 //----------------------------------------------------------- sending html code 252 $ vtp->Parse( $handle , 'sub', $sub);203 $template->assign_var_from_handle('ADMIN_CONTENT', 'categories'); 253 204 ?>
Note: See TracChangeset
for help on using the changeset viewer.