source: extensions/derivatives/include/derivative_std_params.inc.php @ 12770

Last change on this file since 12770 was 12770, checked in by rvelices, 12 years ago
File size: 1.2 KB
Line 
1<?php
2
3define('IMG_TINY', 'tiny');
4define('IMG_THUMB', 'thumb');
5define('IMG_SMALL', 'small');
6define('IMG_MEDIUM', 'medium');
7define('IMG_LARGE', 'large');
8define('IMG_XLARGE', 'xlarge');
9define('IMG_XXLARGE', 'xxlarge');
10define('IMG_CUSTOM', 'custom');
11
12final class ImageStdParams
13{
14  private static $all_types = array();
15  private static $type_map = array();
16 
17  static function get_all_types()
18  {
19    return self::$all_types;
20  }
21 
22  static function get_by_type($type)
23  {
24    return self::$type_map[$type];
25  }
26 
27  static function load_from_db()
28  {
29    self::make_default();
30  }
31
32  static function load_from_file()
33  {
34    self::make_default();
35  }
36
37  static function make_default()
38  {
39    //todo
40    self::$type_map[IMG_TINY] = new ImageParams( SizingParams::square(100,100) );
41    self::$type_map[IMG_THUMB] = new ImageParams( SizingParams::classic(144,144) );
42    self::$type_map[IMG_SMALL] = new ImageParams( SizingParams::classic(240,240) );
43    self::$type_map[IMG_MEDIUM] = new ImageParams( SizingParams::classic(432,432) );
44    self::$type_map[IMG_LARGE] = new ImageParams( SizingParams::classic(864,648) );
45    self::$all_types = array_keys(self::$type_map);
46  }
47}
48
49?>
Note: See TracBrowser for help on using the repository browser.