Changeset 2584
- Timestamp:
- Sep 24, 2008, 11:30:33 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r2583 r2584 1193 1193 } 1194 1194 1195 /** 1196 * returns the list of tags as you can see them in administration (web 1197 * service method). 1198 * 1199 * Only admin can run this method and permissions are not taken into 1200 * account. 1201 */ 1202 function ws_tags_getAdminList($params, &$service) 1203 { 1204 if (!is_admin()) 1205 { 1206 return new PwgError(401, 'Access denied'); 1207 } 1208 1209 $tags = get_all_tags(); 1210 return array( 1211 'tags' => new PwgNamedArray( 1212 $tags, 1213 'tag', 1214 array( 1215 'name', 1216 'id', 1217 'url_name', 1218 ) 1219 ) 1220 ); 1221 } 1195 1222 1196 1223 /** -
trunk/tools/piwigo_remote.pl
r2583 r2584 117 117 } 118 118 119 if ($opt{action} eq 'pwg.tags.getAdminList') { 120 $query = pwg_ws_get_query( 121 method => 'pwg.tags.getAdminList' 122 ); 123 124 $result = $ua->get($query); 125 my $tags = from_json($result->content)->{result}{tags}; 126 127 foreach my $tag (@{$tags}) { 128 # print join(',', keys %{$tag}), "\n"; exit(); 129 printf( 130 '{%u} %s ', 131 $tag->{id}, 132 $tag->{name} 133 ); 134 } 135 136 print "\n"; 137 } 138 119 139 if ($opt{action} eq 'pwg.categories.add') { 120 140 $form = { -
trunk/ws.php
r2583 r2584 212 212 'administration method only' 213 213 ); 214 215 $service->addMethod( 216 'pwg.tags.getAdminList', 217 'ws_tags_getAdminList', 218 array(), 219 'administration method only' 220 ); 214 221 } 215 222
Note: See TracChangeset
for help on using the changeset viewer.