From 06dbe6b6430d4ef0d365d4fb879d5603dfba1a26 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 4 Feb 2015 19:47:47 -0500 Subject: [PATCH] 2.2.x compatability - fixed My_Model issues. --- README.md | 9 +++++---- controllers/admin.php | 5 ++++- details.php | 2 +- models/gallery_image_m.php | 3 ++- models/gallery_m.php | 5 +++-- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 257caf8..c439f47 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ * [Documentation](http://pyrocms.com/docs) * [License](http://pyrocms.com/legal/license) * [Forums](http://pyrocms.com/forums) -* Version: 1.3 +* Version: 1.4 ## Description -This module allow you to create and manage as much galleries as you need. -Easy to use and well integrated with the File module to allow you to manage files in the easiest way! -In this new version has been added the pagination for the galleries, you can choose the number of displayed galleries in the Settings section of your Control Panel. +This module allow you to create and manage as many galleries as you need. +Easy to use and well integrated with the Files Module which allows you to manage files in an easy way! +Version 1.3 had pagination added to the galleries, you can choose the number of displayed galleries in the Settings section of your Control Panel. ## Installation @@ -24,3 +24,4 @@ Just upload the zip via Control Panel or FTP the folder in /addons/default/modul * [PyroCMS Team](http://www.pyrocms.com) * [Christian Giupponi](https://github.com/ChristianGiupponi) (Pagination update) +* [Enliven Applications](http://enlivenapp.com) (PyroCMS 2.2.x compatability) diff --git a/controllers/admin.php b/controllers/admin.php index 3d42ada..cf0ba27 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -4,6 +4,7 @@ * The galleries module enables users to create albums, upload photos and manage their existing albums. * * @author PyroCMS Dev Team + * @author Enliven Applications * @package PyroCMS * @subpackage Gallery Module * @category Modules @@ -144,6 +145,8 @@ public function index() */ public function create() { + $gallery = new StdClass; + $file_folders = $this->file_folders_m->get_folders(); $folders_tree = array(); foreach ($file_folders as $folder) @@ -223,7 +226,7 @@ public function manage($id) $gallery = $this->gallery_m->get($id); $gallery_images = $this->gallery_image_m->get_images_by_gallery($id); - $thumbnails = $this->gallery_image_m->where('gallery_images.gallery_id', $id)->dropdown('files.id', 'files.name'); + $thumbnails = $this->gallery_image_m->where('gallery_images.gallery_id', $id)->dropdown_gal('files.id', 'files.name'); if (empty($gallery)) { diff --git a/details.php b/details.php index 8da1a55..708b40f 100644 --- a/details.php +++ b/details.php @@ -2,7 +2,7 @@ class Module_Galleries extends Module { - public $version = '1.3'; + public $version = '1.4'; public function info() { diff --git a/models/gallery_image_m.php b/models/gallery_image_m.php index 554f8fe..4c477ab 100644 --- a/models/gallery_image_m.php +++ b/models/gallery_image_m.php @@ -4,6 +4,7 @@ * The galleries module enables users to create albums, upload photos and manage their existing albums. * * @author PyroCMS Dev Team + * @author Enliven Applications * @package PyroCMS * @subpackage Gallery Module * @category Modules @@ -227,7 +228,7 @@ public function get($id) * @param string $value * @return mixed */ - public function dropdown($key, $value) + public function dropdown_gal($key, $value) { $dropdown = array(); diff --git a/models/gallery_m.php b/models/gallery_m.php index d171a08..d3119fd 100644 --- a/models/gallery_m.php +++ b/models/gallery_m.php @@ -5,6 +5,7 @@ * The galleries module enables users to create albums, upload photos and manage their existing albums. * * @author Yorick Peterse - PyroCMS Dev Team + * @author Enliven Applications * @package PyroCMS * @subpackage Gallery Module * @category Modules @@ -89,7 +90,7 @@ public function get_all_with_filename($where = NULL, $value = NULL, $num = NULL, * @param array $input The data to insert (a copy of $_POST) * @return bool */ - public function insert($input) + public function insert($input, $skip_validation = false) { if (is_array($input['folder_id'])) { @@ -126,7 +127,7 @@ public function insert($input) * @param array $input The data to use for updating the DB record * @return bool */ - public function update($id, $input) + public function update($id, $input, $skip_validation = false) { return parent::update($id, array( 'title' => $input['title'],