Version Notes
First Preview Release
Download this release
Release Info
Developer | Cinas Technologies |
Extension | cinasstore_facebookcomment |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment.php +12 -0
- app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit.php +45 -0
- app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit/Form.php +19 -0
- app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit/Tab/Form.php +58 -0
- app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit/Tabs.php +24 -0
- app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Grid.php +116 -0
- app/code/local/Cinasstore/Facebookcomment/Block/Facebookcomment.php +44 -0
- app/code/local/Cinasstore/Facebookcomment/Helper/Data.php +28 -0
- app/code/local/Cinasstore/Facebookcomment/Model/Facebookcomment.php +10 -0
- app/code/local/Cinasstore/Facebookcomment/Model/Mysql4/Facebookcomment.php +10 -0
- app/code/local/Cinasstore/Facebookcomment/Model/Mysql4/Facebookcomment/Collection.php +10 -0
- app/code/local/Cinasstore/Facebookcomment/Model/Observer.php +26 -0
- app/code/local/Cinasstore/Facebookcomment/Model/Status.php +15 -0
- app/code/local/Cinasstore/Facebookcomment/Model/System/Config/Language.php +118 -0
- app/code/local/Cinasstore/Facebookcomment/controllers/Adminhtml/FacebookcommentController.php +214 -0
- app/code/local/Cinasstore/Facebookcomment/controllers/IndexController.php +26 -0
- app/code/local/Cinasstore/Facebookcomment/etc/adminhtml.xml +26 -0
- app/code/local/Cinasstore/Facebookcomment/etc/config.xml +147 -0
- app/code/local/Cinasstore/Facebookcomment/etc/system.xml +75 -0
- app/code/local/Cinasstore/Facebookcomment/sql/Facebookcomment_setup/mysql4-install-0.1.0.php +18 -0
- app/code/local/Cinasstore/Facebookcomment/sql/Facebookcomment_setup/mysql4-upgrade-0.1.0-0.1.1.php +7 -0
- app/design/adminhtml/default/default/layout/facebookcomment.xml +8 -0
- app/design/frontend/default/default/layout/facebookcomment.xml +13 -0
- app/design/frontend/default/default/template/facebookcomment/facebookcomment.phtml +10 -0
- app/etc/modules/Cinasstore_Facebookcomment.xml +9 -0
- package.xml +20 -0
app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Cinasstore_Facebookcomment_Block_Adminhtml_Facebookcomment extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_facebookcomment';
|
7 |
+
$this->_blockGroup = 'facebookcomment';
|
8 |
+
$this->_headerText = Mage::helper('facebookcomment')->__('Item Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('facebookcomment')->__('Add Item');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Block_Adminhtml_Facebookcomment_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 = 'facebookcomment';
|
11 |
+
$this->_controller = 'adminhtml_facebookcomment';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('facebookcomment')->__('Save Item'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('facebookcomment')->__('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('facebookcomment_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'facebookcomment_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'facebookcomment_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('facebookcomment_data') && Mage::registry('facebookcomment_data')->getId() ) {
|
40 |
+
return Mage::helper('facebookcomment')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('facebookcomment_data')->getTitle()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('facebookcomment')->__('Add Item');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit/Form.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Block_Adminhtml_Facebookcomment_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/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Block_Adminhtml_Facebookcomment_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('facebookcomment_form', array('legend'=>Mage::helper('facebookcomment')->__('Item information')));
|
10 |
+
|
11 |
+
$fieldset->addField('title', 'text', array(
|
12 |
+
'label' => Mage::helper('facebookcomment')->__('Title'),
|
13 |
+
'class' => 'required-entry',
|
14 |
+
'required' => true,
|
15 |
+
'name' => 'title',
|
16 |
+
));
|
17 |
+
|
18 |
+
$fieldset->addField('filename', 'file', array(
|
19 |
+
'label' => Mage::helper('facebookcomment')->__('File'),
|
20 |
+
'required' => false,
|
21 |
+
'name' => 'filename',
|
22 |
+
));
|
23 |
+
|
24 |
+
$fieldset->addField('status', 'select', array(
|
25 |
+
'label' => Mage::helper('facebookcomment')->__('Status'),
|
26 |
+
'name' => 'status',
|
27 |
+
'values' => array(
|
28 |
+
array(
|
29 |
+
'value' => 1,
|
30 |
+
'label' => Mage::helper('facebookcomment')->__('Enabled'),
|
31 |
+
),
|
32 |
+
|
33 |
+
array(
|
34 |
+
'value' => 2,
|
35 |
+
'label' => Mage::helper('facebookcomment')->__('Disabled'),
|
36 |
+
),
|
37 |
+
),
|
38 |
+
));
|
39 |
+
|
40 |
+
$fieldset->addField('content', 'editor', array(
|
41 |
+
'name' => 'content',
|
42 |
+
'label' => Mage::helper('facebookcomment')->__('Content'),
|
43 |
+
'title' => Mage::helper('facebookcomment')->__('Content'),
|
44 |
+
'style' => 'width:700px; height:500px;',
|
45 |
+
'wysiwyg' => false,
|
46 |
+
'required' => true,
|
47 |
+
));
|
48 |
+
|
49 |
+
if ( Mage::getSingleton('adminhtml/session')->getFacebookcommentData() )
|
50 |
+
{
|
51 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getFacebookcommentData());
|
52 |
+
Mage::getSingleton('adminhtml/session')->setFacebookcommentData(null);
|
53 |
+
} elseif ( Mage::registry('facebookcomment_data') ) {
|
54 |
+
$form->setValues(Mage::registry('facebookcomment_data')->getData());
|
55 |
+
}
|
56 |
+
return parent::_prepareForm();
|
57 |
+
}
|
58 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Edit/Tabs.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Block_Adminhtml_Facebookcomment_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('facebookcomment_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('facebookcomment')->__('Item Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('facebookcomment')->__('Item Information'),
|
18 |
+
'title' => Mage::helper('facebookcomment')->__('Item Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('facebookcomment/adminhtml_facebookcomment_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Block/Adminhtml/Facebookcomment/Grid.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Block_Adminhtml_Facebookcomment_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('facebookcommentGrid');
|
9 |
+
$this->setDefaultSort('facebookcomment_id');
|
10 |
+
$this->setDefaultDir('ASC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection = Mage::getModel('facebookcomment/facebookcomment')->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn('facebookcomment_id', array(
|
24 |
+
'header' => Mage::helper('facebookcomment')->__('ID'),
|
25 |
+
'align' =>'right',
|
26 |
+
'width' => '50px',
|
27 |
+
'index' => 'facebookcomment_id',
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn('title', array(
|
31 |
+
'header' => Mage::helper('facebookcomment')->__('Title'),
|
32 |
+
'align' =>'left',
|
33 |
+
'index' => 'title',
|
34 |
+
));
|
35 |
+
|
36 |
+
/*
|
37 |
+
$this->addColumn('content', array(
|
38 |
+
'header' => Mage::helper('facebookcomment')->__('Item Content'),
|
39 |
+
'width' => '150px',
|
40 |
+
'index' => 'content',
|
41 |
+
));
|
42 |
+
*/
|
43 |
+
|
44 |
+
$this->addColumn('status', array(
|
45 |
+
'header' => Mage::helper('facebookcomment')->__('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('facebookcomment')->__('Action'),
|
59 |
+
'width' => '100',
|
60 |
+
'type' => 'action',
|
61 |
+
'getter' => 'getId',
|
62 |
+
'actions' => array(
|
63 |
+
array(
|
64 |
+
'caption' => Mage::helper('facebookcomment')->__('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('facebookcomment')->__('CSV'));
|
76 |
+
$this->addExportType('*/*/exportXml', Mage::helper('facebookcomment')->__('XML'));
|
77 |
+
|
78 |
+
return parent::_prepareColumns();
|
79 |
+
}
|
80 |
+
|
81 |
+
protected function _prepareMassaction()
|
82 |
+
{
|
83 |
+
$this->setMassactionIdField('facebookcomment_id');
|
84 |
+
$this->getMassactionBlock()->setFormFieldName('facebookcomment');
|
85 |
+
|
86 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
+
'label' => Mage::helper('facebookcomment')->__('Delete'),
|
88 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
+
'confirm' => Mage::helper('facebookcomment')->__('Are you sure?')
|
90 |
+
));
|
91 |
+
|
92 |
+
$statuses = Mage::getSingleton('facebookcomment/status')->getOptionArray();
|
93 |
+
|
94 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
+
$this->getMassactionBlock()->addItem('status', array(
|
96 |
+
'label'=> Mage::helper('facebookcomment')->__('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('facebookcomment')->__('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/Cinasstore/Facebookcomment/Block/Facebookcomment.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Block_Facebookcomment 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('facebookcomment/general/unique_id_of_site');
|
12 |
+
}
|
13 |
+
|
14 |
+
public function numberOfCommment(){
|
15 |
+
return Mage::getStoreConfig('facebookcomment/general/show_number_of_comment');
|
16 |
+
}
|
17 |
+
|
18 |
+
public function widthOfCommmentBox(){
|
19 |
+
return Mage::getStoreConfig('facebookcomment/general/width_of_comment_box');
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
public function getProductId(){
|
25 |
+
$productId = $this->getRequest()->getParam('id');
|
26 |
+
|
27 |
+
return Mage::getModel('catalog/product')->load($productId)->getId();
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getProductPageUrl()
|
31 |
+
{
|
32 |
+
return Mage::helper('core/url')->getCurrentUrl();
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getLanguage(){
|
36 |
+
return Mage::getStoreConfig('facebookcomment/general/language');
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
public function getTemplate(){
|
42 |
+
return parent::getTemplate();
|
43 |
+
}
|
44 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Helper/Data.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function isHiddenLike(){
|
6 |
+
return Mage::getStoreConfig('facebookcomment/general/hidden_like');
|
7 |
+
}
|
8 |
+
|
9 |
+
public function isHiddenComment(){
|
10 |
+
return Mage::getStoreConfig('facebookcomment/general/hidden_comment');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function isCustomLike(){
|
14 |
+
return Mage::getStoreConfig('facebookcomment/like/custom');
|
15 |
+
}
|
16 |
+
|
17 |
+
public function isCustomComment(){
|
18 |
+
return Mage::getStoreConfig('facebookcomment/comment/custom');
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getLikeCssStyle(){
|
22 |
+
return Mage::getStoreConfig('facebookcomment/like/css_style');
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getCommentCssStyle(){
|
26 |
+
return Mage::getStoreConfig('facebookcomment/comment/css_style');
|
27 |
+
}
|
28 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Model/Facebookcomment.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Model_Facebookcomment extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('facebookcomment/facebookcomment');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Model/Mysql4/Facebookcomment.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Model_Mysql4_Facebookcomment extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the facebookcomment_id refers to the key field in your database table.
|
8 |
+
$this->_init('facebookcomment/facebookcomment', 'facebookcomment_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Model/Mysql4/Facebookcomment/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Model_Mysql4_Facebookcomment_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('facebookcomment/facebookcomment');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Model/Observer.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Model_Observer {
|
4 |
+
|
5 |
+
public function saveFacebookcommentConfig($observer)
|
6 |
+
{
|
7 |
+
$facebookcomment = Mage::getModel('facebookcomment/facebookcomment');
|
8 |
+
$facebookcomment->setEditTime(now());
|
9 |
+
try{
|
10 |
+
$facebookcomment->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 != 'facebookcomment')
|
24 |
+
return;
|
25 |
+
}
|
26 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_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('facebookcomment')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('facebookcomment')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/Model/System/Config/Language.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Model_System_Config_Language
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
$options = array(
|
8 |
+
array('value'=>'ca_ES','label'=> Mage::helper('facebookcomment')->__('Catalan')),
|
9 |
+
array('value'=>'cs_CZ','label'=> Mage::helper('facebookcomment')->__('Czech')),
|
10 |
+
array('value'=>'cy_GB','label'=> Mage::helper('facebookcomment')->__('Welsh')),
|
11 |
+
array('value'=>'da_DK','label'=> Mage::helper('facebookcomment')->__('Danish')),
|
12 |
+
array('value'=>'de_DE','label'=> Mage::helper('facebookcomment')->__('German')),
|
13 |
+
array('value'=>'eu_ES','label'=> Mage::helper('facebookcomment')->__('Basque')),
|
14 |
+
array('value'=>'en_PI','label'=> Mage::helper('facebookcomment')->__('English (Pirate)')),
|
15 |
+
array('value'=>'en_UD','label'=> Mage::helper('facebookcomment')->__('English (Upside Down)')),
|
16 |
+
array('value'=>'ck_US','label'=> Mage::helper('facebookcomment')->__('Cherokee')),
|
17 |
+
array('value'=>'en_US','label'=> Mage::helper('facebookcomment')->__('English (US)')),
|
18 |
+
array('value'=>'es_LA','label'=> Mage::helper('facebookcomment')->__('Spanish')),
|
19 |
+
array('value'=>'es_CL','label'=> Mage::helper('facebookcomment')->__('Spanish (Chile)')),
|
20 |
+
array('value'=>'es_CO','label'=> Mage::helper('facebookcomment')->__('Spanish (Colombia)')),
|
21 |
+
array('value'=>'es_ES','label'=> Mage::helper('facebookcomment')->__('Spanish (Spain)')),
|
22 |
+
array('value'=>'es_MX','label'=> Mage::helper('facebookcomment')->__('Spanish (Mexico)')),
|
23 |
+
array('value'=>'es_VE','label'=> Mage::helper('facebookcomment')->__('Spanish (Venezuela)')),
|
24 |
+
array('value'=>'fb_FI','label'=> Mage::helper('facebookcomment')->__('Finnish (test)')),
|
25 |
+
array('value'=>'fi_FI','label'=> Mage::helper('facebookcomment')->__('Finnish')),
|
26 |
+
array('value'=>'fr_FR','label'=> Mage::helper('facebookcomment')->__('French (France)')),
|
27 |
+
array('value'=>'gl_ES','label'=> Mage::helper('facebookcomment')->__('Galician')),
|
28 |
+
array('value'=>'hu_HU','label'=> Mage::helper('facebookcomment')->__('Hungarian')),
|
29 |
+
array('value'=>'it_IT','label'=> Mage::helper('facebookcomment')->__('Italian')),
|
30 |
+
array('value'=>'ja_JP','label'=> Mage::helper('facebookcomment')->__('Japanese')),
|
31 |
+
array('value'=>'ko_KR','label'=> Mage::helper('facebookcomment')->__('Korean')),
|
32 |
+
array('value'=>'nb_NO','label'=> Mage::helper('facebookcomment')->__('Norwegian (bokmal)')),
|
33 |
+
array('value'=>'nn_NO','label'=> Mage::helper('facebookcomment')->__('Norwegian (nynorsk)')),
|
34 |
+
array('value'=>'nl_NL','label'=> Mage::helper('facebookcomment')->__('Dutch')),
|
35 |
+
array('value'=>'pl_PL','label'=> Mage::helper('facebookcomment')->__('Polish')),
|
36 |
+
array('value'=>'pt_BR','label'=> Mage::helper('facebookcomment')->__('Portuguese (Brazil)')),
|
37 |
+
array('value'=>'pt_PT','label'=> Mage::helper('facebookcomment')->__('Portuguese (Portugal)')),
|
38 |
+
array('value'=>'ro_RO','label'=> Mage::helper('facebookcomment')->__('Romanian')),
|
39 |
+
array('value'=>'ru_RU','label'=> Mage::helper('facebookcomment')->__('Russian')),
|
40 |
+
array('value'=>'sk_SK','label'=> Mage::helper('facebookcomment')->__('Slovak')),
|
41 |
+
array('value'=>'sl_SI','label'=> Mage::helper('facebookcomment')->__('Slovenian')),
|
42 |
+
array('value'=>'sv_SE','label'=> Mage::helper('facebookcomment')->__('Swedish')),
|
43 |
+
array('value'=>'th_TH','label'=> Mage::helper('facebookcomment')->__('Thai')),
|
44 |
+
array('value'=>'ku_TR','label'=> Mage::helper('facebookcomment')->__('Kurdish')),
|
45 |
+
array('value'=>'zh_CN','label'=> Mage::helper('facebookcomment')->__('Simplified Chinese (China)')),
|
46 |
+
array('value'=>'zh_HK','label'=> Mage::helper('facebookcomment')->__('Traditional Chinese (Hong Kong)')),
|
47 |
+
array('value'=>'zh_TW','label'=> Mage::helper('facebookcomment')->__('Traditional Chinese (Taiwan)')),
|
48 |
+
array('value'=>'fb_LT','label'=> Mage::helper('facebookcomment')->__('Leet Speak')),
|
49 |
+
array('value'=>'af_ZA','label'=> Mage::helper('facebookcomment')->__('Afrikaans')),
|
50 |
+
array('value'=>'sq_AL','label'=> Mage::helper('facebookcomment')->__('Albanian')),
|
51 |
+
array('value'=>'hy_AM','label'=> Mage::helper('facebookcomment')->__('Armenian')),
|
52 |
+
array('value'=>'az_AZ','label'=> Mage::helper('facebookcomment')->__('Azeri')),
|
53 |
+
array('value'=>'be_BY','label'=> Mage::helper('facebookcomment')->__('Belarusian')),
|
54 |
+
array('value'=>'bn_IN','label'=> Mage::helper('facebookcomment')->__('Bengali')),
|
55 |
+
array('value'=>'bs_BA','label'=> Mage::helper('facebookcomment')->__('Bosnian')),
|
56 |
+
array('value'=>'bg_BG','label'=> Mage::helper('facebookcomment')->__('Bulgarian')),
|
57 |
+
array('value'=>'hr_HR','label'=> Mage::helper('facebookcomment')->__('Croatian')),
|
58 |
+
array('value'=>'nl_BE','label'=> Mage::helper('facebookcomment')->__('Dutch (Belgie)')),
|
59 |
+
array('value'=>'en_GB','label'=> Mage::helper('facebookcomment')->__('English (UK)')),
|
60 |
+
array('value'=>'eo_EO','label'=> Mage::helper('facebookcomment')->__('Esperanto')),
|
61 |
+
array('value'=>'et_EE','label'=> Mage::helper('facebookcomment')->__('Estonian')),
|
62 |
+
array('value'=>'fo_FO','label'=> Mage::helper('facebookcomment')->__('Faroese')),
|
63 |
+
array('value'=>'fr_CA','label'=> Mage::helper('facebookcomment')->__('French (Canada)')),
|
64 |
+
array('value'=>'ka_GE','label'=> Mage::helper('facebookcomment')->__('Georgian')),
|
65 |
+
array('value'=>'el_GR','label'=> Mage::helper('facebookcomment')->__('Greek')),
|
66 |
+
array('value'=>'gu_IN','label'=> Mage::helper('facebookcomment')->__('Gujarati')),
|
67 |
+
array('value'=>'hi_IN','label'=> Mage::helper('facebookcomment')->__('Hindi')),
|
68 |
+
array('value'=>'is_IS','label'=> Mage::helper('facebookcomment')->__('Icelandic')),
|
69 |
+
array('value'=>'id_ID','label'=> Mage::helper('facebookcomment')->__('Indonesian')),
|
70 |
+
array('value'=>'ga_IE','label'=> Mage::helper('facebookcomment')->__('Irish')),
|
71 |
+
array('value'=>'jv_ID','label'=> Mage::helper('facebookcomment')->__('Javanese')),
|
72 |
+
array('value'=>'kn_IN','label'=> Mage::helper('facebookcomment')->__('Kannada')),
|
73 |
+
array('value'=>'kk_KZ','label'=> Mage::helper('facebookcomment')->__('Kazakh')),
|
74 |
+
array('value'=>'la_VA','label'=> Mage::helper('facebookcomment')->__('Latin')),
|
75 |
+
array('value'=>'lv_LV','label'=> Mage::helper('facebookcomment')->__('Latvian')),
|
76 |
+
array('value'=>'li_NL','label'=> Mage::helper('facebookcomment')->__('Limburgish')),
|
77 |
+
array('value'=>'lt_LT','label'=> Mage::helper('facebookcomment')->__('Lithuanian')),
|
78 |
+
array('value'=>'mk_MK','label'=> Mage::helper('facebookcomment')->__('Macedonian')),
|
79 |
+
array('value'=>'mg_MG','label'=> Mage::helper('facebookcomment')->__('Malagasy')),
|
80 |
+
array('value'=>'ms_MY','label'=> Mage::helper('facebookcomment')->__('Malay')),
|
81 |
+
array('value'=>'mt_MT','label'=> Mage::helper('facebookcomment')->__('Maltese')),
|
82 |
+
array('value'=>'mr_IN','label'=> Mage::helper('facebookcomment')->__('Marathi')),
|
83 |
+
array('value'=>'mn_MN','label'=> Mage::helper('facebookcomment')->__('Mongolian')),
|
84 |
+
array('value'=>'ne_NP','label'=> Mage::helper('facebookcomment')->__('Nepali')),
|
85 |
+
array('value'=>'pa_IN','label'=> Mage::helper('facebookcomment')->__('Punjabi')),
|
86 |
+
array('value'=>'rm_CH','label'=> Mage::helper('facebookcomment')->__('Romansh')),
|
87 |
+
array('value'=>'sa_IN','label'=> Mage::helper('facebookcomment')->__('Sanskrit')),
|
88 |
+
array('value'=>'sr_RS','label'=> Mage::helper('facebookcomment')->__('Serbian')),
|
89 |
+
array('value'=>'so_SO','label'=> Mage::helper('facebookcomment')->__('Somali')),
|
90 |
+
array('value'=>'sw_KE','label'=> Mage::helper('facebookcomment')->__('Swahili')),
|
91 |
+
array('value'=>'tl_PH','label'=> Mage::helper('facebookcomment')->__('Filipino')),
|
92 |
+
array('value'=>'ta_IN','label'=> Mage::helper('facebookcomment')->__('Tamil')),
|
93 |
+
array('value'=>'tt_RU','label'=> Mage::helper('facebookcomment')->__('Tatar')),
|
94 |
+
array('value'=>'te_IN','label'=> Mage::helper('facebookcomment')->__('Telugu')),
|
95 |
+
array('value'=>'ml_IN','label'=> Mage::helper('facebookcomment')->__('Malayalam')),
|
96 |
+
array('value'=>'uk_UA','label'=> Mage::helper('facebookcomment')->__('Ukrainian')),
|
97 |
+
array('value'=>'uz_UZ','label'=> Mage::helper('facebookcomment')->__('Uzbek')),
|
98 |
+
array('value'=>'vi_VN','label'=> Mage::helper('facebookcomment')->__('Vietnamese')),
|
99 |
+
array('value'=>'xh_ZA','label'=> Mage::helper('facebookcomment')->__('Xhosa')),
|
100 |
+
array('value'=>'zu_ZA','label'=> Mage::helper('facebookcomment')->__('Zulu')),
|
101 |
+
array('value'=>'km_KH','label'=> Mage::helper('facebookcomment')->__('Khmer')),
|
102 |
+
array('value'=>'tg_TJ','label'=> Mage::helper('facebookcomment')->__('Tajik')),
|
103 |
+
array('value'=>'ar_AR','label'=> Mage::helper('facebookcomment')->__('Arabic')),
|
104 |
+
array('value'=>'he_IL','label'=> Mage::helper('facebookcomment')->__('Hebrew')),
|
105 |
+
array('value'=>'ur_PK','label'=> Mage::helper('facebookcomment')->__('Urdu')),
|
106 |
+
array('value'=>'fa_IR','label'=> Mage::helper('facebookcomment')->__('Persian')),
|
107 |
+
array('value'=>'sy_SY','label'=> Mage::helper('facebookcomment')->__('Syriac')),
|
108 |
+
array('value'=>'yi_DE','label'=> Mage::helper('facebookcomment')->__('Yiddish')),
|
109 |
+
array('value'=>'gn_PY','label'=> Mage::helper('facebookcomment')->__('Guarani')),
|
110 |
+
array('value'=>'qu_PE','label'=> Mage::helper('facebookcomment')->__('Quechua')),
|
111 |
+
array('value'=>'ay_BO','label'=> Mage::helper('facebookcomment')->__('Aymara')),
|
112 |
+
array('value'=>'se_NO','label'=> Mage::helper('facebookcomment')->__('Northern Sami')),
|
113 |
+
array('value'=>'ps_AF','label'=> Mage::helper('facebookcomment')->__('Pashto')),
|
114 |
+
array('value'=>'tl_ST','label'=> Mage::helper('facebookcomment')->__('Klingon')),
|
115 |
+
);
|
116 |
+
return $options;
|
117 |
+
}
|
118 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/controllers/Adminhtml/FacebookcommentController.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Cinasstore_Facebookcomment_Adminhtml_FacebookcommentController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('facebookcomment/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('facebookcomment/facebookcomment')->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('facebookcomment_data', $model);
|
30 |
+
|
31 |
+
$this->loadLayout();
|
32 |
+
$this->_setActiveMenu('facebookcomment/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('facebookcomment/adminhtml_facebookcomment_edit'))
|
40 |
+
->_addLeft($this->getLayout()->createBlock('facebookcomment/adminhtml_facebookcomment_edit_tabs'));
|
41 |
+
|
42 |
+
$this->renderLayout();
|
43 |
+
} else {
|
44 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('facebookcomment')->__('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('facebookcomment/facebookcomment');
|
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('facebookcomment')->__('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('facebookcomment')->__('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('facebookcomment/facebookcomment');
|
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 |
+
$facebookcommentIds = $this->getRequest()->getParam('facebookcomment');
|
137 |
+
if(!is_array($facebookcommentIds)) {
|
138 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
139 |
+
} else {
|
140 |
+
try {
|
141 |
+
foreach ($facebookcommentIds as $facebookcommentId) {
|
142 |
+
$facebookcomment = Mage::getModel('facebookcomment/facebookcomment')->load($facebookcommentId);
|
143 |
+
$facebookcomment->delete();
|
144 |
+
}
|
145 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
146 |
+
Mage::helper('adminhtml')->__(
|
147 |
+
'Total of %d record(s) were successfully deleted', count($facebookcommentIds)
|
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 |
+
$facebookcommentIds = $this->getRequest()->getParam('facebookcomment');
|
160 |
+
if(!is_array($facebookcommentIds)) {
|
161 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
162 |
+
} else {
|
163 |
+
try {
|
164 |
+
foreach ($facebookcommentIds as $facebookcommentId) {
|
165 |
+
$facebookcomment = Mage::getSingleton('facebookcomment/facebookcomment')
|
166 |
+
->load($facebookcommentId)
|
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($facebookcommentIds))
|
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 = 'facebookcomment.csv';
|
184 |
+
$content = $this->getLayout()->createBlock('facebookcomment/adminhtml_facebookcomment_grid')
|
185 |
+
->getCsv();
|
186 |
+
|
187 |
+
$this->_sendUploadResponse($fileName, $content);
|
188 |
+
}
|
189 |
+
|
190 |
+
public function exportXmlAction()
|
191 |
+
{
|
192 |
+
$fileName = 'facebookcomment.xml';
|
193 |
+
$content = $this->getLayout()->createBlock('facebookcomment/adminhtml_facebookcomment_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/Cinasstore/Facebookcomment/controllers/IndexController.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Cinasstore_Facebookcomment_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
|
5 |
+
public function getCssAction()
|
6 |
+
{
|
7 |
+
$helper = Mage::helper('facebookcomment');
|
8 |
+
if($helper->isHiddenComment())
|
9 |
+
$css .= 'div.comment_body, div.comment_body div {display:none;}';
|
10 |
+
elseif($helper->isCustomComment())
|
11 |
+
$css .= $helper->getCommentCssStyle();
|
12 |
+
|
13 |
+
if($helper->isHiddenLike())
|
14 |
+
$css .= 'div.like, div.like div {display:none;}';
|
15 |
+
elseif($helper->isCustomLike())
|
16 |
+
$css .= $helper->getLikeCssStyle();
|
17 |
+
|
18 |
+
echo $css;
|
19 |
+
return;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function testAction(){
|
23 |
+
echo Mage::getStoreConfig('facebookcomment/general/custom_style');
|
24 |
+
return;
|
25 |
+
}
|
26 |
+
}
|
app/code/local/Cinasstore/Facebookcomment/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 |
+
<facebookcomment translate="title">
|
15 |
+
<title>Facebook comment</title>
|
16 |
+
<sort_order>50</sort_order>
|
17 |
+
</facebookcomment>
|
18 |
+
</children>
|
19 |
+
</config>
|
20 |
+
</children>
|
21 |
+
</system>
|
22 |
+
</children>
|
23 |
+
</admin>
|
24 |
+
</resources>
|
25 |
+
</acl>
|
26 |
+
</config>
|
app/code/local/Cinasstore/Facebookcomment/etc/config.xml
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Cinasstore_Facebookcomment>
|
5 |
+
<version>0.1.1</version>
|
6 |
+
</Cinasstore_Facebookcomment>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<facebookcomment>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Cinasstore_Facebookcomment</module>
|
14 |
+
<frontName>facebookcomment</frontName>
|
15 |
+
</args>
|
16 |
+
</facebookcomment>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<facebookcomment>
|
21 |
+
<file>facebookcomment.xml</file>
|
22 |
+
</facebookcomment>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<facebookcomment>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Cinasstore_Facebookcomment</module>
|
32 |
+
<frontName>facebookcomment</frontName>
|
33 |
+
</args>
|
34 |
+
</facebookcomment>
|
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 |
+
<facebookcomment translate="title">
|
50 |
+
<title>Facebook comment</title>
|
51 |
+
<sort_order>50</sort_order>
|
52 |
+
</facebookcomment>
|
53 |
+
</children>
|
54 |
+
</config>
|
55 |
+
</children>
|
56 |
+
</system>
|
57 |
+
</children>
|
58 |
+
</admin>
|
59 |
+
</resources>
|
60 |
+
</acl>
|
61 |
+
<layout>
|
62 |
+
<updates>
|
63 |
+
<facebookcomment>
|
64 |
+
<file>facebookcomment.xml</file>
|
65 |
+
</facebookcomment>
|
66 |
+
</updates>
|
67 |
+
</layout>
|
68 |
+
<events>
|
69 |
+
<controller_action_predispatch_adminhtml>
|
70 |
+
<observers>
|
71 |
+
<cinasstore_facebookcomment_observer>
|
72 |
+
<type>singleton</type>
|
73 |
+
<class>facebookcomment/observer</class>
|
74 |
+
<method>controller_action_predispatch_adminhtml</method>
|
75 |
+
</cinasstore_facebookcomment_observer>
|
76 |
+
</observers>
|
77 |
+
</controller_action_predispatch_adminhtml>
|
78 |
+
</events>
|
79 |
+
</adminhtml>
|
80 |
+
<global>
|
81 |
+
<events>
|
82 |
+
<admin_system_config_changed_section_facebookcomment>
|
83 |
+
<observers>
|
84 |
+
<cinasstore_facebookcomment_observer>
|
85 |
+
<type>singleton</type>
|
86 |
+
<class>facebookcomment/observer</class>
|
87 |
+
<method>saveFacebookcommentConfig</method>
|
88 |
+
</cinasstore_facebookcomment_observer>
|
89 |
+
</observers>
|
90 |
+
</admin_system_config_changed_section_facebookcomment>
|
91 |
+
</events>
|
92 |
+
<models>
|
93 |
+
<facebookcomment>
|
94 |
+
<class>Cinasstore_Facebookcomment_Model</class>
|
95 |
+
<resourceModel>facebookcomment_mysql4</resourceModel>
|
96 |
+
</facebookcomment>
|
97 |
+
<facebookcomment_mysql4>
|
98 |
+
<class>Cinasstore_Facebookcomment_Model_Mysql4</class>
|
99 |
+
<entities>
|
100 |
+
<facebookcomment>
|
101 |
+
<table>facebookcomment</table>
|
102 |
+
</facebookcomment>
|
103 |
+
</entities>
|
104 |
+
</facebookcomment_mysql4>
|
105 |
+
</models>
|
106 |
+
<resources>
|
107 |
+
<facebookcomment_setup>
|
108 |
+
<setup>
|
109 |
+
<module>Cinasstore_Facebookcomment</module>
|
110 |
+
</setup>
|
111 |
+
<connection>
|
112 |
+
<use>core_setup</use>
|
113 |
+
</connection>
|
114 |
+
</facebookcomment_setup>
|
115 |
+
<facebookcomment_write>
|
116 |
+
<connection>
|
117 |
+
<use>core_write</use>
|
118 |
+
</connection>
|
119 |
+
</facebookcomment_write>
|
120 |
+
<facebookcomment_read>
|
121 |
+
<connection>
|
122 |
+
<use>core_read</use>
|
123 |
+
</connection>
|
124 |
+
</facebookcomment_read>
|
125 |
+
</resources>
|
126 |
+
<blocks>
|
127 |
+
<facebookcomment>
|
128 |
+
<class>Cinasstore_Facebookcomment_Block</class>
|
129 |
+
</facebookcomment>
|
130 |
+
</blocks>
|
131 |
+
<helpers>
|
132 |
+
<facebookcomment>
|
133 |
+
<class>Cinasstore_Facebookcomment_Helper</class>
|
134 |
+
</facebookcomment>
|
135 |
+
</helpers>
|
136 |
+
</global>
|
137 |
+
<default>
|
138 |
+
<facebookcomment>
|
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 |
+
|
144 |
+
</general>
|
145 |
+
</facebookcomment>
|
146 |
+
</default>
|
147 |
+
</config>
|
app/code/local/Cinasstore/Facebookcomment/etc/system.xml
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<cinasstore translate="label">
|
5 |
+
<label>Cinasstore Extension</label>
|
6 |
+
<sort_order>400</sort_order>
|
7 |
+
</cinasstore>
|
8 |
+
</tabs>
|
9 |
+
|
10 |
+
<sections>
|
11 |
+
<facebookcomment translate="label" module="facebookcomment">
|
12 |
+
<class>separator-top</class>
|
13 |
+
<label>Facebook comment</label>
|
14 |
+
<tab>cinasstore</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>Facebook App ID</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">Create App</a>]]></comment>
|
37 |
+
</unique_id_of_site>
|
38 |
+
<language translate="label">
|
39 |
+
<label>Language</label>
|
40 |
+
<source_model>facebookcomment/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 |
+
|
49 |
+
<show_number_of_comment translate="label">
|
50 |
+
<label>Show number of comment</label>
|
51 |
+
<frontend_type>text</frontend_type>
|
52 |
+
<sort_order>15</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 |
+
</show_number_of_comment>
|
58 |
+
|
59 |
+
<width_of_comment_box translate="label">
|
60 |
+
<label>Width of comment box</label>
|
61 |
+
<frontend_type>text</frontend_type>
|
62 |
+
<sort_order>20</sort_order>
|
63 |
+
<show_in_default>1</show_in_default>
|
64 |
+
<show_in_website>1</show_in_website>
|
65 |
+
<show_in_store>1</show_in_store>
|
66 |
+
<comment>pixel</comment>
|
67 |
+
</width_of_comment_box>
|
68 |
+
|
69 |
+
</fields>
|
70 |
+
</general>
|
71 |
+
|
72 |
+
</groups>
|
73 |
+
</facebookcomment>
|
74 |
+
</sections>
|
75 |
+
</config>
|
app/code/local/Cinasstore/Facebookcomment/sql/Facebookcomment_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('facebookcomment')};
|
10 |
+
CREATE TABLE {$this->getTable('facebookcomment')} (
|
11 |
+
`facebookcomment_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
+
`edit_time` datetime NULL,
|
13 |
+
PRIMARY KEY (`facebookcomment_id`)
|
14 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
15 |
+
|
16 |
+
");
|
17 |
+
|
18 |
+
$installer->endSetup();
|
app/code/local/Cinasstore/Facebookcomment/sql/Facebookcomment_setup/mysql4-upgrade-0.1.0-0.1.1.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/facebookcomment.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<facebookcomment_adminhtml_facebookcomment_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="facebookcomment/adminhtml_facebookcomment" name="facebookcomment" />
|
6 |
+
</reference>
|
7 |
+
</facebookcomment_adminhtml_facebookcomment_index>
|
8 |
+
</layout>
|
app/design/frontend/default/default/layout/facebookcomment.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="facebookcomment/facebookcomment" name="facebookcomment" as="other" template="facebookcomment/facebookcomment.phtml" />
|
8 |
+
</reference>-->
|
9 |
+
<reference name="product.info.additional">
|
10 |
+
<block type="facebookcomment/facebookcomment" name="facebookcomment" before="-" template="facebookcomment/facebookcomment.phtml" />
|
11 |
+
</reference>
|
12 |
+
</catalog_product_view>
|
13 |
+
</layout>
|
app/design/frontend/default/default/template/facebookcomment/facebookcomment.phtml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<link href="<?php echo $this->getCssUrl();?>" rel="stylesheet" type="text/css">
|
2 |
+
<div id="fb-root"></div>
|
3 |
+
<script>(function(d, s, id) {
|
4 |
+
var js, fjs = d.getElementsByTagName(s)[0];
|
5 |
+
if (d.getElementById(id)) return;
|
6 |
+
js = d.createElement(s); js.id = id;
|
7 |
+
js.src = "//connect.facebook.net/<?php echo $this->getLanguage();?>/all.js#xfbml=1&appId=<?php echo $this->getUniqueId();?>";
|
8 |
+
fjs.parentNode.insertBefore(js, fjs);
|
9 |
+
}(document, 'script', 'facebook-jssdk'));</script>
|
10 |
+
<div class="fb-comments" data-href="<?php echo $this->getProductPageUrl();?>" data-numposts="<?php echo $this->numberOfCommment();?>" data-width="<?php echo $this->widthOfCommmentBox();?>" data-colorscheme="light"></div>
|
app/etc/modules/Cinasstore_Facebookcomment.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Cinasstore_Facebookcomment>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Cinasstore_Facebookcomment>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>cinasstore_facebookcomment</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>GPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Show Facebook Comment box on Product Info page for social sharing of comments.</summary>
|
10 |
+
<description>Show Facebook Comment box on Product Info page for social sharing of comments.
|
11 |
+

|
12 |
+
This extension provide facility to assign Facebook App ID and other settings to show facebook comment.</description>
|
13 |
+
<notes>First Preview Release</notes>
|
14 |
+
<authors><author><name>Cinas Technologies</name><user>Cinas</user><email>sales@cinastechnologies.com</email></author></authors>
|
15 |
+
<date>2013-12-07</date>
|
16 |
+
<time>17:43:30</time>
|
17 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Cinasstore_Facebookcomment.xml" hash="1f815f07f8e39a961d4d139290fa3d69"/></dir></target><target name="magelocal"><dir name="Cinasstore"><dir name="Facebookcomment"><dir name="Block"><dir name="Adminhtml"><dir name="Facebookcomment"><dir name="Edit"><file name="Form.php" hash="7d4809df2793a95b110024b12c4671c3"/><dir name="Tab"><file name="Form.php" hash="2bf97bdfc20fff6dba9cb23a52d0087f"/></dir><file name="Tabs.php" hash="137488445172cdb259a73b5289fb8d2f"/></dir><file name="Edit.php" hash="89d5012e91e1dbe84ff6b172fbc32048"/><file name="Grid.php" hash="77c4ff08a6dec36b0b208e1fa3ad612a"/></dir><file name="Facebookcomment.php" hash="db64e76e09da99779f329c10cc0c52ea"/></dir><file name="Facebookcomment.php" hash="8bc0bab419d179ea687fa82a81d82645"/></dir><dir name="Helper"><file name="Data.php" hash="7a2ff5c168186fe2c528d111c34262d2"/></dir><dir name="Model"><file name="Facebookcomment.php" hash="eea17c313df54da5f61fadde02512b29"/><dir name="Mysql4"><dir name="Facebookcomment"><file name="Collection.php" hash="a2d7bbdda182e1d51538d74e891afc58"/></dir><file name="Facebookcomment.php" hash="083d5f33285e22967a9d640b11d127d7"/></dir><file name="Observer.php" hash="9370d87fadb9f40ee3786b6d38582df1"/><file name="Status.php" hash="199e1096b521b68daf0b3b7bd59c38b6"/><dir name="System"><dir name="Config"><file name="Language.php" hash="35ebeffb7dd0aee286ae77719a288476"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="FacebookcommentController.php" hash="84f41649dd38bd4f1be82faeee375e74"/></dir><file name="IndexController.php" hash="a3e62470627206dc8d54c1575fa13d9e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="92f6deddfd350101151bf55df2f0a6f4"/><file name="config.xml" hash="0eeb7b067661d6fe25e89eb5ff09274d"/><file name="system.xml" hash="1d2ef5d7b007e2e9e5195cd992a2df99"/></dir><dir name="sql"><dir name="Facebookcomment_setup"><file name="mysql4-install-0.1.0.php" hash="02d1695fc9b55e87cceb47fd15e14ab6"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="8c8ea981a81cf84c52b864438a10db1a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="facebookcomment.xml" hash="c5b126db53204e79c86dc5bf6375a056"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="facebookcomment.xml" hash="e4e8252616fba14add25f08a82ca6d72"/></dir><dir name="template"><dir name="facebookcomment"><file name="facebookcomment.phtml" hash="b91974a93079f2897da0cd21fd3da17d"/></dir></dir></dir></dir></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
+
</package>
|