Skip to content

Commit 75915c7

Browse files
committed
Merge branch 'dimajanzen-develop' into develop
2 parents c8cb8be + 7f73b1f commit 75915c7

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

  • src/app/code/community/FireGento/AdminMonitoring
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* This file is part of a FireGento e.V. module.
4+
*
5+
* This FireGento e.V. module is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License version 3 as
7+
* published by the Free Software Foundation.
8+
*
9+
* This script is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12+
*
13+
* PHP version 5
14+
*
15+
* @category FireGento
16+
* @package FireGento_AdminMonitoring
17+
* @author FireGento Team <team@firegento.com>
18+
* @copyright 2014 FireGento Team (http://www.firegento.com)
19+
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
20+
*/
21+
/**
22+
* Observes Category Move
23+
*
24+
* @category FireGento
25+
* @package FireGento_AdminMonitoring
26+
* @author FireGento Team <team@firegento.com>
27+
*/
28+
class FireGento_AdminMonitoring_Model_Observer_Category_Move
29+
extends FireGento_AdminMonitoring_Model_Observer_Log
30+
{
31+
32+
/**
33+
* Observe the category move
34+
*
35+
* @param Varien_Event_Observer $observer Observer Instance
36+
* @return void
37+
*/
38+
public function catalogCategoryMove(Varien_Event_Observer $observer)
39+
{
40+
$category = $observer->getCategory();
41+
42+
$dataModel = Mage::getModel('firegento_adminmonitoring/history_data', $category);
43+
$diffModel = Mage::getModel('firegento_adminmonitoring/history_diff', $dataModel);
44+
45+
$eventData = array(
46+
'object_id' => $dataModel->getObjectId(),
47+
'object_type' => $dataModel->getObjectType(),
48+
'content' => $dataModel->getSerializedContent(),
49+
'content_diff' => $diffModel->getSerializedDiff(),
50+
'action' => FireGento_AdminMonitoring_Helper_Data::ACTION_UPDATE,
51+
);
52+
53+
Mage::dispatchEvent('firegento_adminmonitoring_log', $eventData);
54+
}
55+
}

src/app/code/community/FireGento/AdminMonitoring/etc/config.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@
9191
</firegento_adminmonitoring>
9292
</observers>
9393
</model_delete_after>
94+
<category_move>
95+
<observers>
96+
<firegento_adminmonitoring>
97+
<class>firegento_adminmonitoring/observer_category_move</class>
98+
<method>catalogCategoryMove</method>
99+
</firegento_adminmonitoring>
100+
</observers>
101+
</category_move>
94102
<catalog_product_attribute_update_before>
95103
<observers>
96104
<firegento_adminmonitoring>

0 commit comments

Comments
 (0)