diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-08-06 21:36:17 -0700 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-08-06 21:52:23 -0700 |
| commit | a245c57400398d2b4b1c2aea94f590a9c0a7d8a8 (patch) | |
| tree | e3631c5d4a5af82a7da965f55cc918c6276118e5 /modules/organize/controllers | |
| parent | b2ef37f612f4369a72966e0efbc362039fba1734 (diff) | |
Further streamline the code.
Organize_Controller:
* Remove unnecessary constants
* Rename index() to dialog()
* Simplify _get_micro_thumb_grid
organize.js:
* Move sizing code in here from organize_dialog.html.php
organize_dialog.html.php:
* Move CSS and JS links in here so that we only load them when we need them.
* Move sizing code into organize.js
organize_thumb_grid.html.php:
* Move pagination logic in here, since it's view centric
* Collapse the css class determination code and inline it
Diffstat (limited to 'modules/organize/controllers')
| -rw-r--r-- | modules/organize/controllers/organize.php | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 95d71e9c..3a81ef4f 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -18,10 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Organize_Controller extends Controller { - private static $_MICRO_THUMB_SIZE = 90; - private static $_MICRO_THUMB_PADDING = 10; - - function index($item_id) { + function dialog($item_id) { $item = ORM::factory("item", $item_id); $root = $item->id == 1 ? $item : ORM::factory("item", 1); access::required("view", $item); @@ -36,26 +33,21 @@ class Organize_Controller extends Controller { $parents[$item->id] = 1; $v->album_tree = $this->_tree($root, $parents); - $v->micro_thumb_grid = $this->_get_micro_thumb_grid($item); + $v->micro_thumb_grid = $this->_get_micro_thumb_grid($item, 0); print $v; } - function content($item_id, $offset=0) { + function content($item_id, $offset) { $item = ORM::factory("item", $item_id); access::required("view", $item); access::required("edit", $item); - - $v = $this->_get_micro_thumb_grid($item, $offset); - print $v->__toString(); + print $this->_get_micro_thumb_grid($item, $offset); } - private function _get_micro_thumb_grid($item, $offset=0) { + private function _get_micro_thumb_grid($item, $offset) { $v = new View("organize_thumb_grid.html"); - $v->item_id = $item->id; - $v->children = $item->children(25, $offset); - $v->thumbsize = self::$_MICRO_THUMB_SIZE; - $v->offset = $offset + 25; - + $v->item = $item; + $v->offset = $offset; return $v; } |
