Version Notes
The Guest Book Magento extension is a powerful and simultaneously simple way to build relationships with your website visitors.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Guest_Book |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message.php +31 -0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit.php +57 -0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit/Form.php +34 -0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit/Tab/General.php +132 -0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit/Tabs.php +34 -0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Grid.php +244 -0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Widget/Grid/Column/Renderer/Comment.php +37 -0
- app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Widget/Grid/Column/Renderer/Customer.php +41 -0
- app/code/community/Magpleasure/Guestbook/Block/Comments.php +159 -0
- app/code/community/Magpleasure/Guestbook/Block/Comments/Abstract.php +41 -0
- app/code/community/Magpleasure/Guestbook/Block/Comments/Form.php +115 -0
- app/code/community/Magpleasure/Guestbook/Block/Comments/Message.php +136 -0
- app/code/community/Magpleasure/Guestbook/Block/Menu/Item.php +47 -0
- app/code/community/Magpleasure/Guestbook/Helper/Comment/Render.php +45 -0
- app/code/community/Magpleasure/Guestbook/Helper/Comment/Secure.php +105 -0
- app/code/community/Magpleasure/Guestbook/Helper/Data.php +110 -0
- app/code/community/Magpleasure/Guestbook/Model/Message.php +93 -0
- app/code/community/Magpleasure/Guestbook/Model/Mysql4/Message.php +27 -0
- app/code/community/Magpleasure/Guestbook/Model/Mysql4/Message/Collection.php +107 -0
- app/code/community/Magpleasure/Guestbook/controllers/Adminhtml/MessageController.php +278 -0
- app/code/community/Magpleasure/Guestbook/controllers/IndexController.php +161 -0
- app/code/community/Magpleasure/Guestbook/etc/adminhtml.xml +77 -0
- app/code/community/Magpleasure/Guestbook/etc/config.xml +182 -0
- app/code/community/Magpleasure/Guestbook/etc/system.xml +91 -0
- app/code/community/Magpleasure/Guestbook/sql/guestbook_setup/mysql4-install-1.0.php +45 -0
- app/design/adminhtml/default/default/layout/guestbook.xml +20 -0
- app/design/frontend/default/default/layout/guestbook.xml +36 -0
- app/design/frontend/default/default/template/guestbook/comments.phtml +59 -0
- app/design/frontend/default/default/template/guestbook/comments/form.phtml +110 -0
- app/design/frontend/default/default/template/guestbook/comments/message.phtml +43 -0
- app/design/frontend/default/default/template/guestbook/comments/pager.phtml +37 -0
- app/etc/modules/Magpleasure_Guestbook.xml +9 -0
- app/locale/en_US/Magpleasure_Guestbook.csv +65 -0
- app/locale/ru_RU/Magpleasure_Guestbook.csv +65 -0
- js/guestbook/comments.js +146 -0
- package.xml +18 -0
- skin/frontend/default/default/guestbook/css/styles.css +277 -0
- skin/frontend/default/default/guestbook/images/ajax-loader.gif +0 -0
- skin/frontend/default/default/guestbook/images/backgrounds-sprite.png +0 -0
- skin/frontend/default/default/guestbook/images/button-fill.gif +0 -0
- skin/frontend/default/default/guestbook/images/category-mark.png +0 -0
- skin/frontend/default/default/guestbook/images/commentpoint.png +0 -0
- skin/frontend/default/default/guestbook/images/icon-next.png +0 -0
- skin/frontend/default/default/guestbook/images/icon-prev.png +0 -0
- skin/frontend/default/default/guestbook/images/services-sprite.png +0 -0
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Message extends Mage_Adminhtml_Block_Widget_Grid_Container
|
19 |
+
{
|
20 |
+
|
21 |
+
public function __construct()
|
22 |
+
{
|
23 |
+
|
24 |
+
$this->_controller = "adminhtml_message";
|
25 |
+
$this->_blockGroup = "guestbook";
|
26 |
+
$this->_headerText = Mage::helper("guestbook")->__("Comments");
|
27 |
+
parent::__construct();
|
28 |
+
$this->_removeButton('add');
|
29 |
+
}
|
30 |
+
|
31 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Message_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
19 |
+
{
|
20 |
+
|
21 |
+
protected function _helper()
|
22 |
+
{
|
23 |
+
return Mage::helper('guestbook');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function __construct()
|
27 |
+
{
|
28 |
+
parent::__construct();
|
29 |
+
|
30 |
+
$this->_objectId = 'id';
|
31 |
+
$this->_blockGroup = 'guestbook';
|
32 |
+
$this->_controller = 'adminhtml_message';
|
33 |
+
|
34 |
+
$this->_updateButton('save', 'label', $this->_helper()->__('Save Comment'));
|
35 |
+
$this->_updateButton('delete', 'label', $this->_helper()->__('Delete Comment'));
|
36 |
+
|
37 |
+
$this->_addButton('saveandcontinue', array(
|
38 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
39 |
+
'onclick' => 'saveAndContinueEdit()',
|
40 |
+
'class' => 'save',
|
41 |
+
), -100);
|
42 |
+
|
43 |
+
$this->_formScripts[] = "
|
44 |
+
function saveAndContinueEdit(){
|
45 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
46 |
+
}
|
47 |
+
";
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getHeaderText()
|
51 |
+
{
|
52 |
+
if (Mage::registry('current_comment') && Mage::registry('current_comment')->getId()) {
|
53 |
+
return $this->_helper()->__("Edit Comment of '%s'", $this->escapeHtml(Mage::registry('current_comment')->getName()));
|
54 |
+
}
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit/Form.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Message_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
19 |
+
{
|
20 |
+
protected function _prepareForm()
|
21 |
+
{
|
22 |
+
$form = new Varien_Data_Form(array(
|
23 |
+
'id' => 'edit_form',
|
24 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
25 |
+
'method' => 'post',
|
26 |
+
'enctype' => 'multipart/form-data'
|
27 |
+
)
|
28 |
+
);
|
29 |
+
|
30 |
+
$form->setUseContainer(true);
|
31 |
+
$this->setForm($form);
|
32 |
+
return parent::_prepareForm();
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit/Tab/General.php
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Message_Edit_Tab_General extends Mage_Adminhtml_Block_Widget_Form
|
19 |
+
implements Mage_Adminhtml_Block_Widget_Tab_Interface
|
20 |
+
{
|
21 |
+
|
22 |
+
protected function _helper()
|
23 |
+
{
|
24 |
+
return Mage::helper('guestbook');
|
25 |
+
}
|
26 |
+
|
27 |
+
protected function _prepareForm()
|
28 |
+
{
|
29 |
+
$form = new Varien_Data_Form();
|
30 |
+
$this->setForm($form);
|
31 |
+
$fieldset = $form->addFieldset('guestbook_form', array('legend' => $this->_helper()->__('General')));
|
32 |
+
|
33 |
+
$fieldset->addField('name', 'text', array(
|
34 |
+
'label' => $this->_helper()->__('Name'),
|
35 |
+
'class' => 'required-entry',
|
36 |
+
'required' => true,
|
37 |
+
'name' => 'name',
|
38 |
+
));
|
39 |
+
|
40 |
+
$fieldset->addField('email', 'text', array(
|
41 |
+
'label' => $this->_helper()->__('Email'),
|
42 |
+
'class' => 'required-entry',
|
43 |
+
'required' => true,
|
44 |
+
'name' => 'email',
|
45 |
+
));
|
46 |
+
|
47 |
+
$values = Mage::registry('current_comment')->getData();
|
48 |
+
if (!isset($values['reply_to'])){
|
49 |
+
$fieldset->addField('subject', 'text', array(
|
50 |
+
'label' => $this->_helper()->__('Subject'),
|
51 |
+
'required' => true,
|
52 |
+
'class' => 'required-entry',
|
53 |
+
'name' => 'subject',
|
54 |
+
));
|
55 |
+
}
|
56 |
+
|
57 |
+
$fieldset->addField('message', 'textarea', array(
|
58 |
+
'label' => $this->_helper()->__('Comment'),
|
59 |
+
'class' => 'required-entry',
|
60 |
+
'required' => true,
|
61 |
+
'name' => 'message',
|
62 |
+
));
|
63 |
+
|
64 |
+
$comment = Mage::getSingleton('guestbook/message');
|
65 |
+
|
66 |
+
$fieldset->addField('status', 'select',
|
67 |
+
array(
|
68 |
+
'name' => 'status',
|
69 |
+
'label' => $this->_helper()->__('Status'),
|
70 |
+
'values' => $comment->toOptionArray(),
|
71 |
+
));
|
72 |
+
|
73 |
+
if (!Mage::app()->isSingleStoreMode()){
|
74 |
+
$fieldset->addField('store_id', 'select',
|
75 |
+
array(
|
76 |
+
'label' => $this->_helper()->__('Posted from'),
|
77 |
+
'required' => true,
|
78 |
+
'name' => 'store_id',
|
79 |
+
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()
|
80 |
+
));
|
81 |
+
}
|
82 |
+
|
83 |
+
if (Mage::getSingleton('adminhtml/session')->getPostData()) {
|
84 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getPostData());
|
85 |
+
Mage::getSingleton('adminhtml/session')->getPostData(null);
|
86 |
+
} elseif (Mage::registry('current_comment')) {
|
87 |
+
$form->setValues(Mage::registry('current_comment')->getData());
|
88 |
+
}
|
89 |
+
|
90 |
+
return parent::_prepareForm();
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Return Tab label
|
95 |
+
*
|
96 |
+
* @return string
|
97 |
+
*/
|
98 |
+
public function getTabLabel()
|
99 |
+
{
|
100 |
+
return $this->_helper()->__("General");
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Return Tab title
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getTabTitle()
|
109 |
+
{
|
110 |
+
return $this->_helper()->__("General");
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Can show tab in tabs
|
115 |
+
*
|
116 |
+
* @return boolean
|
117 |
+
*/
|
118 |
+
public function canShowTab()
|
119 |
+
{
|
120 |
+
return true;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Tab is hidden
|
125 |
+
*
|
126 |
+
* @return boolean
|
127 |
+
*/
|
128 |
+
public function isHidden()
|
129 |
+
{
|
130 |
+
return false;
|
131 |
+
}
|
132 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Edit/Tabs.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Message_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
19 |
+
{
|
20 |
+
|
21 |
+
protected function _helper()
|
22 |
+
{
|
23 |
+
return Mage::helper('guestbook');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function __construct()
|
27 |
+
{
|
28 |
+
parent::__construct();
|
29 |
+
$this->setId('guestbook_comments');
|
30 |
+
$this->setDestElementId('edit_form');
|
31 |
+
$this->setTitle($this->_helper()->__('Comment Information'));
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Message/Grid.php
ADDED
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Message_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
19 |
+
{
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Helper
|
23 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
24 |
+
*/
|
25 |
+
protected function _helper()
|
26 |
+
{
|
27 |
+
return Mage::helper('guestbook');
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
public function __construct()
|
32 |
+
{
|
33 |
+
parent::__construct();
|
34 |
+
$this->setId("guestbookGrid");
|
35 |
+
$this->setDefaultSort("message_id");
|
36 |
+
$this->setDefaultDir("DESC");
|
37 |
+
$this->setUseAjax(true);
|
38 |
+
$this->setSaveParametersInSession(true);
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function _prepareCollection()
|
42 |
+
{
|
43 |
+
$collection = Mage::getModel("guestbook/message")->getCollection();
|
44 |
+
$collection->addReplyTo();
|
45 |
+
$this->setCollection($collection);
|
46 |
+
return parent::_prepareCollection();
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function _prepareColumns()
|
50 |
+
{
|
51 |
+
$this->addColumn('message_id', array(
|
52 |
+
'header' => $this->_helper()->__('ID'),
|
53 |
+
'align' => 'right',
|
54 |
+
'width' => '50px',
|
55 |
+
'index' => 'message_id',
|
56 |
+
));
|
57 |
+
|
58 |
+
$this->addColumn('reply_to_text', array(
|
59 |
+
'header' => $this->_helper()->__('Reply To'),
|
60 |
+
'align' => 'left',
|
61 |
+
'width' => '200px',
|
62 |
+
'index' => 'reply_to_text',
|
63 |
+
'renderer' => 'Magpleasure_Guestbook_Block_Adminhtml_Widget_Grid_Column_Renderer_Comment',
|
64 |
+
'filter_condition_callback' => array($this, '_filterReplyToCondition'),
|
65 |
+
));
|
66 |
+
|
67 |
+
$this->addColumn('message', array(
|
68 |
+
'header' => $this->_helper()->__('Comment'),
|
69 |
+
'align' => 'left',
|
70 |
+
'width' => '200px',
|
71 |
+
'renderer' => 'Magpleasure_Guestbook_Block_Adminhtml_Widget_Grid_Column_Renderer_Comment',
|
72 |
+
'index' => 'message',
|
73 |
+
'filter_condition_callback' => array($this, '_filterMessageCondition'),
|
74 |
+
));
|
75 |
+
|
76 |
+
$this->addColumn('name', array(
|
77 |
+
'header' => $this->_helper()->__('Name'),
|
78 |
+
'align' => 'left',
|
79 |
+
'index' => 'name',
|
80 |
+
));
|
81 |
+
|
82 |
+
$this->addColumn('email', array(
|
83 |
+
'header' => $this->_helper()->__('Email'),
|
84 |
+
'align' => 'left',
|
85 |
+
'index' => 'email',
|
86 |
+
));
|
87 |
+
|
88 |
+
$this->addColumn('customer_id', array(
|
89 |
+
'header' => $this->_helper()->__('Customer'),
|
90 |
+
'align' => 'left',
|
91 |
+
'index' => 'customer_id',
|
92 |
+
'filter' => false,
|
93 |
+
'renderer' => 'Magpleasure_Guestbook_Block_Adminhtml_Widget_Grid_Column_Renderer_Customer',
|
94 |
+
));
|
95 |
+
|
96 |
+
$this->addColumn('status', array(
|
97 |
+
'header' => $this->_helper()->__('Status'),
|
98 |
+
'align' => 'left',
|
99 |
+
'width' => '80px',
|
100 |
+
'index' => 'status',
|
101 |
+
'type' => 'options',
|
102 |
+
'options' => Mage::getModel('guestbook/message')->getOptionsArray(),
|
103 |
+
'filter_condition_callback' => array($this, '_filterStatus'),
|
104 |
+
));
|
105 |
+
|
106 |
+
if(!Mage::app()->isSingleStoreMode()){
|
107 |
+
$this->addColumn('store_id', array(
|
108 |
+
'header' => $this->__('Store View'),
|
109 |
+
'index' => 'store_id',
|
110 |
+
'sortable' => true,
|
111 |
+
'width' => '120px',
|
112 |
+
'type' => 'store',
|
113 |
+
'store_view' => true,
|
114 |
+
'renderer' => 'Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Store',
|
115 |
+
));
|
116 |
+
}
|
117 |
+
|
118 |
+
$this->addColumn('created_at', array(
|
119 |
+
'header' => $this->_helper()->__('Created At'),
|
120 |
+
'index' => 'created_at',
|
121 |
+
'type' => 'datetime',
|
122 |
+
'width' => '140px',
|
123 |
+
));
|
124 |
+
|
125 |
+
$this->addColumn('updated_at', array(
|
126 |
+
'header' => $this->_helper()->__('Updated At'),
|
127 |
+
'index' => 'updated_at',
|
128 |
+
'type' => 'datetime',
|
129 |
+
'width' => '140px',
|
130 |
+
));
|
131 |
+
|
132 |
+
$this->addColumn('action',
|
133 |
+
array(
|
134 |
+
'header' => $this->_helper()->__('Action'),
|
135 |
+
'width' => '100',
|
136 |
+
'type' => 'action',
|
137 |
+
'getter' => 'getId',
|
138 |
+
'actions' => array(
|
139 |
+
array(
|
140 |
+
'caption' => $this->_helper()->__('View'),
|
141 |
+
'url' => array('base' => '*/*/view'),
|
142 |
+
'field' => 'id'
|
143 |
+
),
|
144 |
+
array(
|
145 |
+
'caption' => $this->_helper()->__('Approve'),
|
146 |
+
'url' => array('base' => '*/*/approve'),
|
147 |
+
'field' => 'id'
|
148 |
+
),
|
149 |
+
array(
|
150 |
+
'caption' => $this->_helper()->__('Reject'),
|
151 |
+
'url' => array('base' => '*/*/reject'),
|
152 |
+
'field' => 'id'
|
153 |
+
),
|
154 |
+
),
|
155 |
+
'filter' => false,
|
156 |
+
'sortable' => false,
|
157 |
+
'index' => 'stores',
|
158 |
+
'is_system' => true,
|
159 |
+
));
|
160 |
+
|
161 |
+
return parent::_prepareColumns();
|
162 |
+
}
|
163 |
+
|
164 |
+
protected function _prepareMassaction()
|
165 |
+
{
|
166 |
+
$this->setMassactionIdField('message_id');
|
167 |
+
$this->getMassactionBlock()->setFormFieldName('comments');
|
168 |
+
|
169 |
+
$statuses = Mage::getModel('guestbook/message')->toOptionArray();
|
170 |
+
|
171 |
+
array_unshift($statuses, array('label' => '', 'value' => ''));
|
172 |
+
$this->getMassactionBlock()->addItem('status', array(
|
173 |
+
'label' => $this->_helper()->__('Change status'),
|
174 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current' => true)),
|
175 |
+
'additional' => array(
|
176 |
+
'visibility' => array(
|
177 |
+
'name' => 'status',
|
178 |
+
'type' => 'select',
|
179 |
+
'class' => 'required-entry',
|
180 |
+
'label' => $this->_helper()->__('Status'),
|
181 |
+
'values' => $statuses
|
182 |
+
)
|
183 |
+
)
|
184 |
+
));
|
185 |
+
|
186 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
187 |
+
'label' => $this->_helper()->__('Delete'),
|
188 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
189 |
+
'confirm' => $this->_helper()->__('Are you sure?')
|
190 |
+
));
|
191 |
+
return $this;
|
192 |
+
}
|
193 |
+
|
194 |
+
public function getRowUrl($row)
|
195 |
+
{
|
196 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
197 |
+
}
|
198 |
+
|
199 |
+
public function getGridUrl()
|
200 |
+
{
|
201 |
+
return $this->getUrl('*/*/grid');
|
202 |
+
}
|
203 |
+
|
204 |
+
protected function _filterReplyToCondition($collection, $column)
|
205 |
+
{
|
206 |
+
if (!$value = $column->getFilter()->getValue()) {
|
207 |
+
return;
|
208 |
+
}
|
209 |
+
$this->getCollection()->addReplyToTextFilter($value);
|
210 |
+
}
|
211 |
+
|
212 |
+
protected function _filterMessageCondition($collection, $column)
|
213 |
+
{
|
214 |
+
if (!$value = $column->getFilter()->getValue()) {
|
215 |
+
return;
|
216 |
+
}
|
217 |
+
$this->getCollection()->addMessageTextFilter($value);
|
218 |
+
}
|
219 |
+
|
220 |
+
protected function _filterStatus($collection, $column)
|
221 |
+
{
|
222 |
+
if (!$value = $column->getFilter()->getValue()) {
|
223 |
+
return;
|
224 |
+
}
|
225 |
+
$this->getCollection()->addStatusFilter($value);
|
226 |
+
}
|
227 |
+
|
228 |
+
protected function _addColumnFilterToCollection($column)
|
229 |
+
{
|
230 |
+
if ($this->getCollection()) {
|
231 |
+
$field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
|
232 |
+
if ($column->getFilterConditionCallback()) {
|
233 |
+
call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
|
234 |
+
} else {
|
235 |
+
$cond = $column->getFilter()->getCondition();
|
236 |
+
if ($field && isset($cond)) {
|
237 |
+
$this->getCollection()->addFieldToFilter("main_table.".$field , $cond);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
241 |
+
return $this;
|
242 |
+
}
|
243 |
+
|
244 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Widget/Grid/Column/Renderer/Comment.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
|
19 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Widget_Grid_Column_Renderer_Comment extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Renders grid column
|
23 |
+
*
|
24 |
+
* @param Varien_Object $row
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function render(Varien_Object $row)
|
28 |
+
{
|
29 |
+
$content = $this->_getValue($row);
|
30 |
+
if ($content){
|
31 |
+
/** @var Magpleasure_Guestbook_Helper_Data $helper */
|
32 |
+
$helper = Mage::helper('guestbook');
|
33 |
+
return $helper->_render()->render($content, 200);
|
34 |
+
}
|
35 |
+
return parent::render($row);
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Adminhtml/Widget/Grid/Column/Renderer/Customer.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
|
19 |
+
class Magpleasure_Guestbook_Block_Adminhtml_Widget_Grid_Column_Renderer_Customer extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Renders grid column
|
23 |
+
*
|
24 |
+
* @param Varien_Object $row
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function render(Varien_Object $row)
|
28 |
+
{
|
29 |
+
$customerId = $this->_getValue($row);
|
30 |
+
if ($customerId) {
|
31 |
+
$html = "";
|
32 |
+
/** @var Mage_Customer_Model_Customer $customer */
|
33 |
+
$customer = Mage::getModel('customer/customer')->load($customerId);
|
34 |
+
$name = $customer->getName();
|
35 |
+
$url = $this->getUrl('adminhtml/customer/edit', array('id'=>$customerId));
|
36 |
+
$html .= "<a href=\"{$url}\" target=\"_blank\">{$name}</a>";
|
37 |
+
return $html;
|
38 |
+
}
|
39 |
+
return parent::render($row);
|
40 |
+
}
|
41 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Comments.php
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Comments extends Mage_Core_Block_Template
|
19 |
+
{
|
20 |
+
protected $_collection;
|
21 |
+
|
22 |
+
protected function _construct()
|
23 |
+
{
|
24 |
+
parent::_construct();
|
25 |
+
$this->setTemplate("guestbook/comments.phtml");
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _prepareLayout()
|
29 |
+
{
|
30 |
+
parent::_prepareLayout();
|
31 |
+
$head = $this->getLayout()->getBlock("head");
|
32 |
+
if ($head){
|
33 |
+
$head->setTitle($this->_helper()->getMenuLabel());
|
34 |
+
}
|
35 |
+
|
36 |
+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
37 |
+
if ($breadcrumbs){
|
38 |
+
|
39 |
+
$breadcrumbs->addCrumb("home", array(
|
40 |
+
"label" => $this->__("Home"),
|
41 |
+
"title" => $this->__("Home"),
|
42 |
+
"link" => Mage::getBaseUrl('web')
|
43 |
+
));
|
44 |
+
|
45 |
+
$breadcrumbs->addCrumb("guestbook", array(
|
46 |
+
"label" => $this->_helper()->getMenuLabel(),
|
47 |
+
"title" => $this->_helper()->getMenuLabel()
|
48 |
+
));
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Customer Session
|
54 |
+
*
|
55 |
+
* @return Mage_Customer_Model_Session
|
56 |
+
*/
|
57 |
+
public function getCustomerSession()
|
58 |
+
{
|
59 |
+
return Mage::getSingleton('customer/session');
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Helper
|
64 |
+
*
|
65 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
66 |
+
*/
|
67 |
+
public function _helper()
|
68 |
+
{
|
69 |
+
return Mage::helper('guestbook');
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Core
|
74 |
+
*
|
75 |
+
* @return Mage_Core_Helper_Data
|
76 |
+
*/
|
77 |
+
public function _core()
|
78 |
+
{
|
79 |
+
return Mage::helper('core');
|
80 |
+
}
|
81 |
+
|
82 |
+
public function getHeader()
|
83 |
+
{
|
84 |
+
return $this->_helper()->getMenuLabel();
|
85 |
+
}
|
86 |
+
|
87 |
+
protected function _beforeToHtml()
|
88 |
+
{
|
89 |
+
$this->getToolbar()
|
90 |
+
->setPageVarName('p')
|
91 |
+
->setLimit($this->_helper()->getCommentsPerPage())
|
92 |
+
->setTemplate('guestbook/comments/pager.phtml')
|
93 |
+
->setCollection($this->getCollection())
|
94 |
+
;
|
95 |
+
parent::_beforeToHtml();
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getCollection()
|
99 |
+
{
|
100 |
+
if (!$this->_collection){
|
101 |
+
/** @var Magpleasure_Guestbook_Model_Mysql4_Message_Collection $comments */
|
102 |
+
$comments = Mage::getModel('guestbook/message')->getCollection();
|
103 |
+
|
104 |
+
if (!Mage::app()->isSingleStoreMode()){
|
105 |
+
$comments->addStoreFilter(Mage::app()->getStore()->getId());
|
106 |
+
}
|
107 |
+
|
108 |
+
$comments
|
109 |
+
->addActiveFilter($this->_helper()->getCommentsAutoapprove() ? null : $this->getCustomerSession()->getSessionId() )
|
110 |
+
;
|
111 |
+
|
112 |
+
$comments
|
113 |
+
->setDateOrder()
|
114 |
+
->setNotReplies()
|
115 |
+
;
|
116 |
+
|
117 |
+
$this->_collection = $comments;
|
118 |
+
}
|
119 |
+
return $this->_collection;
|
120 |
+
}
|
121 |
+
|
122 |
+
public function getMessageHtml(Magpleasure_Guestbook_Model_Message $message)
|
123 |
+
{
|
124 |
+
$messageBlock = $this->getLayout()->createBlock('guestbook/comments_message');
|
125 |
+
if ($messageBlock){
|
126 |
+
$messageBlock->setMessage($message);
|
127 |
+
return $messageBlock->toHtml();
|
128 |
+
}
|
129 |
+
return false;
|
130 |
+
}
|
131 |
+
|
132 |
+
public function getFormUrl()
|
133 |
+
{
|
134 |
+
return $this->getUrl('guestbook/index/form', array(
|
135 |
+
'reply_to'=>'{{reply_to}}',
|
136 |
+
));
|
137 |
+
}
|
138 |
+
|
139 |
+
public function getPostUrl()
|
140 |
+
{
|
141 |
+
return $this->getUrl('guestbook/index/postForm', array(
|
142 |
+
'reply_to'=>'{{reply_to}}',
|
143 |
+
));
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* @return Mage_Page_Block_Html_Pager
|
148 |
+
*/
|
149 |
+
public function getToolbar()
|
150 |
+
{
|
151 |
+
return $this->getLayout()->getBlock('guestbook_list_toolbar');
|
152 |
+
}
|
153 |
+
|
154 |
+
public function getToolbarHtml()
|
155 |
+
{
|
156 |
+
return $this->getToolbar()->toHtml();
|
157 |
+
}
|
158 |
+
|
159 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Comments/Abstract.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Block_Comments_Abstract extends Mage_Core_Block_Template
|
19 |
+
{
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Helper
|
23 |
+
*
|
24 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
25 |
+
*/
|
26 |
+
public function _helper()
|
27 |
+
{
|
28 |
+
return Mage::helper('guestbook');
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Customer Session
|
33 |
+
*
|
34 |
+
* @return Mage_Customer_Model_Session
|
35 |
+
*/
|
36 |
+
public function getCustomerSession()
|
37 |
+
{
|
38 |
+
return Mage::getSingleton('customer/session');
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Comments/Form.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
|
19 |
+
class Magpleasure_Guestbook_Block_Comments_Form extends Magpleasure_Guestbook_Block_Comments_Abstract
|
20 |
+
{
|
21 |
+
protected $_collection;
|
22 |
+
|
23 |
+
protected $_replyTo;
|
24 |
+
protected $_formData = array();
|
25 |
+
|
26 |
+
protected function _construct()
|
27 |
+
{
|
28 |
+
parent::_construct();
|
29 |
+
$this->setTemplate("guestbook/comments/form.phtml");
|
30 |
+
}
|
31 |
+
|
32 |
+
public function setReplyTo($value)
|
33 |
+
{
|
34 |
+
$this->_replyTo = $value;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function canPostComments()
|
38 |
+
{
|
39 |
+
return $this->_helper()->getCommentsAllowGuests();
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Comment
|
44 |
+
*
|
45 |
+
* @return Magpleasure_Blog_Model_Comment
|
46 |
+
*/
|
47 |
+
public function getReplyTo()
|
48 |
+
{
|
49 |
+
return $this->_replyTo ? $this->_replyTo->getId() : 0;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function isReply()
|
53 |
+
{
|
54 |
+
return !!$this->getReplyTo();
|
55 |
+
}
|
56 |
+
|
57 |
+
public function canPost()
|
58 |
+
{
|
59 |
+
return $this->_helper()->getCommentsAllowGuests() || $this->isLoggedId();
|
60 |
+
}
|
61 |
+
|
62 |
+
public function setFormData(array $data)
|
63 |
+
{
|
64 |
+
$this->_formData = $data;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function getFormData()
|
68 |
+
{
|
69 |
+
return new Varien_Object($this->_formData);
|
70 |
+
}
|
71 |
+
|
72 |
+
public function getRegisterUrl()
|
73 |
+
{
|
74 |
+
return $this->getUrl('customer/account/create');
|
75 |
+
}
|
76 |
+
|
77 |
+
public function getLoginUrl()
|
78 |
+
{
|
79 |
+
return $this->getUrl('customer/account/login');
|
80 |
+
}
|
81 |
+
|
82 |
+
public function isLoggedId()
|
83 |
+
{
|
84 |
+
return $this->getCustomerSession()->isLoggedIn();
|
85 |
+
}
|
86 |
+
|
87 |
+
public function getCustomerId()
|
88 |
+
{
|
89 |
+
return $this->getCustomerSession()->getCustomerId();
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getCustomerName()
|
93 |
+
{
|
94 |
+
return $this->isLoggedId() ? $this->getCustomerSession()->getCustomer()->getName() : '';
|
95 |
+
}
|
96 |
+
|
97 |
+
public function getCustomerEmail()
|
98 |
+
{
|
99 |
+
return $this->getCustomerSession()->getCustomer()->getEmail();
|
100 |
+
}
|
101 |
+
|
102 |
+
public function getSessionId()
|
103 |
+
{
|
104 |
+
return $this->getCustomerSession()->getSessionId();
|
105 |
+
}
|
106 |
+
|
107 |
+
public function getMessageBlockHtml()
|
108 |
+
{
|
109 |
+
$block = $this->getMessagesBlock();
|
110 |
+
if ($block){
|
111 |
+
$block->setMessages($this->getCustomerSession()->getMessages(true));
|
112 |
+
}
|
113 |
+
return $block->toHtml();
|
114 |
+
}
|
115 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Comments/Message.php
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
|
19 |
+
class Magpleasure_Guestbook_Block_Comments_Message extends Magpleasure_Guestbook_Block_Comments_Abstract
|
20 |
+
{
|
21 |
+
protected $_collection;
|
22 |
+
|
23 |
+
protected function _construct()
|
24 |
+
{
|
25 |
+
parent::_construct();
|
26 |
+
$this->setTemplate("guestbook/comments/message.phtml");
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Comment
|
31 |
+
*
|
32 |
+
* @return Magpleasure_Blog_Model_Comment
|
33 |
+
*/
|
34 |
+
public function getMessage()
|
35 |
+
{
|
36 |
+
return $this->getData('message');
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getContent()
|
40 |
+
{
|
41 |
+
return $this->_helper()->_render()->render($this->getMessage()->getMessage());
|
42 |
+
}
|
43 |
+
|
44 |
+
public function getMessageId()
|
45 |
+
{
|
46 |
+
return $this->getMessage()->getId();
|
47 |
+
}
|
48 |
+
|
49 |
+
public function getAuthor()
|
50 |
+
{
|
51 |
+
return $this->getMessage()->getName();
|
52 |
+
}
|
53 |
+
|
54 |
+
public function getDate()
|
55 |
+
{
|
56 |
+
return $this->_helper()->renderDate($this->getMessage()->getCreatedAt());
|
57 |
+
}
|
58 |
+
|
59 |
+
public function getTime()
|
60 |
+
{
|
61 |
+
return $this->_helper()->renderTime($this->getMessage()->getCreatedAt());
|
62 |
+
}
|
63 |
+
|
64 |
+
public function getRepliesCollection()
|
65 |
+
{
|
66 |
+
if (!$this->_collection){
|
67 |
+
/** @var Magpleasure_Guestbook_Model_Mysql4_Message_Collection $messages */
|
68 |
+
$messages = Mage::getModel('guestbook/message')->getCollection();
|
69 |
+
|
70 |
+
if (!Mage::app()->isSingleStoreMode()){
|
71 |
+
$messages->addStoreFilter(Mage::app()->getStore()->getId());
|
72 |
+
}
|
73 |
+
|
74 |
+
$messages
|
75 |
+
->addActiveFilter($this->_helper()->getCommentsAutoapprove() ? null : $this->getCustomerSession()->getSessionId() )
|
76 |
+
;
|
77 |
+
|
78 |
+
$messages
|
79 |
+
->setDateOrder()
|
80 |
+
->setReplyToFilter($this->getMessage()->getId())
|
81 |
+
;
|
82 |
+
|
83 |
+
$this->_collection = $messages;
|
84 |
+
}
|
85 |
+
return $this->_collection;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Replies Html
|
90 |
+
*
|
91 |
+
* @return string
|
92 |
+
*/
|
93 |
+
public function getRepliesHtml()
|
94 |
+
{
|
95 |
+
$html = "";
|
96 |
+
foreach ($this->getRepliesCollection() as $message){
|
97 |
+
$messageBlock = $this->getLayout()->createBlock('guestbook/comments_message');
|
98 |
+
if ($messageBlock){
|
99 |
+
$messageBlock->setMessage($message);
|
100 |
+
$html .= $messageBlock->toHtml();
|
101 |
+
}
|
102 |
+
}
|
103 |
+
return $html;
|
104 |
+
}
|
105 |
+
|
106 |
+
public function isReply()
|
107 |
+
{
|
108 |
+
if ($this->getIsAjax()){
|
109 |
+
return false;
|
110 |
+
}
|
111 |
+
if ($this->getMessage()->getReplyTo()){
|
112 |
+
$flag = 'guestbook_reply_'.$this->getMessage()->getReplyTo();
|
113 |
+
if (!Mage::registry($flag)){
|
114 |
+
Mage::register($flag, true);
|
115 |
+
return true;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
return false;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function getCountCode()
|
122 |
+
{
|
123 |
+
return $this->getCommentsCount() ? $this->__("%s comments", $this->getCommentsCount()) : $this->__("No comments");
|
124 |
+
}
|
125 |
+
|
126 |
+
public function getNeedApproveMessage()
|
127 |
+
{
|
128 |
+
return ($this->getMessage()->getStatus() == Magpleasure_Guestbook_Model_Message::STATUS_PENDING);
|
129 |
+
}
|
130 |
+
|
131 |
+
public function getSubject()
|
132 |
+
{
|
133 |
+
return $this->getMessage()->getSubject();
|
134 |
+
}
|
135 |
+
|
136 |
+
}
|
app/code/community/Magpleasure/Guestbook/Block/Menu/Item.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
class Magpleasure_Guestbook_Block_Menu_Item extends Mage_Core_Block_Abstract
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Helper
|
21 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
22 |
+
*/
|
23 |
+
protected function _helper()
|
24 |
+
{
|
25 |
+
return Mage::helper('guestbook');
|
26 |
+
}
|
27 |
+
|
28 |
+
public function addGuestbookLink()
|
29 |
+
{
|
30 |
+
/** @var Mage_Page_Block_Template_Links $parentBlock */
|
31 |
+
$parentBlock = $this->getParentBlock();
|
32 |
+
if ($parentBlock && $this->_helper()->getMenuEnabled()) {
|
33 |
+
$parentBlock->addLink(
|
34 |
+
$this->_helper()->getMenuLabel(),
|
35 |
+
$this->getUrl('guestbook'),
|
36 |
+
$this->_helper()->getMenuLabel(),
|
37 |
+
false,
|
38 |
+
array(),
|
39 |
+
$this->_helper()->getMenuPosition(),
|
40 |
+
'class="mp-guestbook"',
|
41 |
+
'class="top-link-guestbook"'
|
42 |
+
);
|
43 |
+
}
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
app/code/community/Magpleasure/Guestbook/Helper/Comment/Render.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Helper_Comment_Render extends Mage_Core_Helper_Data
|
19 |
+
{
|
20 |
+
|
21 |
+
public function render($content, $limit = false)
|
22 |
+
{
|
23 |
+
if ($limit){
|
24 |
+
if (strlen($content) > $limit){
|
25 |
+
$content = substr($content, 0, $limit);
|
26 |
+
if (strpos($content, " ") !== false){
|
27 |
+
$cuts = explode(" ", $content);
|
28 |
+
if (count($cuts) && count($cuts) > 1){
|
29 |
+
unset($cuts[count($cuts) - 1]);
|
30 |
+
$content = implode(" ", $cuts)."...";
|
31 |
+
}
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
preg_match_all('#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $content, $match);
|
37 |
+
foreach ($match[0] as $url){
|
38 |
+
$content = str_replace($url, "<a href=\"{$url}\" target=\"_blank\">{$url}</a>", $content);
|
39 |
+
}
|
40 |
+
return nl2br($content);
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
}
|
app/code/community/Magpleasure/Guestbook/Helper/Comment/Secure.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Helper_Comment_Secure extends Mage_Core_Helper_Data
|
19 |
+
{
|
20 |
+
const SESSSION_KEY = 'guestbook_customer_keys';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Helper
|
24 |
+
*
|
25 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
26 |
+
*/
|
27 |
+
public function _helper()
|
28 |
+
{
|
29 |
+
return Mage::helper('guestbook');
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Customer Session
|
34 |
+
*
|
35 |
+
* @return Mage_Customer_Model_Session
|
36 |
+
*/
|
37 |
+
public function getCustomerSession()
|
38 |
+
{
|
39 |
+
return Mage::getSingleton('customer/session');
|
40 |
+
}
|
41 |
+
|
42 |
+
protected function _getMd5Hash()
|
43 |
+
{
|
44 |
+
return md5(time() + rand(1, 1000));
|
45 |
+
}
|
46 |
+
|
47 |
+
protected function _save($key, $values)
|
48 |
+
{
|
49 |
+
$session = $this->getCustomerSession();
|
50 |
+
$keys = $session->getData(self::SESSSION_KEY);
|
51 |
+
if (!$keys || !is_array($keys)){
|
52 |
+
$keys = array();
|
53 |
+
}
|
54 |
+
$keys[$key] = $values;
|
55 |
+
$session->setData(self::SESSSION_KEY, $keys);
|
56 |
+
}
|
57 |
+
|
58 |
+
protected function _load($key)
|
59 |
+
{
|
60 |
+
$session = $this->getCustomerSession();
|
61 |
+
$keys = $session->getData(self::SESSSION_KEY);
|
62 |
+
if ($keys && is_array($keys)){
|
63 |
+
if (isset($keys[$key])){
|
64 |
+
$result = $keys[$key];
|
65 |
+
unset($keys[$key]);
|
66 |
+
return $result;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
return false;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function getSecureCode($replyTo)
|
73 |
+
{
|
74 |
+
$key = $this->_getMd5Hash();
|
75 |
+
$data = array(
|
76 |
+
'reply_to' => $replyTo,
|
77 |
+
);
|
78 |
+
$data = serialize($data);
|
79 |
+
$this->_save($key, $data);
|
80 |
+
return $key;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function validate($secure, $replyTo)
|
84 |
+
{
|
85 |
+
if (!$this->_helper()->getCommentsAllowGuests() && !$this->getCustomerSession()->isLoggedIn()){
|
86 |
+
return false;
|
87 |
+
}
|
88 |
+
$data = $this->_load($secure);
|
89 |
+
if ($data){
|
90 |
+
try {
|
91 |
+
$data = unserialize($data);
|
92 |
+
if (is_array($data)){
|
93 |
+
if (isset($data['reply_to'])){
|
94 |
+
return ($data['reply_to'] == $replyTo);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
} catch (Exception $e){
|
98 |
+
return false;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
return false;
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
}
|
app/code/community/Magpleasure/Guestbook/Helper/Data.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Helper_Data extends Mage_Core_Helper_Abstract
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Auto Approving
|
22 |
+
*
|
23 |
+
* @return mixed
|
24 |
+
*/
|
25 |
+
public function getCommentsAutoapprove()
|
26 |
+
{
|
27 |
+
return Mage::getStoreConfig('guestbook/messages/autoapprove');
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getCommentsPerPage()
|
31 |
+
{
|
32 |
+
return Mage::getStoreConfig('guestbook/messages/record_per_page');
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getCommentsAllowGuests()
|
36 |
+
{
|
37 |
+
return Mage::getStoreConfig('guestbook/messages/allow_guests');
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getMenuEnabled()
|
41 |
+
{
|
42 |
+
return Mage::getStoreConfig('guestbook/menu/enabled');
|
43 |
+
}
|
44 |
+
|
45 |
+
public function getMenuPosition()
|
46 |
+
{
|
47 |
+
return Mage::getStoreConfig('guestbook/menu/position');
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getMenuLabel()
|
51 |
+
{
|
52 |
+
return Mage::getStoreConfig('guestbook/menu/label');
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Render
|
57 |
+
*
|
58 |
+
* @return Magpleasure_Guestbook_Helper_Comment_Render
|
59 |
+
*/
|
60 |
+
public function _render()
|
61 |
+
{
|
62 |
+
return Mage::helper("guestbook/comment_render");
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Comment Secure
|
67 |
+
*
|
68 |
+
* @return Magpleasure_Guestbook_Helper_Comment_Secure
|
69 |
+
*/
|
70 |
+
public function _secure()
|
71 |
+
{
|
72 |
+
return Mage::helper("guestbook/comment_secure");
|
73 |
+
}
|
74 |
+
|
75 |
+
protected function _getTimezone()
|
76 |
+
{
|
77 |
+
return Mage::getStoreConfig('general/locale/timezone');
|
78 |
+
}
|
79 |
+
|
80 |
+
public function renderTime($datetime)
|
81 |
+
{
|
82 |
+
$date = new Zend_Date($datetime, Zend_Date::ISO_8601, Mage::app()->getLocale()->getLocaleCode());
|
83 |
+
$date->setTimezone($this->_getTimezone());
|
84 |
+
return $date->toString(Zend_Date::TIME_SHORT);
|
85 |
+
}
|
86 |
+
|
87 |
+
public function renderDate($datetime)
|
88 |
+
{
|
89 |
+
$date = new Zend_Date($datetime, Zend_Date::ISO_8601, Mage::app()->getLocale()->getLocaleCode());
|
90 |
+
$date->setTimezone($this->_getTimezone());
|
91 |
+
return $date->toString(Zend_Date::DATE_LONG);
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Wrapper for standart strip_tags() function with extra functionality for html entities
|
96 |
+
*
|
97 |
+
* @param string $data
|
98 |
+
* @param string $allowableTags
|
99 |
+
* @param bool $escape
|
100 |
+
* @return string
|
101 |
+
*/
|
102 |
+
public function stripTags($data, $allowableTags = null, $escape = false)
|
103 |
+
{
|
104 |
+
$result = strip_tags($data, $allowableTags);
|
105 |
+
return $escape ? $this->escapeHtml($result, $allowableTags) : $result;
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
}
|
110 |
+
|
app/code/community/Magpleasure/Guestbook/Model/Message.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Magpleasure_Guestbook_Model_Message extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
const STATUS_PENDING = 1;
|
6 |
+
const STATUS_APPROVED = 2;
|
7 |
+
const STATUS_REJECTED = 3;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Helper
|
11 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
12 |
+
*/
|
13 |
+
protected function _helper()
|
14 |
+
{
|
15 |
+
return Mage::helper('guestbook');
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function _construct()
|
19 |
+
{
|
20 |
+
$this->_init("guestbook/message");
|
21 |
+
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getOptionsArray()
|
25 |
+
{
|
26 |
+
return array(
|
27 |
+
self::STATUS_PENDING => $this->_helper()->__("Pending"),
|
28 |
+
self::STATUS_APPROVED => $this->_helper()->__("Approved"),
|
29 |
+
self::STATUS_REJECTED => $this->_helper()->__("Rejected"),
|
30 |
+
);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function toOptionArray()
|
34 |
+
{
|
35 |
+
$result = array();
|
36 |
+
foreach ($this->getOptionsArray() as $value=>$label){
|
37 |
+
$result[] = array('value'=>$value, 'label'=>$label);
|
38 |
+
}
|
39 |
+
return $result;
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
public function approve()
|
44 |
+
{
|
45 |
+
$this
|
46 |
+
->setSessionId(null)
|
47 |
+
->setStatus(self::STATUS_APPROVED)
|
48 |
+
->save();
|
49 |
+
return $this;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function reject()
|
53 |
+
{
|
54 |
+
$this
|
55 |
+
->setSessionId(null)
|
56 |
+
->setStatus(self::STATUS_REJECTED)
|
57 |
+
->save();
|
58 |
+
return $this;
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
protected function _prepareComment($message)
|
63 |
+
{
|
64 |
+
$message = html_entity_decode($message);
|
65 |
+
return strip_tags($message);
|
66 |
+
}
|
67 |
+
|
68 |
+
public function comment(array $data)
|
69 |
+
{
|
70 |
+
$this->addData($data);
|
71 |
+
$this->setStoreId(Mage::app()->getStore()->getId());
|
72 |
+
if ($this->_helper()->getCommentsAutoapprove()){
|
73 |
+
$this->setStatus(self::STATUS_APPROVED);
|
74 |
+
$this->setSessionId(null);
|
75 |
+
} else {
|
76 |
+
$this->setStatus(self::STATUS_PENDING);
|
77 |
+
}
|
78 |
+
$this->setMessage( $this->_prepareComment($data['message']) );
|
79 |
+
$this->save();
|
80 |
+
return $this;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function reply(array $data)
|
84 |
+
{
|
85 |
+
/** @var Magpleasure_Guestbook_Model_Message $message */
|
86 |
+
$message = Mage::getModel('guestbook/message');
|
87 |
+
$message->setReplyTo($this->getId());
|
88 |
+
$message->comment($data);
|
89 |
+
return $message;
|
90 |
+
}
|
91 |
+
|
92 |
+
}
|
93 |
+
|
app/code/community/Magpleasure/Guestbook/Model/Mysql4/Message.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Magpleasure_Guestbook_Model_Mysql4_Message extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Zend_Date date format for Mysql requests
|
6 |
+
*/
|
7 |
+
const MYSQL_ZEND_DATE_FORMAT = 'yyyy-MM-dd HH:mm:ss';
|
8 |
+
|
9 |
+
|
10 |
+
protected function _construct()
|
11 |
+
{
|
12 |
+
$this->_init("guestbook/message", "message_id");
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _beforeSave(Mage_Core_Model_Abstract $object)
|
16 |
+
{
|
17 |
+
parent::_beforeSave($object);
|
18 |
+
$now = new Zend_Date();
|
19 |
+
$now = $now->toString(self::MYSQL_ZEND_DATE_FORMAT);
|
20 |
+
if (!$object->getId()){
|
21 |
+
$object->setCreatedAt($now);
|
22 |
+
}
|
23 |
+
$object->setUpdatedAt($now);
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
|
app/code/community/Magpleasure/Guestbook/Model/Mysql4/Message/Collection.php
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Model_Mysql4_Message_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
19 |
+
{
|
20 |
+
|
21 |
+
public function _construct()
|
22 |
+
{
|
23 |
+
$this->_init("guestbook/message");
|
24 |
+
}
|
25 |
+
|
26 |
+
public function addStoreFilter($storeId)
|
27 |
+
{
|
28 |
+
$this->getSelect()
|
29 |
+
->where("main_table.store_id = ?", $storeId)
|
30 |
+
;
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function addActiveFilter($ownerSessionId = null)
|
35 |
+
{
|
36 |
+
if ($ownerSessionId){
|
37 |
+
$activeStatus = Magpleasure_Guestbook_Model_Message::STATUS_APPROVED;
|
38 |
+
$pendingStatus = Magpleasure_Guestbook_Model_Message::STATUS_PENDING;
|
39 |
+
$this->getSelect()
|
40 |
+
->where(new Zend_Db_Expr("(main_table.status = '{$activeStatus}') OR ((main_table.status = '{$pendingStatus}') AND (main_table.session_id = '$ownerSessionId'))"))
|
41 |
+
;
|
42 |
+
|
43 |
+
|
44 |
+
} else {
|
45 |
+
$this->addFieldToFilter('main_table.status', Magpleasure_Guestbook_Model_Message::STATUS_APPROVED);
|
46 |
+
}
|
47 |
+
return $this;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function addReplyTo()
|
51 |
+
{
|
52 |
+
$this->getSelect()
|
53 |
+
->joinLeft(array('replied'=>$this->getMainTable()), "replied.message_id = main_table.reply_to", array('reply_to_text'=>'replied.message'))
|
54 |
+
;
|
55 |
+
return $this;
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
public function addReplyToTextFilter($filter)
|
60 |
+
{
|
61 |
+
$this->getSelect()
|
62 |
+
->where("replied.message LIKE ('%{$filter}%')")
|
63 |
+
;
|
64 |
+
return $this;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
public function addMessageTextFilter($filter)
|
69 |
+
{
|
70 |
+
$this->getSelect()
|
71 |
+
->where("main_table.message LIKE ('%{$filter}%')")
|
72 |
+
;
|
73 |
+
return $this;
|
74 |
+
}
|
75 |
+
|
76 |
+
public function setDateOrder($dir = 'ASC')
|
77 |
+
{
|
78 |
+
$this->getSelect()
|
79 |
+
->order("main_table.created_at {$dir}");
|
80 |
+
return $this;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function setNotReplies()
|
84 |
+
{
|
85 |
+
$this->getSelect()
|
86 |
+
->where("main_table.reply_to IS NULL")
|
87 |
+
;
|
88 |
+
return $this;
|
89 |
+
}
|
90 |
+
|
91 |
+
public function setReplyToFilter($commentId)
|
92 |
+
{
|
93 |
+
$this->getSelect()
|
94 |
+
->where("main_table.reply_to = ?", $commentId)
|
95 |
+
;
|
96 |
+
return $this;
|
97 |
+
}
|
98 |
+
|
99 |
+
public function addStatusFilter($ststusId)
|
100 |
+
{
|
101 |
+
$this->getSelect()
|
102 |
+
->where("main_table.status = ?", $ststusId)
|
103 |
+
;
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
app/code/community/Magpleasure/Guestbook/controllers/Adminhtml/MessageController.php
ADDED
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_Adminhtml_MessageController extends Mage_Adminhtml_Controller_Action
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Helper
|
22 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
23 |
+
*/
|
24 |
+
protected function _helper()
|
25 |
+
{
|
26 |
+
return Mage::helper('guestbook');
|
27 |
+
}
|
28 |
+
|
29 |
+
protected function _initAction()
|
30 |
+
{
|
31 |
+
$this->loadLayout()
|
32 |
+
->_setActiveMenu('catalog/guestbook')
|
33 |
+
->_addBreadcrumb($this->_helper()->__('Guestbook'), $this->_helper()->__('Guestbook'));
|
34 |
+
return $this;
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
public function indexAction()
|
39 |
+
{
|
40 |
+
$this->_initAction()
|
41 |
+
->renderLayout();
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
public function editAction()
|
46 |
+
{
|
47 |
+
$id = $this->getRequest()->getParam('id');
|
48 |
+
$comment = Mage::getModel('guestbook/message');
|
49 |
+
if ($id){
|
50 |
+
$comment->load($id);
|
51 |
+
}
|
52 |
+
|
53 |
+
$this->loadLayout();
|
54 |
+
$this->_setActiveMenu('catalog/guestbook/comment');
|
55 |
+
|
56 |
+
if ($comment->getId()){
|
57 |
+
|
58 |
+
Mage::register('current_comment', $comment);
|
59 |
+
$data = Mage::getSingleton('adminhtml/session')->getPostData(true);
|
60 |
+
if (!empty($data)) {
|
61 |
+
$comment->setData($data);
|
62 |
+
}
|
63 |
+
|
64 |
+
$this->_addBreadcrumb($this->_helper()->__('Guest Book'), $this->_helper()->__('Guest Book'));
|
65 |
+
$this->_addBreadcrumb($this->_helper()->__('Comment'), $this->_helper()->__('Comment'));
|
66 |
+
|
67 |
+
} else {
|
68 |
+
$this->_getSession()->addError($this->_helper()->__('Comment is not exists.'));
|
69 |
+
$this->_redirect('*/*/index');
|
70 |
+
}
|
71 |
+
|
72 |
+
$this->renderLayout();
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
public function saveAction()
|
77 |
+
{
|
78 |
+
$requestPost = $this->getRequest()->getPost();
|
79 |
+
$comment = Mage::getModel('guestbook/message');
|
80 |
+
if ($id = $this->getRequest()->getParam('id')){
|
81 |
+
$comment->load($id);
|
82 |
+
}
|
83 |
+
|
84 |
+
try {
|
85 |
+
$comment->addData($requestPost);
|
86 |
+
$comment->save();
|
87 |
+
$this->_getSession()->addSuccess($this->_helper()->__("Comment was successfully saved."));
|
88 |
+
|
89 |
+
if ($this->getRequest()->getParam('back')){
|
90 |
+
$this->_redirect('*/*/edit', array('id'=> $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : $comment->getId() ));
|
91 |
+
} else {
|
92 |
+
$this->_redirect('*/*/index');
|
93 |
+
}
|
94 |
+
|
95 |
+
} catch (Exception $e) {
|
96 |
+
Mage::getSingleton('adminhtml/session')->setPostData($requestPost);
|
97 |
+
$this->_getSession()->addError($this->_helper()->__("Error while saving the comment (%s).", $e->getMessage()));
|
98 |
+
$this->_redirectReferer();
|
99 |
+
}
|
100 |
+
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Delete comment
|
105 |
+
* @param int|string $id
|
106 |
+
* @return boolean
|
107 |
+
*/
|
108 |
+
protected function _delete($id)
|
109 |
+
{
|
110 |
+
$comment = Mage::getModel('guestbook/message')->load($id);
|
111 |
+
if ($comment->getId()){
|
112 |
+
try{
|
113 |
+
$comment->delete();
|
114 |
+
return true;
|
115 |
+
} catch(Exception $e) {
|
116 |
+
return false;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
return false;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Approve comment
|
124 |
+
* @param int|string $id
|
125 |
+
* @return boolean
|
126 |
+
*/
|
127 |
+
protected function _approve($id)
|
128 |
+
{
|
129 |
+
$comment = Mage::getModel('guestbook/message')->load($id);
|
130 |
+
if ($comment->getId()){
|
131 |
+
try{
|
132 |
+
$comment->approve();
|
133 |
+
return true;
|
134 |
+
} catch(Exception $e) {
|
135 |
+
return false;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
return false;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Reject comment
|
143 |
+
* @param int|string $id
|
144 |
+
* @return boolean
|
145 |
+
*/
|
146 |
+
protected function _reject($id)
|
147 |
+
{
|
148 |
+
$comment = Mage::getModel('guestbook/message')->load($id);
|
149 |
+
if ($comment->getId()){
|
150 |
+
try{
|
151 |
+
$comment->reject();
|
152 |
+
return true;
|
153 |
+
} catch(Exception $e) {
|
154 |
+
return false;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
return false;
|
158 |
+
}
|
159 |
+
|
160 |
+
protected function _updateStatus($id, $status)
|
161 |
+
{
|
162 |
+
if ($id){
|
163 |
+
try {
|
164 |
+
$comment = Mage::getModel('guestbook/message')->load($id);
|
165 |
+
$comment->setStatus($status);
|
166 |
+
$comment->save();
|
167 |
+
return true;
|
168 |
+
} catch (Exception $e){
|
169 |
+
return false;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
public function massStatusAction()
|
175 |
+
{
|
176 |
+
$comments = $this->getRequest()->getPost('comments');
|
177 |
+
$status = $this->getRequest()->getPost('status');
|
178 |
+
if ($comments){
|
179 |
+
$success = 0;
|
180 |
+
$error = 0;
|
181 |
+
foreach ($comments as $commentId){
|
182 |
+
if ($this->_updateStatus($commentId, $status)){
|
183 |
+
$success++;
|
184 |
+
} else {
|
185 |
+
$error++;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
if ($success){
|
189 |
+
$this->_getSession()->addSuccess($this->_helper()->__("%s comments successfully updated.", $success));
|
190 |
+
}
|
191 |
+
if ($error){
|
192 |
+
$this->_getSession()->addError($this->_helper()->__("%s comments was not updated.", $error));
|
193 |
+
}
|
194 |
+
}
|
195 |
+
$this->_redirectReferer();
|
196 |
+
}
|
197 |
+
|
198 |
+
public function massDeleteAction()
|
199 |
+
{
|
200 |
+
$comments = $this->getRequest()->getPost('comments');
|
201 |
+
if ($comments){
|
202 |
+
$success = 0;
|
203 |
+
$error = 0;
|
204 |
+
foreach ($comments as $commentId){
|
205 |
+
if ($this->_delete($commentId)){
|
206 |
+
$success++;
|
207 |
+
} else {
|
208 |
+
$error++;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
if ($success){
|
212 |
+
$this->_getSession()->addSuccess($this->_helper()->__("%s comments successfully deleted.", $success));
|
213 |
+
}
|
214 |
+
if ($error){
|
215 |
+
$this->_getSession()->addError($this->_helper()->__("%s comments was not deleted.", $error));
|
216 |
+
}
|
217 |
+
}
|
218 |
+
$this->_redirectReferer();
|
219 |
+
}
|
220 |
+
|
221 |
+
public function approveAction()
|
222 |
+
{
|
223 |
+
$id = $this->getRequest()->getParam('id');
|
224 |
+
if ($id){
|
225 |
+
try {
|
226 |
+
$this->_approve($id);
|
227 |
+
$this->_getSession()->addSuccess($this->_helper()->__("Comment was successfully approved."));
|
228 |
+
} catch (Exception $e){
|
229 |
+
$this->_getSession()->addError($this->_helper()->__("Comment was not approved (%s).", $e->getMessage()));
|
230 |
+
$this->_redirectReferer();
|
231 |
+
return;
|
232 |
+
}
|
233 |
+
}
|
234 |
+
$this->_redirect('*/*/index');
|
235 |
+
}
|
236 |
+
|
237 |
+
public function rejectAction()
|
238 |
+
{
|
239 |
+
$id = $this->getRequest()->getParam('id');
|
240 |
+
if ($id){
|
241 |
+
try {
|
242 |
+
$this->_reject($id);
|
243 |
+
$this->_getSession()->addSuccess($this->_helper()->__("Comment was successfully rejected."));
|
244 |
+
} catch (Exception $e){
|
245 |
+
$this->_getSession()->addError($this->_helper()->__("Comment was not rejected (%s).", $e->getMessage()));
|
246 |
+
$this->_redirectReferer();
|
247 |
+
return;
|
248 |
+
}
|
249 |
+
}
|
250 |
+
$this->_redirect('*/*/index');
|
251 |
+
}
|
252 |
+
|
253 |
+
public function deleteAction()
|
254 |
+
{
|
255 |
+
$id = $this->getRequest()->getParam('id');
|
256 |
+
if ($id){
|
257 |
+
try {
|
258 |
+
$this->_delete($id);
|
259 |
+
$this->_getSession()->addSuccess($this->_helper()->__("Comment was successfully deleted."));
|
260 |
+
} catch (Exception $e){
|
261 |
+
$this->_getSession()->addError($this->_helper()->__("Comment was not deleted (%s).", $e->getMessage()));
|
262 |
+
$this->_redirectReferer();
|
263 |
+
return;
|
264 |
+
}
|
265 |
+
}
|
266 |
+
$this->_redirect('*/*/index');
|
267 |
+
}
|
268 |
+
|
269 |
+
|
270 |
+
public function gridAction()
|
271 |
+
{
|
272 |
+
$grid = $this->getLayout()->createBlock('guestbook/adminhtml_message_grid');
|
273 |
+
if ($grid){
|
274 |
+
$this->getResponse()->setBody($grid->toHtml());
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
}
|
app/code/community/Magpleasure/Guestbook/controllers/IndexController.php
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
class Magpleasure_Guestbook_IndexController extends Mage_Core_Controller_Front_Action
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Helper
|
22 |
+
*
|
23 |
+
* @return Magpleasure_Guestbook_Helper_Data
|
24 |
+
*/
|
25 |
+
public function _helper()
|
26 |
+
{
|
27 |
+
return Mage::helper('guestbook');
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Response for Ajax Request
|
32 |
+
*
|
33 |
+
* @param array $result
|
34 |
+
*/
|
35 |
+
protected function _ajaxResponse($result = array())
|
36 |
+
{
|
37 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
38 |
+
}
|
39 |
+
|
40 |
+
public function indexAction()
|
41 |
+
{
|
42 |
+
$this->loadLayout()->renderLayout();
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
protected function _getMessageBlockHtml()
|
47 |
+
{
|
48 |
+
return $this->getLayout()->getMessagesBlock()->addMessages($this->_getCustomerSession()->getMessages(true))->toHtml();
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Customer Session
|
53 |
+
*
|
54 |
+
* @return Mage_Customer_Model_Session
|
55 |
+
*/
|
56 |
+
protected function _getCustomerSession()
|
57 |
+
{
|
58 |
+
return Mage::getSingleton('customer/session');
|
59 |
+
}
|
60 |
+
|
61 |
+
public function formAction()
|
62 |
+
{
|
63 |
+
$result = array();
|
64 |
+
$error = false;
|
65 |
+
|
66 |
+
$replyTo = $this->getRequest()->getParam('reply_to');
|
67 |
+
|
68 |
+
if (!is_null($replyTo)){
|
69 |
+
$comment = Mage::getModel('guestbook/message')->load($replyTo);
|
70 |
+
}
|
71 |
+
|
72 |
+
/** @var Magpleasure_Guestbook_Block_Comments_Form $form */
|
73 |
+
$form = $this->getLayout()->createBlock('guestbook/comments_form');
|
74 |
+
if ($form){
|
75 |
+
|
76 |
+
if (isset($comment) && $comment->getId()){
|
77 |
+
$form->setReplyTo($comment);
|
78 |
+
}
|
79 |
+
|
80 |
+
$form->setSecureCode($this->_helper()->_secure()->getSecureCode($replyTo));
|
81 |
+
$result['form'] = $form->toHtml();
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
if ($error){
|
86 |
+
$result['error'] = 1;
|
87 |
+
$result['message'] = $this->_getMessageBlockHtml();
|
88 |
+
}
|
89 |
+
$this->_ajaxResponse($result);
|
90 |
+
}
|
91 |
+
|
92 |
+
public function postFormAction()
|
93 |
+
{
|
94 |
+
$result = array();
|
95 |
+
$error = false;
|
96 |
+
|
97 |
+
$post = new Varien_Object($this->getRequest()->getPost());
|
98 |
+
|
99 |
+
$replyTo = $post->getReplyTo();
|
100 |
+
$secureCode = $post->getSecureCode();
|
101 |
+
|
102 |
+
if ($this->_helper()->_secure()->validate($secureCode, $replyTo)){
|
103 |
+
$newComment = null;
|
104 |
+
if ($replyTo){
|
105 |
+
/** @var Magpleasure_Guestbook_Model_Message $comment */
|
106 |
+
$comment = Mage::getModel('guestbook/message')->load($replyTo);
|
107 |
+
if ($comment->getId()){
|
108 |
+
$newComment = $comment->reply($post->getData());
|
109 |
+
}
|
110 |
+
|
111 |
+
} else {
|
112 |
+
$post->unsetData('reply_to');
|
113 |
+
/** @var Magpleasure_Guestbook_Model_Message $comment */
|
114 |
+
$comment = Mage::getModel('guestbook/message');
|
115 |
+
$newComment = $comment->comment($post->getData());
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
if ($newComment){
|
120 |
+
/** @var Magpleasure_Guestbook_Block_Comments_Message $message */
|
121 |
+
$message = $this->getLayout()->createBlock('guestbook/comments_message');
|
122 |
+
if ($message){
|
123 |
+
$message->setMessage($newComment);
|
124 |
+
$message->setIsAjax(true);
|
125 |
+
$result['message'] = $message->toHtml();
|
126 |
+
$result['comment_id'] = $newComment->getId();
|
127 |
+
$result['count_code'] = $message->getCountCode();
|
128 |
+
}
|
129 |
+
} else {
|
130 |
+
$error = 1;
|
131 |
+
$this->_getCustomerSession()->addError($this->_helper()->__("Can not create post."));
|
132 |
+
}
|
133 |
+
|
134 |
+
} else {
|
135 |
+
$error = 1;
|
136 |
+
$this->_getCustomerSession()->addError($this->_helper()->__("Your session is expired. Please refresh this page and try again. "));
|
137 |
+
}
|
138 |
+
|
139 |
+
if ($error){
|
140 |
+
$result['error'] = 1;
|
141 |
+
|
142 |
+
/** @var Magpleasure_Guestbook_Block_Comments_Form $form */
|
143 |
+
$form = $this->getLayout()->createBlock('guestbook/comments_form');
|
144 |
+
if ($form){
|
145 |
+
if ($replyTo){
|
146 |
+
/** @var Magpleasure_Guestbook_Model_Message $comment */
|
147 |
+
$replyTo = Mage::getModel('guestbook/message')->load($replyTo);
|
148 |
+
$form->setReplyTo($replyTo);
|
149 |
+
}
|
150 |
+
$form->setIsAjax(true);
|
151 |
+
$form->setFormData($post->getData());
|
152 |
+
$form->setSecureCode($this->_helper()->_secure()->getSecureCode($postId, $replyTo));
|
153 |
+
$result['form'] = $form->toHtml();
|
154 |
+
}
|
155 |
+
|
156 |
+
}
|
157 |
+
|
158 |
+
$this->_ajaxResponse($result);
|
159 |
+
}
|
160 |
+
|
161 |
+
}
|
app/code/community/Magpleasure/Guestbook/etc/adminhtml.xml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<catalog>
|
5 |
+
<children>
|
6 |
+
<guestbook module="guestbook">
|
7 |
+
<title>Guest Book</title>
|
8 |
+
<sort_order>100</sort_order>
|
9 |
+
<children>
|
10 |
+
<message module="guestbook">
|
11 |
+
<title>Comments</title>
|
12 |
+
<sort_order>10</sort_order>
|
13 |
+
<action>guestbook_admin/adminhtml_message</action>
|
14 |
+
</message>
|
15 |
+
<config module="guestbook">
|
16 |
+
<title>Configuration</title>
|
17 |
+
<sort_order>20</sort_order>
|
18 |
+
<action>adminhtml/system_config/edit/section/guestbook/</action>
|
19 |
+
</config>
|
20 |
+
</children>
|
21 |
+
</guestbook>
|
22 |
+
</children>
|
23 |
+
</catalog>
|
24 |
+
</menu>
|
25 |
+
<acl>
|
26 |
+
<resources>
|
27 |
+
<all>
|
28 |
+
<title>Allow Everything</title>
|
29 |
+
</all>
|
30 |
+
<admin>
|
31 |
+
<children>
|
32 |
+
<system>
|
33 |
+
<children>
|
34 |
+
<config>
|
35 |
+
<children>
|
36 |
+
<guestbook>
|
37 |
+
<title>MagPleasure - Guest Book</title>
|
38 |
+
</guestbook>
|
39 |
+
</children>
|
40 |
+
</config>
|
41 |
+
</children>
|
42 |
+
</system>
|
43 |
+
<catalog>
|
44 |
+
<children>
|
45 |
+
<guestbook module="guestbook">
|
46 |
+
<title>MagPleasure - Guest Book</title>
|
47 |
+
<sort_order>100</sort_order>
|
48 |
+
<children>
|
49 |
+
<message module="guestbook">
|
50 |
+
<title>Comments</title>
|
51 |
+
<sort_order>10</sort_order>
|
52 |
+
</message>
|
53 |
+
</children>
|
54 |
+
</guestbook>
|
55 |
+
</children>
|
56 |
+
</catalog>
|
57 |
+
</children>
|
58 |
+
</admin>
|
59 |
+
</resources>
|
60 |
+
</acl>
|
61 |
+
<layout>
|
62 |
+
<updates>
|
63 |
+
<guestbook>
|
64 |
+
<file>guestbook.xml</file>
|
65 |
+
</guestbook>
|
66 |
+
</updates>
|
67 |
+
</layout>
|
68 |
+
<translate>
|
69 |
+
<modules>
|
70 |
+
<Magpleasure_Guestbook>
|
71 |
+
<files>
|
72 |
+
<default>Magpleasure_Guestbook.csv</default>
|
73 |
+
</files>
|
74 |
+
</Magpleasure_Guestbook>
|
75 |
+
</modules>
|
76 |
+
</translate>
|
77 |
+
</config>
|
app/code/community/Magpleasure/Guestbook/etc/config.xml
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Magpleasure_Guestbook>
|
5 |
+
<version>1.0</version>
|
6 |
+
</Magpleasure_Guestbook>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<guestbook>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Magpleasure_Guestbook</module>
|
14 |
+
<frontName>guestbook</frontName>
|
15 |
+
</args>
|
16 |
+
</guestbook>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<guestbook>
|
21 |
+
<file>guestbook.xml</file>
|
22 |
+
</guestbook>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
<translate>
|
26 |
+
<modules>
|
27 |
+
<Magpleasure_Guestbook>
|
28 |
+
<files>
|
29 |
+
<default>Magpleasure_Guestbook.csv</default>
|
30 |
+
</files>
|
31 |
+
</Magpleasure_Guestbook>
|
32 |
+
</modules>
|
33 |
+
</translate>
|
34 |
+
</frontend>
|
35 |
+
<global>
|
36 |
+
<helpers>
|
37 |
+
<guestbook>
|
38 |
+
<class>Magpleasure_Guestbook_Helper</class>
|
39 |
+
</guestbook>
|
40 |
+
</helpers>
|
41 |
+
|
42 |
+
<blocks>
|
43 |
+
<guestbook>
|
44 |
+
<class>Magpleasure_Guestbook_Block</class>
|
45 |
+
</guestbook>
|
46 |
+
</blocks>
|
47 |
+
<models>
|
48 |
+
<guestbook>
|
49 |
+
<class>Magpleasure_Guestbook_Model</class>
|
50 |
+
<resourceModel>guestbook_mysql4</resourceModel>
|
51 |
+
</guestbook>
|
52 |
+
<guestbook_mysql4>
|
53 |
+
<class>Magpleasure_Guestbook_Model_Mysql4</class>
|
54 |
+
<entities>
|
55 |
+
<message>
|
56 |
+
<table>mp_gb_messages</table>
|
57 |
+
</message>
|
58 |
+
</entities>
|
59 |
+
</guestbook_mysql4>
|
60 |
+
</models>
|
61 |
+
<resources>
|
62 |
+
<guestbook_setup>
|
63 |
+
<setup>
|
64 |
+
<module>Magpleasure_Guestbook</module>
|
65 |
+
</setup>
|
66 |
+
<connection>
|
67 |
+
<use>core_setup</use>
|
68 |
+
</connection>
|
69 |
+
</guestbook_setup>
|
70 |
+
<guestbook_write>
|
71 |
+
<connection>
|
72 |
+
<use>core_write</use>
|
73 |
+
</connection>
|
74 |
+
</guestbook_write>
|
75 |
+
<guestbook_read>
|
76 |
+
<connection>
|
77 |
+
<use>core_read</use>
|
78 |
+
</connection>
|
79 |
+
</guestbook_read>
|
80 |
+
</resources>
|
81 |
+
</global>
|
82 |
+
<admin>
|
83 |
+
<routers>
|
84 |
+
<guestbook_admin>
|
85 |
+
<use>admin</use>
|
86 |
+
<args>
|
87 |
+
<module>Magpleasure_Guestbook</module>
|
88 |
+
<frontName>guestbook_admin</frontName>
|
89 |
+
</args>
|
90 |
+
</guestbook_admin>
|
91 |
+
</routers>
|
92 |
+
</admin>
|
93 |
+
<adminhtml>
|
94 |
+
<menu>
|
95 |
+
<catalog>
|
96 |
+
<children>
|
97 |
+
<guestbook module="guestbook">
|
98 |
+
<title>Guest Book</title>
|
99 |
+
<sort_order>100</sort_order>
|
100 |
+
<children>
|
101 |
+
<message module="guestbook">
|
102 |
+
<title>Comments</title>
|
103 |
+
<sort_order>10</sort_order>
|
104 |
+
<action>guestbook_admin/adminhtml_message</action>
|
105 |
+
</message>
|
106 |
+
<config module="guestbook">
|
107 |
+
<title>Configuration</title>
|
108 |
+
<sort_order>20</sort_order>
|
109 |
+
<action>adminhtml/system_config/edit/section/guestbook/</action>
|
110 |
+
</config>
|
111 |
+
</children>
|
112 |
+
</guestbook>
|
113 |
+
</children>
|
114 |
+
</catalog>
|
115 |
+
</menu>
|
116 |
+
<acl>
|
117 |
+
<resources>
|
118 |
+
<all>
|
119 |
+
<title>Allow Everything</title>
|
120 |
+
</all>
|
121 |
+
<admin>
|
122 |
+
<children>
|
123 |
+
<system>
|
124 |
+
<children>
|
125 |
+
<config>
|
126 |
+
<children>
|
127 |
+
<guestbook>
|
128 |
+
<title>MagPleasure - Guest Book</title>
|
129 |
+
</guestbook>
|
130 |
+
</children>
|
131 |
+
</config>
|
132 |
+
</children>
|
133 |
+
</system>
|
134 |
+
<catalog>
|
135 |
+
<children>
|
136 |
+
<guestbook module="guestbook">
|
137 |
+
<title>MagPleasure - Guest Book</title>
|
138 |
+
<sort_order>100</sort_order>
|
139 |
+
<children>
|
140 |
+
<message module="guestbook">
|
141 |
+
<title>Comments</title>
|
142 |
+
<sort_order>10</sort_order>
|
143 |
+
</message>
|
144 |
+
</children>
|
145 |
+
</guestbook>
|
146 |
+
</children>
|
147 |
+
</catalog>
|
148 |
+
</children>
|
149 |
+
</admin>
|
150 |
+
</resources>
|
151 |
+
</acl>
|
152 |
+
<layout>
|
153 |
+
<updates>
|
154 |
+
<guestbook>
|
155 |
+
<file>guestbook.xml</file>
|
156 |
+
</guestbook>
|
157 |
+
</updates>
|
158 |
+
</layout>
|
159 |
+
<translate>
|
160 |
+
<modules>
|
161 |
+
<Magpleasure_Guestbook>
|
162 |
+
<files>
|
163 |
+
<default>Magpleasure_Guestbook.csv</default>
|
164 |
+
</files>
|
165 |
+
</Magpleasure_Guestbook>
|
166 |
+
</modules>
|
167 |
+
</translate>
|
168 |
+
</adminhtml>
|
169 |
+
<default>
|
170 |
+
<guestbook>
|
171 |
+
<menu>
|
172 |
+
<enabled>1</enabled>
|
173 |
+
<label>Guest Book</label>
|
174 |
+
<position>8</position>
|
175 |
+
</menu>
|
176 |
+
<messages>
|
177 |
+
<allow_guests>1</allow_guests>
|
178 |
+
<record_per_page>10</record_per_page>
|
179 |
+
</messages>
|
180 |
+
</guestbook>
|
181 |
+
</default>
|
182 |
+
</config>
|
app/code/community/Magpleasure/Guestbook/etc/system.xml
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<magpleasure translate="label" module="guestbook">
|
5 |
+
<label>MagPleasure Extensions</label>
|
6 |
+
<sort_order>300</sort_order>
|
7 |
+
</magpleasure>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<guestbook module="guestbook" translate="label">
|
11 |
+
<label>Guest Book</label>
|
12 |
+
<tab>magpleasure</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>670</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<menu>
|
20 |
+
<label>Menu Integration</label>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<show_in_website>1</show_in_website>
|
23 |
+
<show_in_store>1</show_in_store>
|
24 |
+
<sort_order>10</sort_order>
|
25 |
+
<fields>
|
26 |
+
<enabled translate="label">
|
27 |
+
<label>Enabled</label>
|
28 |
+
<frontend_type>select</frontend_type>
|
29 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
30 |
+
<sort_order>10</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
</enabled>
|
35 |
+
<label translate="label">
|
36 |
+
<label>Label</label>
|
37 |
+
<frontend_type>text</frontend_type>
|
38 |
+
<sort_order>20</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
</label>
|
43 |
+
<position translate="label">
|
44 |
+
<label>Position</label>
|
45 |
+
<frontend_type>text</frontend_type>
|
46 |
+
<sort_order>30</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<show_in_store>1</show_in_store>
|
50 |
+
</position>
|
51 |
+
</fields>
|
52 |
+
</menu>
|
53 |
+
<messages>
|
54 |
+
<label>Message Configuration</label>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<sort_order>40</sort_order>
|
59 |
+
<fields>
|
60 |
+
<autoapprove translate="label">
|
61 |
+
<label>Automatical Approving</label>
|
62 |
+
<frontend_type>select</frontend_type>
|
63 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
64 |
+
<sort_order>20</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
</autoapprove>
|
69 |
+
<allow_guests translate="label">
|
70 |
+
<label>Allow Guests</label>
|
71 |
+
<frontend_type>select</frontend_type>
|
72 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
73 |
+
<sort_order>30</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
</allow_guests>
|
78 |
+
<record_per_page translate="label">
|
79 |
+
<label>Records per Page</label>
|
80 |
+
<frontend_type>text</frontend_type>
|
81 |
+
<sort_order>40</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 |
+
</record_per_page>
|
86 |
+
</fields>
|
87 |
+
</messages>
|
88 |
+
</groups>
|
89 |
+
</guestbook>
|
90 |
+
</sections>
|
91 |
+
</config>
|
app/code/community/Magpleasure/Guestbook/sql/guestbook_setup/mysql4-install-1.0.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
$installer = $this;
|
19 |
+
$installer->startSetup();
|
20 |
+
$installer->run("
|
21 |
+
|
22 |
+
DROP TABLE IF EXISTS {$this->getTable('mp_gb_messages')};
|
23 |
+
|
24 |
+
CREATE TABLE IF NOT EXISTS {$this->getTable('mp_gb_messages')}(
|
25 |
+
`message_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
26 |
+
`store_id` SMALLINT(5) UNSIGNED NOT NULL,
|
27 |
+
`reply_to` BIGINT UNSIGNED,
|
28 |
+
`customer_id` INT(10) UNSIGNED,
|
29 |
+
`status` smallint(5) UNSIGNED NOT NULL,
|
30 |
+
`message` TEXT,
|
31 |
+
`name` VARCHAR(255),
|
32 |
+
`subject` VARCHAR(255),
|
33 |
+
`email` VARCHAR(255),
|
34 |
+
`session_id` VARCHAR(255),
|
35 |
+
`created_at` timestamp NOT NULL ,
|
36 |
+
`updated_at` timestamp NOT NULL ,
|
37 |
+
PRIMARY KEY (`message_id`),
|
38 |
+
INDEX (`session_id`),
|
39 |
+
INDEX `KEY_MPGUESTBOOK_COMMENTS_COMMENTS` (`reply_to`),
|
40 |
+
CONSTRAINT `KEY_MPGUESTBOOK_COMMENTS_COMMENTS` FOREIGN KEY (`reply_to`) REFERENCES `{$this->getTable('mp_gb_messages')}` (`message_id`) ON UPDATE CASCADE ON DELETE CASCADE
|
41 |
+
) ENGINE=INNODB CHARSET=utf8;
|
42 |
+
|
43 |
+
");
|
44 |
+
|
45 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/guestbook.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<guestbook_admin_adminhtml_message_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="guestbook/adminhtml_message" name="message"/>
|
6 |
+
</reference>
|
7 |
+
</guestbook_admin_adminhtml_message_index>
|
8 |
+
<guestbook_admin_adminhtml_message_edit>
|
9 |
+
<reference name="content">
|
10 |
+
<block type="guestbook/adminhtml_message_edit" name="mpblog_comment_edit" />
|
11 |
+
</reference>
|
12 |
+
<reference name="left">
|
13 |
+
<block type="guestbook/adminhtml_message_edit_tabs" name="guestbook_comment_edit_tabs">
|
14 |
+
<block type="guestbook/adminhtml_message_edit_tab_general" name="guestbook_comment_edit_tab_general" />
|
15 |
+
<action method="addTab"><name>general</name><block>guestbook_comment_edit_tab_general</block></action>
|
16 |
+
</block>
|
17 |
+
</reference>
|
18 |
+
</guestbook_admin_adminhtml_message_edit>
|
19 |
+
|
20 |
+
</layout>
|
app/design/frontend/default/default/layout/guestbook.xml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="1.0.0">
|
3 |
+
<default>
|
4 |
+
<reference name="top.links">
|
5 |
+
<block type="guestbook/menu_item" name="guestbook_item_top">
|
6 |
+
<action method="addGuestbookLink"></action>
|
7 |
+
</block>
|
8 |
+
</reference>
|
9 |
+
<reference name="footer_links">
|
10 |
+
<block type="guestbook/menu_item" name="guestbook_item_footer">
|
11 |
+
<action method="addGuestbookLink"></action>
|
12 |
+
</block>
|
13 |
+
</reference>
|
14 |
+
</default>
|
15 |
+
<guestbook_index_index>
|
16 |
+
<reference name="head">
|
17 |
+
<action method="addCss"><styles>guestbook/css/styles.css</styles></action>
|
18 |
+
<action method="addJs"><styles>guestbook/comments.js</styles></action>
|
19 |
+
<action method="addJs"><styles>scriptaculous/effects.js</styles></action>
|
20 |
+
<block type="mpblog/rss_wrapper" name="mpblog.rss.wrapper" as="mpblog_rss_wrapper" />
|
21 |
+
</reference>
|
22 |
+
|
23 |
+
<reference name="root">
|
24 |
+
<action method="setTemplate">
|
25 |
+
<template>page/1column.phtml</template>
|
26 |
+
</action>
|
27 |
+
</reference>
|
28 |
+
|
29 |
+
<reference name="content">
|
30 |
+
<block type="guestbook/comments" name="guestbook_comments" >
|
31 |
+
<block type="page/html_pager" name="guestbook_list_toolbar"/>
|
32 |
+
</block>
|
33 |
+
</reference>
|
34 |
+
</guestbook_index_index>
|
35 |
+
</layout>
|
36 |
+
|
app/design/frontend/default/default/template/guestbook/comments.phtml
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
|
18 |
+
/** @var Magpleasure_Guestbook_Model_Mysql4_Message_Collection $collection */
|
19 |
+
$collection = $this->getCollection();
|
20 |
+
?>
|
21 |
+
<div class="mp-guestbook">
|
22 |
+
<div class="messages-header">
|
23 |
+
<h1 class="mp-guestbook-header"><?php echo $this->escapeHtml($this->getHeader()); ?></h1>
|
24 |
+
<button class="leave-a-comment" value="<?php echo $this->__("Leave a Сomment"); ?>" onclick="guestbookComments.getForm('form', 0); return false;"><?php echo $this->__("Leave a Сomment"); ?></button>
|
25 |
+
<div class="fixed"></div>
|
26 |
+
</div>
|
27 |
+
<div class="guestbook-messages-livestream" id="livestream">
|
28 |
+
<?php if ($collection->getSize()): ?>
|
29 |
+
<?php foreach ($collection as $message): ?>
|
30 |
+
<?php echo $this->getMessageHtml($message); ?>
|
31 |
+
<?php endforeach; ?>
|
32 |
+
<?php else: ?>
|
33 |
+
<div class="no-comments" id="no_comments">
|
34 |
+
<?php echo $this->__("There are no comments."); ?>
|
35 |
+
</div>
|
36 |
+
<?php endif; ?>
|
37 |
+
<div class="mp-comment-form" id="form" style="display: none;"></div>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div id="guestbook_loader_container" style="display: none;">
|
41 |
+
<div class="mp-blog-loader"></div>
|
42 |
+
</div>
|
43 |
+
<div class="messages-footer">
|
44 |
+
<button class="leave-a-comment" value="<?php echo $this->__("Leave a Сomment"); ?>" onclick="guestbookComments.getForm('form', 0); return false;"><?php echo $this->__("Leave a Сomment"); ?></button>
|
45 |
+
<div class="fixed"></div>
|
46 |
+
</div>
|
47 |
+
<?php echo $this->getToolbarHtml(); ?>
|
48 |
+
<script type="text/javascript">
|
49 |
+
var guestbookComments = new MpGuestbookComments({
|
50 |
+
form_selector: '.mp-comment-form',
|
51 |
+
loader_container: 'guestbook_loader_container',
|
52 |
+
form_url: '<?php echo $this->getFormUrl() ?>',
|
53 |
+
post_url: '<?php echo $this->getPostUrl() ?>',
|
54 |
+
messages_counter: 'messages_counter',
|
55 |
+
no_comments: 'no_comments'
|
56 |
+
});
|
57 |
+
</script>
|
58 |
+
|
59 |
+
</div>
|
app/design/frontend/default/default/template/guestbook/comments/form.phtml
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
?>
|
18 |
+
<?php if ($this->canPost()): ?>
|
19 |
+
<?php if ($this->isReply()): ?>
|
20 |
+
<h3><?php echo $this->__('Leave a Reply'); ?></h3>
|
21 |
+
<?php else: ?>
|
22 |
+
<h3><?php echo $this->__('Leave a Comment'); ?></h3>
|
23 |
+
<?php endif; ?>
|
24 |
+
<?php if ($this->getIsAjax()): ?>
|
25 |
+
<?php echo $this->getMessageBlockHtml(); ?>
|
26 |
+
<?php endif; ?>
|
27 |
+
<form id="mp-guestbook-form" onsubmit="guestbookComments.submitForm(); return false;">
|
28 |
+
<fieldset>
|
29 |
+
<div class="comment-form-field">
|
30 |
+
<label title="<?php echo $this->__('Name') ?>" for="name_field"<?php if ($this->htmlEscape($this->getFormData()->getName() ? $this->getFormData()->getName() : $this->getCustomerName())): ?> style="display: none;"<?php endif; ?>>
|
31 |
+
<?php echo $this->__('Name') ?>
|
32 |
+
<span class="mp-required"><?php echo $this->__("(required)"); ?></span>
|
33 |
+
</label>
|
34 |
+
<div class="comment-form-input">
|
35 |
+
<input type="text" name="name" id="name_field" title="<?php echo $this->__('Name') ?>" class="required-entry" value="<?php echo $this->htmlEscape($this->getFormData()->getName() ? $this->getFormData()->getName() : $this->getCustomerName()) ?>" />
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
<?php if (!$this->isLoggedId()): ?>
|
39 |
+
<div class="comment-form-field">
|
40 |
+
<label title="<?php echo $this->__('Email') ?>" for="email_field"<?php if ($this->htmlEscape($this->getFormData()->getEmail())): ?> style="display: none;"<?php endif; ?>>
|
41 |
+
<?php echo $this->__('Email') ?>
|
42 |
+
<span class="mp-required"><?php echo $this->__("(required)"); ?></span>
|
43 |
+
<span class="mp-private"><?php echo $this->__("(Not published)"); ?></span>
|
44 |
+
</label>
|
45 |
+
<div class="comment-form-input">
|
46 |
+
<input type="text" name="email" id="email_field" class="required-entry validate-email" title="<?php echo $this->__('Email') ?>" value="<?php echo $this->htmlEscape($this->getFormData()->getEmail()) ?>" />
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
<?php else: ?>
|
50 |
+
<input type="hidden" name="email" value="<?php echo $this->getCustomerEmail(); ?>" />
|
51 |
+
<input type="hidden" name="customer_id" value="<?php echo $this->getCustomerId(); ?>" />
|
52 |
+
<?php endif; ?>
|
53 |
+
<?php if (!$this->isReply()): ?>
|
54 |
+
<div class="comment-form-field">
|
55 |
+
<label title="<?php echo $this->__('Subject') ?>" for="subject"<?php if ($this->htmlEscape($this->getFormData()->getSubject() ? $this->getFormData()->getSubject() : '')): ?> style="display: none;"<?php endif; ?>>
|
56 |
+
<?php echo $this->__('Subject') ?>
|
57 |
+
<span class="mp-required"><?php echo $this->__("(required)"); ?></span>
|
58 |
+
</label>
|
59 |
+
<div class="comment-form-input">
|
60 |
+
<input type="text" name="subject" id="subject" title="<?php echo $this->__('Subject') ?>" class="required-entry" value="<?php echo $this->htmlEscape($this->getFormData()->getSubject() ? $this->getFormData()->getSubject() : '') ?>" />
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
<?php endif; ?>
|
64 |
+
<div class="comment-form-field">
|
65 |
+
<?php if ($this->isReply()): ?>
|
66 |
+
<label for="message_field" class="required"<?php if ($this->htmlEscape($this->getFormData()->getMessage())): ?> style="display: none;"<?php endif; ?>><?php echo $this->__('Enter your reply here...') ?></label>
|
67 |
+
<?php else: ?>
|
68 |
+
<label for="message_field" class="required"<?php if ($this->htmlEscape($this->getFormData()->getMessage())): ?> style="display: none;"<?php endif; ?>><?php echo $this->__('Enter your comment here...') ?></label>
|
69 |
+
<?php endif; ?>
|
70 |
+
<div class="comment-form-input">
|
71 |
+
<textarea name="message" id="message_field" cols="5" rows="3" title="<?php echo $this->isReply() ? $this->__('Reply') : $this->__('Comment'); ?>" class="required-entry"><?php echo $this->htmlEscape($this->getFormData()->getMessage()) ?></textarea>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
<input type="hidden" name="secure_code" value="<?php echo $this->getSecureCode(); ?>" />
|
75 |
+
<input type="hidden" name="reply_to" value="<?php echo $this->getReplyTo(); ?>" />
|
76 |
+
<input type="hidden" name="session_id" value="<?php echo $this->getSessionId(); ?>" />
|
77 |
+
<div class="mp-form-footer">
|
78 |
+
<button type="submit"><?php echo $this->__("Submit"); ?></button>
|
79 |
+
</div>
|
80 |
+
</fieldset>
|
81 |
+
</form>
|
82 |
+
<script type="text/javascript">
|
83 |
+
guestbookComments.form = new VarienForm('mp-guestbook-form');
|
84 |
+
$$('#mp-guestbook-form .comment-form-field label').each(function(element){
|
85 |
+
$(element.htmlFor).observe('focus', (function(e){
|
86 |
+
if (element.style.display !== 'none'){
|
87 |
+
Effect.Fade(element, {duration: 0.5});
|
88 |
+
}
|
89 |
+
}).bind(element));
|
90 |
+
$(element.htmlFor).observe('blur', (function(e){
|
91 |
+
if (!$(element.htmlFor).getValue()){
|
92 |
+
Effect.Appear(element, {duration: 0.5});
|
93 |
+
}
|
94 |
+
}).bind(element));
|
95 |
+
});
|
96 |
+
$('message_field').focus();
|
97 |
+
</script>
|
98 |
+
<?php else: ?>
|
99 |
+
<?php if ($this->getIsAjax()): ?>
|
100 |
+
<?php echo $this->getMessageBlockHtml(); ?>
|
101 |
+
<?php endif; ?>
|
102 |
+
<?php if ($this->isReply()): ?>
|
103 |
+
<p><?php echo $this->__("Please <a href=\"%s\">login</a> to reply.", $this->getLoginUrl()); ?></p>
|
104 |
+
<?php else: ?>
|
105 |
+
<p><?php echo $this->__("Please <a href=\"%s\">login</a> to comment.", $this->getLoginUrl()); ?></p>
|
106 |
+
<?php endif; ?>
|
107 |
+
<p><?php echo $this->__("Don't have an account?"); ?></p>
|
108 |
+
<p><?php echo $this->__("<a href=\"%s\">Register here</a>!", $this->getRegisterUrl()); ?></p>
|
109 |
+
<?php endif; ?>
|
110 |
+
|
app/design/frontend/default/default/template/guestbook/comments/message.phtml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
?>
|
18 |
+
|
19 |
+
<div class="mpblog-comment" id="mp-blog-comment-<?php echo $this->getMessageId(); ?>"<?php if ($this->getIsAjax()): ?> style="display: none;"<?php endif; ?>>
|
20 |
+
<?php if ($this->isReply()): ?>
|
21 |
+
<div class="is-reply"></div>
|
22 |
+
<?php endif; ?>
|
23 |
+
<div class="mp-comment-content">
|
24 |
+
<div class="mp-comment-header">
|
25 |
+
<span class="mp-comment-author"><strong><?php echo $this->escapeHtml($this->getAuthor()); ?></strong></span>
|
26 |
+
<span class="mp-comment-date"><?php echo $this->__("%s at %s", $this->getDate(), $this->getTime()); ?></span>
|
27 |
+
<?php if ($this->getNeedApproveMessage()): ?>
|
28 |
+
<span class="mp-comment-willapprove"><?php echo $this->__("This post will become public after administrator approval."); ?></span>
|
29 |
+
<?php endif; ?>
|
30 |
+
<span class="mp-comment-reply-btn"><a href="#mp-comment-form-<?php echo $this->getMessageId(); ?>" onclick="guestbookComments.getForm('mp-comment-form-<?php echo $this->getMessageId(); ?>', <?php echo $this->getMessageId(); ?>); return false;"><?php echo $this->__("Reply"); ?></a></span>
|
31 |
+
<div class="fixed"></div>
|
32 |
+
</div>
|
33 |
+
<?php if ($this->getSubject()): ?>
|
34 |
+
<h4><?php echo $this->escapeHtml($this->getSubject()); ?></h4>
|
35 |
+
<?php endif; ?>
|
36 |
+
<?php echo $this->getContent(); ?>
|
37 |
+
</div>
|
38 |
+
<div class="mp-replies">
|
39 |
+
<?php echo $this->getRepliesHtml(); ?>
|
40 |
+
<div class="mp-comment-form" id="mp-comment-form-<?php echo $this->getMessageId(); ?>" style="display: none;"></div>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
</div>
|
app/design/frontend/default/default/template/guestbook/comments/pager.phtml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* MagPleasure Co.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://www.magpleasure.com/LICENSE.txt
|
11 |
+
*
|
12 |
+
* @category Magpleasure
|
13 |
+
* @package Magpleasure_Guestbook
|
14 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
15 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
16 |
+
*/
|
17 |
+
?>
|
18 |
+
<?php if($this->getCollection()->getSize()): ?>
|
19 |
+
<?php if($this->getLastPageNum()>1): ?>
|
20 |
+
<div class="mp-pager">
|
21 |
+
<div>
|
22 |
+
<span class="navi newer">
|
23 |
+
<?php if (!$this->isFirstPage()): ?>
|
24 |
+
<a href="<?php echo $this->getPreviousPageUrl() ?>" title="<?php echo $this->__('Older Entries') ?>"><?php echo $this->__('Older Entries') ?></a>
|
25 |
+
<?php endif;?>
|
26 |
+
</span>
|
27 |
+
<span class="navi older">
|
28 |
+
<?php if (!$this->isLastPage()): ?>
|
29 |
+
|
30 |
+
<a href="<?php echo $this->getNextPageUrl() ?>" title="<?php echo $this->__('Newer Entries') ?>"><?php echo $this->__('Newer Entries') ?></a>
|
31 |
+
<?php endif;?>
|
32 |
+
</span>
|
33 |
+
</div>
|
34 |
+
<div class="fixed"></div>
|
35 |
+
</div>
|
36 |
+
<?php endif; ?>
|
37 |
+
<?php endif ?>
|
app/etc/modules/Magpleasure_Guestbook.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Magpleasure_Guestbook>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Magpleasure_Guestbook>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/en_US/Magpleasure_Guestbook.csv
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Action","Action"
|
2 |
+
"<a href=\"%s\">Register here</a>!","<a href=\"%s\">Register here</a>!"
|
3 |
+
"Approve","Approve"
|
4 |
+
"Approved","Approved"
|
5 |
+
"Are you sure?","Are you sure?"
|
6 |
+
"Can not create post.","Can not create post."
|
7 |
+
"Change status","Change status"
|
8 |
+
"Comment","Comment"
|
9 |
+
"Comment Information","Comment Information"
|
10 |
+
"Comment is not exists.","Comment is not exists."
|
11 |
+
"Comments","Comments"
|
12 |
+
"Comment was not approved (%s).","Comment was not approved (%s)."
|
13 |
+
"Comment was not deleted (%s).","Comment was not deleted (%s)."
|
14 |
+
"Comment was not rejected (%s).","Comment was not rejected (%s)."
|
15 |
+
"Comment was successfully approved.","Comment was successfully approved."
|
16 |
+
"Comment was successfully deleted.","Comment was successfully deleted."
|
17 |
+
"Comment was successfully rejected.","Comment was successfully rejected."
|
18 |
+
"Comment was successfully saved.","Comment was successfully saved."
|
19 |
+
"Created At","Created At"
|
20 |
+
"Customer","Customer"
|
21 |
+
"Delete Comment","Delete Comment"
|
22 |
+
"Delete","Delete"
|
23 |
+
"Don't have an account?","Don't have an account?"
|
24 |
+
"Edit Comment of '%s'","Edit Comment of '%s'"
|
25 |
+
"Email","Email"
|
26 |
+
"Enter your comment here...","Enter your comment here..."
|
27 |
+
"Enter your reply here...","Enter your reply here..."
|
28 |
+
"Error while saving the comment (%s).","Error while saving the comment (%s)."
|
29 |
+
"General","General"
|
30 |
+
"Guestbook","Guestbook"
|
31 |
+
"Guest Book","Guest Book"
|
32 |
+
"Home","Home"
|
33 |
+
"ID","ID"
|
34 |
+
"Leave a Comment","Leave a Comment"
|
35 |
+
"Leave a Reply","Leave a Reply"
|
36 |
+
"Name","Name"
|
37 |
+
"Newer Entries","Newer Entries"
|
38 |
+
"(Not published)","(Not published)"
|
39 |
+
"Older Entries","Older Entries"
|
40 |
+
"Pending","Pending"
|
41 |
+
"Please <a href=\"%s\">login</a> to comment.","Please <a href=\"%s\">login</a> to comment."
|
42 |
+
"Please <a href=\"%s\">login</a> to reply.","Please <a href=\"%s\">login</a> to reply."
|
43 |
+
"Posted from","Posted from"
|
44 |
+
"Rejected","Rejected"
|
45 |
+
"Reject","Reject"
|
46 |
+
"Reply","Reply"
|
47 |
+
"Reply To","Reply To"
|
48 |
+
"(required)","(required)"
|
49 |
+
"%s at %s","%s at %s"
|
50 |
+
"Save And Continue Edit","Save And Continue Edit"
|
51 |
+
"Save Comment","Save Comment"
|
52 |
+
"%s comments","%s comments"
|
53 |
+
"%s comments successfully deleted.","%s comments successfully deleted."
|
54 |
+
"%s comments successfully updated.","%s comments successfully updated."
|
55 |
+
"%s comments was not deleted.","%s comments was not deleted."
|
56 |
+
"%s comments was not updated.","%s comments was not updated."
|
57 |
+
"Status","Status"
|
58 |
+
"Store View","Store View"
|
59 |
+
"Subject","Subject"
|
60 |
+
"Submit","Submit"
|
61 |
+
"There are no comments.","There are no comments."
|
62 |
+
"This post will become public after administrator approval.","This post will become public after administrator approval."
|
63 |
+
"Updated At","Updated At"
|
64 |
+
"View","View"
|
65 |
+
"Your session is expired. Please refresh this page and try again.","Your session is expired. Please refresh this page and try again."
|
app/locale/ru_RU/Magpleasure_Guestbook.csv
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"Action","Действие"
|
2 |
+
"<a href=\"%s\">Register here</a>!","<a href=\"%s\">Зарегестрироваться</a>!"
|
3 |
+
"Approve","Принять"
|
4 |
+
"Approved","Принят"
|
5 |
+
"Are you sure?","Вы уверены?"
|
6 |
+
"Can not create post.","Не могу создать запись."
|
7 |
+
"Change status","Изменить статус"
|
8 |
+
"Comment","Отзыв"
|
9 |
+
"Comment Information","Информация о отзыве"
|
10 |
+
"Comment is not exists.","Отзыв не существует."
|
11 |
+
"Comments","Отзывы"
|
12 |
+
"Comment was not approved (%s).","Отзыв не был принят (%s)."
|
13 |
+
"Comment was not deleted (%s).","Отзыв не был удален (%s)."
|
14 |
+
"Comment was not rejected (%s).","Отзыв не был отклонен (%s)."
|
15 |
+
"Comment was successfully approved.","Отзыв был принят."
|
16 |
+
"Comment was successfully deleted.","Отзыв был удален."
|
17 |
+
"Comment was successfully rejected.","Отзыв был отклонен."
|
18 |
+
"Comment was successfully saved.","Отзыв был сохранен."
|
19 |
+
"Created At","Дата создания"
|
20 |
+
"Customer","Покупатель"
|
21 |
+
"Delete Comment","Удалить комментарий"
|
22 |
+
"Delete","Удалить"
|
23 |
+
"Don't have an account?","Еще не зарегестрированы?"
|
24 |
+
"Edit Comment of '%s'","Редактирование комментария '%s'"
|
25 |
+
"Email","Email"
|
26 |
+
"Enter your comment here...","Напишите здесь отзыв..."
|
27 |
+
"Enter your reply here...","Напишите здесь ответ..."
|
28 |
+
"Error while saving the comment (%s).","Ошибка во время сохранения комментария (%s)."
|
29 |
+
"General","Основной"
|
30 |
+
"Guestbook","Отзывы"
|
31 |
+
"Guest Book","Отзывы"
|
32 |
+
"Home","Главная"
|
33 |
+
"ID","ID"
|
34 |
+
"Leave a Comment","Оставить отзыв"
|
35 |
+
"Leave a Reply","Ответить"
|
36 |
+
"Name","Имя"
|
37 |
+
"Newer Entries","Предыдущие"
|
38 |
+
"(Not published)","(Не публикуется)"
|
39 |
+
"Older Entries","Последубщие"
|
40 |
+
"Pending","Ожидает решения"
|
41 |
+
"Please <a href=\"%s\">login</a> to comment.","Пожалуйста <a href=\"%s\">авторизуйтесь</a>, чтобы написать отзыв."
|
42 |
+
"Please <a href=\"%s\">login</a> to reply.","Пожалуйста <a href=\"%s\">авторизуйтесь</a>, чтобы написать ответ."
|
43 |
+
"Posted from","Отправлено с"
|
44 |
+
"Rejected","Отклонен"
|
45 |
+
"Reject","Отклонить"
|
46 |
+
"Reply","Ответить"
|
47 |
+
"Reply To","Ответить"
|
48 |
+
"(required)","(обязательно)"
|
49 |
+
"%s at %s","%s из %s"
|
50 |
+
"Save And Continue Edit","Сохранить и Продолжить"
|
51 |
+
"Save Comment","Сохранить"
|
52 |
+
"%s comments","%s отзывов"
|
53 |
+
"%s comments successfully deleted.","%s отзывов удалено."
|
54 |
+
"%s comments successfully updated.","%s отзывов обновлено."
|
55 |
+
"%s comments was not deleted.","%s отзывов не удалено."
|
56 |
+
"%s comments was not updated.","%s отзывов не обновлено."
|
57 |
+
"Status","Статус"
|
58 |
+
"Store View","Вид магазина"
|
59 |
+
"Subject","Тема"
|
60 |
+
"Submit","Отправить"
|
61 |
+
"There are no comments.","Еще нет ни одного отзыва."
|
62 |
+
"This post will become public after administrator approval.","Этот отзыв будет опубликован сразу после проверки администратором."
|
63 |
+
"Updated At","Дата изменения"
|
64 |
+
"View","Вид"
|
65 |
+
"Your session is expired. Please refresh this page and try again.","Ваша сессия истекла. Обновите страницу и попробуйте снова."
|
js/guestbook/comments.js
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* MagPleasure Co.
|
3 |
+
*
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the EULA
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://www.magpleasure.com/LICENSE.txt
|
10 |
+
*
|
11 |
+
* @category Magpleasure
|
12 |
+
* @package Magpleasure_Guestbook
|
13 |
+
* @copyright Copyright (c) 2012 Magpleasure Co. (http://www.magpleasure.com)
|
14 |
+
* @license http://www.magpleasure.com/LICENSE.txt
|
15 |
+
*/
|
16 |
+
|
17 |
+
var MpGuestbookComments = Class.create();
|
18 |
+
MpGuestbookComments.prototype = {
|
19 |
+
initialize:function (params) {
|
20 |
+
for (key in params) {
|
21 |
+
this[key] = params[key];
|
22 |
+
}
|
23 |
+
this.form = false;
|
24 |
+
},
|
25 |
+
hideForm: function(form_id, callback){
|
26 |
+
$(form_id).innerHTML = '';
|
27 |
+
Effect.Fade(form_id, {
|
28 |
+
afterFinish: (typeof(callback) != 'undefined' ? callback() : function(){}),
|
29 |
+
duration: 1.0
|
30 |
+
});
|
31 |
+
},
|
32 |
+
getForm:function (container, id) {
|
33 |
+
var formContainer = $(container);
|
34 |
+
if (formContainer && (formContainer.getStyle('display') == 'none')) {
|
35 |
+
|
36 |
+
$$(this.form_selector).each(function (element) {
|
37 |
+
if (element.id !== container) {
|
38 |
+
element.innerHTML = '';
|
39 |
+
Effect.Fade(element.id);
|
40 |
+
}
|
41 |
+
});
|
42 |
+
|
43 |
+
this.showLoader(container);
|
44 |
+
Effect.Appear(container, {
|
45 |
+
duration:1.0,
|
46 |
+
afterFinish:(function (e) {
|
47 |
+
Effect.ScrollTo(formContainer.id);
|
48 |
+
this.loadFormToContainer(container, id);
|
49 |
+
|
50 |
+
|
51 |
+
}).bind(this)
|
52 |
+
});
|
53 |
+
} else {
|
54 |
+
Effect.ScrollTo(formContainer.id);
|
55 |
+
}
|
56 |
+
return false;
|
57 |
+
},
|
58 |
+
showLoader:function (who) {
|
59 |
+
$(who).innerHTML = $(this.loader_container).innerHTML;
|
60 |
+
},
|
61 |
+
loadFormToContainer:function (container, id) {
|
62 |
+
var url = this.form_url.replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, ''));
|
63 |
+
|
64 |
+
new Ajax.Request(
|
65 |
+
url.replace('{{post_id}}', this.post_id).replace('{{reply_to}}', id), {
|
66 |
+
method:'get',
|
67 |
+
onComplete:function (transport) {
|
68 |
+
if (transport && transport.responseText) {
|
69 |
+
try {
|
70 |
+
var response = eval('(' + transport.responseText + ')');
|
71 |
+
if (!response.error) {
|
72 |
+
$(container).innerHTML = response.form;
|
73 |
+
response.form.evalScripts();
|
74 |
+
}
|
75 |
+
} catch (e) {
|
76 |
+
response = {};
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
});
|
81 |
+
},
|
82 |
+
submitForm: function(){
|
83 |
+
if (this.form && this.form.validator && this.form.validator.validate()){
|
84 |
+
|
85 |
+
var form_id = this.form.form.id;
|
86 |
+
var data = {};
|
87 |
+
$$('#' + form_id + ' input, #' + form_id + ' textarea').each((function(element){
|
88 |
+
if (element.type == 'checkbox'){
|
89 |
+
data[element.name] = element.checked ? 1 : 0;
|
90 |
+
} else {
|
91 |
+
data[element.name] = element.value;
|
92 |
+
}
|
93 |
+
}).bind(this).bind(data));
|
94 |
+
|
95 |
+
var url = this.post_url.replace(/^http[s]{0,1}/, window.location.href.replace(/:[^:].*$/i, ''));
|
96 |
+
|
97 |
+
var container = this.form.form.parentNode.id;
|
98 |
+
this.showLoader(container);
|
99 |
+
|
100 |
+
new Ajax.Request(
|
101 |
+
url.replace('{{post_id}}', this.post_id).replace('{{reply_to}}', data.reply_to), {
|
102 |
+
method: 'post',
|
103 |
+
parameters: data,
|
104 |
+
onComplete: (function(transport){
|
105 |
+
if (transport && transport.responseText) {
|
106 |
+
try {
|
107 |
+
var response = eval('(' + transport.responseText + ')');
|
108 |
+
if (!response.error) {
|
109 |
+
this.hideForm(container, (function(){
|
110 |
+
Element.insert($(container), { before: response.message });
|
111 |
+
Effect.Appear('mp-blog-comment-' + response.comment_id, {
|
112 |
+
duration: 1.0,
|
113 |
+
afterFinish: (function(){
|
114 |
+
Effect.ScrollTo('mp-blog-comment-' + response.comment_id, {
|
115 |
+
afterFinish: (function(){
|
116 |
+
if ($('no_comments')){
|
117 |
+
Effect.Fade('no_comments');
|
118 |
+
}
|
119 |
+
|
120 |
+
}).bind(response).bind(this)
|
121 |
+
});
|
122 |
+
}).bind(response).bind(this)
|
123 |
+
});
|
124 |
+
response.message.evalScripts();
|
125 |
+
}).bind(response).bind(this));
|
126 |
+
if ($(this.comments_counter)){
|
127 |
+
$(this.comments_counter).innerHTML = response.count_code;
|
128 |
+
}
|
129 |
+
} else {
|
130 |
+
$(container).innerHTML = response.form;
|
131 |
+
response.form.evalScripts();
|
132 |
+
}
|
133 |
+
} catch (e) {
|
134 |
+
response = {};
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}).bind(this).bind(container)
|
138 |
+
});
|
139 |
+
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
|
144 |
+
}
|
145 |
+
}
|
146 |
+
};
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Guest_Book</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/OSL-3.0">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Free Guest Book Magento Extension</summary>
|
10 |
+
<description>The Guest Book Magento extension is a powerful and simultaneously simple way to build relationships with your website visitors.</description>
|
11 |
+
<notes>The Guest Book Magento extension is a powerful and simultaneously simple way to build relationships with your website visitors.</notes>
|
12 |
+
<authors><author><name>MagPleasure</name><user>auto-converted</user><email>general@magpleasure.com</email></author></authors>
|
13 |
+
<date>2012-02-29</date>
|
14 |
+
<time>03:53:06</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Magpleasure"><dir name="Guestbook"><dir name="Block"><dir name="Adminhtml"><dir name="Message"><dir name="Edit"><dir name="Tab"><file name="General.php" hash="c4e301361ac569cef966738d9a4f7feb"/></dir><file name="Form.php" hash="efc03122826c1340c79d74d2f72c51c8"/><file name="Tabs.php" hash="db20bc15e8ea35fe8285428272aed9d3"/></dir><file name="Edit.php" hash="0c2cdec1e125a7e0bdc01b32f1053705"/><file name="Grid.php" hash="3675eb192ebc64a8630043ee170a6017"/></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Comment.php" hash="8f0fcc8e70c5ccd7844df56f11deadc9"/><file name="Customer.php" hash="0cb0b293190aa679a3325f6f54770875"/></dir></dir></dir></dir><file name="Message.php" hash="bdec95a99fa9b5a0a21beaa2336fcc22"/></dir><dir name="Comments"><file name="Abstract.php" hash="4a105e8610bd4552c81ae67b14ee6d51"/><file name="Form.php" hash="b0bb3d3e7a90bdf23d7f4c47fef52ce6"/><file name="Message.php" hash="ac35116a425c8399fef106c017853ebc"/></dir><dir name="Menu"><file name="Item.php" hash="2f80a1c6624443a2b3ad00f3745ab452"/></dir><file name="Comments.php" hash="29013f3a7065437390780b8627706130"/></dir><dir name="Helper"><dir name="Comment"><file name="Render.php" hash="9cb8d47642bbf143bbe96f3bdd2c688d"/><file name="Secure.php" hash="c65e92792f635b96fb1dabab012730ef"/></dir><file name="Data.php" hash="87cf016cecc8cc1bcb436efcddcc4c72"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Message"><file name="Collection.php" hash="8659afcb9de97458cf2b923a5d4dc7ff"/></dir><file name="Message.php" hash="f39e6eb60ebd676ef041a7d4f91e7dd9"/></dir><file name="Message.php" hash="28c85ec351289beb43ab9a2e39ba09f5"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MessageController.php" hash="ae5efdb7118e3a72d3fe34f382abb900"/></dir><file name="IndexController.php" hash="ba864fefb0452a57c79cf9ff3da617b7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="33703e86ce448590891ef6105a212214"/><file name="config.xml" hash="8a7c26b8ffbdcc198593b238ad502383"/><file name="system.xml" hash="c99dfaec3da172d0c0843b2c7cbb7472"/></dir><dir name="sql"><dir name="guestbook_setup"><file name="mysql4-install-1.0.php" hash="5396160737dd75b83b01a2bcbb26c3c0"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magpleasure_Guestbook.xml" hash="c6b8752d7f8424e13e851aeaf11aea40"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="guestbook.xml" hash="79378168bbc2e2c9f85a0e25ad801aee"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="guestbook.xml" hash="96fece024da5e7a141dc90b087305722"/></dir><dir name="template"><dir name="guestbook"><dir name="comments"><file name="form.phtml" hash="70289819c165a884dc9a4a91e87ba574"/><file name="message.phtml" hash="5b372f3ac209c7860661e0e33527ea9e"/><file name="pager.phtml" hash="b1071ccdc52b17ac5063d3c2f16cb8c8"/></dir><file name="comments.phtml" hash="588730292d5ecde6e80cbd3e169be2fe"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Magpleasure_Guestbook.csv" hash="6b37730f56167d2c8b9033e0fbde1427"/></dir><dir name="ru_RU"><file name="Magpleasure_Guestbook.csv" hash="63434626a37c6810464055f7ee2b4401"/></dir></target><target name="mageweb"><dir name="js"><dir name="guestbook"><file name="comments.js" hash="d12268f39951461d1569439d25db4a29"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="guestbook"><dir name="css"><file name="styles.css" hash="a59e27bff4b656409ae19066e97f2fcc"/></dir><dir name="images"><file name="ajax-loader.gif" hash="2842a01748d5994fbcae920981a5f3d6"/><file name="backgrounds-sprite.png" hash="045f249ef2e75c26a3b2b16f202c27f3"/><file name="button-fill.gif" hash="09f0966ffe796444b7632a9db7373096"/><file name="category-mark.png" hash="d9140b9f7ba76e995b8fcb8ae559ca61"/><file name="commentpoint.png" hash="cf5a4e5f8df6229efaa94f364d2e1a6a"/><file name="icon-next.png" hash="99678d55967a2fba747ff34e9eb3f404"/><file name="icon-prev.png" hash="f2ed82621db3bba1e6aa5cf1f57cbac6"/><file name="services-sprite.png" hash="02f209a0e4b4cd2a2be21206cb69e469"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|
skin/frontend/default/default/guestbook/css/styles.css
ADDED
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div.fixed { clear: both; }
|
2 |
+
.mp-guestbook { clear: both; margin-bottom: 20px; }
|
3 |
+
.mp-guestbook .mp-header { margin-bottom: 10px; }
|
4 |
+
.mp-guestbook h2.mp-post-header, .mp-guestbook h1.mp-post-header { padding-bottom: 5px; border-bottom: 1px solid #cccccc; }
|
5 |
+
|
6 |
+
.mp-content { padding-left: 20px; }
|
7 |
+
.mp-content div.mp-readmore { clear: both; }
|
8 |
+
.mp-content div.mp-details { margin-top: 20px; }
|
9 |
+
|
10 |
+
.mp-guestbook span.mp-tags, .mp-guestbook span.categories, .mp-guestbook span.posted-by,
|
11 |
+
.mp-guestbook span.date, .mp-guestbook span.go-to-comments, .mp-guestbook span.leave-a-comment,
|
12 |
+
.mp-guestbook span.comments, .mp-guestbook span.rss-comments { font-size: 11px;}
|
13 |
+
.mp-guestbook span.mp-tags {
|
14 |
+
margin-right: 20px;
|
15 |
+
margin-left: 6px;
|
16 |
+
float: left;
|
17 |
+
}
|
18 |
+
|
19 |
+
.mp-guestbook span.categories {
|
20 |
+
margin-right: 20px;
|
21 |
+
margin-left: 6px;
|
22 |
+
float: left;
|
23 |
+
}
|
24 |
+
|
25 |
+
.mp-guestbook .leave-a-comment {
|
26 |
+
float: right;
|
27 |
+
margin-left: 20px;
|
28 |
+
}
|
29 |
+
|
30 |
+
.mp-guestbook .messages-header h1.mp-guestbook-header {
|
31 |
+
float: left;
|
32 |
+
}
|
33 |
+
.mp-guestbook .messages-header button.leave-a-comment {
|
34 |
+
float: right;
|
35 |
+
}
|
36 |
+
|
37 |
+
.mp-guestbook .mp-header .posted-by, .mp-guestbook .mp-header .date {
|
38 |
+
float: left;
|
39 |
+
}
|
40 |
+
|
41 |
+
.mp-guestbook .mp-header .comments { float: right; }
|
42 |
+
|
43 |
+
.mp-pager {
|
44 |
+
padding: 10px 5px 0;
|
45 |
+
}
|
46 |
+
.mp-pager .navi a {
|
47 |
+
line-height: 16px;
|
48 |
+
min-height: 16px;
|
49 |
+
width: 45%;
|
50 |
+
}
|
51 |
+
|
52 |
+
.mp-pager .older a {
|
53 |
+
background: url('../images/icon-next.png') no-repeat scroll 100% 2px transparent;
|
54 |
+
padding-right: 16px;
|
55 |
+
float: right;
|
56 |
+
text-align: right;
|
57 |
+
}
|
58 |
+
|
59 |
+
.mp-pager .newer a {
|
60 |
+
background: url('../images/icon-prev.png') no-repeat scroll 0 2px transparent;
|
61 |
+
padding-left: 16px;
|
62 |
+
float: left;
|
63 |
+
text-align: left;
|
64 |
+
}
|
65 |
+
|
66 |
+
/* Sidebars */
|
67 |
+
|
68 |
+
.mpblog-categories .block-content, .mpblog-recentposts .block-content ,
|
69 |
+
.mpblog-tags .block-content, .mpblog-recentcomments .block-content {
|
70 |
+
padding: 5px 10px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.mpblog-tags .block-content.tagcloud { padding: 0; }
|
74 |
+
|
75 |
+
.mpblog-categories ul li, .mpblog-recentposts ul li, .mpblog-recentcomments ul li {
|
76 |
+
padding-left: 20px;
|
77 |
+
margin-bottom: 3px;
|
78 |
+
background: url('../images/category-mark.png') no-repeat scroll 0 3px transparent;
|
79 |
+
}
|
80 |
+
|
81 |
+
.mpblog-categories ul li.active a, .mpblog-recentposts ul li.active a {
|
82 |
+
font-weight: bold;
|
83 |
+
}
|
84 |
+
|
85 |
+
.mpblog-comments-container {
|
86 |
+
margin-top: 20px;
|
87 |
+
padding-top: 10px;
|
88 |
+
border-bottom: 1px solid #CCCCCC;
|
89 |
+
}
|
90 |
+
|
91 |
+
.mpblog-comments-container .comments-header span.leave-a-comment {
|
92 |
+
float: left; margin-left: 0;
|
93 |
+
}
|
94 |
+
|
95 |
+
.mpblog-comments-container .comments-header .mpblog-comments-counter {
|
96 |
+
position: absolute;
|
97 |
+
right: 10px;
|
98 |
+
bottom: -1px;
|
99 |
+
border: 1px solid #CCCCCC;
|
100 |
+
border-bottom-color: #FFFFFE;
|
101 |
+
padding: 3px 15px;
|
102 |
+
-webkit-border-top-left-radius: 6px;
|
103 |
+
-webkit-border-top-right-radius: 6px;
|
104 |
+
-moz-border-radius-topleft: 6px;
|
105 |
+
-moz-border-radius-topright: 6px;
|
106 |
+
border-top-left-radius: 6px;
|
107 |
+
border-top-right-radius: 6px;
|
108 |
+
-moz-box-shadow: 0 -9px 7px -8px #CCCCCC;
|
109 |
+
-webkit-box-shadow: 0 -9px 7px -8px #CCCCCC;
|
110 |
+
box-shadow: 0 -9px 7px -8px #CCCCCC;
|
111 |
+
}
|
112 |
+
|
113 |
+
.mpblog-comments-livestream {
|
114 |
+
|
115 |
+
}
|
116 |
+
.mp-comment-header { margin-bottom: 10px; }
|
117 |
+
.mp-comment-author, .mp-comment-date, .mp-comment-willapprove { float: left; }
|
118 |
+
.mp-comment-willapprove {
|
119 |
+
color: red;
|
120 |
+
font-size: 11px;
|
121 |
+
margin-left: 10px;
|
122 |
+
}
|
123 |
+
|
124 |
+
.mpblog-comments-container .comments-header {
|
125 |
+
border-bottom: 1px solid #CCCCCC;
|
126 |
+
padding-bottom: 5px;
|
127 |
+
position: relative;
|
128 |
+
}
|
129 |
+
|
130 |
+
.mpblog-comment .is-reply {
|
131 |
+
background: url("../images/commentpoint.png") no-repeat scroll 0 100% transparent;
|
132 |
+
height: 20px;
|
133 |
+
left: 27px;
|
134 |
+
position: absolute;
|
135 |
+
top: -19px;
|
136 |
+
width: 100px;
|
137 |
+
}
|
138 |
+
.mpblog-comment { position: relative; }
|
139 |
+
|
140 |
+
.mp-comment-content, .mp-comment-form {
|
141 |
+
padding: 10px;
|
142 |
+
margin: 20px 10px;
|
143 |
+
background: none repeat scroll 0 0 #EDEFF0;
|
144 |
+
-webkit-border-radius: 6px;
|
145 |
+
-moz-border-radius: 6px;
|
146 |
+
border-radius: 6px;
|
147 |
+
}
|
148 |
+
.mp-comment-reply-btn { float: right; }
|
149 |
+
.mp-comment-date {
|
150 |
+
margin-left: 10px;
|
151 |
+
}
|
152 |
+
.mp-comment-author, .mp-comment-date, .mp-comment-reply-btn { font-size: 11px; }
|
153 |
+
|
154 |
+
.mp-replies {
|
155 |
+
padding-left: 20px;
|
156 |
+
}
|
157 |
+
|
158 |
+
.mp-blog-loader {
|
159 |
+
background: url('../images/ajax-loader.gif') no-repeat scroll 50% 0 transparent;
|
160 |
+
height: 11px;
|
161 |
+
width: 100%;
|
162 |
+
}
|
163 |
+
|
164 |
+
/* Dream Form Implementation */
|
165 |
+
.comment-form-input input, .comment-form-input textarea {
|
166 |
+
width: 98%;
|
167 |
+
padding: 5px;
|
168 |
+
}
|
169 |
+
|
170 |
+
.mp-comment-form h3 {
|
171 |
+
border-bottom: 1px solid #CCCCCC;
|
172 |
+
padding-bottom: 5px;
|
173 |
+
}
|
174 |
+
|
175 |
+
.comment-form-field { margin-bottom: 10px; position: relative; }
|
176 |
+
.comment-form-field textarea { height: 60px; }
|
177 |
+
.comment-form-field input { height: 18px; }
|
178 |
+
.comment-form-field input, .comment-form-field textarea {
|
179 |
+
border: 1px solid #B6B6B6;
|
180 |
+
border-radius: 4px 4px 4px 4px;
|
181 |
+
-webkit-radius: 4px 4px 4px 4px;
|
182 |
+
-moz-border-radius: 4px 4px 4px 4px;
|
183 |
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16) inset;
|
184 |
+
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16) inset;
|
185 |
+
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16) inset;
|
186 |
+
background-color: #fff;
|
187 |
+
border: 1px solid #C1C1C1;
|
188 |
+
|
189 |
+
}
|
190 |
+
.comment-form-field label .mp-required { }
|
191 |
+
|
192 |
+
.comment-form-field label .mp-private, .comment-form-field label .mp-required {
|
193 |
+
background-color: transparent;
|
194 |
+
color: rgba(0, 0, 0, 0.4);
|
195 |
+
float: none;
|
196 |
+
font-size: 11px;
|
197 |
+
left: auto;
|
198 |
+
margin: 0;
|
199 |
+
padding: 0;
|
200 |
+
position: relative;
|
201 |
+
text-align: left;
|
202 |
+
top: auto;
|
203 |
+
width: auto;
|
204 |
+
}
|
205 |
+
|
206 |
+
.comment-form-field label .mp-private {
|
207 |
+
float: none;
|
208 |
+
position: absolute;
|
209 |
+
right: 15px;
|
210 |
+
}
|
211 |
+
|
212 |
+
.comment-form-field label {
|
213 |
+
color: #666666;
|
214 |
+
display: block;
|
215 |
+
font-size: 12px;
|
216 |
+
left: 5px;
|
217 |
+
line-height: 18px;
|
218 |
+
padding: 0 !important;
|
219 |
+
position: absolute;
|
220 |
+
top: 5px;
|
221 |
+
width: 100%;
|
222 |
+
}
|
223 |
+
|
224 |
+
.comment-form-field input:focus, .comment-form-field textarea:focus {
|
225 |
+
background-color: #e7e77f;
|
226 |
+
}
|
227 |
+
|
228 |
+
button.leave-a-comment { margin-top: -8px !important; }
|
229 |
+
button.leave-a-comment, .mp-form-footer button, .messages-footer button {
|
230 |
+
border-radius: 3px 3px 3px 3px;
|
231 |
+
-webkit-border-radius: 3px 3px 3px 3px;
|
232 |
+
-moz-border-radius: 3px 3px 3px 3px;
|
233 |
+
background: url('../images/backgrounds-sprite.png') repeat-x scroll 0 0 transparent;
|
234 |
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
235 |
+
font-size: 13px;
|
236 |
+
line-height: 14px;
|
237 |
+
margin: 0 0 1em;
|
238 |
+
max-height: 36px;
|
239 |
+
overflow: hidden;
|
240 |
+
padding: 9px 10px;
|
241 |
+
position: relative;
|
242 |
+
white-space: nowrap;
|
243 |
+
}
|
244 |
+
|
245 |
+
.mp-guestbook .mp-content ol {
|
246 |
+
list-style-type: decimal;
|
247 |
+
margin-left: 20px;
|
248 |
+
}
|
249 |
+
|
250 |
+
.mp-guestbook .mp-content ul {
|
251 |
+
list-style-type: disc;
|
252 |
+
margin-left: 20px;
|
253 |
+
}
|
254 |
+
|
255 |
+
.mpblog-social-container { margin-top: 20px; }
|
256 |
+
.mpblog-social-container .mp-buttons {
|
257 |
+
margin-left: 20px;
|
258 |
+
margin-top: 15px;
|
259 |
+
}
|
260 |
+
.mpblog-social-container .mp-buttons ul li { margin-right: 5px; float: left; }
|
261 |
+
.mpblog-social-container .mp-share-button img { border: none; }
|
262 |
+
.mpblog-social-container .mp-share-button {
|
263 |
+
width: 16px;
|
264 |
+
height: 16px;
|
265 |
+
background: url('../images/services-sprite.png') no-repeat scroll 0 0 transparent;
|
266 |
+
-webkit-transition:opacity 300ms;
|
267 |
+
-moz-transition:opacity 300ms;
|
268 |
+
-o-transition:opacity 300ms;
|
269 |
+
opacity: 0.7;
|
270 |
+
filter: alpha(opacity=70);
|
271 |
+
}
|
272 |
+
|
273 |
+
.mpblog-social-container .mp-share-button:hover {
|
274 |
+
opacity: 1;
|
275 |
+
filter: alpha(opacity=100);
|
276 |
+
}
|
277 |
+
|
skin/frontend/default/default/guestbook/images/ajax-loader.gif
ADDED
Binary file
|
skin/frontend/default/default/guestbook/images/backgrounds-sprite.png
ADDED
Binary file
|
skin/frontend/default/default/guestbook/images/button-fill.gif
ADDED
Binary file
|
skin/frontend/default/default/guestbook/images/category-mark.png
ADDED
Binary file
|
skin/frontend/default/default/guestbook/images/commentpoint.png
ADDED
Binary file
|
skin/frontend/default/default/guestbook/images/icon-next.png
ADDED
Binary file
|
skin/frontend/default/default/guestbook/images/icon-prev.png
ADDED
Binary file
|
skin/frontend/default/default/guestbook/images/services-sprite.png
ADDED
Binary file
|