MagestoreFbcomment - Version 0.1.0

Version Notes

Fbcomment

Download this release

Release Info

Developer Magestore
Extension MagestoreFbcomment
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (29) hide show
  1. app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment.php +12 -0
  2. app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit.php +45 -0
  3. app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit/Form.php +19 -0
  4. app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit/Tab/Form.php +58 -0
  5. app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit/Tabs.php +24 -0
  6. app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Grid.php +116 -0
  7. app/code/local/Magestore/Fbcomment/Block/Fbcomment.php +53 -0
  8. app/code/local/Magestore/Fbcomment/Helper/Data.php +28 -0
  9. app/code/local/Magestore/Fbcomment/Model/Fbcomment.php +10 -0
  10. app/code/local/Magestore/Fbcomment/Model/Mysql4/Fbcomment.php +10 -0
  11. app/code/local/Magestore/Fbcomment/Model/Mysql4/Fbcomment/Collection.php +10 -0
  12. app/code/local/Magestore/Fbcomment/Model/Observer.php +26 -0
  13. app/code/local/Magestore/Fbcomment/Model/Status.php +15 -0
  14. app/code/local/Magestore/Fbcomment/Model/System/Config/Language.php +118 -0
  15. app/code/local/Magestore/Fbcomment/controllers/Adminhtml/FbcommentController.php +214 -0
  16. app/code/local/Magestore/Fbcomment/controllers/IndexController.php +27 -0
  17. app/code/local/Magestore/Fbcomment/etc/adminhtml.xml +26 -0
  18. app/code/local/Magestore/Fbcomment/etc/config.xml +278 -0
  19. app/code/local/Magestore/Fbcomment/etc/system.xml +181 -0
  20. app/code/local/Magestore/Fbcomment/sql/fbcomment_setup/mysql4-install-0.1.0.php +18 -0
  21. app/design/adminhtml/default/default/layout/fbcomment.xml +8 -0
  22. app/design/frontend/default/default/layout/fbcomment.xml +13 -0
  23. app/design/frontend/default/default/template/fbcomment/fbcomment.phtml +17 -0
  24. app/etc/modules/Magestore_Fbcomment.xml +9 -0
  25. js/tinybox/tinybox.js +126 -0
  26. package.xml +18 -0
  27. skin/adminhtml/default/default/css/tinybox/images/preload.gif +0 -0
  28. skin/adminhtml/default/default/css/tinybox/images/rhino.jpg +0 -0
  29. skin/adminhtml/default/default/css/tinybox/style.css +8 -0
app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Magestore_Fbcomment_Block_Adminhtml_Fbcomment extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_fbcomment';
7
+ $this->_blockGroup = 'fbcomment';
8
+ $this->_headerText = Mage::helper('fbcomment')->__('Item Manager');
9
+ $this->_addButtonLabel = Mage::helper('fbcomment')->__('Add Item');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Block_Adminhtml_Fbcomment_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'fbcomment';
11
+ $this->_controller = 'adminhtml_fbcomment';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('fbcomment')->__('Save Item'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('fbcomment')->__('Delete Item'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+
22
+ $this->_formScripts[] = "
23
+ function toggleEditor() {
24
+ if (tinyMCE.getInstanceById('fbcomment_content') == null) {
25
+ tinyMCE.execCommand('mceAddControl', false, 'fbcomment_content');
26
+ } else {
27
+ tinyMCE.execCommand('mceRemoveControl', false, 'fbcomment_content');
28
+ }
29
+ }
30
+
31
+ function saveAndContinueEdit(){
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ ";
35
+ }
36
+
37
+ public function getHeaderText()
38
+ {
39
+ if( Mage::registry('fbcomment_data') && Mage::registry('fbcomment_data')->getId() ) {
40
+ return Mage::helper('fbcomment')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('fbcomment_data')->getTitle()));
41
+ } else {
42
+ return Mage::helper('fbcomment')->__('Add Item');
43
+ }
44
+ }
45
+ }
app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Block_Adminhtml_Fbcomment_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit/Tab/Form.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Block_Adminhtml_Fbcomment_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset('fbcomment_form', array('legend'=>Mage::helper('fbcomment')->__('Item information')));
10
+
11
+ $fieldset->addField('title', 'text', array(
12
+ 'label' => Mage::helper('fbcomment')->__('Title'),
13
+ 'class' => 'required-entry',
14
+ 'required' => true,
15
+ 'name' => 'title',
16
+ ));
17
+
18
+ $fieldset->addField('filename', 'file', array(
19
+ 'label' => Mage::helper('fbcomment')->__('File'),
20
+ 'required' => false,
21
+ 'name' => 'filename',
22
+ ));
23
+
24
+ $fieldset->addField('status', 'select', array(
25
+ 'label' => Mage::helper('fbcomment')->__('Status'),
26
+ 'name' => 'status',
27
+ 'values' => array(
28
+ array(
29
+ 'value' => 1,
30
+ 'label' => Mage::helper('fbcomment')->__('Enabled'),
31
+ ),
32
+
33
+ array(
34
+ 'value' => 2,
35
+ 'label' => Mage::helper('fbcomment')->__('Disabled'),
36
+ ),
37
+ ),
38
+ ));
39
+
40
+ $fieldset->addField('content', 'editor', array(
41
+ 'name' => 'content',
42
+ 'label' => Mage::helper('fbcomment')->__('Content'),
43
+ 'title' => Mage::helper('fbcomment')->__('Content'),
44
+ 'style' => 'width:700px; height:500px;',
45
+ 'wysiwyg' => false,
46
+ 'required' => true,
47
+ ));
48
+
49
+ if ( Mage::getSingleton('adminhtml/session')->getFbcommentData() )
50
+ {
51
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getFbcommentData());
52
+ Mage::getSingleton('adminhtml/session')->setFbcommentData(null);
53
+ } elseif ( Mage::registry('fbcomment_data') ) {
54
+ $form->setValues(Mage::registry('fbcomment_data')->getData());
55
+ }
56
+ return parent::_prepareForm();
57
+ }
58
+ }
app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Block_Adminhtml_Fbcomment_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('fbcomment_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('fbcomment')->__('Item Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('fbcomment')->__('Item Information'),
18
+ 'title' => Mage::helper('fbcomment')->__('Item Information'),
19
+ 'content' => $this->getLayout()->createBlock('fbcomment/adminhtml_fbcomment_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/local/Magestore/Fbcomment/Block/Adminhtml/Fbcomment/Grid.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Block_Adminhtml_Fbcomment_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('fbcommentGrid');
9
+ $this->setDefaultSort('fbcomment_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('fbcomment/fbcomment')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('fbcomment_id', array(
24
+ 'header' => Mage::helper('fbcomment')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'fbcomment_id',
28
+ ));
29
+
30
+ $this->addColumn('title', array(
31
+ 'header' => Mage::helper('fbcomment')->__('Title'),
32
+ 'align' =>'left',
33
+ 'index' => 'title',
34
+ ));
35
+
36
+ /*
37
+ $this->addColumn('content', array(
38
+ 'header' => Mage::helper('fbcomment')->__('Item Content'),
39
+ 'width' => '150px',
40
+ 'index' => 'content',
41
+ ));
42
+ */
43
+
44
+ $this->addColumn('status', array(
45
+ 'header' => Mage::helper('fbcomment')->__('Status'),
46
+ 'align' => 'left',
47
+ 'width' => '80px',
48
+ 'index' => 'status',
49
+ 'type' => 'options',
50
+ 'options' => array(
51
+ 1 => 'Enabled',
52
+ 2 => 'Disabled',
53
+ ),
54
+ ));
55
+
56
+ $this->addColumn('action',
57
+ array(
58
+ 'header' => Mage::helper('fbcomment')->__('Action'),
59
+ 'width' => '100',
60
+ 'type' => 'action',
61
+ 'getter' => 'getId',
62
+ 'actions' => array(
63
+ array(
64
+ 'caption' => Mage::helper('fbcomment')->__('Edit'),
65
+ 'url' => array('base'=> '*/*/edit'),
66
+ 'field' => 'id'
67
+ )
68
+ ),
69
+ 'filter' => false,
70
+ 'sortable' => false,
71
+ 'index' => 'stores',
72
+ 'is_system' => true,
73
+ ));
74
+
75
+ $this->addExportType('*/*/exportCsv', Mage::helper('fbcomment')->__('CSV'));
76
+ $this->addExportType('*/*/exportXml', Mage::helper('fbcomment')->__('XML'));
77
+
78
+ return parent::_prepareColumns();
79
+ }
80
+
81
+ protected function _prepareMassaction()
82
+ {
83
+ $this->setMassactionIdField('fbcomment_id');
84
+ $this->getMassactionBlock()->setFormFieldName('fbcomment');
85
+
86
+ $this->getMassactionBlock()->addItem('delete', array(
87
+ 'label' => Mage::helper('fbcomment')->__('Delete'),
88
+ 'url' => $this->getUrl('*/*/massDelete'),
89
+ 'confirm' => Mage::helper('fbcomment')->__('Are you sure?')
90
+ ));
91
+
92
+ $statuses = Mage::getSingleton('fbcomment/status')->getOptionArray();
93
+
94
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
95
+ $this->getMassactionBlock()->addItem('status', array(
96
+ 'label'=> Mage::helper('fbcomment')->__('Change status'),
97
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
+ 'additional' => array(
99
+ 'visibility' => array(
100
+ 'name' => 'status',
101
+ 'type' => 'select',
102
+ 'class' => 'required-entry',
103
+ 'label' => Mage::helper('fbcomment')->__('Status'),
104
+ 'values' => $statuses
105
+ )
106
+ )
107
+ ));
108
+ return $this;
109
+ }
110
+
111
+ public function getRowUrl($row)
112
+ {
113
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
+ }
115
+
116
+ }
app/code/local/Magestore/Fbcomment/Block/Fbcomment.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Block_Fbcomment extends Mage_Core_Block_Template
4
+ {
5
+ public function _prepareLayout()
6
+ {
7
+ return parent::_prepareLayout();
8
+ }
9
+
10
+ public function getUniqueId(){
11
+ return Mage::getStoreConfig('fbcomment/general/unique_id_of_site');
12
+ }
13
+
14
+ public function numberOfCommment(){
15
+ return Mage::getStoreConfig('fbcomment/general/show_number_of_comment');
16
+ }
17
+
18
+ public function widthOfCommmentBox(){
19
+ return Mage::getStoreConfig('fbcomment/general/width_of_comment_box');
20
+ }
21
+
22
+ public function publicFeed(){
23
+ return Mage::getStoreConfig('fbcomment/general/publish_feed');
24
+ }
25
+
26
+ public function getXid(){
27
+ $productId = $this->getRequest()->getParam('id');
28
+ return Mage::getModel('catalog/product')->load($productId)->getId();
29
+ }
30
+
31
+ public function getLanguage(){
32
+ return Mage::getStoreConfig('fbcomment/general/language');
33
+ }
34
+
35
+ public function isRoundedBox(){
36
+ return Mage::getStoreConfig('fbcomment/general/rounded_box');
37
+ }
38
+
39
+ public function isReserveOrdering(){
40
+ return Mage::getStoreConfig('fbcomment/general/reverse_ordering');
41
+ }
42
+
43
+ public function getCssUrl(){
44
+ $fbcomment = Mage::getModel('fbcomment/fbcomment')->getCollection()
45
+ ->setOrder('fbcomment_id', 'DESC')
46
+ ->getFirstItem();
47
+ return $this->getUrl('fbcomment/index/getCss'). '?' . $fbcomment->getId();
48
+ }
49
+
50
+ public function getTemplate(){
51
+ return parent::getTemplate();
52
+ }
53
+ }
app/code/local/Magestore/Fbcomment/Helper/Data.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function isHiddenLike(){
6
+ return Mage::getStoreConfig('fbcomment/general/hidden_like');
7
+ }
8
+
9
+ public function isHiddenComment(){
10
+ return Mage::getStoreConfig('fbcomment/general/hidden_comment');
11
+ }
12
+
13
+ public function isCustomLike(){
14
+ return Mage::getStoreConfig('fbcomment/like/custom');
15
+ }
16
+
17
+ public function isCustomComment(){
18
+ return Mage::getStoreConfig('fbcomment/comment/custom');
19
+ }
20
+
21
+ public function getLikeCssStyle(){
22
+ return Mage::getStoreConfig('fbcomment/like/css_style');
23
+ }
24
+
25
+ public function getCommentCssStyle(){
26
+ return Mage::getStoreConfig('fbcomment/comment/css_style');
27
+ }
28
+ }
app/code/local/Magestore/Fbcomment/Model/Fbcomment.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Model_Fbcomment extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('fbcomment/fbcomment');
9
+ }
10
+ }
app/code/local/Magestore/Fbcomment/Model/Mysql4/Fbcomment.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Model_Mysql4_Fbcomment extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the fbcomment_id refers to the key field in your database table.
8
+ $this->_init('fbcomment/fbcomment', 'fbcomment_id');
9
+ }
10
+ }
app/code/local/Magestore/Fbcomment/Model/Mysql4/Fbcomment/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Model_Mysql4_Fbcomment_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('fbcomment/fbcomment');
9
+ }
10
+ }
app/code/local/Magestore/Fbcomment/Model/Observer.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Model_Observer {
4
+
5
+ public function saveFbcommentConfig($observer)
6
+ {
7
+ $fbcomment = Mage::getModel('fbcomment/fbcomment');
8
+ $fbcomment->setEditTime(now());
9
+ try{
10
+ $fbcomment->save();
11
+ }catch(Exception $e){
12
+ Mage::getSingleton('core/session')->addError($e);
13
+ }
14
+ }
15
+
16
+ public function controller_action_predispatch_adminhtml($observer)
17
+ {
18
+ $controller = $observer->getControllerAction();
19
+ if($controller->getRequest()->getControllerName() != 'system_config'
20
+ || $controller->getRequest()->getActionName() != 'edit')
21
+ return;
22
+ $section = $controller->getRequest()->getParam('section');
23
+ if($section != 'fbcomment')
24
+ return;
25
+ }
26
+ }
app/code/local/Magestore/Fbcomment/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_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('fbcomment')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('fbcomment')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/local/Magestore/Fbcomment/Model/System/Config/Language.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Model_System_Config_Language
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array(
8
+ array('value'=>'ca_ES','label'=> Mage::helper('fbcomment')->__('Catalan')),
9
+ array('value'=>'cs_CZ','label'=> Mage::helper('fbcomment')->__('Czech')),
10
+ array('value'=>'cy_GB','label'=> Mage::helper('fbcomment')->__('Welsh')),
11
+ array('value'=>'da_DK','label'=> Mage::helper('fbcomment')->__('Danish')),
12
+ array('value'=>'de_DE','label'=> Mage::helper('fbcomment')->__('German')),
13
+ array('value'=>'eu_ES','label'=> Mage::helper('fbcomment')->__('Basque')),
14
+ array('value'=>'en_PI','label'=> Mage::helper('fbcomment')->__('English (Pirate)')),
15
+ array('value'=>'en_UD','label'=> Mage::helper('fbcomment')->__('English (Upside Down)')),
16
+ array('value'=>'ck_US','label'=> Mage::helper('fbcomment')->__('Cherokee')),
17
+ array('value'=>'en_US','label'=> Mage::helper('fbcomment')->__('English (US)')),
18
+ array('value'=>'es_LA','label'=> Mage::helper('fbcomment')->__('Spanish')),
19
+ array('value'=>'es_CL','label'=> Mage::helper('fbcomment')->__('Spanish (Chile)')),
20
+ array('value'=>'es_CO','label'=> Mage::helper('fbcomment')->__('Spanish (Colombia)')),
21
+ array('value'=>'es_ES','label'=> Mage::helper('fbcomment')->__('Spanish (Spain)')),
22
+ array('value'=>'es_MX','label'=> Mage::helper('fbcomment')->__('Spanish (Mexico)')),
23
+ array('value'=>'es_VE','label'=> Mage::helper('fbcomment')->__('Spanish (Venezuela)')),
24
+ array('value'=>'fb_FI','label'=> Mage::helper('fbcomment')->__('Finnish (test)')),
25
+ array('value'=>'fi_FI','label'=> Mage::helper('fbcomment')->__('Finnish')),
26
+ array('value'=>'fr_FR','label'=> Mage::helper('fbcomment')->__('French (France)')),
27
+ array('value'=>'gl_ES','label'=> Mage::helper('fbcomment')->__('Galician')),
28
+ array('value'=>'hu_HU','label'=> Mage::helper('fbcomment')->__('Hungarian')),
29
+ array('value'=>'it_IT','label'=> Mage::helper('fbcomment')->__('Italian')),
30
+ array('value'=>'ja_JP','label'=> Mage::helper('fbcomment')->__('Japanese')),
31
+ array('value'=>'ko_KR','label'=> Mage::helper('fbcomment')->__('Korean')),
32
+ array('value'=>'nb_NO','label'=> Mage::helper('fbcomment')->__('Norwegian (bokmal)')),
33
+ array('value'=>'nn_NO','label'=> Mage::helper('fbcomment')->__('Norwegian (nynorsk)')),
34
+ array('value'=>'nl_NL','label'=> Mage::helper('fbcomment')->__('Dutch')),
35
+ array('value'=>'pl_PL','label'=> Mage::helper('fbcomment')->__('Polish')),
36
+ array('value'=>'pt_BR','label'=> Mage::helper('fbcomment')->__('Portuguese (Brazil)')),
37
+ array('value'=>'pt_PT','label'=> Mage::helper('fbcomment')->__('Portuguese (Portugal)')),
38
+ array('value'=>'ro_RO','label'=> Mage::helper('fbcomment')->__('Romanian')),
39
+ array('value'=>'ru_RU','label'=> Mage::helper('fbcomment')->__('Russian')),
40
+ array('value'=>'sk_SK','label'=> Mage::helper('fbcomment')->__('Slovak')),
41
+ array('value'=>'sl_SI','label'=> Mage::helper('fbcomment')->__('Slovenian')),
42
+ array('value'=>'sv_SE','label'=> Mage::helper('fbcomment')->__('Swedish')),
43
+ array('value'=>'th_TH','label'=> Mage::helper('fbcomment')->__('Thai')),
44
+ array('value'=>'ku_TR','label'=> Mage::helper('fbcomment')->__('Kurdish')),
45
+ array('value'=>'zh_CN','label'=> Mage::helper('fbcomment')->__('Simplified Chinese (China)')),
46
+ array('value'=>'zh_HK','label'=> Mage::helper('fbcomment')->__('Traditional Chinese (Hong Kong)')),
47
+ array('value'=>'zh_TW','label'=> Mage::helper('fbcomment')->__('Traditional Chinese (Taiwan)')),
48
+ array('value'=>'fb_LT','label'=> Mage::helper('fbcomment')->__('Leet Speak')),
49
+ array('value'=>'af_ZA','label'=> Mage::helper('fbcomment')->__('Afrikaans')),
50
+ array('value'=>'sq_AL','label'=> Mage::helper('fbcomment')->__('Albanian')),
51
+ array('value'=>'hy_AM','label'=> Mage::helper('fbcomment')->__('Armenian')),
52
+ array('value'=>'az_AZ','label'=> Mage::helper('fbcomment')->__('Azeri')),
53
+ array('value'=>'be_BY','label'=> Mage::helper('fbcomment')->__('Belarusian')),
54
+ array('value'=>'bn_IN','label'=> Mage::helper('fbcomment')->__('Bengali')),
55
+ array('value'=>'bs_BA','label'=> Mage::helper('fbcomment')->__('Bosnian')),
56
+ array('value'=>'bg_BG','label'=> Mage::helper('fbcomment')->__('Bulgarian')),
57
+ array('value'=>'hr_HR','label'=> Mage::helper('fbcomment')->__('Croatian')),
58
+ array('value'=>'nl_BE','label'=> Mage::helper('fbcomment')->__('Dutch (Belgie)')),
59
+ array('value'=>'en_GB','label'=> Mage::helper('fbcomment')->__('English (UK)')),
60
+ array('value'=>'eo_EO','label'=> Mage::helper('fbcomment')->__('Esperanto')),
61
+ array('value'=>'et_EE','label'=> Mage::helper('fbcomment')->__('Estonian')),
62
+ array('value'=>'fo_FO','label'=> Mage::helper('fbcomment')->__('Faroese')),
63
+ array('value'=>'fr_CA','label'=> Mage::helper('fbcomment')->__('French (Canada)')),
64
+ array('value'=>'ka_GE','label'=> Mage::helper('fbcomment')->__('Georgian')),
65
+ array('value'=>'el_GR','label'=> Mage::helper('fbcomment')->__('Greek')),
66
+ array('value'=>'gu_IN','label'=> Mage::helper('fbcomment')->__('Gujarati')),
67
+ array('value'=>'hi_IN','label'=> Mage::helper('fbcomment')->__('Hindi')),
68
+ array('value'=>'is_IS','label'=> Mage::helper('fbcomment')->__('Icelandic')),
69
+ array('value'=>'id_ID','label'=> Mage::helper('fbcomment')->__('Indonesian')),
70
+ array('value'=>'ga_IE','label'=> Mage::helper('fbcomment')->__('Irish')),
71
+ array('value'=>'jv_ID','label'=> Mage::helper('fbcomment')->__('Javanese')),
72
+ array('value'=>'kn_IN','label'=> Mage::helper('fbcomment')->__('Kannada')),
73
+ array('value'=>'kk_KZ','label'=> Mage::helper('fbcomment')->__('Kazakh')),
74
+ array('value'=>'la_VA','label'=> Mage::helper('fbcomment')->__('Latin')),
75
+ array('value'=>'lv_LV','label'=> Mage::helper('fbcomment')->__('Latvian')),
76
+ array('value'=>'li_NL','label'=> Mage::helper('fbcomment')->__('Limburgish')),
77
+ array('value'=>'lt_LT','label'=> Mage::helper('fbcomment')->__('Lithuanian')),
78
+ array('value'=>'mk_MK','label'=> Mage::helper('fbcomment')->__('Macedonian')),
79
+ array('value'=>'mg_MG','label'=> Mage::helper('fbcomment')->__('Malagasy')),
80
+ array('value'=>'ms_MY','label'=> Mage::helper('fbcomment')->__('Malay')),
81
+ array('value'=>'mt_MT','label'=> Mage::helper('fbcomment')->__('Maltese')),
82
+ array('value'=>'mr_IN','label'=> Mage::helper('fbcomment')->__('Marathi')),
83
+ array('value'=>'mn_MN','label'=> Mage::helper('fbcomment')->__('Mongolian')),
84
+ array('value'=>'ne_NP','label'=> Mage::helper('fbcomment')->__('Nepali')),
85
+ array('value'=>'pa_IN','label'=> Mage::helper('fbcomment')->__('Punjabi')),
86
+ array('value'=>'rm_CH','label'=> Mage::helper('fbcomment')->__('Romansh')),
87
+ array('value'=>'sa_IN','label'=> Mage::helper('fbcomment')->__('Sanskrit')),
88
+ array('value'=>'sr_RS','label'=> Mage::helper('fbcomment')->__('Serbian')),
89
+ array('value'=>'so_SO','label'=> Mage::helper('fbcomment')->__('Somali')),
90
+ array('value'=>'sw_KE','label'=> Mage::helper('fbcomment')->__('Swahili')),
91
+ array('value'=>'tl_PH','label'=> Mage::helper('fbcomment')->__('Filipino')),
92
+ array('value'=>'ta_IN','label'=> Mage::helper('fbcomment')->__('Tamil')),
93
+ array('value'=>'tt_RU','label'=> Mage::helper('fbcomment')->__('Tatar')),
94
+ array('value'=>'te_IN','label'=> Mage::helper('fbcomment')->__('Telugu')),
95
+ array('value'=>'ml_IN','label'=> Mage::helper('fbcomment')->__('Malayalam')),
96
+ array('value'=>'uk_UA','label'=> Mage::helper('fbcomment')->__('Ukrainian')),
97
+ array('value'=>'uz_UZ','label'=> Mage::helper('fbcomment')->__('Uzbek')),
98
+ array('value'=>'vi_VN','label'=> Mage::helper('fbcomment')->__('Vietnamese')),
99
+ array('value'=>'xh_ZA','label'=> Mage::helper('fbcomment')->__('Xhosa')),
100
+ array('value'=>'zu_ZA','label'=> Mage::helper('fbcomment')->__('Zulu')),
101
+ array('value'=>'km_KH','label'=> Mage::helper('fbcomment')->__('Khmer')),
102
+ array('value'=>'tg_TJ','label'=> Mage::helper('fbcomment')->__('Tajik')),
103
+ array('value'=>'ar_AR','label'=> Mage::helper('fbcomment')->__('Arabic')),
104
+ array('value'=>'he_IL','label'=> Mage::helper('fbcomment')->__('Hebrew')),
105
+ array('value'=>'ur_PK','label'=> Mage::helper('fbcomment')->__('Urdu')),
106
+ array('value'=>'fa_IR','label'=> Mage::helper('fbcomment')->__('Persian')),
107
+ array('value'=>'sy_SY','label'=> Mage::helper('fbcomment')->__('Syriac')),
108
+ array('value'=>'yi_DE','label'=> Mage::helper('fbcomment')->__('Yiddish')),
109
+ array('value'=>'gn_PY','label'=> Mage::helper('fbcomment')->__('Guarani')),
110
+ array('value'=>'qu_PE','label'=> Mage::helper('fbcomment')->__('Quechua')),
111
+ array('value'=>'ay_BO','label'=> Mage::helper('fbcomment')->__('Aymara')),
112
+ array('value'=>'se_NO','label'=> Mage::helper('fbcomment')->__('Northern Sami')),
113
+ array('value'=>'ps_AF','label'=> Mage::helper('fbcomment')->__('Pashto')),
114
+ array('value'=>'tl_ST','label'=> Mage::helper('fbcomment')->__('Klingon')),
115
+ );
116
+ return $options;
117
+ }
118
+ }
app/code/local/Magestore/Fbcomment/controllers/Adminhtml/FbcommentController.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Fbcomment_Adminhtml_FbcommentController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('fbcomment/items')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_initAction()
16
+ ->renderLayout();
17
+ }
18
+
19
+ public function editAction() {
20
+ $id = $this->getRequest()->getParam('id');
21
+ $model = Mage::getModel('fbcomment/fbcomment')->load($id);
22
+
23
+ if ($model->getId() || $id == 0) {
24
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
25
+ if (!empty($data)) {
26
+ $model->setData($data);
27
+ }
28
+
29
+ Mage::register('fbcomment_data', $model);
30
+
31
+ $this->loadLayout();
32
+ $this->_setActiveMenu('fbcomment/items');
33
+
34
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
35
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
36
+
37
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
38
+
39
+ $this->_addContent($this->getLayout()->createBlock('fbcomment/adminhtml_fbcomment_edit'))
40
+ ->_addLeft($this->getLayout()->createBlock('fbcomment/adminhtml_fbcomment_edit_tabs'));
41
+
42
+ $this->renderLayout();
43
+ } else {
44
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('fbcomment')->__('Item does not exist'));
45
+ $this->_redirect('*/*/');
46
+ }
47
+ }
48
+
49
+ public function newAction() {
50
+ $this->_forward('edit');
51
+ }
52
+
53
+ public function saveAction() {
54
+ if ($data = $this->getRequest()->getPost()) {
55
+
56
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
57
+ try {
58
+ /* Starting upload */
59
+ $uploader = new Varien_File_Uploader('filename');
60
+
61
+ // Any extention would work
62
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
63
+ $uploader->setAllowRenameFiles(false);
64
+
65
+ // Set the file upload mode
66
+ // false -> get the file directly in the specified folder
67
+ // true -> get the file in the product like folders
68
+ // (file.jpg will go in something like /media/f/i/file.jpg)
69
+ $uploader->setFilesDispersion(false);
70
+
71
+ // We set media as the upload dir
72
+ $path = Mage::getBaseDir('media') . DS ;
73
+ $uploader->save($path, $_FILES['filename']['name'] );
74
+
75
+ } catch (Exception $e) {
76
+
77
+ }
78
+
79
+ //this way the name is saved in DB
80
+ $data['filename'] = $_FILES['filename']['name'];
81
+ }
82
+
83
+
84
+ $model = Mage::getModel('fbcomment/fbcomment');
85
+ $model->setData($data)
86
+ ->setId($this->getRequest()->getParam('id'));
87
+
88
+ try {
89
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
90
+ $model->setCreatedTime(now())
91
+ ->setUpdateTime(now());
92
+ } else {
93
+ $model->setUpdateTime(now());
94
+ }
95
+
96
+ $model->save();
97
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('fbcomment')->__('Item was successfully saved'));
98
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
99
+
100
+ if ($this->getRequest()->getParam('back')) {
101
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
102
+ return;
103
+ }
104
+ $this->_redirect('*/*/');
105
+ return;
106
+ } catch (Exception $e) {
107
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
108
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
109
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
110
+ return;
111
+ }
112
+ }
113
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('fbcomment')->__('Unable to find item to save'));
114
+ $this->_redirect('*/*/');
115
+ }
116
+
117
+ public function deleteAction() {
118
+ if( $this->getRequest()->getParam('id') > 0 ) {
119
+ try {
120
+ $model = Mage::getModel('fbcomment/fbcomment');
121
+
122
+ $model->setId($this->getRequest()->getParam('id'))
123
+ ->delete();
124
+
125
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
126
+ $this->_redirect('*/*/');
127
+ } catch (Exception $e) {
128
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
129
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
130
+ }
131
+ }
132
+ $this->_redirect('*/*/');
133
+ }
134
+
135
+ public function massDeleteAction() {
136
+ $fbcommentIds = $this->getRequest()->getParam('fbcomment');
137
+ if(!is_array($fbcommentIds)) {
138
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
+ } else {
140
+ try {
141
+ foreach ($fbcommentIds as $fbcommentId) {
142
+ $fbcomment = Mage::getModel('fbcomment/fbcomment')->load($fbcommentId);
143
+ $fbcomment->delete();
144
+ }
145
+ Mage::getSingleton('adminhtml/session')->addSuccess(
146
+ Mage::helper('adminhtml')->__(
147
+ 'Total of %d record(s) were successfully deleted', count($fbcommentIds)
148
+ )
149
+ );
150
+ } catch (Exception $e) {
151
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
152
+ }
153
+ }
154
+ $this->_redirect('*/*/index');
155
+ }
156
+
157
+ public function massStatusAction()
158
+ {
159
+ $fbcommentIds = $this->getRequest()->getParam('fbcomment');
160
+ if(!is_array($fbcommentIds)) {
161
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
+ } else {
163
+ try {
164
+ foreach ($fbcommentIds as $fbcommentId) {
165
+ $fbcomment = Mage::getSingleton('fbcomment/fbcomment')
166
+ ->load($fbcommentId)
167
+ ->setStatus($this->getRequest()->getParam('status'))
168
+ ->setIsMassupdate(true)
169
+ ->save();
170
+ }
171
+ $this->_getSession()->addSuccess(
172
+ $this->__('Total of %d record(s) were successfully updated', count($fbcommentIds))
173
+ );
174
+ } catch (Exception $e) {
175
+ $this->_getSession()->addError($e->getMessage());
176
+ }
177
+ }
178
+ $this->_redirect('*/*/index');
179
+ }
180
+
181
+ public function exportCsvAction()
182
+ {
183
+ $fileName = 'fbcomment.csv';
184
+ $content = $this->getLayout()->createBlock('fbcomment/adminhtml_fbcomment_grid')
185
+ ->getCsv();
186
+
187
+ $this->_sendUploadResponse($fileName, $content);
188
+ }
189
+
190
+ public function exportXmlAction()
191
+ {
192
+ $fileName = 'fbcomment.xml';
193
+ $content = $this->getLayout()->createBlock('fbcomment/adminhtml_fbcomment_grid')
194
+ ->getXml();
195
+
196
+ $this->_sendUploadResponse($fileName, $content);
197
+ }
198
+
199
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
200
+ {
201
+ $response = $this->getResponse();
202
+ $response->setHeader('HTTP/1.1 200 OK','');
203
+ $response->setHeader('Pragma', 'public', true);
204
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
205
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
206
+ $response->setHeader('Last-Modified', date('r'));
207
+ $response->setHeader('Accept-Ranges', 'bytes');
208
+ $response->setHeader('Content-Length', strlen($content));
209
+ $response->setHeader('Content-type', $contentType);
210
+ $response->setBody($content);
211
+ $response->sendResponse();
212
+ die;
213
+ }
214
+ }
app/code/local/Magestore/Fbcomment/controllers/IndexController.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Magestore_Fbcomment_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+
5
+ public function getCssAction()
6
+ {
7
+ $helper = Mage::helper('fbcomment');
8
+ //echo $helper->isHiddenComment();die();
9
+ if($helper->isHiddenComment())
10
+ $css .= 'div.comment_body, div.comment_body div {display:none;}';
11
+ elseif($helper->isCustomComment())
12
+ $css .= $helper->getCommentCssStyle();
13
+
14
+ if($helper->isHiddenLike())
15
+ $css .= 'div.like, div.like div {display:none;}';
16
+ elseif($helper->isCustomLike())
17
+ $css .= $helper->getLikeCssStyle();
18
+
19
+ echo $css;
20
+ return;
21
+ }
22
+
23
+ public function testAction(){
24
+ echo Mage::getStoreConfig('fbcomment/general/custom_style');
25
+ return;
26
+ }
27
+ }
app/code/local/Magestore/Fbcomment/etc/adminhtml.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <fbcomment translate="title">
15
+ <title>Facebook comment</title>
16
+ <sort_order>50</sort_order>
17
+ </fbcomment>
18
+ </children>
19
+ </config>
20
+ </children>
21
+ </system>
22
+ </children>
23
+ </admin>
24
+ </resources>
25
+ </acl>
26
+ </config>
app/code/local/Magestore/Fbcomment/etc/config.xml ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magestore_Fbcomment>
5
+ <version>0.1.0</version>
6
+ </Magestore_Fbcomment>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <fbcomment>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Magestore_Fbcomment</module>
14
+ <frontName>fbcomment</frontName>
15
+ </args>
16
+ </fbcomment>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <fbcomment>
21
+ <file>fbcomment.xml</file>
22
+ </fbcomment>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <fbcomment>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Magestore_Fbcomment</module>
32
+ <frontName>fbcomment</frontName>
33
+ </args>
34
+ </fbcomment>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <acl>
39
+ <resources>
40
+ <all>
41
+ <title>Allow Everything</title>
42
+ </all>
43
+ <admin>
44
+ <children>
45
+ <system>
46
+ <children>
47
+ <config>
48
+ <children>
49
+ <fbcomment translate="title">
50
+ <title>Facebook comment</title>
51
+ <sort_order>50</sort_order>
52
+ </fbcomment>
53
+ </children>
54
+ </config>
55
+ </children>
56
+ </system>
57
+ </children>
58
+ </admin>
59
+ </resources>
60
+ </acl>
61
+ <layout>
62
+ <updates>
63
+ <fbcomment>
64
+ <file>fbcomment.xml</file>
65
+ </fbcomment>
66
+ </updates>
67
+ </layout>
68
+ <events>
69
+ <controller_action_predispatch_adminhtml>
70
+ <observers>
71
+ <magestore_fbcomment_observer>
72
+ <type>singleton</type>
73
+ <class>fbcomment/observer</class>
74
+ <method>controller_action_predispatch_adminhtml</method>
75
+ </magestore_fbcomment_observer>
76
+ </observers>
77
+ </controller_action_predispatch_adminhtml>
78
+ </events>
79
+ </adminhtml>
80
+ <global>
81
+ <events>
82
+ <admin_system_config_changed_section_fbcomment>
83
+ <observers>
84
+ <magestore_fbcomment_observer>
85
+ <type>singleton</type>
86
+ <class>fbcomment/observer</class>
87
+ <method>saveFbcommentConfig</method>
88
+ </magestore_fbcomment_observer>
89
+ </observers>
90
+ </admin_system_config_changed_section_fbcomment>
91
+ </events>
92
+ <models>
93
+ <fbcomment>
94
+ <class>Magestore_Fbcomment_Model</class>
95
+ <resourceModel>fbcomment_mysql4</resourceModel>
96
+ </fbcomment>
97
+ <fbcomment_mysql4>
98
+ <class>Magestore_Fbcomment_Model_Mysql4</class>
99
+ <entities>
100
+ <fbcomment>
101
+ <table>fbcomment</table>
102
+ </fbcomment>
103
+ </entities>
104
+ </fbcomment_mysql4>
105
+ </models>
106
+ <resources>
107
+ <fbcomment_setup>
108
+ <setup>
109
+ <module>Magestore_Fbcomment</module>
110
+ </setup>
111
+ <connection>
112
+ <use>core_setup</use>
113
+ </connection>
114
+ </fbcomment_setup>
115
+ <fbcomment_write>
116
+ <connection>
117
+ <use>core_write</use>
118
+ </connection>
119
+ </fbcomment_write>
120
+ <fbcomment_read>
121
+ <connection>
122
+ <use>core_read</use>
123
+ </connection>
124
+ </fbcomment_read>
125
+ </resources>
126
+ <blocks>
127
+ <fbcomment>
128
+ <class>Magestore_Fbcomment_Block</class>
129
+ </fbcomment>
130
+ </blocks>
131
+ <helpers>
132
+ <fbcomment>
133
+ <class>Magestore_Fbcomment_Helper</class>
134
+ </fbcomment>
135
+ </helpers>
136
+ </global>
137
+ <default>
138
+ <fbcomment>
139
+ <general>
140
+ <show_number_of_comment>10</show_number_of_comment>
141
+ <width_of_comment_box>642</width_of_comment_box>
142
+ <language>en_US</language>
143
+ <reserve_ordering>0</reserve_ordering>
144
+ <publish_feed>0</publish_feed>
145
+ <hidden_like>1</hidden_like>
146
+ <hidden_comment>0</hidden_comment>
147
+ <rounded_box>0</rounded_box>
148
+ </general>
149
+ <like>
150
+ <custom>0</custom>
151
+ <css_style>div.like {
152
+ margin-bottom:5px;
153
+ }
154
+
155
+ div.like a.connect_widget_like_button{
156
+ ntebackground: #F18200;
157
+ border:1px solid #DE5400;
158
+ display:block;
159
+ font:bold 12px/19px Arial,Helvetica,sans-serif;
160
+ height:19px;
161
+ padding:0 8px;
162
+ text-align:cer;
163
+ white-space:nowrap;
164
+ }
165
+
166
+ div.like a.connect_widget_like_button span.liketext {
167
+ color:#FFFFFF;
168
+ padding:0;
169
+ background:transparent;
170
+ }
171
+
172
+ div.like span.connect_widget_text {
173
+ color:#2F2F2F;
174
+ }
175
+
176
+ div.like span.connect_widget_text a {
177
+ color:#C76200;
178
+ }</css_style>
179
+ </like>
180
+ <comment>
181
+ <custom>1</custom>
182
+ <css_style>div.comment_body {
183
+ background:#F4F3F3;
184
+ border: 1px solid #C4C6C8;
185
+ }
186
+
187
+
188
+ div.comment_body div.composer div.connected {
189
+ color:#2F2F2F;
190
+ }
191
+
192
+ div.comment_body div.composer div.connected span.namelink a {
193
+ color:#C76200;
194
+ }
195
+
196
+ div.comment_body div.post_area div.connected label {
197
+ color:#777777;
198
+ }
199
+
200
+ div.comment_body .uiButtonConfirm {
201
+ background: #F18200;
202
+ border:1px solid #DE5400;
203
+ height:19px;
204
+ padding:0 8px;
205
+ text-align:center;
206
+ white-space:nowrap;
207
+ background: #F18200;
208
+ }
209
+
210
+ .uiButtonConfirm input {
211
+ font:bold 12px/19px Arial,Helvetica,sans-serif;
212
+ }
213
+
214
+ .wallkit_frame .inputsubmit-disabled{
215
+ background-color:transparent;
216
+ border:0;color:#2F2F2F;
217
+ }
218
+
219
+ div.comment_body div.show_connected a.editsettings {
220
+ color:#C76200;
221
+ }
222
+
223
+ div.comment_body div.show_connected div.profile_pic {
224
+ margin-top:18px;
225
+ position:absolute;
226
+ }
227
+ div.comment_body div.show_not_connected div.profile_pic {
228
+ margin-top:6px;
229
+ position:absolute;
230
+ }
231
+
232
+ div.comment_body div.wallkit_form div.loading_page {
233
+ margin-left:19px;
234
+ padding-top:80px;
235
+ position:absolute;
236
+ }
237
+
238
+ div.comment_body div.wallkit_post{
239
+ border-bottom:1px solid #D8DFEA;
240
+ margin:5px;
241
+ padding-bottom:5px;
242
+ }
243
+
244
+ div.comment_body .wallkit_form {
245
+ padding:5px ;
246
+ }
247
+
248
+ div.comment_body div.wallkit_postcontent h4 a {
249
+ color:#C76200;
250
+ }
251
+
252
+ div.comment_body div.wallkit_postcontent h4 span.wall_time {
253
+ color:#777777;
254
+ }
255
+
256
+ div.comment_body div.wallkit_postcontent div {
257
+ color:#2F2F2F;
258
+ }
259
+
260
+ div.comment_body div.wallkit_actionset a {
261
+ color:#1E7EC8!important;
262
+ }
263
+
264
+ div.comment_body div.wallkit_subtitle div.post_counter {
265
+ color:#777777;
266
+ }
267
+
268
+ div.comment_body div.wallkit_subtitle div.pager a {
269
+ color:#1E7EC8;
270
+ }
271
+
272
+ div.comment_body div.wallkit_subtitle div.UIImageBlock{
273
+ display:none;
274
+ } </css_style>
275
+ </comment>
276
+ </fbcomment>
277
+ </default>
278
+ </config>
app/code/local/Magestore/Fbcomment/etc/system.xml ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <magestore translate="label">
5
+ <label>Magestore Extension</label>
6
+ <sort_order>400</sort_order>
7
+ </magestore>
8
+ </tabs>
9
+
10
+ <sections>
11
+ <fbcomment translate="label" module="fbcomment">
12
+ <class>separator-top</class>
13
+ <label>Facebook comment</label>
14
+ <tab>magestore</tab>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>300</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <groups>
21
+ <general translate="label">
22
+ <label>Facebook Comment Configuration</label>
23
+ <frontend_type>text</frontend_type>
24
+ <sort_order>0</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>0</show_in_store>
28
+ <fields>
29
+ <unique_id_of_site translate="label">
30
+ <label>Unique ID of this site</label>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>0</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <comment><![CDATA[<a href="http://developers.facebook.com/setup/" target="_bank">Register</a>]]></comment>
37
+ </unique_id_of_site>
38
+ <language translate="label">
39
+ <label>Language</label>
40
+ <source_model>fbcomment/system_config_language</source_model>
41
+ <frontend_type>select</frontend_type>
42
+ <sort_order>5</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ <comment></comment>
47
+ </language>
48
+ <reverse_ordering translate="label">
49
+ <label>Reverse Ordering</label>
50
+ <source_model>adminhtml/system_config_source_yesno</source_model>
51
+ <frontend_type>select</frontend_type>
52
+ <sort_order>10</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_in_website>1</show_in_website>
55
+ <show_in_store>1</show_in_store>
56
+ <comment></comment>
57
+ </reverse_ordering>
58
+ <show_number_of_comment translate="label">
59
+ <label>Show number of comment</label>
60
+ <frontend_type>text</frontend_type>
61
+ <sort_order>15</sort_order>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>1</show_in_store>
65
+ <comment></comment>
66
+ </show_number_of_comment>
67
+
68
+ <width_of_comment_box translate="label">
69
+ <label>Width of comment box</label>
70
+ <frontend_type>text</frontend_type>
71
+ <sort_order>20</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ <comment>pixel</comment>
76
+ </width_of_comment_box>
77
+ <publish_feed translate="label">
78
+ <label>Public feed story</label>
79
+ <frontend_type>select</frontend_type>
80
+ <source_model>adminhtml/system_config_source_yesno</source_model>
81
+ <sort_order>30</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ <comment>Whether the public feed story checkbox is checked</comment>
86
+ </publish_feed>
87
+ <rounded_box>
88
+ <label>Rounded Form</label>
89
+ <frontend_type>select</frontend_type>
90
+ <source_model>adminhtml/system_config_source_yesno</source_model>
91
+ <sort_order>40</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ <comment></comment>
96
+ </rounded_box>
97
+ <hidden_comment>
98
+ <label>Hidden comment</label>
99
+ <frontend_type>select</frontend_type>
100
+ <source_model>adminhtml/system_config_source_yesno</source_model>
101
+ <sort_order>50</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>1</show_in_store>
105
+ <comment></comment>
106
+ </hidden_comment>
107
+ <hidden_like>
108
+ <label>Hidden like</label>
109
+ <frontend_type>select</frontend_type>
110
+ <source_model>adminhtml/system_config_source_yesno</source_model>
111
+ <sort_order>60</sort_order>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ <comment></comment>
116
+ </hidden_like>
117
+ </fields>
118
+ </general>
119
+ <like translate="label">
120
+ <label>Custom Like</label>
121
+ <frontend_type>text</frontend_type>
122
+ <sort_order>10</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>0</show_in_store>
126
+ <fields>
127
+ <custom>
128
+ <label>Custom like</label>
129
+ <frontend_type>select</frontend_type>
130
+ <source_model>adminhtml/system_config_source_yesno</source_model>
131
+ <sort_order>0</sort_order>
132
+ <show_in_default>1</show_in_default>
133
+ <show_in_website>1</show_in_website>
134
+ <show_in_store>1</show_in_store>
135
+ <comment></comment>
136
+ </custom>
137
+
138
+ <css_style>
139
+ <label>CSS style</label>
140
+ <frontend_type>textarea</frontend_type>
141
+ <sort_order>10</sort_order>
142
+ <show_in_default>1</show_in_default>
143
+ <show_in_website>1</show_in_website>
144
+ <show_in_store>1</show_in_store>
145
+ <comment><![CDATA[Actived when show like]]></comment>
146
+ </css_style>
147
+ </fields>
148
+ </like>
149
+ <comment>
150
+ <label>Custom Comment Box</label>
151
+ <frontend_type>text</frontend_type>
152
+ <sort_order>20</sort_order>
153
+ <show_in_default>1</show_in_default>
154
+ <show_in_website>1</show_in_website>
155
+ <show_in_store>0</show_in_store>
156
+ <fields>
157
+ <custom>
158
+ <label>Custom comment</label>
159
+ <frontend_type>select</frontend_type>
160
+ <source_model>adminhtml/system_config_source_yesno</source_model>
161
+ <sort_order>0</sort_order>
162
+ <show_in_default>1</show_in_default>
163
+ <show_in_website>1</show_in_website>
164
+ <show_in_store>1</show_in_store>
165
+ <comment></comment>
166
+ </custom>
167
+ <css_style>
168
+ <label>CSS style</label>
169
+ <frontend_type>textarea</frontend_type>
170
+ <sort_order>10</sort_order>
171
+ <show_in_default>1</show_in_default>
172
+ <show_in_website>1</show_in_website>
173
+ <show_in_store>1</show_in_store>
174
+ <comment></comment>
175
+ </css_style>
176
+ </fields>
177
+ </comment>
178
+ </groups>
179
+ </fbcomment>
180
+ </sections>
181
+ </config>
app/code/local/Magestore/Fbcomment/sql/fbcomment_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('fbcomment')};
10
+ CREATE TABLE {$this->getTable('fbcomment')} (
11
+ `fbcomment_id` int(11) unsigned NOT NULL auto_increment,
12
+ `edit_time` datetime NULL,
13
+ PRIMARY KEY (`fbcomment_id`)
14
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
+
16
+ ");
17
+
18
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/fbcomment.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <fbcomment_adminhtml_fbcomment_index>
4
+ <reference name="content">
5
+ <block type="fbcomment/adminhtml_fbcomment" name="fbcomment" />
6
+ </reference>
7
+ </fbcomment_adminhtml_fbcomment_index>
8
+ </layout>
app/design/frontend/default/default/layout/fbcomment.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <catalog_product_view>
6
+ <!--<reference name="product.info">
7
+ <block type="fbcomment/fbcomment" name="fbcomment" as="other" template="fbcomment/fbcomment.phtml" />
8
+ </reference>-->
9
+ <reference name="product.info.additional">
10
+ <block type="fbcomment/fbcomment" name="fbcomment" before="-" template="fbcomment/fbcomment.phtml" />
11
+ </reference>
12
+ </catalog_product_view>
13
+ </layout>
app/design/frontend/default/default/template/fbcomment/fbcomment.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $isHiddenLike = $this->helper('fbcomment')->isHiddenLike()?>
2
+ <?php $isHiddenComment = $this->helper('fbcomment')->isHiddenComment()?>
3
+ <?php if(!$isHiddenComment){?>
4
+ <div class="box-collateral fbcomment">
5
+ <h2><?php echo $this->__('Comments') ?></h2>
6
+ <?php }?>
7
+
8
+ <?php if(!$isHiddenLike || !$isHiddenComment){?>
9
+ <div id="fb-root"></div><script src="http://connect.facebook.net/<?php echo $this->getLanguage() ?>/all.js#appId=<?php echo $this->getUniqueId()?>&amp;xfbml=1"></script>
10
+ <div class="fblike">
11
+ <fb:comments xid="<?php echo $this->getXid()?>" numposts="<?php echo $this->numberOfCommment()?>" width="<?php echo $this->widthOfCommmentBox() ?>" publish_feed="<?php echo $this->publicFeed() ?>" reverse="<?php echo $this->isReserveOrdering() ?>" simple="<?php echo !$this->isRoundedBox() ?>" css="<?php echo $this->getCssUrl() ?>">
12
+ <fb:title></fb:title>
13
+ </fb:comments>
14
+ </div>
15
+ </div>
16
+ <?php }?>
17
+
app/etc/modules/Magestore_Fbcomment.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magestore_Fbcomment>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Magestore_Fbcomment>
8
+ </modules>
9
+ </config>
js/tinybox/tinybox.js ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var TINY={};
2
+
3
+ function T$(i){return document.getElementById(i)}
4
+
5
+ TINY.box=function(){
6
+ var p,m,b,fn,ic,iu,iw,ih,ia,f=0;
7
+ return{
8
+ show:function(c,u,w,h,a,t){
9
+ if(!f){
10
+ p=document.createElement('div'); p.id='tinybox';
11
+ m=document.createElement('div'); m.id='tinymask';
12
+ b=document.createElement('div'); b.id='tinycontent';
13
+ document.body.appendChild(m); document.body.appendChild(p); p.appendChild(b);
14
+ m.onclick=TINY.box.hide; window.onresize=TINY.box.resize; f=1
15
+ }
16
+ if(!a&&!u){
17
+ p.style.width=w?w+'px':'auto'; p.style.height=h?h+'px':'auto';
18
+ p.style.backgroundImage='none'; b.innerHTML=c
19
+ }else{
20
+ b.style.display='none'; p.style.width=p.style.height='100px'
21
+ }
22
+ this.mask();
23
+ ic=c; iu=u; iw=w; ih=h; ia=a; this.alpha(m,1,80,3);
24
+ if(t){setTimeout(function(){TINY.box.hide()},1000*t)}
25
+ },
26
+ fill:function(c,u,w,h,a){
27
+ if(u){
28
+ p.style.backgroundImage='';
29
+ var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');
30
+ x.onreadystatechange=function(){
31
+ if(x.readyState==4&&x.status==200){TINY.box.psh(x.responseText,w,h,a)}
32
+ };
33
+ x.open('GET',c,1); x.send(null)
34
+ }else{
35
+ this.psh(c,w,h,a)
36
+ }
37
+ },
38
+ psh:function(c,w,h,a){
39
+ if(a){
40
+ if(!w||!h){
41
+ var x=p.style.width, y=p.style.height; b.innerHTML=c;
42
+ p.style.width=w?w+'px':''; p.style.height=h?h+'px':'';
43
+ b.style.display='';
44
+ w=parseInt(b.offsetWidth); h=parseInt(b.offsetHeight);
45
+ b.style.display='none'; p.style.width=x; p.style.height=y;
46
+ }else{
47
+ b.innerHTML=c
48
+ }
49
+ this.size(p,w,h)
50
+ }else{
51
+ p.style.backgroundImage='none'
52
+ }
53
+ },
54
+ hide:function(){
55
+ TINY.box.alpha(p,-1,0,3)
56
+ },
57
+ resize:function(){
58
+ TINY.box.pos(); TINY.box.mask()
59
+ },
60
+ mask:function(){
61
+ m.style.height=TINY.page.total(1)+'px';
62
+ m.style.width=''; m.style.width=TINY.page.total(0)+'px'
63
+ },
64
+ pos:function(){
65
+ var t=(TINY.page.height()/2)-(p.offsetHeight/2); t=t<10?10:t;
66
+ p.style.top=(t+TINY.page.top())+'px';
67
+ p.style.left=(TINY.page.width()/2)-(p.offsetWidth/2)+'px'
68
+ },
69
+ alpha:function(e,d,a){
70
+ clearInterval(e.ai);
71
+ if(d==1){
72
+ e.style.opacity=0; e.style.filter='alpha(opacity=0)';
73
+ e.style.display='block'; this.pos()
74
+ }
75
+ e.ai=setInterval(function(){TINY.box.ta(e,a,d)},20)
76
+ },
77
+ ta:function(e,a,d){
78
+ var o=Math.round(e.style.opacity*100);
79
+ if(o==a){
80
+ clearInterval(e.ai);
81
+ if(d==-1){
82
+ e.style.display='none';
83
+ e==p?TINY.box.alpha(m,-1,0,2):b.innerHTML=p.style.backgroundImage=''
84
+ }else{
85
+ e==m?this.alpha(p,1,100):TINY.box.fill(ic,iu,iw,ih,ia)
86
+ }
87
+ }else{
88
+ var n=Math.ceil((o+((a-o)*.5))); n=n==1?0:n;
89
+ e.style.opacity=n/100; e.style.filter='alpha(opacity='+n+')'
90
+ }
91
+ },
92
+ size:function(e,w,h){
93
+ e=typeof e=='object'?e:T$(e); clearInterval(e.si);
94
+ var ow=e.offsetWidth, oh=e.offsetHeight,
95
+ wo=ow-parseInt(e.style.width), ho=oh-parseInt(e.style.height);
96
+ var wd=ow-wo>w?0:1, hd=(oh-ho>h)?0:1;
97
+ e.si=setInterval(function(){TINY.box.ts(e,w,wo,wd,h,ho,hd)},20)
98
+ },
99
+ ts:function(e,w,wo,wd,h,ho,hd){
100
+ var ow=e.offsetWidth-wo, oh=e.offsetHeight-ho;
101
+ if(ow==w&&oh==h){
102
+ clearInterval(e.si); p.style.backgroundImage='none'; b.style.display='block'
103
+ }else{
104
+ if(ow!=w){var n=ow+((w-ow)*.5); e.style.width=wd?Math.ceil(n)+'px':Math.floor(n)+'px'}
105
+ if(oh!=h){var n=oh+((h-oh)*.5); e.style.height=hd?Math.ceil(n)+'px':Math.floor(n)+'px'}
106
+ this.pos()
107
+ }
108
+ }
109
+ }
110
+ }();
111
+
112
+ TINY.page=function(){
113
+ return{
114
+ top:function(){return document.documentElement.scrollTop||document.body.scrollTop},
115
+ width:function(){return self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
116
+ height:function(){return self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},
117
+ total:function(d){
118
+ var b=document.body, e=document.documentElement;
119
+ return d?Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight)):
120
+ Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth))
121
+ }
122
+ }
123
+ }();
124
+
125
+
126
+
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>MagestoreFbcomment</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</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>Fbcomment</summary>
10
+ <description>Fbcomment</description>
11
+ <notes>Fbcomment</notes>
12
+ <authors><author><name>Magestore</name><user>Magestore</user><email>magento.subscription@magestore.com</email></author></authors>
13
+ <date>2011-12-06</date>
14
+ <time>04:49:08</time>
15
+ <contents><target name="magelocal"><dir name="Magestore"><dir name="Fbcomment"><dir name="Block"><dir name="Adminhtml"><dir name="Fbcomment"><dir name="Edit"><file name="Form.php" hash="3ce90a6d019a32a642d697ae8dbdcc9a"/><dir name="Tab"><file name="Form.php" hash="a2669dbbce376c1e0f8d96d1406a6fe3"/></dir><file name="Tabs.php" hash="81008e4948adb97286c824061c433f28"/></dir><file name="Edit.php" hash="9806f296de56ce25cd7908dd332a21a0"/><file name="Grid.php" hash="39cc0fb5bbe969a95229df2f0bec66db"/></dir><file name="Fbcomment.php" hash="9f920187c4aafcd86d202f6f6cb2065a"/></dir><file name="Fbcomment.php" hash="8c924b4137d645be76cca25dd55dc2f8"/></dir><dir name="Helper"><file name="Data.php" hash="ffbe589516cd069c883729402bb0fc6d"/></dir><dir name="Model"><file name="Fbcomment.php" hash="315b212c059f5641e63c2627ed407e2e"/><dir name="Mysql4"><dir name="Fbcomment"><file name="Collection.php" hash="1cadb9745f8a02823e4d1c8f699b4e34"/></dir><file name="Fbcomment.php" hash="3f0fa8e81ba207347509f92804d2eba1"/></dir><file name="Observer.php" hash="dba5db0bd3d2e3c947a53367dafe5a73"/><file name="Status.php" hash="5a7d03025211a2b813e02b7490ef636d"/><dir name="System"><dir name="Config"><file name="Language.php" hash="74e2d7d337920f69e08719558cc016ff"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="FbcommentController.php" hash="9342332d14e9323e0e3490de8608dd53"/></dir><file name="IndexController.php" hash="03a525ef6fac16b783f8b720c5e8d303"/></dir><dir name="etc"><file name="adminhtml.xml" hash="99250d06fe44896128bd5d1ea05244b5"/><file name="config.xml" hash="5eb4883c600a83f041d595cdec355b1f"/><file name="system.xml" hash="35457944f4360f75760b754970c3ac4a"/></dir><dir name="sql"><dir name="fbcomment_setup"><file name="mysql4-install-0.1.0.php" hash="f418f446bd198139594da37a5b3894ef"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magestore_Fbcomment.xml" hash="15e1b12408940b8e44d3d8adbdf1b251"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="fbcomment.xml" hash="99513a6dd7f52cd84215a7b760b6827a"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="fbcomment.xml" hash="222f7add09f335934846af8ab881da9b"/></dir><dir name="template"><dir name="fbcomment"><file name="fbcomment.phtml" hash="f1cf5f4e6e655900d630d15eac825eed"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="tinybox"><dir name="images"><file name="preload.gif" hash="bf3ec68db23e93ba2ec795ef558e96da"/><file name="rhino.jpg" hash="d00bad1ec05584e10a5601ec103aff72"/></dir><file name="style.css" hash="e3016ee232fbf3c6f780255002703237"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="tinybox"><file name="tinybox.js" hash="2ca7fcb7fefc5e8d85887f3c6dc6e315"/></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/css/tinybox/images/preload.gif ADDED
Binary file
skin/adminhtml/default/default/css/tinybox/images/rhino.jpg ADDED
Binary file
skin/adminhtml/default/default/css/tinybox/style.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ body {height:100%; margin:0px; padding:0}
2
+
3
+ #tinybox {position:absolute; display:none; padding:10px; background:#fff url(images/preload.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:2000}
4
+ #tinymask {position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000; z-index:1500}
5
+ #tinycontent {background:#fff}
6
+
7
+ .button {margin-bottom:10px; padding:8px 10px 9px; border:1px solid #ccc; background:#eee; cursor:pointer}
8
+ .button:hover {border:1px solid #bbb; background:#e3e3e3}