Version Notes
No notes
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mage_Imaclean |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Mage/Imaclean/Block/Adminhtml/Imaclean.php +13 -0
- app/code/local/Mage/Imaclean/Block/Adminhtml/Imaclean/Grid.php +77 -0
- app/code/local/Mage/Imaclean/Block/Adminhtml/Renderer/Image.php +45 -0
- app/code/local/Mage/Imaclean/Block/Imaclean.php +17 -0
- app/code/local/Mage/Imaclean/Helper/Data.php +57 -0
- app/code/local/Mage/Imaclean/Model/Imaclean.php +10 -0
- app/code/local/Mage/Imaclean/Model/Mysql4/Imaclean.php +11 -0
- app/code/local/Mage/Imaclean/Model/Mysql4/Imaclean/Collection.php +35 -0
- app/code/local/Mage/Imaclean/Model/Status.php +15 -0
- app/code/local/Mage/Imaclean/controllers/Adminhtml/ImacleanController.php +68 -0
- app/code/local/Mage/Imaclean/controllers/IndexController.php +10 -0
- app/code/local/Mage/Imaclean/etc/config.xml +120 -0
- app/code/local/Mage/Imaclean/sql/imaclean_setup/mysql4-install-0.1.0.php +18 -0
- app/design/adminhtml/default/default/layout/imaclean.xml +8 -0
- app/etc/modules/Mage_Imaclean.xml +9 -0
- package.xml +18 -0
app/code/local/Mage/Imaclean/Block/Adminhtml/Imaclean.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Imaclean_Block_Adminhtml_Imaclean extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_imaclean';
|
7 |
+
$this->_blockGroup = 'imaclean';
|
8 |
+
$this->_headerText = Mage::helper('imaclean')->__('Items Manager. These files are not in database.');
|
9 |
+
$this->_addButtonLabel = Mage::helper('imaclean')->__('Refresh');
|
10 |
+
parent::__construct();
|
11 |
+
|
12 |
+
}
|
13 |
+
}
|
app/code/local/Mage/Imaclean/Block/Adminhtml/Imaclean/Grid.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Block_Adminhtml_Imaclean_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('imacleanGrid');
|
10 |
+
$this->setDefaultSort('imaclean_id');
|
11 |
+
$this->setDefaultDir('ASC');
|
12 |
+
$this->setSaveParametersInSession(true);
|
13 |
+
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
// **** // trae las imagenes que no estan en base de datos...
|
18 |
+
protected function _prepareCollection()
|
19 |
+
{
|
20 |
+
$collection = Mage::getModel('imaclean/imaclean')->getCollection();
|
21 |
+
|
22 |
+
$this->setCollection($collection);
|
23 |
+
|
24 |
+
return parent::_prepareCollection();
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _prepareColumns()
|
29 |
+
{
|
30 |
+
|
31 |
+
$this->addColumn('filename', array(
|
32 |
+
'header' => Mage::helper('imaclean')->__('Filename'),
|
33 |
+
'renderer' =>'Mage_Imaclean_Block_Adminhtml_Renderer_Image',
|
34 |
+
'align' =>'left',
|
35 |
+
'index' => 'filename'
|
36 |
+
|
37 |
+
));
|
38 |
+
|
39 |
+
$this->addColumn('action',
|
40 |
+
array(
|
41 |
+
'header' => Mage::helper('imaclean')->__('Action'),
|
42 |
+
'width' => '100',
|
43 |
+
'type' => 'action',
|
44 |
+
'getter' => 'getId',
|
45 |
+
'actions' => array(
|
46 |
+
array(
|
47 |
+
'caption' => Mage::helper('imaclean')->__('delete'),
|
48 |
+
'url' => array('base'=> '*/*/delete'),
|
49 |
+
'field' => 'id'
|
50 |
+
)
|
51 |
+
),
|
52 |
+
'filter' => false,
|
53 |
+
'sortable' => false,
|
54 |
+
'index' => 'stores',
|
55 |
+
'is_system' => true,
|
56 |
+
));
|
57 |
+
|
58 |
+
return parent::_prepareColumns();
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
protected function _prepareMassaction()
|
63 |
+
{
|
64 |
+
|
65 |
+
$this->setMassactionIdField('imaclean_id');
|
66 |
+
$this->getMassactionBlock()->setFormFieldName('imaclean');
|
67 |
+
|
68 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
69 |
+
'label' => Mage::helper('imaclean')->__('Delete'),
|
70 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
71 |
+
'confirm' => Mage::helper('imaclean')->__('Are you sure?')
|
72 |
+
));
|
73 |
+
return $this;
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
}
|
app/code/local/Mage/Imaclean/Block/Adminhtml/Renderer/Image.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Block_Adminhtml_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Format variables pattern
|
7 |
+
*
|
8 |
+
* @var string
|
9 |
+
*/
|
10 |
+
protected $_variablePattern = '/\\$([a-z0-9_]+)/i';
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Renders grid column
|
14 |
+
*
|
15 |
+
* @param Varien_Object $row
|
16 |
+
* @return mixed
|
17 |
+
*/
|
18 |
+
public function _getValue(Varien_Object $row)
|
19 |
+
{
|
20 |
+
|
21 |
+
$format = ( $this->getColumn()->getFormat() ) ? $this->getColumn()->getFormat() : null;
|
22 |
+
$defaultValue = $this->getColumn()->getDefault();
|
23 |
+
if (is_null($format)) {
|
24 |
+
// If no format and it column not filtered specified return data as is.
|
25 |
+
$data = parent::_getValue($row);
|
26 |
+
$string = is_null($data) ? $defaultValue : $data;
|
27 |
+
$url = htmlspecialchars($string);
|
28 |
+
}
|
29 |
+
elseif (preg_match_all($this->_variablePattern, $format, $matches)) {
|
30 |
+
// Parsing of format string
|
31 |
+
$formatedString = $format;
|
32 |
+
foreach ($matches[0] as $matchIndex=>$match) {
|
33 |
+
$value = $row->getData($matches[1][$matchIndex]);
|
34 |
+
$formatedString = str_replace($match, $value, $formatedString);
|
35 |
+
}
|
36 |
+
$url = $formatedString;
|
37 |
+
} else {
|
38 |
+
$url = htmlspecialchars($format);
|
39 |
+
}
|
40 |
+
|
41 |
+
$location = Mage::getStoreConfig('web/secure/base_url');
|
42 |
+
return "<img src='". $location ."media/catalog/product{$url}' alt='{$url}' title='{$url}' width='150' height='150' />";
|
43 |
+
|
44 |
+
}
|
45 |
+
}
|
app/code/local/Mage/Imaclean/Block/Imaclean.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Imaclean_Block_Imaclean extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getImaclean()
|
10 |
+
{
|
11 |
+
if (!$this->hasData('imaclean')) {
|
12 |
+
$this->setData('imaclean', Mage::registry('imaclean'));
|
13 |
+
}
|
14 |
+
return $this->getData('imaclean');
|
15 |
+
|
16 |
+
}
|
17 |
+
}
|
app/code/local/Mage/Imaclean/Helper/Data.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
protected $result = array();
|
7 |
+
protected $_mainTable;
|
8 |
+
public $valdir = array();
|
9 |
+
|
10 |
+
public function listDirectories($path){
|
11 |
+
if(is_dir($path)){
|
12 |
+
|
13 |
+
if ($dir = opendir($path)) {
|
14 |
+
while (($entry = readdir($dir)) !== false) {
|
15 |
+
if(preg_match('/^\./',$entry) != 1){
|
16 |
+
if (is_dir($path . DS . $entry) && !in_array($entry,array('cache','watermark')) ){
|
17 |
+
$this->listDirectories($path . DS . $entry);
|
18 |
+
} elseif(!in_array($entry,array('cache','watermark')) && (strpos($entry,'.') != 0)) {
|
19 |
+
$this->result[] = substr($path . DS . $entry, 21);
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
}
|
24 |
+
closedir($dir);
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
28 |
+
return $this->result;
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
public function compareList() {
|
33 |
+
|
34 |
+
$valores = Mage::getModel('imaclean/imaclean')->getCollection()->getImages();
|
35 |
+
|
36 |
+
$pepe = 'media' . DS . 'catalog' . DS . 'product';
|
37 |
+
|
38 |
+
$leer = $this->listDirectories($pepe);
|
39 |
+
|
40 |
+
$model = Mage::getModel('imaclean/imaclean');
|
41 |
+
foreach ($leer as $item){
|
42 |
+
try{
|
43 |
+
$item = strtr($item,'\\','/');
|
44 |
+
if(!in_array($item, $valores)){
|
45 |
+
$valdir[]['filename'] = $item;
|
46 |
+
$model->setData(array('filename'=>$item))->setId(null);
|
47 |
+
$model->save();
|
48 |
+
}
|
49 |
+
} catch(Zend_Db_Exception $e){
|
50 |
+
} catch(Exception $e){
|
51 |
+
Mage::log($e->getMessage());
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
}
|
app/code/local/Mage/Imaclean/Model/Imaclean.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Model_Imaclean extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('imaclean/imaclean');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Mage/Imaclean/Model/Mysql4/Imaclean.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Model_Mysql4_Imaclean extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the imaclean_id refers to the key field in your database table.
|
8 |
+
$this->_init('imaclean/imaclean', 'imaclean_id');
|
9 |
+
}
|
10 |
+
|
11 |
+
}
|
app/code/local/Mage/Imaclean/Model/Mysql4/Imaclean/Collection.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Model_Mysql4_Imaclean_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected $total;
|
6 |
+
public function _construct()
|
7 |
+
{
|
8 |
+
parent::_construct();
|
9 |
+
$this->_init('imaclean/imaclean');
|
10 |
+
|
11 |
+
}
|
12 |
+
|
13 |
+
// trae imagenes que estan guardadas en la base de datos...
|
14 |
+
|
15 |
+
public function getImages(){
|
16 |
+
try {
|
17 |
+
$this->setConnection($this->getResource()->getReadConnection());
|
18 |
+
$this->getSelect()
|
19 |
+
->from(array('main_table'=>$this->getTable('catalog/product_attribute_media_gallery')),'*')
|
20 |
+
->group(array('value_id'));
|
21 |
+
|
22 |
+
$array=array();
|
23 |
+
foreach ($this->getData() as $item){
|
24 |
+
$array[] = $item['value'];
|
25 |
+
}
|
26 |
+
}catch(Exception $e){
|
27 |
+
Mage::log($e->getMessage());
|
28 |
+
}
|
29 |
+
|
30 |
+
return $array;
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
}
|
app/code/local/Mage/Imaclean/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('imaclean')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('imaclean')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Mage/Imaclean/controllers/Adminhtml/ImacleanController.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mage_Imaclean_Adminhtml_ImacleanController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('imaclean/items')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
|
16 |
+
$this->_initAction()
|
17 |
+
->renderLayout();
|
18 |
+
}
|
19 |
+
|
20 |
+
public function newAction(){
|
21 |
+
|
22 |
+
Mage::helper('imaclean')->compareList();
|
23 |
+
$this->_redirect('*/*/');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function deleteAction() {
|
27 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
28 |
+
try {
|
29 |
+
$model = Mage::getModel('imaclean/imaclean');
|
30 |
+
$model->load($this->getRequest()->getParam('id'));
|
31 |
+
unlink('media/catalog/product'. $model->getFilename());
|
32 |
+
$model->setId($this->getRequest()->getParam('id'))->delete();
|
33 |
+
|
34 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
35 |
+
$this->_redirect('*/*/');
|
36 |
+
} catch (Exception $e) {
|
37 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
38 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
39 |
+
}
|
40 |
+
}
|
41 |
+
$this->_redirect('*/*/');
|
42 |
+
}
|
43 |
+
|
44 |
+
public function massDeleteAction() {
|
45 |
+
$imacleanIds = $this->getRequest()->getParam('imaclean');
|
46 |
+
if(!is_array($imacleanIds)) {
|
47 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
48 |
+
} else {
|
49 |
+
try {
|
50 |
+
$model = Mage::getModel('imaclean/imaclean');
|
51 |
+
foreach ($imacleanIds as $imacleanId) {
|
52 |
+
$model->load($imacleanId);
|
53 |
+
unlink('media/catalog/product'. $model->getFilename());
|
54 |
+
$model->setId($imacleanId)->delete();
|
55 |
+
}
|
56 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
57 |
+
Mage::helper('adminhtml')->__(
|
58 |
+
'Total of %d record(s) were successfully deleted', count($imacleanIds)
|
59 |
+
)
|
60 |
+
);
|
61 |
+
} catch (Exception $e) {
|
62 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
63 |
+
}
|
64 |
+
}
|
65 |
+
$this->_redirect('*/*/index');
|
66 |
+
}
|
67 |
+
|
68 |
+
}
|
app/code/local/Mage/Imaclean/controllers/IndexController.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mage_Imaclean_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
|
7 |
+
$this->loadLayout();
|
8 |
+
$this->renderLayout();
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Mage/Imaclean/etc/config.xml
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_Imaclean>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Mage_Imaclean>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<imaclean>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Mage_Imaclean</module>
|
14 |
+
<frontName>imaclean</frontName>
|
15 |
+
</args>
|
16 |
+
</imaclean>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<imaclean>
|
21 |
+
<file>imaclean.xml</file>
|
22 |
+
</imaclean>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<imaclean>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Mage_Imaclean</module>
|
32 |
+
<frontName>imaclean</frontName>
|
33 |
+
</args>
|
34 |
+
</imaclean>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<menu>
|
39 |
+
<imaclean module="imaclean">
|
40 |
+
<title>Imaclean</title>
|
41 |
+
<sort_order>71</sort_order>
|
42 |
+
<children>
|
43 |
+
<items module="imaclean">
|
44 |
+
<title>Manage Items</title>
|
45 |
+
<sort_order>0</sort_order>
|
46 |
+
<action>imaclean/adminhtml_imaclean</action>
|
47 |
+
</items>
|
48 |
+
</children>
|
49 |
+
</imaclean>
|
50 |
+
</menu>
|
51 |
+
<acl>
|
52 |
+
<resources>
|
53 |
+
<all>
|
54 |
+
<title>Allow Everything</title>
|
55 |
+
</all>
|
56 |
+
<admin>
|
57 |
+
<children>
|
58 |
+
<Mage_Imaclean>
|
59 |
+
<title>Imaclean Module</title>
|
60 |
+
<sort_order>10</sort_order>
|
61 |
+
</Mage_Imaclean>
|
62 |
+
</children>
|
63 |
+
</admin>
|
64 |
+
</resources>
|
65 |
+
</acl>
|
66 |
+
<layout>
|
67 |
+
<updates>
|
68 |
+
<imaclean>
|
69 |
+
<file>imaclean.xml</file>
|
70 |
+
</imaclean>
|
71 |
+
</updates>
|
72 |
+
</layout>
|
73 |
+
</adminhtml>
|
74 |
+
<global>
|
75 |
+
<models>
|
76 |
+
<imaclean>
|
77 |
+
<class>Mage_Imaclean_Model</class>
|
78 |
+
<resourceModel>imaclean_mysql4</resourceModel>
|
79 |
+
</imaclean>
|
80 |
+
<imaclean_mysql4>
|
81 |
+
<class>Mage_Imaclean_Model_Mysql4</class>
|
82 |
+
<entities>
|
83 |
+
<imaclean>
|
84 |
+
<table>imaclean</table>
|
85 |
+
</imaclean>
|
86 |
+
</entities>
|
87 |
+
</imaclean_mysql4>
|
88 |
+
</models>
|
89 |
+
<resources>
|
90 |
+
<imaclean_setup>
|
91 |
+
<setup>
|
92 |
+
<module>Mage_Imaclean</module>
|
93 |
+
</setup>
|
94 |
+
<connection>
|
95 |
+
<use>core_setup</use>
|
96 |
+
</connection>
|
97 |
+
</imaclean_setup>
|
98 |
+
<imaclean_write>
|
99 |
+
<connection>
|
100 |
+
<use>core_write</use>
|
101 |
+
</connection>
|
102 |
+
</imaclean_write>
|
103 |
+
<imaclean_read>
|
104 |
+
<connection>
|
105 |
+
<use>core_read</use>
|
106 |
+
</connection>
|
107 |
+
</imaclean_read>
|
108 |
+
</resources>
|
109 |
+
<blocks>
|
110 |
+
<imaclean>
|
111 |
+
<class>Mage_Imaclean_Block</class>
|
112 |
+
</imaclean>
|
113 |
+
</blocks>
|
114 |
+
<helpers>
|
115 |
+
<imaclean>
|
116 |
+
<class>Mage_Imaclean_Helper</class>
|
117 |
+
</imaclean>
|
118 |
+
</helpers>
|
119 |
+
</global>
|
120 |
+
</config>
|
app/code/local/Mage/Imaclean/sql/imaclean_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
DROP TABLE IF EXISTS {$this->getTable('imaclean')};
|
10 |
+
CREATE TABLE {$this->getTable('imaclean')} (
|
11 |
+
`imaclean_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
+
`filename` varchar(255) NOT NULL default '',
|
13 |
+
PRIMARY KEY (`imaclean_id`),
|
14 |
+
UNIQUE KEY `filename` (`filename`)
|
15 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
16 |
+
");
|
17 |
+
|
18 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/imaclean.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<imaclean_adminhtml_imaclean_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="imaclean/adminhtml_imaclean" name="imaclean" />
|
6 |
+
</reference>
|
7 |
+
</imaclean_adminhtml_imaclean_index>
|
8 |
+
</layout>
|
app/etc/modules/Mage_Imaclean.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_Imaclean>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Mage_Imaclean>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mage_Imaclean</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>beta</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This extension allows to list all the product images that already are not in use and to erase them.</summary>
|
10 |
+
<description>This extension lists all the product images that they find in the directory "media/catalog/product" and that they do not find in the database. It allows to select and to erase these files.</description>
|
11 |
+
<notes>No notes</notes>
|
12 |
+
<authors><author><name>defcon2</name><user>auto-converted</user><email>manuel@e-fluxus.com</email></author></authors>
|
13 |
+
<date>2009-04-13</date>
|
14 |
+
<time>11:02:11</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="imaclean.xml" hash="103023a683f6b6fb9b6c74a2489ca9f2"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="Mage"><dir name="Imaclean"><dir name="Block"><dir name="Adminhtml"><dir name="Imaclean"><file name="Grid.php" hash="393ef4f285fba3c75ebe4aa21a016c7e"/></dir><dir name="Renderer"><file name="Image.php" hash="ce6e171f069a87b17aa80b7318735359"/></dir><file name="Imaclean.php" hash="af231f45275404f280a30342138c863e"/></dir><file name="Imaclean.php" hash="b61726220887251370ee2f533bd48c5f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ImacleanController.php" hash="6db44227e283dcc0da4272660f62c225"/></dir><file name="IndexController.php" hash="9bb2fed7a6e11c20c82c7f60dbbd8d5c"/></dir><dir name="etc"><file name="config.xml" hash="e83915ed50fa9399d55c4716d1fb002e"/></dir><dir name="Helper"><file name="Data.php" hash="88e034c6fec139bbf03baace7c10ab22"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Imaclean"><file name="Collection.php" hash="600d097a0f7f83119981578523bf4305"/></dir><file name="Imaclean.php" hash="56794405f0401b20eac6a2d3c0f5c09d"/></dir><file name="Imaclean.php" hash="c729e132945284856ae53d230f006e37"/><file name="Status.php" hash="e6bc2c02406bba86b31515f6deb82c10"/></dir><dir name="sql"><dir name="imaclean_setup"><file name="mysql4-install-0.1.0.php" hash="65a1e75360822cd133a3e704f8499e0b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_Imaclean.xml" hash="5fc26361ae583682d091b0bc947f161d"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|