Changeset 18628
- Timestamp:
- Oct 12, 2012, 9:56:12 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r18463 r18628 254 254 'cat_move', // ?only POST 255 255 'cat_options', // ?only POST; public/private; lock/unlock 256 'picture_modify', // ?only POST; associate/dissociate257 256 'user_perm', 258 257 'group_perm', -
trunk/admin/include/functions.php
r17980 r18628 34 34 WHERE site_id = '.$id.' 35 35 ;'; 36 $result = pwg_query($query); 37 $category_ids = array(); 38 while ($row = pwg_db_fetch_assoc($result)) 39 { 40 array_push($category_ids, $row['id']); 41 } 36 $category_ids = array_from_query($query, 'id'); 42 37 delete_categories($category_ids); 43 38 … … 80 75 '.wordwrap(implode(', ', $ids), 80, "\n").') 81 76 ;'; 82 $result = pwg_query($query); 83 $element_ids = array(); 84 while ($row = pwg_db_fetch_assoc($result)) 85 { 86 array_push($element_ids, $row['id']); 87 } 77 $element_ids = array_from_query($query, 'id'); 88 78 delete_elements($element_ids); 89 79 … … 396 386 foreach ($orphan_tags as $tag) 397 387 { 398 array_push($orphan_tag_ids, $tag['id']);388 $orphan_tag_ids[] = $tag['id']; 399 389 } 400 390 … … 413 403 function get_orphan_tags() 414 404 { 415 $orphan_tags = array();416 417 405 $query = ' 418 406 SELECT … … 423 411 WHERE tag_id IS NULL 424 412 ;'; 425 $result = pwg_query($query); 426 while ($row = pwg_db_fetch_assoc($result)) 427 { 428 array_push($orphan_tags, $row); 429 } 430 431 return $orphan_tags; 413 return array_from_query($query); 432 414 } 433 415 … … 786 768 787 769 // categories : id, site_id, uppercats 788 $categories = array();789 790 770 $query = ' 791 771 SELECT id, uppercats, site_id … … 795 775 '.wordwrap(implode(', ', $cat_ids), 80, "\n").') 796 776 ;'; 797 $result = pwg_query($query); 798 while ($row = pwg_db_fetch_assoc($result)) 799 { 800 array_push($categories, $row); 801 } 777 $categories = array_from_query($query); 802 778 803 779 // filling $cat_fulldirs … … 1604 1580 WHERE id IN ('.implode(',', $images).') 1605 1581 '; 1606 1582 1607 1583 if (is_array($categories) and count($categories) > 0) 1608 1584 { … … 2084 2060 case 'rating': 2085 2061 case 'tags': 2086 case 'picture_modify':2087 2062 case 'batch_manager': 2088 2063 return 0; … … 2146 2121 { 2147 2122 $alt_names = trigger_event('get_tag_alt_names', array(), $raw_name); 2148 2149 // TEMP 2.42150 if (count($alt_names)==0 and preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row['name'], $matches))2151 {2152 foreach ($matches[2] as $alt)2153 {2154 $alt_names[] = $alt;2155 }2156 }2157 2123 2158 2124 foreach( array_diff( array_unique($alt_names), array($name) ) as $alt) -
trunk/admin/include/themes.class.php
r16179 r18628 79 79 { 80 80 array_push( 81 $errors, 81 $errors, 82 82 sprintf( 83 83 l10n('Impossible to activate this theme, the parent theme is missing: %s'), … … 85 85 ) 86 86 ); 87 87 88 88 break; 89 89 } … … 212 212 break; 213 213 } 214 214 215 215 if (!$this->deltree(PHPWG_THEMES_PATH.$theme_id)) 216 216 { … … 221 221 case 'set_default': 222 222 // first we need to know which users are using the current default theme 223 $this->set_default_theme($theme_id); 223 $this->set_default_theme($theme_id); 224 224 break; 225 225 } … … 233 233 return null; 234 234 } 235 235 236 236 $parent = $this->fs_themes[$theme_id]['parent']; 237 237 238 238 if ('default' == $parent) 239 239 { 240 240 return null; 241 241 } 242 242 243 243 if (!isset($this->fs_themes[$parent])) 244 244 { … … 252 252 { 253 253 $children = array(); 254 254 255 255 foreach ($this->fs_themes as $test_child) 256 256 { … … 262 262 263 263 return $children; 264 } 264 } 265 265 266 266 function set_default_theme($theme_id) 267 267 { 268 268 global $conf; 269 269 270 270 // first we need to know which users are using the current default theme 271 271 $default_theme = get_default_theme(); 272 272 273 273 $query = ' 274 274 SELECT … … 301 301 * 302 302 FROM '.THEMES_TABLE; 303 303 304 304 $clauses = array(); 305 305 if (!empty($id)) … … 322 322 } 323 323 324 324 325 325 /** 326 326 * Get themes defined in the theme directory 327 */ 327 */ 328 328 function get_fs_themes() 329 329 { 330 330 $dir = opendir(PHPWG_THEMES_PATH); 331 331 332 332 while ($file = readdir($dir)) 333 333 { … … 532 532 return false; 533 533 } 534 534 535 535 /** 536 536 * Sort $server_themes … … 654 654 return $status; 655 655 } 656 656 657 657 /** 658 658 * delete $path directory … … 775 775 } 776 776 777 // themes specific methods778 function get_fs_themes_with_ini()779 {780 $themes_dir = PHPWG_ROOT_PATH.'themes';781 782 $fs_themes = array();783 784 foreach (get_dirs($themes_dir) as $theme)785 {786 $conf_file = $themes_dir.'/'.$theme.'/themeconf.inc.php';787 if (file_exists($conf_file))788 {789 $theme_data = array(790 'name' => $theme,791 );792 793 $ini_file = $themes_dir.'/'.$theme.'/theme.ini';794 if (file_exists($ini_file))795 {796 $theme_ini = parse_ini_file($ini_file);797 if (isset($theme_ini['extension_id']))798 {799 $theme_data['extension_id'] = $theme_ini['extension_id'];800 }801 }802 803 array_push($fs_themes, $theme_data);804 }805 }806 807 echo '<pre>'; print_r($fs_themes); echo '</pre>';808 }809 810 811 777 } 812 778 ?>
Note: See TracChangeset
for help on using the changeset viewer.