Changeset 13444 for trunk/include


Ignore:
Timestamp:
Feb 29, 2012, 10:21:46 PM (12 years ago)
Author:
patdenice
Message:

Multisize
Load thumbnails with ajax.

File:
1 edited

Legend:

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

    r13252 r13444  
    100100
    101101  private $params;
    102   private $rel_path, $rel_url;
     102  private $rel_path, $rel_url, $is_cached;
    103103
    104104  function __construct($type, $src_image)
     
    114114    }
    115115
    116     self::build($src_image, $this->params, $this->rel_path, $this->rel_url);
     116    self::build($src_image, $this->params, $this->rel_path, $this->rel_url, $this->is_cached);
    117117  }
    118118
     
    154154  }
    155155
    156   private static function build($src, &$params, &$rel_path, &$rel_url)
     156  private static function build($src, &$params, &$rel_path, &$rel_url, &$is_cached=null)
    157157  {
    158158    if ( $src->has_size() && $params->is_identity( $src->get_size() ) )
     
    161161      $params = null;
    162162      $rel_path = $rel_url = $src->rel_path;
     163      $is_cached = true;
    163164      return;
    164165    }
     
    192193      if ($mtime===false or $mtime < $params->last_mod_time)
    193194      {
     195        $is_cached = false;
    194196        $url_style = 2;
    195197      }
    196198      else
    197199      {
     200        $is_cached = true;
    198201        $url_style = 1;
    199202      }
     
    304307    }
    305308  }
     309
     310  function is_cached()
     311  {
     312    return $this->is_cached;
     313  }
    306314}
    307315
Note: See TracChangeset for help on using the changeset viewer.