Masonry_Responsive_Image_Gallery - Version 1.0.1

Version Notes

Solved Delete image bug

Download this release

Release Info

Developer Vsourz Digital
Extension Masonry_Responsive_Image_Gallery
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Vsourz/Imagegallery/controllers/Adminhtml/CategoryController.php CHANGED
@@ -47,7 +47,7 @@ class Vsourz_Imagegallery_Adminhtml_CategoryController extends Mage_Adminhtml_Co
47
  }
48
  }
49
  else{
50
- if(isset($data['category_img']['delete']) && $data['category_img']['delete'] == 1){
51
  // delete image file
52
  $image = explode(',',$data['category_img']);
53
  unlink(Mage::getBaseDir('media').DS.$image[1]);
47
  }
48
  }
49
  else{
50
+ if(isset($data['category_img']) && $data['category_img']['delete'] == 1){
51
  // delete image file
52
  $image = explode(',',$data['category_img']);
53
  unlink(Mage::getBaseDir('media').DS.$image[1]);
app/code/community/Vsourz/Imagegallery/controllers/Adminhtml/ImageController.php CHANGED
@@ -28,14 +28,14 @@ class Vsourz_Imagegallery_Adminhtml_ImageController extends Mage_Adminhtml_Contr
28
  $model->load($id);
29
  }
30
  //Code to Save Gallery Image
31
- if(isset($_FILES['gallery_img']['name']) and (file_exists($_FILES['gallery_img']['tmp_name']))){
32
  try{
33
  $uploader = new Varien_File_Uploader('gallery_img');
34
  $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); // or pdf or anything
35
  $uploader->setAllowRenameFiles(false);
36
  // setAllowRenameFiles(true) -> move your file in a folder the magento way
37
  $uploader->setFilesDispersion(false);
38
- $path = Mage::getBaseDir('media') . DS .'imagegallery';
39
  $imgName = explode('.',$_FILES['gallery_img']['name']);
40
  $imgName[0] = $imgName[0].'-'.'gallery-img'.'-'.date('Y-m-d H-i-s');
41
  $imgName = implode('.',$imgName);
@@ -47,10 +47,13 @@ class Vsourz_Imagegallery_Adminhtml_ImageController extends Mage_Adminhtml_Contr
47
  }
48
  }
49
  else{
50
- if(isset($data['gallery_img']['delete']) && $data['gallery_img']['delete'] == 1){
51
  // delete image file
52
  $image = explode(',',$data['gallery_img']);
53
- unlink(Mage::getBaseDir('media').DS.$image[1]);
 
 
 
54
  // set db blank entry
55
  $data['gallery_img'] = '';
56
  }else{
28
  $model->load($id);
29
  }
30
  //Code to Save Gallery Image
31
+ if(isset($_FILES['gallery_img']['name']) && (file_exists($_FILES['gallery_img']['tmp_name']))){
32
  try{
33
  $uploader = new Varien_File_Uploader('gallery_img');
34
  $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); // or pdf or anything
35
  $uploader->setAllowRenameFiles(false);
36
  // setAllowRenameFiles(true) -> move your file in a folder the magento way
37
  $uploader->setFilesDispersion(false);
38
+ $path = Mage::getBaseDir('media'). DS .'imagegallery' .DS;
39
  $imgName = explode('.',$_FILES['gallery_img']['name']);
40
  $imgName[0] = $imgName[0].'-'.'gallery-img'.'-'.date('Y-m-d H-i-s');
41
  $imgName = implode('.',$imgName);
47
  }
48
  }
49
  else{
50
+ if(isset($data['gallery_img']) && $data['gallery_img']['delete'] == 1){
51
  // delete image file
52
  $image = explode(',',$data['gallery_img']);
53
+ $img = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA). DS .$image[1] .DS;
54
+ if(file_exists($img)){
55
+ unlink($img);
56
+ }
57
  // set db blank entry
58
  $data['gallery_img'] = '';
59
  }else{
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Masonry_Responsive_Image_Gallery</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">Massachusetts Institute of Technology License (MITL)</license>
7
  <channel>community</channel>
@@ -24,11 +24,11 @@ Features:&#xD;
24
  - Facility to add Image title and Description&#xD;
25
  - Smooth Pop Up navigation&#xD;
26
  - Responsive Layout</description>
27
- <notes>This is the first release of the extension</notes>
28
  <authors><author><name>Vsourz Digital</name><user>MAG002979323</user><email>mehul@vsourz.com</email></author></authors>
29
- <date>2015-04-20</date>
30
- <time>11:31:04</time>
31
- <contents><target name="magecommunity"><dir name="Vsourz"><dir name="Imagegallery"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="4dfc98b8d47de92168dd2af4d1ceb59b"/><dir name="Tabs"><file name="Form.php" hash="c7ec795ca7e26f34898d794ddab5513f"/></dir><file name="Tabs.php" hash="6a0d5f077e39b8da735e7c5e5ec412ae"/></dir><file name="Edit.php" hash="4a1cff2d7aabeddd48417491552a0974"/><file name="Grid.php" hash="b8adc8bea02ff87630f721f20dbc888e"/></dir><file name="Category.php" hash="5e709564bb49ff528a282d0ff28c36f4"/><dir name="Image"><dir name="Edit"><file name="Form.php" hash="109e6649791fcc746e9cb8569d899ecb"/><dir name="Tabs"><file name="Form.php" hash="926c2b2fa16e85e50aa0e74994077292"/></dir><file name="Tabs.php" hash="5f800ef86474a8d442da93dcdfe06fc9"/></dir><file name="Edit.php" hash="c2aa1247ff8d3810131348b3052d149a"/><file name="Grid.php" hash="657c587a2579d5182774d4327f97247e"/></dir><file name="Image.php" hash="a58193e203d2a574ebe9098a69b58ac8"/><dir name="Imagegallery"><dir name="Renderer"><file name="Category.php" hash="86675087f8583258fd68922e4889f057"/><file name="Catimage.php" hash="5e155696e6d55c8d32cc9a796a1c5185"/><file name="Image.php" hash="bc48bfe317aee82375bdb2855b0a3b2b"/><file name="Status.php" hash="cfd1dd4c0bdb8d79df9430a46f6ca286"/></dir></dir></dir><file name="Imagegallery.php" hash="95efc6cc4d5c03d1530846a87a4bbd46"/></dir><dir name="Helper"><file name="Data.php" hash="fabe8e0acec8db8cef0737ccd284d97e"/></dir><dir name="Model"><file name="Categoryval.php" hash="27d8840994488f51adaa7ebfa625d494"/><file name="Imagecategory.php" hash="bd794d0c94dc1c6c819931021a8612aa"/><file name="Imagedetail.php" hash="91eb4f3055da08011d05696968f470aa"/><file name="Imagegallery.php" hash="2dcc3e00547b0a4d8b26de3d1d708408"/><dir name="Resource"><dir name="Imagecategory"><file name="Collection.php" hash="c64ccf034d71a7544ad8431a5b39ea85"/></dir><file name="Imagecategory.php" hash="e99769496f95cb1c148b5e4528146f6f"/><dir name="Imagedetail"><file name="Collection.php" hash="d5720222b3d79fc8b2396b0d563ad656"/></dir><file name="Imagedetail.php" hash="990f3a47b3c2fb70a29a2cffa04b4613"/></dir><dir name="Source"><file name="Transition.php" hash="eefe7e92beb9be01d6564b5dc048200e"/><file name="Truefalse.php" hash="8aec1bd8bc378da1ed624f81cb9657e5"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategoryController.php" hash="b6b395ea977bf78a8138a73c33be72eb"/><file name="ImageController.php" hash="5ca3cbc08188ff5102032f4de6943933"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d9a665a5fb368bdcdfdc7702e892c2b0"/><file name="config.xml" hash="a986d1acc3cce8c1b0785615aef199ce"/><file name="system.xml" hash="b65ffc243a8249e98763c4eb88d2af92"/></dir><dir name="sql"><dir name="imagegallery_setup"><file name="mysql4-install-0.1.0.php" hash="8784ed8179981fa3074a72d00c2c60bd"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="imagegallery"><file name="imagegallery.phtml" hash="175bda7beccb7e0be0fd71b4e00b99f4"/></dir></dir><dir name="layout"><file name="imagegallery.xml" hash="064e64706da5130e728aebb40dcdcb86"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="imagegallery.xml" hash="97c384487e782254d0eeace392ed44cf"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Vsourz_Imagegallery.xml" hash="de046c38ddfb211dad16aa97cfc07dba"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="imagegallery"><file name="imagegallery.css" hash="4431d10aa51bf35f21ac034cc310f219"/><file name="magnific-popup.css" hash="feb5ed9aae9d875a0632fba1621c1aa2"/></dir></dir><dir name="images"><dir name="imagegallery"><file name="left-arrow.png" hash="bc1dd5ff9a0e49498ecb0dc21324627a"/><file name="right-arrow.png" hash="ae1e4d0566dbbbc1de1dd2ef1820747c"/><file name="view-image.png" hash="3624d70806879558f0fcba126cfc35a5"/></dir></dir><dir name="js"><dir name="imagegallery"><file name="jquery-1.10.2.min.js" hash="628072e7212db1e8cdacb22b21752cda"/><file name="jquery.magnific-popup.min.js" hash="d9267d6dda814fd767e1df7bfbe7eb57"/><file name="magnific-popup.js" hash="81af8a0075df9127fce325ba31c03445"/><file name="masonry.min.js" hash="7055b53b3da0bedce27f793a9909472b"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="imagegallery"><file name="favicon.ico" hash="88733ee53676a47fc354a61c32516e82"/></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Masonry_Responsive_Image_Gallery</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">Massachusetts Institute of Technology License (MITL)</license>
7
  <channel>community</channel>
24
  - Facility to add Image title and Description&#xD;
25
  - Smooth Pop Up navigation&#xD;
26
  - Responsive Layout</description>
27
+ <notes>Solved Delete image bug</notes>
28
  <authors><author><name>Vsourz Digital</name><user>MAG002979323</user><email>mehul@vsourz.com</email></author></authors>
29
+ <date>2015-05-14</date>
30
+ <time>11:29:36</time>
31
+ <contents><target name="magecommunity"><dir name="Vsourz"><dir name="Imagegallery"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="4dfc98b8d47de92168dd2af4d1ceb59b"/><dir name="Tabs"><file name="Form.php" hash="c7ec795ca7e26f34898d794ddab5513f"/></dir><file name="Tabs.php" hash="6a0d5f077e39b8da735e7c5e5ec412ae"/></dir><file name="Edit.php" hash="4a1cff2d7aabeddd48417491552a0974"/><file name="Grid.php" hash="b8adc8bea02ff87630f721f20dbc888e"/></dir><file name="Category.php" hash="5e709564bb49ff528a282d0ff28c36f4"/><dir name="Image"><dir name="Edit"><file name="Form.php" hash="109e6649791fcc746e9cb8569d899ecb"/><dir name="Tabs"><file name="Form.php" hash="926c2b2fa16e85e50aa0e74994077292"/></dir><file name="Tabs.php" hash="5f800ef86474a8d442da93dcdfe06fc9"/></dir><file name="Edit.php" hash="c2aa1247ff8d3810131348b3052d149a"/><file name="Grid.php" hash="657c587a2579d5182774d4327f97247e"/></dir><file name="Image.php" hash="a58193e203d2a574ebe9098a69b58ac8"/><dir name="Imagegallery"><dir name="Renderer"><file name="Category.php" hash="86675087f8583258fd68922e4889f057"/><file name="Catimage.php" hash="5e155696e6d55c8d32cc9a796a1c5185"/><file name="Image.php" hash="bc48bfe317aee82375bdb2855b0a3b2b"/><file name="Status.php" hash="cfd1dd4c0bdb8d79df9430a46f6ca286"/></dir></dir></dir><file name="Imagegallery.php" hash="95efc6cc4d5c03d1530846a87a4bbd46"/></dir><dir name="Helper"><file name="Data.php" hash="fabe8e0acec8db8cef0737ccd284d97e"/></dir><dir name="Model"><file name="Categoryval.php" hash="27d8840994488f51adaa7ebfa625d494"/><file name="Imagecategory.php" hash="bd794d0c94dc1c6c819931021a8612aa"/><file name="Imagedetail.php" hash="91eb4f3055da08011d05696968f470aa"/><file name="Imagegallery.php" hash="2dcc3e00547b0a4d8b26de3d1d708408"/><dir name="Resource"><dir name="Imagecategory"><file name="Collection.php" hash="c64ccf034d71a7544ad8431a5b39ea85"/></dir><file name="Imagecategory.php" hash="e99769496f95cb1c148b5e4528146f6f"/><dir name="Imagedetail"><file name="Collection.php" hash="d5720222b3d79fc8b2396b0d563ad656"/></dir><file name="Imagedetail.php" hash="990f3a47b3c2fb70a29a2cffa04b4613"/></dir><dir name="Source"><file name="Transition.php" hash="eefe7e92beb9be01d6564b5dc048200e"/><file name="Truefalse.php" hash="8aec1bd8bc378da1ed624f81cb9657e5"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategoryController.php" hash="54302dd7a3cc2cf99677b59f3c9425ad"/><file name="ImageController.php" hash="62853f39c3ac5fd19bad716bfc14a876"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d9a665a5fb368bdcdfdc7702e892c2b0"/><file name="config.xml" hash="a986d1acc3cce8c1b0785615aef199ce"/><file name="system.xml" hash="b65ffc243a8249e98763c4eb88d2af92"/></dir><dir name="sql"><dir name="imagegallery_setup"><file name="mysql4-install-0.1.0.php" hash="8784ed8179981fa3074a72d00c2c60bd"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="imagegallery"><file name="imagegallery.phtml" hash="175bda7beccb7e0be0fd71b4e00b99f4"/></dir></dir><dir name="layout"><file name="imagegallery.xml" hash="064e64706da5130e728aebb40dcdcb86"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="imagegallery.xml" hash="97c384487e782254d0eeace392ed44cf"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Vsourz_Imagegallery.xml" hash="de046c38ddfb211dad16aa97cfc07dba"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="imagegallery"><file name="imagegallery.css" hash="4431d10aa51bf35f21ac034cc310f219"/><file name="magnific-popup.css" hash="feb5ed9aae9d875a0632fba1621c1aa2"/></dir></dir><dir name="images"><dir name="imagegallery"><file name="left-arrow.png" hash="bc1dd5ff9a0e49498ecb0dc21324627a"/><file name="right-arrow.png" hash="ae1e4d0566dbbbc1de1dd2ef1820747c"/><file name="view-image.png" hash="3624d70806879558f0fcba126cfc35a5"/></dir></dir><dir name="js"><dir name="imagegallery"><file name="jquery-1.10.2.min.js" hash="628072e7212db1e8cdacb22b21752cda"/><file name="jquery.magnific-popup.min.js" hash="d9267d6dda814fd767e1df7bfbe7eb57"/><file name="magnific-popup.js" hash="81af8a0075df9127fce325ba31c03445"/><file name="masonry.min.js" hash="7055b53b3da0bedce27f793a9909472b"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="imagegallery"><file name="favicon.ico" hash="88733ee53676a47fc354a61c32516e82"/></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>