Ignore:
Timestamp:
Nov 29, 2013, 2:48:55 PM (10 years ago)
Author:
mistic100
Message:

feature 2999 : Documentation of multisize classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/derivative_std_params.inc.php

    r19703 r25754  
    2020// +-----------------------------------------------------------------------+
    2121
     22/**
     23 * @package Derivatives
     24 */
     25
     26
    2227define('IMG_SQUARE', 'square');
    2328define('IMG_THUMB', 'thumb');
     
    3136define('IMG_CUSTOM', 'custom');
    3237
     38
     39/**
     40 * Container for watermark configuration.
     41 */
    3342final class WatermarkParams
    3443{
     44  /** @var string */
    3545  public $file = '';
     46  /** @var int[] */
    3647  public $min_size = array(500,500);
     48  /** @var int */
    3749  public $xpos = 50;
     50  /** @var int */
    3851  public $ypos = 50;
     52  /** @var int */
    3953  public $xrepeat = 0;
     54  /** @var int */
    4055  public $opacity = 100;
    4156}
    4257
    4358
     59/**
     60 * Container for standard derivatives parameters.
     61 */
    4462final class ImageStdParams
    4563{
     64  /** @var string[] */
    4665  private static $all_types = array(
    47     IMG_SQUARE,IMG_THUMB,IMG_XXSMALL,IMG_XSMALL,IMG_SMALL,IMG_MEDIUM,IMG_LARGE,IMG_XLARGE,IMG_XXLARGE
     66    IMG_SQUARE, IMG_THUMB, IMG_XXSMALL, IMG_XSMALL, IMG_SMALL,
     67    IMG_MEDIUM, IMG_LARGE, IMG_XLARGE, IMG_XXLARGE
    4868    );
     69  /** @var DerivativeParams[] */
    4970  private static $all_type_map = array();
     71  /** @var DerivativeParams[] */
    5072  private static $type_map = array();
     73  /** @var DerivativeParams[] */
    5174  private static $undefined_type_map = array();
     75  /** @var WatermarkParams */
    5276  private static $watermark;
     77  /** @var array */
    5378  public static $custom = array();
     79  /** @var int */
    5480  public static $quality=95;
    5581
     82  /**
     83   * @return string[]
     84   */
    5685  static function get_all_types()
    5786  {
     
    5988  }
    6089
     90  /**
     91   * @return DerivativeParams[]
     92   */
    6193  static function get_all_type_map()
    6294  {
     
    6496  }
    6597
     98  /**
     99   * @return DerivativeParams[]
     100   */
    66101  static function get_defined_type_map()
    67102  {
     
    69104  }
    70105
     106  /**
     107   * @return DerivativeParams[]
     108   */
    71109  static function get_undefined_type_map()
    72110  {
     
    74112  }
    75113
     114  /**
     115   * @return DerivativeParams
     116   */
    76117  static function get_by_type($type)
    77118  {
     
    79120  }
    80121
     122  /**
     123   * @param int $w
     124   * @param int $h
     125   * @param float $crop
     126   * @param int $minw
     127   * @param int $minh
     128   * @return DerivativeParams
     129   */
    81130  static function get_custom($w, $h, $crop=0, $minw=null, $minh=null)
    82131  {
     
    95144  }
    96145
     146  /**
     147   * @return WatermarkParams
     148   */
    97149  static function get_watermark()
    98150  {
     
    100152  }
    101153
     154  /**
     155   * Loads derivative configuration from database or initializes it.
     156   */
    102157  static function load_from_db()
    103158  {
     
    122177  }
    123178
     179  /**
     180   * @param WatermarkParams $watermark
     181   */
    124182  static function set_watermark($watermark)
    125183  {
     
    127185  }
    128186
     187  /**
     188   * @see ImageStdParams::save()
     189   *
     190   * @param DerivativeParams[] $map
     191   */
    129192  static function set_and_save($map)
    130193  {
     
    134197  }
    135198
     199  /**
     200   * Saves the configuration in database.
     201   */
    136202  static function save()
    137203  {
     
    147213  }
    148214
     215  /**
     216   * @return DerivativeParams[]
     217   */
    149218  static function get_default_sizes()
    150219  {
     
    160229      IMG_XXLARGE => new DerivativeParams( SizingParams::classic(1656,1242) ),
    161230    );
     231    $now = time();
    162232    foreach($arr as $params)
    163233    {
    164       $params->last_mod_time = time();
     234      $params->last_mod_time = $now;
    165235    }
    166236    return $arr;
    167237  }
    168238
     239  /**
     240   * Compute 'apply_watermark'
     241   *
     242   * @param DerivativeParams $params
     243   */
    169244  static function apply_global($params)
    170245  {
     
    174249  }
    175250
     251  /**
     252   * Build 'type_map', 'all_type_map' and 'undefined_type_map'.
     253   */
    176254  private static function build_maps()
    177255  {
     
    201279    }
    202280  }
    203 
    204281}
    205282
Note: See TracChangeset for help on using the changeset viewer.