Skip to content

Commit

Permalink
2.2.x compatability - fixed My_Model issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Feb 5, 2015
1 parent 41a8d03 commit 06dbe6b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
5 changes: 4 additions & 1 deletion controllers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
{
Expand Down
2 changes: 1 addition & 1 deletion details.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Module_Galleries extends Module {

public $version = '1.3';
public $version = '1.4';

public function info()
{
Expand Down
3 changes: 2 additions & 1 deletion models/gallery_image_m.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand Down
5 changes: 3 additions & 2 deletions models/gallery_m.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']))
{
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit 06dbe6b

Please sign in to comment.