diff --git a/3.0/modules/albumtree/helpers/albumtree_block.php b/3.0/modules/albumtree/helpers/albumtree_block.php new file mode 100644 index 00000000..8d184f51 --- /dev/null +++ b/3.0/modules/albumtree/helpers/albumtree_block.php @@ -0,0 +1,37 @@ + t("Album tree")); + } + + static function get($block_id) { + $block = new Block(); + switch ($block_id) { + case "albumtree": + $block->css_id = "g-albumtree"; + $block->title = t("Album Tree"); + $block->content = new View("albumtree_block.html"); + $block->content->root = item::root(); + break; + } + return $block; + } +} \ No newline at end of file diff --git a/3.0/modules/albumtree/module.info b/3.0/modules/albumtree/module.info new file mode 100644 index 00000000..d6c29a03 --- /dev/null +++ b/3.0/modules/albumtree/module.info @@ -0,0 +1,3 @@ +name = "Album Tree" +description = "Provides a block in the sidebar with quick links to all other albums." +version = 1 diff --git a/3.0/modules/albumtree/views/albumtree_block.html.php b/3.0/modules/albumtree/views/albumtree_block.html.php new file mode 100644 index 00000000..7cf66799 --- /dev/null +++ b/3.0/modules/albumtree/views/albumtree_block.html.php @@ -0,0 +1,24 @@ + + diff --git a/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php new file mode 100644 index 00000000..9334972c --- /dev/null +++ b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php @@ -0,0 +1,72 @@ + $dims[0]) { + // Too wide, scale it down + list ($new_width, $new_height) = array($dims[0], $dims[0] / $desired_ratio); + } + + if ($new_height > $dims[1]) { + // Too tall, scale it down some more + $new_width = min($dims[0], $dims[1] * $desired_ratio); + $new_height = $new_width / $desired_ratio; + } + $new_width = round($new_width); + $new_height = round($new_height); + + Image::factory($input_file) + ->crop($new_width, $new_height) + ->quality(module::get_var("gallery", "image_quality")) + ->save($output_file); + } +} diff --git a/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php new file mode 100644 index 00000000..1fc6815c --- /dev/null +++ b/3.0/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php @@ -0,0 +1,29 @@ + t("Album tree")); + } + + static function get($block_id) { + $block = new Block(); + switch ($block_id) { + case "albumtree": + $block->css_id = "g-albumtree"; + $block->title = t("Album Tree"); + $block->content = new View("albumtree_block.html"); + $block->content->root = item::root(); + break; + } + return $block; + } +} \ No newline at end of file diff --git a/3.1/modules/albumtree/module.info b/3.1/modules/albumtree/module.info new file mode 100644 index 00000000..d6c29a03 --- /dev/null +++ b/3.1/modules/albumtree/module.info @@ -0,0 +1,3 @@ +name = "Album Tree" +description = "Provides a block in the sidebar with quick links to all other albums." +version = 1 diff --git a/3.1/modules/albumtree/views/albumtree_block.html.php b/3.1/modules/albumtree/views/albumtree_block.html.php new file mode 100644 index 00000000..7cf66799 --- /dev/null +++ b/3.1/modules/albumtree/views/albumtree_block.html.php @@ -0,0 +1,24 @@ + + diff --git a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php new file mode 100644 index 00000000..9334972c --- /dev/null +++ b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php @@ -0,0 +1,72 @@ + $dims[0]) { + // Too wide, scale it down + list ($new_width, $new_height) = array($dims[0], $dims[0] / $desired_ratio); + } + + if ($new_height > $dims[1]) { + // Too tall, scale it down some more + $new_width = min($dims[0], $dims[1] * $desired_ratio); + $new_height = $new_width / $desired_ratio; + } + $new_width = round($new_width); + $new_height = round($new_height); + + Image::factory($input_file) + ->crop($new_width, $new_height) + ->quality(module::get_var("gallery", "image_quality")) + ->save($output_file); + } +} diff --git a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php new file mode 100644 index 00000000..1fc6815c --- /dev/null +++ b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php @@ -0,0 +1,29 @@ +