diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-02-22 23:55:47 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-02-22 23:55:47 +0000 |
commit | f924cd66ac63f85460ab69c7857376a2036eb691 (patch) | |
tree | d842eaaf0e715947bfbcde26787e2746b0fe9b56 /core/controllers/scaffold.php | |
parent | ffbab952c679ea60bd7de102411e5e8a92896c96 (diff) |
Remove the $item from the various graphics functions, that was a bad
idea. Instead convert movies to jpeg before doing any
transformations, which keeps the graphics functions clean and abstract
and dealing solely with image types. Lighter/simpler solution.
Diffstat (limited to 'core/controllers/scaffold.php')
-rw-r--r-- | core/controllers/scaffold.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/controllers/scaffold.php b/core/controllers/scaffold.php index 26ccc51f..bb56edf7 100644 --- a/core/controllers/scaffold.php +++ b/core/controllers/scaffold.php @@ -20,6 +20,23 @@ class Scaffold_Controller extends Template_Controller { public $template = "scaffold.html"; + function test() { + $this->auto_render = false; + $source = ORM::factory("item", 3); + $target = ORM::factory("item", 4); + + printf("<pre>%s</pre>",print_r($source->as_array(),1));flush(); + printf("<pre>%s</pre>",print_r($target->as_array(),1));flush(); + + // If the target has no cover item, make this it. + if ($target->album_cover_item_id == null) { + $target->album_cover_item_id = + $source->is_album() ? $source->album_cover_item_id : $source->id; + $target->save(); + } + graphics::generate($target); + } + function index() { try { $session = Session::instance(); |