Changeset 25817 for extensions/AdminTools/include
- Timestamp:
- Dec 7, 2013, 6:43:09 PM (10 years ago)
- Location:
- extensions/AdminTools/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AdminTools/include/MultiView.class.php
r25791 r25817 212 212 } 213 213 } 214 215 /** 216 * Register custom API methods 217 */ 218 public static function register_ws($arr) 219 { 220 $service = &$arr[0]; 221 222 $service->addMethod( 223 'multiView.getData', 224 array('MultiView', 'ws_get_data'), 225 array(), 226 'AdminTools private method.', 227 null, 228 array('admin_only' => true, 'hidden' => true) 229 ); 230 } 231 232 /** 233 * API method 234 * Return full list of users, themes and languages 235 */ 236 public static function ws_get_data($params) 237 { 238 global $conf; 239 240 // get users 241 $query = ' 242 SELECT 243 '.$conf['user_fields']['id'].' AS id, 244 '.$conf['user_fields']['username'].' AS username 245 FROM '.USERS_TABLE.' 246 ORDER BY CONVERT('.$conf['user_fields']['username'].', CHAR) 247 ;'; 248 $out['users'] = array_from_query($query); 249 250 // get themes 251 include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); 252 $themes = new themes(); 253 foreach (array_keys($themes->db_themes_by_id) as $theme) 254 { 255 if (!empty($theme)) 256 { 257 $out['themes'][] = $theme; 258 } 259 } 260 261 // get languages 262 foreach (get_languages() as $code => $name) 263 { 264 $out['languages'][] = array( 265 'id' => $code, 266 'name' => $name, 267 ); 268 } 269 270 return $out; 271 } 214 272 } -
extensions/AdminTools/include/events.inc.php
r25791 r25817 81 81 ); 82 82 83 // gets tags 83 // gets tags (full available list is loaded in ajax) 84 84 $query = ' 85 85 SELECT id, name … … 89 89 ;'; 90 90 $tag_selection = get_taglist($query); 91 92 $query = '93 SELECT id, name94 FROM '.TAGS_TABLE.'95 ;';96 $tags = get_taglist($query, false);97 91 98 92 $tpl_vars['QUICK_EDIT'] = array( … … 105 99 'date_creation_time' => substr($picture['current']['date_creation'], 11, 5), 106 100 'tag_selection' => $tag_selection, 107 'tags' => $tags,108 101 ); 109 102 } … … 146 139 $tpl_vars['QUICK_EDIT']['img'] = DerivativeImage::get_one(IMG_SQUARE, $image_infos)->get_url(); 147 140 } 148 }149 150 151 // get users152 $query = '153 SELECT154 '.$conf['user_fields']['id'].' AS id,155 '.$conf['user_fields']['username'].' AS username156 FROM '.USERS_TABLE.'157 ORDER BY CONVERT('.$conf['user_fields']['username'].', CHAR)158 ;';159 $tpl_vars['USERS'] = simple_hash_from_query($query, 'id', 'username');160 161 // get themes162 include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');163 $themes = new themes();164 foreach (array_keys($themes->db_themes_by_id) as $theme)165 {166 if (!empty($theme))167 {168 $tpl_vars['THEMES'][$theme] = $theme;169 }170 }171 172 // get languages173 foreach (get_languages() as $code => $name)174 {175 $tpl_vars['LANGS'][$code] = $name;176 141 } 177 142
Note: See TracChangeset
for help on using the changeset viewer.