Version Notes
* Widget Support
Download this release
Release Info
Developer | DCKAP Inc. |
Extension | faqaskquestions |
Version | 1.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.4
- app/code/community/DCKAP/Faq/Block/Adminhtml/Category.php +11 -11
- app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit.php +52 -52
- app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit/Form.php +18 -18
- app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit/Tab/Form.php +96 -96
- app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit/Tabs.php +23 -23
- app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Grid.php +138 -138
- app/code/community/DCKAP/Faq/Block/Adminhtml/Faq.php +11 -11
- app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit.php +52 -52
- app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit/Form.php +18 -18
- app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit/Tab/Form.php +135 -135
- app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit/Tabs.php +23 -23
- app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Grid.php +175 -175
- app/code/community/DCKAP/Faq/Block/Faq.php +161 -161
- app/code/community/DCKAP/Faq/Block/Widget.php +8 -0
- app/code/community/DCKAP/Faq/Helper/Data.php +5 -5
- app/code/community/DCKAP/Faq/Model/Category.php +8 -8
- app/code/community/DCKAP/Faq/Model/Faq.php +8 -8
- app/code/community/DCKAP/Faq/Model/Mysql4/Category.php +7 -7
- app/code/community/DCKAP/Faq/Model/Mysql4/Category/Collection.php +22 -22
- app/code/community/DCKAP/Faq/Model/Mysql4/Faq.php +7 -7
- app/code/community/DCKAP/Faq/Model/Mysql4/Faq/Collection.php +22 -22
- app/code/community/DCKAP/Faq/Model/Status.php +14 -14
- app/code/community/DCKAP/Faq/controllers/Adminhtml/CategoryController.php +167 -170
- app/code/community/DCKAP/Faq/controllers/Adminhtml/FaqController.php +193 -193
- app/code/community/DCKAP/Faq/controllers/Adminhtml/FaqController.php~ +0 -193
- app/code/community/DCKAP/Faq/controllers/IndexController.php +109 -109
- app/code/community/DCKAP/Faq/etc/config.xml +205 -205
- app/code/community/DCKAP/Faq/etc/system.xml +241 -241
- app/code/community/DCKAP/Faq/etc/widget.xml +7 -0
- app/code/community/DCKAP/Faq/sql/dckap_faq_setup/mysql4-install-0.1.0.php +38 -38
- app/design/adminhtml/default/default/layout/faq.xml +20 -20
- app/design/frontend/base/default/layout/faq.xml +32 -31
- app/design/frontend/base/default/template/faq/faq.phtml +328 -326
- app/etc/modules/DCKAP_Faq.xml +10 -10
- app/locale/en_US/template/email/faq_notification.html +15 -15
- package.xml +5 -5
- skin/frontend/base/default/faq/css/dckap_faq.css +391 -381
app/code/community/DCKAP/Faq/Block/Adminhtml/Category.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Block_Adminhtml_Category extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
$this->_controller = 'adminhtml_category';
|
7 |
-
$this->_blockGroup = 'faq';
|
8 |
-
$this->_headerText = Mage::helper('faq')->__('Category Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('faq')->__('Add Category');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Block_Adminhtml_Category extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_category';
|
7 |
+
$this->_blockGroup = 'faq';
|
8 |
+
$this->_headerText = Mage::helper('faq')->__('Category Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('faq')->__('Add Category');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit.php
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Category_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
|
9 |
-
$this->_objectId = 'id';
|
10 |
-
$this->_blockGroup = 'faq';
|
11 |
-
$this->_controller = 'adminhtml_category';
|
12 |
-
|
13 |
-
$this->_updateButton('save', 'label', Mage::helper('faq')->__('Save Category'));
|
14 |
-
$this->_updateButton('delete', 'label', Mage::helper('faq')->__('Delete Category'));
|
15 |
-
|
16 |
-
$this->_addButton('saveandcontinue', array(
|
17 |
-
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
-
'onclick' => 'saveAndContinueEdit()',
|
19 |
-
'class' => 'save',
|
20 |
-
), -100);
|
21 |
-
|
22 |
-
$this->_formScripts[] = "
|
23 |
-
function toggleEditor() {
|
24 |
-
if (tinyMCE.getInstanceById('faq_content') == null) {
|
25 |
-
tinyMCE.execCommand('mceAddControl', false, 'faq_content');
|
26 |
-
} else {
|
27 |
-
tinyMCE.execCommand('mceRemoveControl', false, 'faq_content');
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
function saveAndContinueEdit(){
|
32 |
-
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
-
}
|
34 |
-
";
|
35 |
-
}
|
36 |
-
|
37 |
-
public function getHeaderText()
|
38 |
-
{
|
39 |
-
if( Mage::registry('category_data') && Mage::registry('category_data')->getId() ) {
|
40 |
-
return Mage::helper('faq')->__("Edit category '%s'", $this->htmlEscape(Mage::registry('category_data')->getName()));
|
41 |
-
} else {
|
42 |
-
return Mage::helper('faq')->__('Add Category');
|
43 |
-
}
|
44 |
-
}
|
45 |
-
protected function _prepareLayout()
|
46 |
-
{
|
47 |
-
|
48 |
-
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
49 |
-
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
50 |
-
}
|
51 |
-
parent::_prepareLayout();
|
52 |
-
}
|
53 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Category_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
|
9 |
+
$this->_objectId = 'id';
|
10 |
+
$this->_blockGroup = 'faq';
|
11 |
+
$this->_controller = 'adminhtml_category';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('faq')->__('Save Category'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('faq')->__('Delete Category'));
|
15 |
+
|
16 |
+
$this->_addButton('saveandcontinue', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
+
'onclick' => 'saveAndContinueEdit()',
|
19 |
+
'class' => 'save',
|
20 |
+
), -100);
|
21 |
+
|
22 |
+
$this->_formScripts[] = "
|
23 |
+
function toggleEditor() {
|
24 |
+
if (tinyMCE.getInstanceById('faq_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'faq_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'faq_content');
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function saveAndContinueEdit(){
|
32 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
+
}
|
34 |
+
";
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getHeaderText()
|
38 |
+
{
|
39 |
+
if( Mage::registry('category_data') && Mage::registry('category_data')->getId() ) {
|
40 |
+
return Mage::helper('faq')->__("Edit category '%s'", $this->htmlEscape(Mage::registry('category_data')->getName()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('faq')->__('Add Category');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
protected function _prepareLayout()
|
46 |
+
{
|
47 |
+
|
48 |
+
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
49 |
+
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
50 |
+
}
|
51 |
+
parent::_prepareLayout();
|
52 |
+
}
|
53 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit/Form.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form(array(
|
8 |
-
'id' => 'edit_form',
|
9 |
-
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
-
'method' => 'post',
|
11 |
-
'enctype' => 'multipart/form-data'
|
12 |
-
)
|
13 |
-
);
|
14 |
-
|
15 |
-
$form->setUseContainer(true);
|
16 |
-
$this->setForm($form);
|
17 |
-
return parent::_prepareForm();
|
18 |
-
}
|
19 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form(array(
|
8 |
+
'id' => 'edit_form',
|
9 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
+
'method' => 'post',
|
11 |
+
'enctype' => 'multipart/form-data'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$form->setUseContainer(true);
|
16 |
+
$this->setForm($form);
|
17 |
+
return parent::_prepareForm();
|
18 |
+
}
|
19 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit/Tab/Form.php
CHANGED
@@ -1,96 +1,96 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Category_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form();
|
8 |
-
$this->setForm($form);
|
9 |
-
$form->setHtmlIdPrefix('faq');
|
10 |
-
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')
|
11 |
-
->getConfig(array('tab_id' => 'form_section'));
|
12 |
-
$wysiwygConfig["files_browser_window_url"] =
|
13 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index');
|
14 |
-
$wysiwygConfig["directives_url"] =
|
15 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
16 |
-
$wysiwygConfig["directives_url_quoted"] =
|
17 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
18 |
-
$wysiwygConfig["widget_window_url"] =
|
19 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/widget/index');
|
20 |
-
$wysiwygConfig["files_browser_window_width"] =
|
21 |
-
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width');
|
22 |
-
$wysiwygConfig["files_browser_window_height"] =
|
23 |
-
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height');
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
$fieldset = $form->addFieldset('faq_form', array('legend'=>Mage::helper('faq')->__('Category information')));
|
29 |
-
$fieldset->addField('name', 'editor', array(
|
30 |
-
'name' => 'name',
|
31 |
-
'label' => Mage::helper('faq')->__('Category Name'),
|
32 |
-
'title' => Mage::helper('faq')->__('Category Name'),
|
33 |
-
'style' => 'width:500px; height:100px;',
|
34 |
-
'wysiwyg' => false,
|
35 |
-
'required' => true,
|
36 |
-
|
37 |
-
));
|
38 |
-
|
39 |
-
$fieldset->addField('description', 'editor', array(
|
40 |
-
'name' => 'description',
|
41 |
-
'label' => Mage::helper('faq')->__('Category Description'),
|
42 |
-
'title' => Mage::helper('faq')->__('Category Description'),
|
43 |
-
'style' => 'width:700px; ',
|
44 |
-
|
45 |
-
'wysiwyg' => false,
|
46 |
-
'required' => false,
|
47 |
-
'note' => Mage::helper('faq')->__('Maximum 100 Characters allowed'),
|
48 |
-
));
|
49 |
-
|
50 |
-
|
51 |
-
$fieldset->addField('status', 'select', array(
|
52 |
-
'name' => 'status',
|
53 |
-
'label' => Mage::helper('faq')->__('Status'),
|
54 |
-
'title' => Mage::helper('faq')->__('Status'),
|
55 |
-
'values' => array(
|
56 |
-
array(
|
57 |
-
'value' => 1,
|
58 |
-
'label' => Mage::helper('faq')->__('Enabled'),
|
59 |
-
),
|
60 |
-
|
61 |
-
array(
|
62 |
-
'value' => 2,
|
63 |
-
'label' => Mage::helper('faq')->__('Disabled'),
|
64 |
-
),
|
65 |
-
),
|
66 |
-
));
|
67 |
-
|
68 |
-
$fieldset->addField('priority', 'text',
|
69 |
-
array(
|
70 |
-
'name' => 'priority',
|
71 |
-
'label' => Mage::helper('faq')->__('Priority'),
|
72 |
-
'class' => 'validate-not-negative-number',
|
73 |
-
'required' => false,
|
74 |
-
'note' => Mage::helper('faq')->__('Ascending order priority'),
|
75 |
-
)
|
76 |
-
);
|
77 |
-
$fieldset->addField('store_id', 'multiselect', array(
|
78 |
-
'name' => 'stores[]',
|
79 |
-
'label' => Mage::helper('faq')->__('Store View'),
|
80 |
-
'title' => Mage::helper('faq')->__('Store View'),
|
81 |
-
'required' => true,
|
82 |
-
'values' => Mage::getSingleton('adminhtml/system_store')
|
83 |
-
->getStoreValuesForForm(false, true),
|
84 |
-
));
|
85 |
-
|
86 |
-
|
87 |
-
if ( Mage::getSingleton('adminhtml/session')->getCategoryData() ) {
|
88 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->getCategoryData());
|
89 |
-
Mage::getSingleton('adminhtml/session')->setCategoryData(null);
|
90 |
-
}
|
91 |
-
elseif(Mage::registry('category_data')) {
|
92 |
-
$form->setValues(Mage::registry('category_data')->getData());
|
93 |
-
}
|
94 |
-
return parent::_prepareForm();
|
95 |
-
}
|
96 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Category_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$form->setHtmlIdPrefix('faq');
|
10 |
+
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')
|
11 |
+
->getConfig(array('tab_id' => 'form_section'));
|
12 |
+
$wysiwygConfig["files_browser_window_url"] =
|
13 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index');
|
14 |
+
$wysiwygConfig["directives_url"] =
|
15 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
16 |
+
$wysiwygConfig["directives_url_quoted"] =
|
17 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
18 |
+
$wysiwygConfig["widget_window_url"] =
|
19 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/widget/index');
|
20 |
+
$wysiwygConfig["files_browser_window_width"] =
|
21 |
+
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width');
|
22 |
+
$wysiwygConfig["files_browser_window_height"] =
|
23 |
+
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height');
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
$fieldset = $form->addFieldset('faq_form', array('legend'=>Mage::helper('faq')->__('Category information')));
|
29 |
+
$fieldset->addField('name', 'editor', array(
|
30 |
+
'name' => 'name',
|
31 |
+
'label' => Mage::helper('faq')->__('Category Name'),
|
32 |
+
'title' => Mage::helper('faq')->__('Category Name'),
|
33 |
+
'style' => 'width:500px; height:100px;',
|
34 |
+
'wysiwyg' => false,
|
35 |
+
'required' => true,
|
36 |
+
|
37 |
+
));
|
38 |
+
|
39 |
+
$fieldset->addField('description', 'editor', array(
|
40 |
+
'name' => 'description',
|
41 |
+
'label' => Mage::helper('faq')->__('Category Description'),
|
42 |
+
'title' => Mage::helper('faq')->__('Category Description'),
|
43 |
+
'style' => 'width:700px; ',
|
44 |
+
|
45 |
+
'wysiwyg' => false,
|
46 |
+
'required' => false,
|
47 |
+
'note' => Mage::helper('faq')->__('Maximum 100 Characters allowed'),
|
48 |
+
));
|
49 |
+
|
50 |
+
|
51 |
+
$fieldset->addField('status', 'select', array(
|
52 |
+
'name' => 'status',
|
53 |
+
'label' => Mage::helper('faq')->__('Status'),
|
54 |
+
'title' => Mage::helper('faq')->__('Status'),
|
55 |
+
'values' => array(
|
56 |
+
array(
|
57 |
+
'value' => 1,
|
58 |
+
'label' => Mage::helper('faq')->__('Enabled'),
|
59 |
+
),
|
60 |
+
|
61 |
+
array(
|
62 |
+
'value' => 2,
|
63 |
+
'label' => Mage::helper('faq')->__('Disabled'),
|
64 |
+
),
|
65 |
+
),
|
66 |
+
));
|
67 |
+
|
68 |
+
$fieldset->addField('priority', 'text',
|
69 |
+
array(
|
70 |
+
'name' => 'priority',
|
71 |
+
'label' => Mage::helper('faq')->__('Priority'),
|
72 |
+
'class' => 'validate-not-negative-number',
|
73 |
+
'required' => false,
|
74 |
+
'note' => Mage::helper('faq')->__('Ascending order priority'),
|
75 |
+
)
|
76 |
+
);
|
77 |
+
$fieldset->addField('store_id', 'multiselect', array(
|
78 |
+
'name' => 'stores[]',
|
79 |
+
'label' => Mage::helper('faq')->__('Store View'),
|
80 |
+
'title' => Mage::helper('faq')->__('Store View'),
|
81 |
+
'required' => true,
|
82 |
+
'values' => Mage::getSingleton('adminhtml/system_store')
|
83 |
+
->getStoreValuesForForm(false, true),
|
84 |
+
));
|
85 |
+
|
86 |
+
|
87 |
+
if ( Mage::getSingleton('adminhtml/session')->getCategoryData() ) {
|
88 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getCategoryData());
|
89 |
+
Mage::getSingleton('adminhtml/session')->setCategoryData(null);
|
90 |
+
}
|
91 |
+
elseif(Mage::registry('category_data')) {
|
92 |
+
$form->setValues(Mage::registry('category_data')->getData());
|
93 |
+
}
|
94 |
+
return parent::_prepareForm();
|
95 |
+
}
|
96 |
+
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Edit/Tabs.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Category_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
-
$this->setId('faq_tabs');
|
10 |
-
$this->setDestElementId('edit_form');
|
11 |
-
$this->setTitle(Mage::helper('faq')->__('Category Information'));
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('faq')->__('Category Information'),
|
18 |
-
'title' => Mage::helper('faq')->__('Category Information'),
|
19 |
-
'content' => $this->getLayout()->createBlock('faq/adminhtml_category_edit_tab_form')->toHtml(),
|
20 |
-
));
|
21 |
-
|
22 |
-
return parent::_beforeToHtml();
|
23 |
-
}
|
24 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Category_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('faq_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('faq')->__('Category Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('faq')->__('Category Information'),
|
18 |
+
'title' => Mage::helper('faq')->__('Category Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('faq/adminhtml_category_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Category/Grid.php
CHANGED
@@ -1,138 +1,138 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('categoryGrid');
|
9 |
-
$this->setDefaultSort('cat_id');
|
10 |
-
$this->setDefaultDir('ASC');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
|
13 |
-
}
|
14 |
-
|
15 |
-
protected function _prepareCollection()
|
16 |
-
{
|
17 |
-
$collection = Mage::getModel('faq/category')->getCollection();
|
18 |
-
$this->setCollection($collection);
|
19 |
-
return parent::_prepareCollection();
|
20 |
-
}
|
21 |
-
|
22 |
-
protected function _prepareColumns()
|
23 |
-
{
|
24 |
-
$this->addColumn('cat_id', array(
|
25 |
-
'header' => Mage::helper('faq')->__('Category ID'),
|
26 |
-
'align' =>'right',
|
27 |
-
'width' => '50px',
|
28 |
-
'index' => 'cat_id',
|
29 |
-
));
|
30 |
-
|
31 |
-
$this->addColumn('name', array(
|
32 |
-
'header' => Mage::helper('faq')->__('Name'),
|
33 |
-
'align' =>'left',
|
34 |
-
'index' => 'name',
|
35 |
-
));
|
36 |
-
$this->addColumn('description', array(
|
37 |
-
'header' => Mage::helper('faq')->__('Description'),
|
38 |
-
'align' =>'left',
|
39 |
-
'index' => 'description',
|
40 |
-
));
|
41 |
-
|
42 |
-
$this->addColumn('status', array(
|
43 |
-
'header' => Mage::helper('faq')->__('Status'),
|
44 |
-
'align' => 'left',
|
45 |
-
'width' => '80px',
|
46 |
-
'index' => 'status',
|
47 |
-
'type' => 'options',
|
48 |
-
'options' => array(
|
49 |
-
1 => 'Enabled',
|
50 |
-
2 => 'Disabled',
|
51 |
-
),
|
52 |
-
));
|
53 |
-
|
54 |
-
$this->addColumn('priority',
|
55 |
-
array(
|
56 |
-
'header' => Mage::helper('faq')->__('Priority'),
|
57 |
-
'width' => '50px',
|
58 |
-
'index' => 'priority'
|
59 |
-
)
|
60 |
-
);
|
61 |
-
if (!Mage::app()->isSingleStoreMode()) {
|
62 |
-
$this->addColumn('store_id', array(
|
63 |
-
'header' => Mage::helper('faq')->__('Store View'),
|
64 |
-
'index' => 'store_id',
|
65 |
-
'type' => 'store',
|
66 |
-
'store_all' => true,
|
67 |
-
'store_view' => true,
|
68 |
-
'sortable' => true,
|
69 |
-
'filter_condition_callback' => array($this,
|
70 |
-
'_filterStoreCondition'),
|
71 |
-
) );
|
72 |
-
}
|
73 |
-
|
74 |
-
$this->addColumn('action',
|
75 |
-
array(
|
76 |
-
'header' => Mage::helper('faq')->__('Action'),
|
77 |
-
'width' => '100',
|
78 |
-
'type' => 'action',
|
79 |
-
'getter' => 'getId',
|
80 |
-
'actions' => array(
|
81 |
-
array(
|
82 |
-
'caption' => Mage::helper('faq')->__('Edit'),
|
83 |
-
'url' => array('base'=> '*/*/edit'),
|
84 |
-
'field' => 'id'
|
85 |
-
)
|
86 |
-
),
|
87 |
-
'filter' => false,
|
88 |
-
'sortable' => false,
|
89 |
-
'index' => 'stores',
|
90 |
-
'is_system' => true,
|
91 |
-
));
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
return parent::_prepareColumns();
|
96 |
-
}
|
97 |
-
protected function _filterStoreCondition($collection, $column){
|
98 |
-
if (!$value = $column->getFilter()->getValue()) {
|
99 |
-
return;
|
100 |
-
}
|
101 |
-
$this->getCollection()->addStoreFilter($value);
|
102 |
-
}
|
103 |
-
|
104 |
-
protected function _prepareMassaction()
|
105 |
-
{
|
106 |
-
$this->setMassactionIdField('cat_id');
|
107 |
-
$this->getMassactionBlock()->setFormFieldName('faq');
|
108 |
-
|
109 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
110 |
-
'label' => Mage::helper('faq')->__('Delete'),
|
111 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
112 |
-
'confirm' => Mage::helper('faq')->__('Are you sure?')
|
113 |
-
));
|
114 |
-
$statuses = Mage::getSingleton('faq/status')->getOptionArray();
|
115 |
-
|
116 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
117 |
-
$this->getMassactionBlock()->addItem('status', array(
|
118 |
-
'label'=> Mage::helper('faq')->__('Change status'),
|
119 |
-
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
120 |
-
'additional' => array(
|
121 |
-
'visibility' => array(
|
122 |
-
'name' => 'status',
|
123 |
-
'type' => 'select',
|
124 |
-
'class' => 'required-entry',
|
125 |
-
'label' => Mage::helper('faq')->__('Status'),
|
126 |
-
'values' => $statuses
|
127 |
-
)
|
128 |
-
)
|
129 |
-
));
|
130 |
-
return $this;
|
131 |
-
}
|
132 |
-
|
133 |
-
public function getRowUrl($row)
|
134 |
-
{
|
135 |
-
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
136 |
-
}
|
137 |
-
|
138 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('categoryGrid');
|
9 |
+
$this->setDefaultSort('cat_id');
|
10 |
+
$this->setDefaultDir('ASC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _prepareCollection()
|
16 |
+
{
|
17 |
+
$collection = Mage::getModel('faq/category')->getCollection();
|
18 |
+
$this->setCollection($collection);
|
19 |
+
return parent::_prepareCollection();
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareColumns()
|
23 |
+
{
|
24 |
+
$this->addColumn('cat_id', array(
|
25 |
+
'header' => Mage::helper('faq')->__('Category ID'),
|
26 |
+
'align' =>'right',
|
27 |
+
'width' => '50px',
|
28 |
+
'index' => 'cat_id',
|
29 |
+
));
|
30 |
+
|
31 |
+
$this->addColumn('name', array(
|
32 |
+
'header' => Mage::helper('faq')->__('Name'),
|
33 |
+
'align' =>'left',
|
34 |
+
'index' => 'name',
|
35 |
+
));
|
36 |
+
$this->addColumn('description', array(
|
37 |
+
'header' => Mage::helper('faq')->__('Description'),
|
38 |
+
'align' =>'left',
|
39 |
+
'index' => 'description',
|
40 |
+
));
|
41 |
+
|
42 |
+
$this->addColumn('status', array(
|
43 |
+
'header' => Mage::helper('faq')->__('Status'),
|
44 |
+
'align' => 'left',
|
45 |
+
'width' => '80px',
|
46 |
+
'index' => 'status',
|
47 |
+
'type' => 'options',
|
48 |
+
'options' => array(
|
49 |
+
1 => 'Enabled',
|
50 |
+
2 => 'Disabled',
|
51 |
+
),
|
52 |
+
));
|
53 |
+
|
54 |
+
$this->addColumn('priority',
|
55 |
+
array(
|
56 |
+
'header' => Mage::helper('faq')->__('Priority'),
|
57 |
+
'width' => '50px',
|
58 |
+
'index' => 'priority'
|
59 |
+
)
|
60 |
+
);
|
61 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
62 |
+
$this->addColumn('store_id', array(
|
63 |
+
'header' => Mage::helper('faq')->__('Store View'),
|
64 |
+
'index' => 'store_id',
|
65 |
+
'type' => 'store',
|
66 |
+
'store_all' => true,
|
67 |
+
'store_view' => true,
|
68 |
+
'sortable' => true,
|
69 |
+
'filter_condition_callback' => array($this,
|
70 |
+
'_filterStoreCondition'),
|
71 |
+
) );
|
72 |
+
}
|
73 |
+
|
74 |
+
$this->addColumn('action',
|
75 |
+
array(
|
76 |
+
'header' => Mage::helper('faq')->__('Action'),
|
77 |
+
'width' => '100',
|
78 |
+
'type' => 'action',
|
79 |
+
'getter' => 'getId',
|
80 |
+
'actions' => array(
|
81 |
+
array(
|
82 |
+
'caption' => Mage::helper('faq')->__('Edit'),
|
83 |
+
'url' => array('base'=> '*/*/edit'),
|
84 |
+
'field' => 'id'
|
85 |
+
)
|
86 |
+
),
|
87 |
+
'filter' => false,
|
88 |
+
'sortable' => false,
|
89 |
+
'index' => 'stores',
|
90 |
+
'is_system' => true,
|
91 |
+
));
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
return parent::_prepareColumns();
|
96 |
+
}
|
97 |
+
protected function _filterStoreCondition($collection, $column){
|
98 |
+
if (!$value = $column->getFilter()->getValue()) {
|
99 |
+
return;
|
100 |
+
}
|
101 |
+
$this->getCollection()->addStoreFilter($value);
|
102 |
+
}
|
103 |
+
|
104 |
+
protected function _prepareMassaction()
|
105 |
+
{
|
106 |
+
$this->setMassactionIdField('cat_id');
|
107 |
+
$this->getMassactionBlock()->setFormFieldName('faq');
|
108 |
+
|
109 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
110 |
+
'label' => Mage::helper('faq')->__('Delete'),
|
111 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
112 |
+
'confirm' => Mage::helper('faq')->__('Are you sure?')
|
113 |
+
));
|
114 |
+
$statuses = Mage::getSingleton('faq/status')->getOptionArray();
|
115 |
+
|
116 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
117 |
+
$this->getMassactionBlock()->addItem('status', array(
|
118 |
+
'label'=> Mage::helper('faq')->__('Change status'),
|
119 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
120 |
+
'additional' => array(
|
121 |
+
'visibility' => array(
|
122 |
+
'name' => 'status',
|
123 |
+
'type' => 'select',
|
124 |
+
'class' => 'required-entry',
|
125 |
+
'label' => Mage::helper('faq')->__('Status'),
|
126 |
+
'values' => $statuses
|
127 |
+
)
|
128 |
+
)
|
129 |
+
));
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
public function getRowUrl($row)
|
134 |
+
{
|
135 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
136 |
+
}
|
137 |
+
|
138 |
+
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Faq.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Block_Adminhtml_Faq extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
$this->_controller = 'adminhtml_faq';
|
7 |
-
$this->_blockGroup = 'faq';
|
8 |
-
$this->_headerText = Mage::helper('faq')->__('FAQ\'s Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('faq')->__('Add item');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Block_Adminhtml_Faq extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_faq';
|
7 |
+
$this->_blockGroup = 'faq';
|
8 |
+
$this->_headerText = Mage::helper('faq')->__('FAQ\'s Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('faq')->__('Add item');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit.php
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Faq_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
|
9 |
-
$this->_objectId = 'id';
|
10 |
-
$this->_blockGroup = 'faq';
|
11 |
-
$this->_controller = 'adminhtml_faq';
|
12 |
-
|
13 |
-
$this->_updateButton('save', 'label', Mage::helper('faq')->__('Save Item'));
|
14 |
-
$this->_updateButton('delete', 'label', Mage::helper('faq')->__('Delete Item'));
|
15 |
-
|
16 |
-
$this->_addButton('saveandcontinue', array(
|
17 |
-
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
-
'onclick' => 'saveAndContinueEdit()',
|
19 |
-
'class' => 'save',
|
20 |
-
), -100);
|
21 |
-
|
22 |
-
$this->_formScripts[] = "
|
23 |
-
function toggleEditor() {
|
24 |
-
if (tinyMCE.getInstanceById('faq_content') == null) {
|
25 |
-
tinyMCE.execCommand('mceAddControl', false, 'faq_content');
|
26 |
-
} else {
|
27 |
-
tinyMCE.execCommand('mceRemoveControl', false, 'faq_content');
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
function saveAndContinueEdit(){
|
32 |
-
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
-
}
|
34 |
-
";
|
35 |
-
}
|
36 |
-
|
37 |
-
public function getHeaderText()
|
38 |
-
{
|
39 |
-
if( Mage::registry('faq_data') && Mage::registry('faq_data')->getId() ) {
|
40 |
-
return Mage::helper('faq')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('faq_data')->getId()));
|
41 |
-
} else {
|
42 |
-
return Mage::helper('faq')->__('Add Item');
|
43 |
-
}
|
44 |
-
}
|
45 |
-
protected function _prepareLayout()
|
46 |
-
{
|
47 |
-
|
48 |
-
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
49 |
-
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
50 |
-
}
|
51 |
-
parent::_prepareLayout();
|
52 |
-
}
|
53 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Faq_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
|
9 |
+
$this->_objectId = 'id';
|
10 |
+
$this->_blockGroup = 'faq';
|
11 |
+
$this->_controller = 'adminhtml_faq';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('faq')->__('Save Item'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('faq')->__('Delete Item'));
|
15 |
+
|
16 |
+
$this->_addButton('saveandcontinue', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
+
'onclick' => 'saveAndContinueEdit()',
|
19 |
+
'class' => 'save',
|
20 |
+
), -100);
|
21 |
+
|
22 |
+
$this->_formScripts[] = "
|
23 |
+
function toggleEditor() {
|
24 |
+
if (tinyMCE.getInstanceById('faq_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'faq_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'faq_content');
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function saveAndContinueEdit(){
|
32 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
+
}
|
34 |
+
";
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getHeaderText()
|
38 |
+
{
|
39 |
+
if( Mage::registry('faq_data') && Mage::registry('faq_data')->getId() ) {
|
40 |
+
return Mage::helper('faq')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('faq_data')->getId()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('faq')->__('Add Item');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
protected function _prepareLayout()
|
46 |
+
{
|
47 |
+
|
48 |
+
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
49 |
+
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
50 |
+
}
|
51 |
+
parent::_prepareLayout();
|
52 |
+
}
|
53 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit/Form.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Faq_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form(array(
|
8 |
-
'id' => 'edit_form',
|
9 |
-
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
-
'method' => 'post',
|
11 |
-
'enctype' => 'multipart/form-data'
|
12 |
-
)
|
13 |
-
);
|
14 |
-
|
15 |
-
$form->setUseContainer(true);
|
16 |
-
$this->setForm($form);
|
17 |
-
return parent::_prepareForm();
|
18 |
-
}
|
19 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Faq_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form(array(
|
8 |
+
'id' => 'edit_form',
|
9 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
+
'method' => 'post',
|
11 |
+
'enctype' => 'multipart/form-data'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$form->setUseContainer(true);
|
16 |
+
$this->setForm($form);
|
17 |
+
return parent::_prepareForm();
|
18 |
+
}
|
19 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit/Tab/Form.php
CHANGED
@@ -1,135 +1,135 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Faq_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form();
|
8 |
-
$this->setForm($form);
|
9 |
-
$form->setHtmlIdPrefix('faq');
|
10 |
-
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')
|
11 |
-
->getConfig(array('tab_id' => 'form_section'));
|
12 |
-
$wysiwygConfig["files_browser_window_url"] =
|
13 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index');
|
14 |
-
$wysiwygConfig["directives_url"] =
|
15 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
16 |
-
$wysiwygConfig["directives_url_quoted"] =
|
17 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
18 |
-
$wysiwygConfig["widget_window_url"] =
|
19 |
-
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/widget/index');
|
20 |
-
$wysiwygConfig["files_browser_window_width"] =
|
21 |
-
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width');
|
22 |
-
$wysiwygConfig["files_browser_window_height"] =
|
23 |
-
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height');
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
$fieldset = $form->addFieldset('faq_form', array('legend'=>Mage::helper('faq')->__('FAQ\'s information')));
|
28 |
-
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
29 |
-
$model = Mage::getModel('faq/category')->getCollection();
|
30 |
-
|
31 |
-
$categoryvalues[] = array(
|
32 |
-
'value' => '0',
|
33 |
-
'label' => '--',
|
34 |
-
);
|
35 |
-
foreach ($model as $category) {
|
36 |
-
$categoryvalues[] = array(
|
37 |
-
'value' => $category->getId(),
|
38 |
-
'label' => Mage::helper('faq')->__($category->getName()),
|
39 |
-
);
|
40 |
-
}
|
41 |
-
|
42 |
-
$fieldset->addField('category', 'select', array(
|
43 |
-
'name' => 'category',
|
44 |
-
'label' => Mage::helper('faq')->__('Category'),
|
45 |
-
'title' => Mage::helper('faq')->__('Category'),
|
46 |
-
'values' => $categoryvalues
|
47 |
-
));
|
48 |
-
}
|
49 |
-
$fieldset->addField('question', 'editor', array(
|
50 |
-
'name' => 'question',
|
51 |
-
'label' => Mage::helper('faq')->__('Question'),
|
52 |
-
'title' => Mage::helper('faq')->__('Question'),
|
53 |
-
'style' => 'width:500px; height:100px;',
|
54 |
-
'wysiwyg' => false,
|
55 |
-
'required' => true,
|
56 |
-
));
|
57 |
-
|
58 |
-
$fieldset->addField('answer', 'editor', array(
|
59 |
-
'name' => 'answer',
|
60 |
-
'label' => Mage::helper('faq')->__('Answer'),
|
61 |
-
'title' => Mage::helper('faq')->__('Answer'),
|
62 |
-
'style' => 'width:700px; ',
|
63 |
-
|
64 |
-
'wysiwyg' => true,
|
65 |
-
'required' => true,
|
66 |
-
'state' => 'html',
|
67 |
-
'config' => $wysiwygConfig,
|
68 |
-
));
|
69 |
-
|
70 |
-
$fieldset->addField('status', 'select', array(
|
71 |
-
'name' => 'status',
|
72 |
-
'label' => Mage::helper('faq')->__('Status'),
|
73 |
-
'title' => Mage::helper('faq')->__('Status'),
|
74 |
-
'values' => array(
|
75 |
-
array(
|
76 |
-
'value' => 1,
|
77 |
-
'label' => Mage::helper('faq')->__('Enabled'),
|
78 |
-
),
|
79 |
-
array(
|
80 |
-
'value' => 2,
|
81 |
-
'label' => Mage::helper('faq')->__('Disabled'),
|
82 |
-
),
|
83 |
-
),
|
84 |
-
));
|
85 |
-
|
86 |
-
if(!Mage::getStoreConfig('faq/faq_group/viewsorter')){
|
87 |
-
$fieldset->addField('priority', 'text',
|
88 |
-
array(
|
89 |
-
'name' => 'priority',
|
90 |
-
'label' => Mage::helper('faq')->__('Priority'),
|
91 |
-
'class' => 'validate-not-negative-number',
|
92 |
-
'required' => false,
|
93 |
-
'note' => Mage::helper('faq')->__('Ascending order priority'),
|
94 |
-
)
|
95 |
-
);
|
96 |
-
}
|
97 |
-
|
98 |
-
$fieldset->addField('store_id', 'multiselect', array(
|
99 |
-
'name' => 'stores[]',
|
100 |
-
'label' => Mage::helper('faq')->__('Store View'),
|
101 |
-
'title' => Mage::helper('faq')->__('Store View'),
|
102 |
-
'required' => true,
|
103 |
-
'values' => Mage::getSingleton('adminhtml/system_store')
|
104 |
-
->getStoreValuesForForm(false, true),
|
105 |
-
));
|
106 |
-
if(Mage::registry('faq_data')->getCustomerId()){
|
107 |
-
$fieldset->addField('customer_name', 'label',
|
108 |
-
array(
|
109 |
-
'name' => 'customer_name',
|
110 |
-
'label' => Mage::helper('faq')->__('Customer Name'),
|
111 |
-
)
|
112 |
-
);
|
113 |
-
$fieldset->addField('customer_id', 'label',
|
114 |
-
array(
|
115 |
-
'name' => 'customer_id',
|
116 |
-
'label' => Mage::helper('faq')->__('Customer ID'),
|
117 |
-
)
|
118 |
-
);
|
119 |
-
$fieldset->addField('customer_email', 'label',
|
120 |
-
array(
|
121 |
-
'name' => 'customer_email',
|
122 |
-
'label' => Mage::helper('faq')->__('Customer Email'),
|
123 |
-
)
|
124 |
-
);
|
125 |
-
}
|
126 |
-
if ( Mage::getSingleton('adminhtml/session')->getFaqData() ) {
|
127 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->getFaqData());
|
128 |
-
Mage::getSingleton('adminhtml/session')->setFaqData(null);
|
129 |
-
}
|
130 |
-
elseif(Mage::registry('faq_data')) {
|
131 |
-
$form->setValues(Mage::registry('faq_data')->getData());
|
132 |
-
}
|
133 |
-
return parent::_prepareForm();
|
134 |
-
}
|
135 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Faq_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$form->setHtmlIdPrefix('faq');
|
10 |
+
$wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')
|
11 |
+
->getConfig(array('tab_id' => 'form_section'));
|
12 |
+
$wysiwygConfig["files_browser_window_url"] =
|
13 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index');
|
14 |
+
$wysiwygConfig["directives_url"] =
|
15 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
16 |
+
$wysiwygConfig["directives_url_quoted"] =
|
17 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
|
18 |
+
$wysiwygConfig["widget_window_url"] =
|
19 |
+
Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/widget/index');
|
20 |
+
$wysiwygConfig["files_browser_window_width"] =
|
21 |
+
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width');
|
22 |
+
$wysiwygConfig["files_browser_window_height"] =
|
23 |
+
(int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height');
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
$fieldset = $form->addFieldset('faq_form', array('legend'=>Mage::helper('faq')->__('FAQ\'s information')));
|
28 |
+
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
29 |
+
$model = Mage::getModel('faq/category')->getCollection();
|
30 |
+
|
31 |
+
$categoryvalues[] = array(
|
32 |
+
'value' => '0',
|
33 |
+
'label' => '--',
|
34 |
+
);
|
35 |
+
foreach ($model as $category) {
|
36 |
+
$categoryvalues[] = array(
|
37 |
+
'value' => $category->getId(),
|
38 |
+
'label' => Mage::helper('faq')->__($category->getName()),
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
$fieldset->addField('category', 'select', array(
|
43 |
+
'name' => 'category',
|
44 |
+
'label' => Mage::helper('faq')->__('Category'),
|
45 |
+
'title' => Mage::helper('faq')->__('Category'),
|
46 |
+
'values' => $categoryvalues
|
47 |
+
));
|
48 |
+
}
|
49 |
+
$fieldset->addField('question', 'editor', array(
|
50 |
+
'name' => 'question',
|
51 |
+
'label' => Mage::helper('faq')->__('Question'),
|
52 |
+
'title' => Mage::helper('faq')->__('Question'),
|
53 |
+
'style' => 'width:500px; height:100px;',
|
54 |
+
'wysiwyg' => false,
|
55 |
+
'required' => true,
|
56 |
+
));
|
57 |
+
|
58 |
+
$fieldset->addField('answer', 'editor', array(
|
59 |
+
'name' => 'answer',
|
60 |
+
'label' => Mage::helper('faq')->__('Answer'),
|
61 |
+
'title' => Mage::helper('faq')->__('Answer'),
|
62 |
+
'style' => 'width:700px; ',
|
63 |
+
|
64 |
+
'wysiwyg' => true,
|
65 |
+
'required' => true,
|
66 |
+
'state' => 'html',
|
67 |
+
'config' => $wysiwygConfig,
|
68 |
+
));
|
69 |
+
|
70 |
+
$fieldset->addField('status', 'select', array(
|
71 |
+
'name' => 'status',
|
72 |
+
'label' => Mage::helper('faq')->__('Status'),
|
73 |
+
'title' => Mage::helper('faq')->__('Status'),
|
74 |
+
'values' => array(
|
75 |
+
array(
|
76 |
+
'value' => 1,
|
77 |
+
'label' => Mage::helper('faq')->__('Enabled'),
|
78 |
+
),
|
79 |
+
array(
|
80 |
+
'value' => 2,
|
81 |
+
'label' => Mage::helper('faq')->__('Disabled'),
|
82 |
+
),
|
83 |
+
),
|
84 |
+
));
|
85 |
+
|
86 |
+
if(!Mage::getStoreConfig('faq/faq_group/viewsorter')){
|
87 |
+
$fieldset->addField('priority', 'text',
|
88 |
+
array(
|
89 |
+
'name' => 'priority',
|
90 |
+
'label' => Mage::helper('faq')->__('Priority'),
|
91 |
+
'class' => 'validate-not-negative-number',
|
92 |
+
'required' => false,
|
93 |
+
'note' => Mage::helper('faq')->__('Ascending order priority'),
|
94 |
+
)
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
$fieldset->addField('store_id', 'multiselect', array(
|
99 |
+
'name' => 'stores[]',
|
100 |
+
'label' => Mage::helper('faq')->__('Store View'),
|
101 |
+
'title' => Mage::helper('faq')->__('Store View'),
|
102 |
+
'required' => true,
|
103 |
+
'values' => Mage::getSingleton('adminhtml/system_store')
|
104 |
+
->getStoreValuesForForm(false, true),
|
105 |
+
));
|
106 |
+
if(Mage::registry('faq_data')->getCustomerId()){
|
107 |
+
$fieldset->addField('customer_name', 'label',
|
108 |
+
array(
|
109 |
+
'name' => 'customer_name',
|
110 |
+
'label' => Mage::helper('faq')->__('Customer Name'),
|
111 |
+
)
|
112 |
+
);
|
113 |
+
$fieldset->addField('customer_id', 'label',
|
114 |
+
array(
|
115 |
+
'name' => 'customer_id',
|
116 |
+
'label' => Mage::helper('faq')->__('Customer ID'),
|
117 |
+
)
|
118 |
+
);
|
119 |
+
$fieldset->addField('customer_email', 'label',
|
120 |
+
array(
|
121 |
+
'name' => 'customer_email',
|
122 |
+
'label' => Mage::helper('faq')->__('Customer Email'),
|
123 |
+
)
|
124 |
+
);
|
125 |
+
}
|
126 |
+
if ( Mage::getSingleton('adminhtml/session')->getFaqData() ) {
|
127 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getFaqData());
|
128 |
+
Mage::getSingleton('adminhtml/session')->setFaqData(null);
|
129 |
+
}
|
130 |
+
elseif(Mage::registry('faq_data')) {
|
131 |
+
$form->setValues(Mage::registry('faq_data')->getData());
|
132 |
+
}
|
133 |
+
return parent::_prepareForm();
|
134 |
+
}
|
135 |
+
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Edit/Tabs.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Faq_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
-
$this->setId('faq_tabs');
|
10 |
-
$this->setDestElementId('edit_form');
|
11 |
-
$this->setTitle(Mage::helper('faq')->__('FAQ\'s Information'));
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('faq')->__('FAQ\'s Information'),
|
18 |
-
'title' => Mage::helper('faq')->__('FAQ\'s Information'),
|
19 |
-
'content' => $this->getLayout()->createBlock('faq/adminhtml_faq_edit_tab_form')->toHtml(),
|
20 |
-
));
|
21 |
-
|
22 |
-
return parent::_beforeToHtml();
|
23 |
-
}
|
24 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Faq_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('faq_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('faq')->__('FAQ\'s Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('faq')->__('FAQ\'s Information'),
|
18 |
+
'title' => Mage::helper('faq')->__('FAQ\'s Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('faq/adminhtml_faq_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
}
|
app/code/community/DCKAP/Faq/Block/Adminhtml/Faq/Grid.php
CHANGED
@@ -1,175 +1,175 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Block_Adminhtml_Faq_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('faqGrid');
|
9 |
-
$this->setDefaultSort('question_id');
|
10 |
-
$this->setDefaultDir('DESC');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
|
13 |
-
}
|
14 |
-
|
15 |
-
protected function _prepareCollection()
|
16 |
-
{
|
17 |
-
$collection = Mage::getModel('faq/faq')->getCollection();
|
18 |
-
$this->setCollection($collection);
|
19 |
-
return parent::_prepareCollection();
|
20 |
-
}
|
21 |
-
|
22 |
-
protected function _prepareColumns()
|
23 |
-
{
|
24 |
-
$this->addColumn('question_id', array(
|
25 |
-
'header' => Mage::helper('faq')->__('Question_ID'),
|
26 |
-
'align' =>'right',
|
27 |
-
'width' => '50px',
|
28 |
-
'index' => 'question_id',
|
29 |
-
));
|
30 |
-
|
31 |
-
$this->addColumn('question', array(
|
32 |
-
'header' => Mage::helper('faq')->__('Question'),
|
33 |
-
'align' =>'left',
|
34 |
-
'index' => 'question',
|
35 |
-
));
|
36 |
-
|
37 |
-
$this->addColumn('answer', array(
|
38 |
-
'header' => Mage::helper('faq')->__('Answer'),
|
39 |
-
'align' =>'left',
|
40 |
-
'index' => 'answer',
|
41 |
-
));
|
42 |
-
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
43 |
-
$valuess = array();
|
44 |
-
$categoryvalues = Mage::getModel('faq/category')->getCollection();
|
45 |
-
foreach ($categoryvalues as $category) {
|
46 |
-
$valuess[$category->getId()] = $category->getName();
|
47 |
-
}
|
48 |
-
$this->addColumn('category', array(
|
49 |
-
'header' => Mage::helper('faq')->__('Category'),
|
50 |
-
'align' => 'left',
|
51 |
-
'width' => '80px',
|
52 |
-
'index' => 'category',
|
53 |
-
'type' => 'options',
|
54 |
-
'options' => $valuess,
|
55 |
-
));
|
56 |
-
}
|
57 |
-
$this->addColumn('status', array(
|
58 |
-
'header' => Mage::helper('faq')->__('Status'),
|
59 |
-
'align' => 'left',
|
60 |
-
'width' => '80px',
|
61 |
-
'index' => 'status',
|
62 |
-
'type' => 'options',
|
63 |
-
'options' => array(
|
64 |
-
1 => 'Enabled',
|
65 |
-
2 => 'Disabled',
|
66 |
-
),
|
67 |
-
));
|
68 |
-
$this->addColumn('byuser', array(
|
69 |
-
'header' => Mage::helper('faq')->__('User/Admin'),
|
70 |
-
'align' => 'left',
|
71 |
-
'width' => '80px',
|
72 |
-
'index' => 'byuser',
|
73 |
-
'type' => 'options',
|
74 |
-
'options' => array(
|
75 |
-
0 => 'Admin',
|
76 |
-
1 => 'Guest',
|
77 |
-
2 => 'Customer',
|
78 |
-
),
|
79 |
-
));
|
80 |
-
$this->addColumn('customer_name',
|
81 |
-
array(
|
82 |
-
'header' => Mage::helper('faq')->__('Customer Name'),
|
83 |
-
'width' => '50px',
|
84 |
-
'index' => 'customer_name'
|
85 |
-
)
|
86 |
-
);
|
87 |
-
if(!Mage::getStoreConfig('faq/faq_group/viewsorter')){
|
88 |
-
$this->addColumn('priority',
|
89 |
-
array(
|
90 |
-
'header' => Mage::helper('faq')->__('Priority'),
|
91 |
-
'width' => '50px',
|
92 |
-
'index' => 'priority'
|
93 |
-
)
|
94 |
-
);
|
95 |
-
}
|
96 |
-
|
97 |
-
if (!Mage::app()->isSingleStoreMode()) {
|
98 |
-
$this->addColumn('store_id', array(
|
99 |
-
'header' => Mage::helper('faq')->__('Store View'),
|
100 |
-
'index' => 'store_id',
|
101 |
-
'type' => 'store',
|
102 |
-
'store_all' => true,
|
103 |
-
'store_view' => true,
|
104 |
-
'sortable' => true,
|
105 |
-
'filter_condition_callback' => array($this,
|
106 |
-
'_filterStoreCondition'),
|
107 |
-
) );
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
$this->addColumn('action',
|
112 |
-
array(
|
113 |
-
'header' => Mage::helper('faq')->__('Action'),
|
114 |
-
'width' => '100',
|
115 |
-
'type' => 'action',
|
116 |
-
'getter' => 'getId',
|
117 |
-
'actions' => array(
|
118 |
-
array(
|
119 |
-
'caption' => Mage::helper('faq')->__('Edit'),
|
120 |
-
'url' => array('base'=> '*/*/edit'),
|
121 |
-
'field' => 'id'
|
122 |
-
)
|
123 |
-
),
|
124 |
-
'filter' => false,
|
125 |
-
'sortable' => false,
|
126 |
-
'index' => 'stores',
|
127 |
-
'is_system' => true,
|
128 |
-
));
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
return parent::_prepareColumns();
|
133 |
-
}
|
134 |
-
protected function _filterStoreCondition($collection, $column){
|
135 |
-
if (!$value = $column->getFilter()->getValue()) {
|
136 |
-
return;
|
137 |
-
}
|
138 |
-
$this->getCollection()->addStoreFilter($value);
|
139 |
-
}
|
140 |
-
|
141 |
-
protected function _prepareMassaction()
|
142 |
-
{
|
143 |
-
$this->setMassactionIdField('question_id');
|
144 |
-
$this->getMassactionBlock()->setFormFieldName('faq');
|
145 |
-
|
146 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
147 |
-
'label' => Mage::helper('faq')->__('Delete'),
|
148 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
149 |
-
'confirm' => Mage::helper('faq')->__('Are you sure?')
|
150 |
-
));
|
151 |
-
$statuses = Mage::getSingleton('faq/status')->getOptionArray();
|
152 |
-
|
153 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
154 |
-
$this->getMassactionBlock()->addItem('status', array(
|
155 |
-
'label'=> Mage::helper('faq')->__('Change status'),
|
156 |
-
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
157 |
-
'additional' => array(
|
158 |
-
'visibility' => array(
|
159 |
-
'name' => 'status',
|
160 |
-
'type' => 'select',
|
161 |
-
'class' => 'required-entry',
|
162 |
-
'label' => Mage::helper('faq')->__('Status'),
|
163 |
-
'values' => $statuses
|
164 |
-
)
|
165 |
-
)
|
166 |
-
));
|
167 |
-
return $this;
|
168 |
-
}
|
169 |
-
|
170 |
-
public function getRowUrl($row)
|
171 |
-
{
|
172 |
-
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
173 |
-
}
|
174 |
-
|
175 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Block_Adminhtml_Faq_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('faqGrid');
|
9 |
+
$this->setDefaultSort('question_id');
|
10 |
+
$this->setDefaultDir('DESC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _prepareCollection()
|
16 |
+
{
|
17 |
+
$collection = Mage::getModel('faq/faq')->getCollection();
|
18 |
+
$this->setCollection($collection);
|
19 |
+
return parent::_prepareCollection();
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareColumns()
|
23 |
+
{
|
24 |
+
$this->addColumn('question_id', array(
|
25 |
+
'header' => Mage::helper('faq')->__('Question_ID'),
|
26 |
+
'align' =>'right',
|
27 |
+
'width' => '50px',
|
28 |
+
'index' => 'question_id',
|
29 |
+
));
|
30 |
+
|
31 |
+
$this->addColumn('question', array(
|
32 |
+
'header' => Mage::helper('faq')->__('Question'),
|
33 |
+
'align' =>'left',
|
34 |
+
'index' => 'question',
|
35 |
+
));
|
36 |
+
|
37 |
+
$this->addColumn('answer', array(
|
38 |
+
'header' => Mage::helper('faq')->__('Answer'),
|
39 |
+
'align' =>'left',
|
40 |
+
'index' => 'answer',
|
41 |
+
));
|
42 |
+
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
43 |
+
$valuess = array();
|
44 |
+
$categoryvalues = Mage::getModel('faq/category')->getCollection();
|
45 |
+
foreach ($categoryvalues as $category) {
|
46 |
+
$valuess[$category->getId()] = $category->getName();
|
47 |
+
}
|
48 |
+
$this->addColumn('category', array(
|
49 |
+
'header' => Mage::helper('faq')->__('Category'),
|
50 |
+
'align' => 'left',
|
51 |
+
'width' => '80px',
|
52 |
+
'index' => 'category',
|
53 |
+
'type' => 'options',
|
54 |
+
'options' => $valuess,
|
55 |
+
));
|
56 |
+
}
|
57 |
+
$this->addColumn('status', array(
|
58 |
+
'header' => Mage::helper('faq')->__('Status'),
|
59 |
+
'align' => 'left',
|
60 |
+
'width' => '80px',
|
61 |
+
'index' => 'status',
|
62 |
+
'type' => 'options',
|
63 |
+
'options' => array(
|
64 |
+
1 => 'Enabled',
|
65 |
+
2 => 'Disabled',
|
66 |
+
),
|
67 |
+
));
|
68 |
+
$this->addColumn('byuser', array(
|
69 |
+
'header' => Mage::helper('faq')->__('User/Admin'),
|
70 |
+
'align' => 'left',
|
71 |
+
'width' => '80px',
|
72 |
+
'index' => 'byuser',
|
73 |
+
'type' => 'options',
|
74 |
+
'options' => array(
|
75 |
+
0 => 'Admin',
|
76 |
+
1 => 'Guest',
|
77 |
+
2 => 'Customer',
|
78 |
+
),
|
79 |
+
));
|
80 |
+
$this->addColumn('customer_name',
|
81 |
+
array(
|
82 |
+
'header' => Mage::helper('faq')->__('Customer Name'),
|
83 |
+
'width' => '50px',
|
84 |
+
'index' => 'customer_name'
|
85 |
+
)
|
86 |
+
);
|
87 |
+
if(!Mage::getStoreConfig('faq/faq_group/viewsorter')){
|
88 |
+
$this->addColumn('priority',
|
89 |
+
array(
|
90 |
+
'header' => Mage::helper('faq')->__('Priority'),
|
91 |
+
'width' => '50px',
|
92 |
+
'index' => 'priority'
|
93 |
+
)
|
94 |
+
);
|
95 |
+
}
|
96 |
+
|
97 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
98 |
+
$this->addColumn('store_id', array(
|
99 |
+
'header' => Mage::helper('faq')->__('Store View'),
|
100 |
+
'index' => 'store_id',
|
101 |
+
'type' => 'store',
|
102 |
+
'store_all' => true,
|
103 |
+
'store_view' => true,
|
104 |
+
'sortable' => true,
|
105 |
+
'filter_condition_callback' => array($this,
|
106 |
+
'_filterStoreCondition'),
|
107 |
+
) );
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
+
$this->addColumn('action',
|
112 |
+
array(
|
113 |
+
'header' => Mage::helper('faq')->__('Action'),
|
114 |
+
'width' => '100',
|
115 |
+
'type' => 'action',
|
116 |
+
'getter' => 'getId',
|
117 |
+
'actions' => array(
|
118 |
+
array(
|
119 |
+
'caption' => Mage::helper('faq')->__('Edit'),
|
120 |
+
'url' => array('base'=> '*/*/edit'),
|
121 |
+
'field' => 'id'
|
122 |
+
)
|
123 |
+
),
|
124 |
+
'filter' => false,
|
125 |
+
'sortable' => false,
|
126 |
+
'index' => 'stores',
|
127 |
+
'is_system' => true,
|
128 |
+
));
|
129 |
+
|
130 |
+
|
131 |
+
|
132 |
+
return parent::_prepareColumns();
|
133 |
+
}
|
134 |
+
protected function _filterStoreCondition($collection, $column){
|
135 |
+
if (!$value = $column->getFilter()->getValue()) {
|
136 |
+
return;
|
137 |
+
}
|
138 |
+
$this->getCollection()->addStoreFilter($value);
|
139 |
+
}
|
140 |
+
|
141 |
+
protected function _prepareMassaction()
|
142 |
+
{
|
143 |
+
$this->setMassactionIdField('question_id');
|
144 |
+
$this->getMassactionBlock()->setFormFieldName('faq');
|
145 |
+
|
146 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
147 |
+
'label' => Mage::helper('faq')->__('Delete'),
|
148 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
149 |
+
'confirm' => Mage::helper('faq')->__('Are you sure?')
|
150 |
+
));
|
151 |
+
$statuses = Mage::getSingleton('faq/status')->getOptionArray();
|
152 |
+
|
153 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
154 |
+
$this->getMassactionBlock()->addItem('status', array(
|
155 |
+
'label'=> Mage::helper('faq')->__('Change status'),
|
156 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
157 |
+
'additional' => array(
|
158 |
+
'visibility' => array(
|
159 |
+
'name' => 'status',
|
160 |
+
'type' => 'select',
|
161 |
+
'class' => 'required-entry',
|
162 |
+
'label' => Mage::helper('faq')->__('Status'),
|
163 |
+
'values' => $statuses
|
164 |
+
)
|
165 |
+
)
|
166 |
+
));
|
167 |
+
return $this;
|
168 |
+
}
|
169 |
+
|
170 |
+
public function getRowUrl($row)
|
171 |
+
{
|
172 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
173 |
+
}
|
174 |
+
|
175 |
+
}
|
app/code/community/DCKAP/Faq/Block/Faq.php
CHANGED
@@ -1,162 +1,162 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Block_Faq extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
private $_itemPerPage;
|
5 |
-
private $_pageFrame = 8;
|
6 |
-
private $_curPage = 1;
|
7 |
-
|
8 |
-
public function _construct()
|
9 |
-
{
|
10 |
-
parent::_construct();
|
11 |
-
$this->_itemPerPage = Mage::getStoreConfig('faq/faq_group/faq_text');
|
12 |
-
|
13 |
-
}
|
14 |
-
public function getFaq($keyword = null)
|
15 |
-
{
|
16 |
-
$currentStore = Mage::app()->getStore(true)->getId();
|
17 |
-
$collection = Mage::getModel('faq/faq')->getCollection();
|
18 |
-
|
19 |
-
$collection->addFieldToSelect('question_id')
|
20 |
-
->addFieldToSelect('question')
|
21 |
-
->addFieldToSelect('answer')
|
22 |
-
->addFieldToFilter('answer', array('neq' => '' ))
|
23 |
-
->addFieldToSelect('store_id')
|
24 |
-
->addFieldToFilter('status',array('eq'=>1))
|
25 |
-
->addFieldToFilter(
|
26 |
-
array('store_id','store_set','store_id','store_set' ),
|
27 |
-
array(
|
28 |
-
array('eq'=>Mage::app()->getStore(true)->getId()),
|
29 |
-
array('like'=>'%,'.$currentStore.',%'),
|
30 |
-
array('eq'=>'0'),
|
31 |
-
array('like'=>'%,0,%')
|
32 |
-
)
|
33 |
-
);
|
34 |
-
if(!Mage::getStoreConfig('faq/faq_group/viewsorter')){
|
35 |
-
$collection->setOrder('priority','ASC');
|
36 |
-
}else{
|
37 |
-
$collection->setOrder('views','DESC');
|
38 |
-
}
|
39 |
-
if($keyword){
|
40 |
-
$collection->addFieldToFilter(
|
41 |
-
array('question','answer' ),
|
42 |
-
array(
|
43 |
-
array('like'=>'%'.$keyword.'%'),
|
44 |
-
array('like'=>'%'.$keyword.'%')
|
45 |
-
)
|
46 |
-
);
|
47 |
-
}
|
48 |
-
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
49 |
-
if($this->getRequest()->getParam('category')){
|
50 |
-
$collection->addFieldtoFilter('category',$this->getRequest()->getParam('category'));
|
51 |
-
}
|
52 |
-
}
|
53 |
-
return $collection;
|
54 |
-
}
|
55 |
-
|
56 |
-
public function getCategories()
|
57 |
-
{
|
58 |
-
$currentStore= Mage::app()->getStore(true)->getId();
|
59 |
-
$collection = Mage::getModel('faq/faq')->getCollection();
|
60 |
-
|
61 |
-
$collection = Mage::getModel('faq/category')->getCollection()->setOrder('priority','ASC');
|
62 |
-
$collection->addFieldToFilter(
|
63 |
-
array('store_id','store_set','store_id','store_set' ),
|
64 |
-
array(
|
65 |
-
array('eq'=>$currentStore),
|
66 |
-
array('like'=>'%,'.$currentStore.',%'),
|
67 |
-
array('eq'=>'0'),
|
68 |
-
array('like'=>'%,0,%')
|
69 |
-
)
|
70 |
-
);
|
71 |
-
$collection->addFieldToFilter('status',array('eq'=>1));
|
72 |
-
return $collection;
|
73 |
-
}
|
74 |
-
public function getCurrentPage()
|
75 |
-
{
|
76 |
-
return $this->getRequest()->getParam('p');
|
77 |
-
}
|
78 |
-
|
79 |
-
public function getCollection($collection = 'null')
|
80 |
-
{
|
81 |
-
|
82 |
-
if($collection != 'null'){
|
83 |
-
$page = $this->getRequest()->getParam('p');
|
84 |
-
if($page) $this->_curPage = $page;
|
85 |
-
|
86 |
-
$collection->setCurPage($this->_curPage);
|
87 |
-
$collection->setPageSize($this->_itemPerPage);
|
88 |
-
return $collection;
|
89 |
-
}
|
90 |
-
|
91 |
-
}
|
92 |
-
|
93 |
-
public function getPagerHtml($collection = 'null')
|
94 |
-
{
|
95 |
-
$html = false;
|
96 |
-
if($collection == 'null') return;
|
97 |
-
|
98 |
-
|
99 |
-
if($collection->count() > $this->_itemPerPage)
|
100 |
-
{
|
101 |
-
$curPage = $this->getRequest()->getParam('p');
|
102 |
-
$pager = (int)($collection->count() / $this->_itemPerPage);
|
103 |
-
$count = ($collection->count() % $this->_itemPerPage == 0) ? $pager : $pager + 1 ;
|
104 |
-
$url = $this->getPagerUrl();
|
105 |
-
$start = 1;
|
106 |
-
$end = $this->_pageFrame;
|
107 |
-
$category = $this->getRequest()->getParam('category');
|
108 |
-
$keyword = $this->getRequest()->getParam('keyword');
|
109 |
-
$slash = "?";
|
110 |
-
if($category || $keyword){
|
111 |
-
$slash = "&";
|
112 |
-
}
|
113 |
-
|
114 |
-
$html .= '<ol>';
|
115 |
-
if(isset($curPage) && $curPage != 1){
|
116 |
-
$start = $curPage - 1;
|
117 |
-
$end = $start + $this->_pageFrame;
|
118 |
-
}else{
|
119 |
-
$end = $start + $this->_pageFrame;
|
120 |
-
}
|
121 |
-
if($end > $count){
|
122 |
-
$start = $count - ($this->_pageFrame-1);
|
123 |
-
}else{
|
124 |
-
$count = $end-1;
|
125 |
-
}
|
126 |
-
|
127 |
-
for($i = $start; $i<=$count; $i++)
|
128 |
-
{
|
129 |
-
if($i >= 1){
|
130 |
-
if($curPage){
|
131 |
-
$html .= ($curPage == $i) ? '<li class="current">'. $i .'</li>' : '<li><a href="'.$url.$slash.'p='.$i.'">'. $i .'</a></li>';
|
132 |
-
}else{
|
133 |
-
$html .= ($i == 1) ? '<li class="current">'. $i .'</li>' : '<li><a href="'.$url.$slash.'p='.$i.'">'. $i .'</a></li>';
|
134 |
-
}
|
135 |
-
}
|
136 |
-
|
137 |
-
}
|
138 |
-
|
139 |
-
$html .= '</ol>';
|
140 |
-
}
|
141 |
-
|
142 |
-
return $html;
|
143 |
-
}
|
144 |
-
|
145 |
-
public function getPagerUrl()
|
146 |
-
{
|
147 |
-
$cur_url = mage::helper('core/url')->getCurrentUrl();
|
148 |
-
$category = $this->getRequest()->getParam('category');
|
149 |
-
$keyword = $this->getRequest()->getParam('keyword');
|
150 |
-
$new_url = preg_replace('/\?p=.*/', '', $cur_url);
|
151 |
-
if($category){
|
152 |
-
$new_url = preg_replace('/\&p=.*/', '', $cur_url);
|
153 |
-
}
|
154 |
-
if($keyword){
|
155 |
-
$new_url = preg_replace('/\&p=.*/', '', $cur_url);
|
156 |
-
}
|
157 |
-
return $new_url;
|
158 |
-
}
|
159 |
-
|
160 |
-
|
161 |
-
}
|
162 |
?>
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Block_Faq extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
private $_itemPerPage;
|
5 |
+
private $_pageFrame = 8;
|
6 |
+
private $_curPage = 1;
|
7 |
+
|
8 |
+
public function _construct()
|
9 |
+
{
|
10 |
+
parent::_construct();
|
11 |
+
$this->_itemPerPage = Mage::getStoreConfig('faq/faq_group/faq_text');
|
12 |
+
|
13 |
+
}
|
14 |
+
public function getFaq($keyword = null)
|
15 |
+
{
|
16 |
+
$currentStore = Mage::app()->getStore(true)->getId();
|
17 |
+
$collection = Mage::getModel('faq/faq')->getCollection();
|
18 |
+
|
19 |
+
$collection->addFieldToSelect('question_id')
|
20 |
+
->addFieldToSelect('question')
|
21 |
+
->addFieldToSelect('answer')
|
22 |
+
->addFieldToFilter('answer', array('neq' => '' ))
|
23 |
+
->addFieldToSelect('store_id')
|
24 |
+
->addFieldToFilter('status',array('eq'=>1))
|
25 |
+
->addFieldToFilter(
|
26 |
+
array('store_id','store_set','store_id','store_set' ),
|
27 |
+
array(
|
28 |
+
array('eq'=>Mage::app()->getStore(true)->getId()),
|
29 |
+
array('like'=>'%,'.$currentStore.',%'),
|
30 |
+
array('eq'=>'0'),
|
31 |
+
array('like'=>'%,0,%')
|
32 |
+
)
|
33 |
+
);
|
34 |
+
if(!Mage::getStoreConfig('faq/faq_group/viewsorter')){
|
35 |
+
$collection->setOrder('priority','ASC');
|
36 |
+
}else{
|
37 |
+
$collection->setOrder('views','DESC');
|
38 |
+
}
|
39 |
+
if($keyword){
|
40 |
+
$collection->addFieldToFilter(
|
41 |
+
array('question','answer' ),
|
42 |
+
array(
|
43 |
+
array('like'=>'%'.$keyword.'%'),
|
44 |
+
array('like'=>'%'.$keyword.'%')
|
45 |
+
)
|
46 |
+
);
|
47 |
+
}
|
48 |
+
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
49 |
+
if($this->getRequest()->getParam('category')){
|
50 |
+
$collection->addFieldtoFilter('category',$this->getRequest()->getParam('category'));
|
51 |
+
}
|
52 |
+
}
|
53 |
+
return $collection;
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getCategories()
|
57 |
+
{
|
58 |
+
$currentStore= Mage::app()->getStore(true)->getId();
|
59 |
+
$collection = Mage::getModel('faq/faq')->getCollection();
|
60 |
+
|
61 |
+
$collection = Mage::getModel('faq/category')->getCollection()->setOrder('priority','ASC');
|
62 |
+
$collection->addFieldToFilter(
|
63 |
+
array('store_id','store_set','store_id','store_set' ),
|
64 |
+
array(
|
65 |
+
array('eq'=>$currentStore),
|
66 |
+
array('like'=>'%,'.$currentStore.',%'),
|
67 |
+
array('eq'=>'0'),
|
68 |
+
array('like'=>'%,0,%')
|
69 |
+
)
|
70 |
+
);
|
71 |
+
$collection->addFieldToFilter('status',array('eq'=>1));
|
72 |
+
return $collection;
|
73 |
+
}
|
74 |
+
public function getCurrentPage()
|
75 |
+
{
|
76 |
+
return $this->getRequest()->getParam('p');
|
77 |
+
}
|
78 |
+
|
79 |
+
public function getCollection($collection = 'null')
|
80 |
+
{
|
81 |
+
|
82 |
+
if($collection != 'null'){
|
83 |
+
$page = $this->getRequest()->getParam('p');
|
84 |
+
if($page) $this->_curPage = $page;
|
85 |
+
|
86 |
+
$collection->setCurPage($this->_curPage);
|
87 |
+
$collection->setPageSize($this->_itemPerPage);
|
88 |
+
return $collection;
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
92 |
+
|
93 |
+
public function getPagerHtml($collection = 'null')
|
94 |
+
{
|
95 |
+
$html = false;
|
96 |
+
if($collection == 'null') return;
|
97 |
+
|
98 |
+
|
99 |
+
if($collection->count() > $this->_itemPerPage)
|
100 |
+
{
|
101 |
+
$curPage = $this->getRequest()->getParam('p');
|
102 |
+
$pager = (int)($collection->count() / $this->_itemPerPage);
|
103 |
+
$count = ($collection->count() % $this->_itemPerPage == 0) ? $pager : $pager + 1 ;
|
104 |
+
$url = $this->getPagerUrl();
|
105 |
+
$start = 1;
|
106 |
+
$end = $this->_pageFrame;
|
107 |
+
$category = $this->getRequest()->getParam('category');
|
108 |
+
$keyword = $this->getRequest()->getParam('keyword');
|
109 |
+
$slash = "?";
|
110 |
+
if($category || $keyword){
|
111 |
+
$slash = "&";
|
112 |
+
}
|
113 |
+
|
114 |
+
$html .= '<ol>';
|
115 |
+
if(isset($curPage) && $curPage != 1){
|
116 |
+
$start = $curPage - 1;
|
117 |
+
$end = $start + $this->_pageFrame;
|
118 |
+
}else{
|
119 |
+
$end = $start + $this->_pageFrame;
|
120 |
+
}
|
121 |
+
if($end > $count){
|
122 |
+
$start = $count - ($this->_pageFrame-1);
|
123 |
+
}else{
|
124 |
+
$count = $end-1;
|
125 |
+
}
|
126 |
+
|
127 |
+
for($i = $start; $i<=$count; $i++)
|
128 |
+
{
|
129 |
+
if($i >= 1){
|
130 |
+
if($curPage){
|
131 |
+
$html .= ($curPage == $i) ? '<li class="current">'. $i .'</li>' : '<li><a href="'.$url.$slash.'p='.$i.'">'. $i .'</a></li>';
|
132 |
+
}else{
|
133 |
+
$html .= ($i == 1) ? '<li class="current">'. $i .'</li>' : '<li><a href="'.$url.$slash.'p='.$i.'">'. $i .'</a></li>';
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
$html .= '</ol>';
|
140 |
+
}
|
141 |
+
|
142 |
+
return $html;
|
143 |
+
}
|
144 |
+
|
145 |
+
public function getPagerUrl()
|
146 |
+
{
|
147 |
+
$cur_url = mage::helper('core/url')->getCurrentUrl();
|
148 |
+
$category = $this->getRequest()->getParam('category');
|
149 |
+
$keyword = $this->getRequest()->getParam('keyword');
|
150 |
+
$new_url = preg_replace('/\?p=.*/', '', $cur_url);
|
151 |
+
if($category){
|
152 |
+
$new_url = preg_replace('/\&p=.*/', '', $cur_url);
|
153 |
+
}
|
154 |
+
if($keyword){
|
155 |
+
$new_url = preg_replace('/\&p=.*/', '', $cur_url);
|
156 |
+
}
|
157 |
+
return $new_url;
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
}
|
162 |
?>
|
app/code/community/DCKAP/Faq/Block/Widget.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Block_Widget extends Mage_Core_Block_Template
|
3 |
+
implements Mage_Widget_Block_Interface {
|
4 |
+
|
5 |
+
protected function _toHtml() {
|
6 |
+
return $this->getLayout()->createBlock('faq/faq')->setTemplate('faq/faq.phtml')->toHtml();
|
7 |
+
}
|
8 |
+
}
|
app/code/community/DCKAP/Faq/Helper/Data.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
-
{
|
4 |
-
|
5 |
-
}
|
6 |
?>
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
6 |
?>
|
app/code/community/DCKAP/Faq/Model/Category.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Model_Category extends Mage_Core_Model_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
parent::_construct();
|
7 |
-
$this->_init('faq/category');
|
8 |
-
}
|
9 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Model_Category extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('faq/category');
|
8 |
+
}
|
9 |
}
|
app/code/community/DCKAP/Faq/Model/Faq.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Model_Faq extends Mage_Core_Model_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
parent::_construct();
|
7 |
-
$this->_init('faq/faq');
|
8 |
-
}
|
9 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Model_Faq extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('faq/faq');
|
8 |
+
}
|
9 |
}
|
app/code/community/DCKAP/Faq/Model/Mysql4/Category.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
$this->_init('faq/category','cat_id');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('faq/category','cat_id');
|
7 |
+
}
|
8 |
}
|
app/code/community/DCKAP/Faq/Model/Mysql4/Category/Collection.php
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
parent::_construct();
|
7 |
-
$this->_init('faq/category');
|
8 |
-
}
|
9 |
-
public function addStoreFilter($store, $withAdmin = true) {
|
10 |
-
|
11 |
-
if ($store instanceof Mage_Core_Model_Store) {
|
12 |
-
$store = array($store->getId());
|
13 |
-
}
|
14 |
-
|
15 |
-
if (!is_array($store)) {
|
16 |
-
$store = array($store);
|
17 |
-
}
|
18 |
-
|
19 |
-
$this->addFilter('store_id', array('in' => $store));
|
20 |
-
|
21 |
-
return $this;
|
22 |
-
}
|
23 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('faq/category');
|
8 |
+
}
|
9 |
+
public function addStoreFilter($store, $withAdmin = true) {
|
10 |
+
|
11 |
+
if ($store instanceof Mage_Core_Model_Store) {
|
12 |
+
$store = array($store->getId());
|
13 |
+
}
|
14 |
+
|
15 |
+
if (!is_array($store)) {
|
16 |
+
$store = array($store);
|
17 |
+
}
|
18 |
+
|
19 |
+
$this->addFilter('store_id', array('in' => $store));
|
20 |
+
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
}
|
app/code/community/DCKAP/Faq/Model/Mysql4/Faq.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Model_Mysql4_Faq extends Mage_Core_Model_Mysql4_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
$this->_init('faq/faq','question_id');
|
7 |
-
}
|
8 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Model_Mysql4_Faq extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('faq/faq','question_id');
|
7 |
+
}
|
8 |
}
|
app/code/community/DCKAP/Faq/Model/Mysql4/Faq/Collection.php
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
parent::_construct();
|
7 |
-
$this->_init('faq/faq');
|
8 |
-
}
|
9 |
-
public function addStoreFilter($store, $withAdmin = true) {
|
10 |
-
|
11 |
-
if ($store instanceof Mage_Core_Model_Store) {
|
12 |
-
$store = array($store->getId());
|
13 |
-
}
|
14 |
-
|
15 |
-
if (!is_array($store)) {
|
16 |
-
$store = array($store);
|
17 |
-
}
|
18 |
-
|
19 |
-
$this->addFilter('store_id', array('in' => $store));
|
20 |
-
|
21 |
-
return $this;
|
22 |
-
}
|
23 |
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('faq/faq');
|
8 |
+
}
|
9 |
+
public function addStoreFilter($store, $withAdmin = true) {
|
10 |
+
|
11 |
+
if ($store instanceof Mage_Core_Model_Store) {
|
12 |
+
$store = array($store->getId());
|
13 |
+
}
|
14 |
+
|
15 |
+
if (!is_array($store)) {
|
16 |
+
$store = array($store);
|
17 |
+
}
|
18 |
+
|
19 |
+
$this->addFilter('store_id', array('in' => $store));
|
20 |
+
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
}
|
app/code/community/DCKAP/Faq/Model/Status.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Model_Status extends Varien_Object
|
4 |
-
{
|
5 |
-
const STATUS_ENABLED = 1;
|
6 |
-
const STATUS_DISABLED = 2;
|
7 |
-
|
8 |
-
static public function getOptionArray()
|
9 |
-
{
|
10 |
-
return array(
|
11 |
-
self::STATUS_ENABLED => Mage::helper('faq')->__('Enabled'),
|
12 |
-
self::STATUS_DISABLED => Mage::helper('faq')->__('Disabled')
|
13 |
-
);
|
14 |
-
}
|
15 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('faq')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('faq')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
}
|
app/code/community/DCKAP/Faq/controllers/Adminhtml/CategoryController.php
CHANGED
@@ -1,171 +1,168 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Adminhtml_CategoryController extends Mage_Adminhtml_Controller_action
|
4 |
-
{
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
->
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
$this->
|
42 |
-
$this->
|
43 |
-
|
44 |
-
$this->
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
$this->
|
50 |
-
|
51 |
-
|
52 |
-
$this->
|
53 |
-
}
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
if
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
Mage::getSingleton('adminhtml/session')->
|
116 |
-
$this->_redirect('*/*/');
|
117 |
-
}
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
->
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
$this->_redirect('*/*/index');
|
169 |
-
}
|
170 |
-
}
|
171 |
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Adminhtml_CategoryController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('faq/categoryitems')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
$faqEnable= Mage::getStoreConfig('faq/faq_group/faq_select');
|
16 |
+
if($faqEnable && Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
17 |
+
$this->_initAction()
|
18 |
+
->renderLayout();
|
19 |
+
}
|
20 |
+
else{
|
21 |
+
$this->_redirect('adminhtml/dashboard/index');
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
public function editAction() {
|
26 |
+
$id = $this->getRequest()->getParam('id');
|
27 |
+
$model = Mage::getModel('faq/category')->load($id);
|
28 |
+
|
29 |
+
if ($model->getId() || $id == 0) {
|
30 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
31 |
+
$data1["store_set"]=",".$data["store_id"].",";
|
32 |
+
if (!empty($data)) {
|
33 |
+
$model->setData($data);
|
34 |
+
$model->setData($data1);
|
35 |
+
}
|
36 |
+
Mage::register('category_data', $model);
|
37 |
+
|
38 |
+
$this->loadLayout();
|
39 |
+
$this->_setActiveMenu('faq/categoryitems');
|
40 |
+
|
41 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
42 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
43 |
+
|
44 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
45 |
+
|
46 |
+
$this->_addContent($this->getLayout()->createBlock('faq/adminhtml_category_edit'))
|
47 |
+
->_addLeft($this->getLayout()->createBlock('faq/adminhtml_category_edit_tabs'));
|
48 |
+
|
49 |
+
$this->renderLayout();
|
50 |
+
} else {
|
51 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Item does not exist'));
|
52 |
+
$this->_redirect('*/*/');
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
public function newAction() {
|
57 |
+
$this->_forward('edit');
|
58 |
+
}
|
59 |
+
|
60 |
+
public function saveAction() {
|
61 |
+
if ($data = $this->getRequest()->getPost()) {
|
62 |
+
|
63 |
+
|
64 |
+
if(isset($data['stores'])) {
|
65 |
+
if(in_array('0',$data['stores'])){
|
66 |
+
$data['store_id'] = '0';
|
67 |
+
}
|
68 |
+
else{
|
69 |
+
$data['store_id'] = implode(",", $data['stores']);
|
70 |
+
}
|
71 |
+
unset($data['stores']);
|
72 |
+
}
|
73 |
+
$data["store_set"]=",".$data["store_id"].",";
|
74 |
+
$model = Mage::getModel('faq/category');
|
75 |
+
|
76 |
+
$model->setData($data)
|
77 |
+
->setId($this->getRequest()->getParam('id'));
|
78 |
+
|
79 |
+
|
80 |
+
try {
|
81 |
+
|
82 |
+
$model->save();
|
83 |
+
|
84 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('faq')->__('Item was successfully saved'));
|
85 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
86 |
+
|
87 |
+
if ($this->getRequest()->getParam('back')) {
|
88 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
$this->_redirect('*/*/');
|
92 |
+
return;
|
93 |
+
} catch (Exception $e) {
|
94 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
95 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
96 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
97 |
+
return;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Unable to find item to save'));
|
101 |
+
$this->_redirect('*/*/');
|
102 |
+
}
|
103 |
+
|
104 |
+
public function deleteAction() {
|
105 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
106 |
+
try {
|
107 |
+
$model = Mage::getModel('faq/category');
|
108 |
+
|
109 |
+
$model->setId($this->getRequest()->getParam('id'))
|
110 |
+
->delete();
|
111 |
+
|
112 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
113 |
+
$this->_redirect('*/*/');
|
114 |
+
} catch (Exception $e) {
|
115 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
116 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
117 |
+
}
|
118 |
+
}
|
119 |
+
$this->_redirect('*/*/');
|
120 |
+
}
|
121 |
+
|
122 |
+
public function massDeleteAction() {
|
123 |
+
$questionIds = $this->getRequest()->getParam('faq');
|
124 |
+
if(!is_array($questionIds)) {
|
125 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
126 |
+
} else {
|
127 |
+
try {
|
128 |
+
foreach ($questionIds as $questionId) {
|
129 |
+
$question = Mage::getModel('faq/category')->load($questionId);
|
130 |
+
$question->delete();
|
131 |
+
}
|
132 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
133 |
+
Mage::helper('adminhtml')->__(
|
134 |
+
'Total of %d record(s) were successfully deleted', count($questionIds)
|
135 |
+
)
|
136 |
+
);
|
137 |
+
} catch (Exception $e) {
|
138 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
139 |
+
}
|
140 |
+
}
|
141 |
+
$this->_redirect('*/*/index');
|
142 |
+
}
|
143 |
+
|
144 |
+
public function massStatusAction()
|
145 |
+
{
|
146 |
+
$questionIds = $this->getRequest()->getParam('faq');
|
147 |
+
if(!is_array($questionIds)) {
|
148 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
149 |
+
} else {
|
150 |
+
try {
|
151 |
+
foreach ($questionIds as $questionId) {
|
152 |
+
$question = Mage::getSingleton('faq/category')
|
153 |
+
->load($questionId)
|
154 |
+
->setStatus($this->getRequest()->getParam('status'))
|
155 |
+
->setIsMassupdate(true)
|
156 |
+
->save();
|
157 |
+
}
|
158 |
+
$this->_getSession()->addSuccess(
|
159 |
+
$this->__('Total of %d record(s) were successfully updated', count($questionIds))
|
160 |
+
);
|
161 |
+
} catch (Exception $e) {
|
162 |
+
$this->_getSession()->addError($e->getMessage());
|
163 |
+
}
|
164 |
+
}
|
165 |
+
$this->_redirect('*/*/index');
|
166 |
+
}
|
167 |
+
}
|
|
|
|
|
|
|
168 |
|
app/code/community/DCKAP/Faq/controllers/Adminhtml/FaqController.php
CHANGED
@@ -1,194 +1,194 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Adminhtml_FaqController extends Mage_Adminhtml_Controller_action
|
4 |
-
{
|
5 |
-
|
6 |
-
protected function _initAction() {
|
7 |
-
$this->loadLayout()
|
8 |
-
->_setActiveMenu('faq/items')
|
9 |
-
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
-
|
11 |
-
return $this;
|
12 |
-
}
|
13 |
-
|
14 |
-
public function indexAction() {
|
15 |
-
$faqEnable= Mage::getStoreConfig('faq/faq_group/faq_select');
|
16 |
-
if($faqEnable){
|
17 |
-
$this->_initAction()
|
18 |
-
->renderLayout();
|
19 |
-
}
|
20 |
-
else{
|
21 |
-
$this->_redirect('adminhtml/dashboard/index');
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
public function editAction() {
|
26 |
-
$id = $this->getRequest()->getParam('id');
|
27 |
-
$model = Mage::getModel('faq/faq')->load($id);
|
28 |
-
|
29 |
-
if ($model->getId() || $id == 0) {
|
30 |
-
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
31 |
-
$data1["store_set"]=",".$data["store_id"].",";
|
32 |
-
if (!empty($data)) {
|
33 |
-
$model->setData($data);
|
34 |
-
$model->setData($data1);
|
35 |
-
}
|
36 |
-
Mage::register('faq_data', $model);
|
37 |
-
|
38 |
-
$this->loadLayout();
|
39 |
-
$this->_setActiveMenu('faq/items');
|
40 |
-
|
41 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
42 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
43 |
-
|
44 |
-
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
45 |
-
|
46 |
-
$this->_addContent($this->getLayout()->createBlock('faq/adminhtml_faq_edit'))
|
47 |
-
->_addLeft($this->getLayout()->createBlock('faq/adminhtml_faq_edit_tabs'));
|
48 |
-
|
49 |
-
$this->renderLayout();
|
50 |
-
} else {
|
51 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Item does not exist'));
|
52 |
-
$this->_redirect('*/*/');
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
public function newAction() {
|
57 |
-
$this->_forward('edit');
|
58 |
-
}
|
59 |
-
|
60 |
-
public function saveAction() {
|
61 |
-
if ($data = $this->getRequest()->getPost()) {
|
62 |
-
|
63 |
-
|
64 |
-
if(isset($data['stores'])) {
|
65 |
-
if(in_array('0',$data['stores'])){
|
66 |
-
$data['store_id'] = '0';
|
67 |
-
}
|
68 |
-
else{
|
69 |
-
$data['store_id'] = implode(",", $data['stores']);
|
70 |
-
}
|
71 |
-
unset($data['stores']);
|
72 |
-
}
|
73 |
-
$data["store_set"]=",".$data["store_id"].",";
|
74 |
-
$customerData = Mage::getModel('faq/faq')->load($this->getRequest()->getParam('id'));
|
75 |
-
$notified = "";
|
76 |
-
if(Mage::getStoreConfig('faq/notifications/mail_enable') && !$customerData->getNotified() && $customerData->getCustomerEmail() && $data['status']){
|
77 |
-
$email = Mage::getModel('core/email_template')->loadDefault(Mage::getStoreConfig('faq/notifications/emailtemplate'));
|
78 |
-
|
79 |
-
$question = $data["question"];
|
80 |
-
$receiver = $customerData->getCustomerName();
|
81 |
-
$sendto = $customerData->getCustomerEmail();
|
82 |
-
|
83 |
-
$email->setTemplateSubject(Mage::getStoreConfig('faq/notifications/mail_subject'));
|
84 |
-
$email->setSenderName(Mage::getStoreConfig('faq/notifications/mail_sendername'));
|
85 |
-
$email->setSenderEmail(Mage::getStoreConfig('faq/notifications/mail_sendermail'));
|
86 |
-
$faqurl = str_replace("/index.php", "", Mage::getBaseUrl())."index.php/faq";
|
87 |
-
$data1 = array('question' => $question,'faq_url' => $faqurl,'receiver' => $receiver);
|
88 |
-
|
89 |
-
$notified = $email->send($sendto, $receiver, $data1);
|
90 |
-
}
|
91 |
-
|
92 |
-
$model = Mage::getModel('faq/faq');
|
93 |
-
if($notified){
|
94 |
-
$data['notified'] = 1;
|
95 |
-
}
|
96 |
-
|
97 |
-
$model->setData($data)
|
98 |
-
->setId($this->getRequest()->getParam('id'));
|
99 |
-
|
100 |
-
try {
|
101 |
-
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
102 |
-
$model->setCreatedTime(now())
|
103 |
-
->setUpdateTime(now());
|
104 |
-
} else {
|
105 |
-
$model->setUpdateTime(now());
|
106 |
-
}
|
107 |
-
|
108 |
-
$model->save();
|
109 |
-
|
110 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('faq')->__('Item was successfully saved'));
|
111 |
-
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
112 |
-
|
113 |
-
if ($this->getRequest()->getParam('back')) {
|
114 |
-
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
115 |
-
return;
|
116 |
-
}
|
117 |
-
$this->_redirect('*/*/');
|
118 |
-
return;
|
119 |
-
} catch (Exception $e) {
|
120 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
121 |
-
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
122 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
123 |
-
return;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Unable to find item to save'));
|
127 |
-
$this->_redirect('*/*/');
|
128 |
-
}
|
129 |
-
|
130 |
-
public function deleteAction() {
|
131 |
-
if( $this->getRequest()->getParam('id') > 0 ) {
|
132 |
-
try {
|
133 |
-
$model = Mage::getModel('faq/faq');
|
134 |
-
|
135 |
-
$model->setId($this->getRequest()->getParam('id'))
|
136 |
-
->delete();
|
137 |
-
|
138 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
139 |
-
$this->_redirect('*/*/');
|
140 |
-
} catch (Exception $e) {
|
141 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
142 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
143 |
-
}
|
144 |
-
}
|
145 |
-
$this->_redirect('*/*/');
|
146 |
-
}
|
147 |
-
|
148 |
-
public function massDeleteAction() {
|
149 |
-
$questionIds = $this->getRequest()->getParam('faq');
|
150 |
-
if(!is_array($questionIds)) {
|
151 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
152 |
-
} else {
|
153 |
-
try {
|
154 |
-
foreach ($questionIds as $questionId) {
|
155 |
-
$question = Mage::getModel('faq/faq')->load($questionId);
|
156 |
-
$question->delete();
|
157 |
-
}
|
158 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(
|
159 |
-
Mage::helper('adminhtml')->__(
|
160 |
-
'Total of %d record(s) were successfully deleted', count($questionIds)
|
161 |
-
)
|
162 |
-
);
|
163 |
-
} catch (Exception $e) {
|
164 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
165 |
-
}
|
166 |
-
}
|
167 |
-
$this->_redirect('*/*/index');
|
168 |
-
}
|
169 |
-
|
170 |
-
public function massStatusAction()
|
171 |
-
{
|
172 |
-
$questionIds = $this->getRequest()->getParam('faq');
|
173 |
-
if(!is_array($questionIds)) {
|
174 |
-
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
175 |
-
} else {
|
176 |
-
try {
|
177 |
-
foreach ($questionIds as $questionId) {
|
178 |
-
$question = Mage::getSingleton('faq/faq')
|
179 |
-
->load($questionId)
|
180 |
-
->setStatus($this->getRequest()->getParam('status'))
|
181 |
-
->setIsMassupdate(true)
|
182 |
-
->save();
|
183 |
-
}
|
184 |
-
$this->_getSession()->addSuccess(
|
185 |
-
$this->__('Total of %d record(s) were successfully updated', count($questionIds))
|
186 |
-
);
|
187 |
-
} catch (Exception $e) {
|
188 |
-
$this->_getSession()->addError($e->getMessage());
|
189 |
-
}
|
190 |
-
}
|
191 |
-
$this->_redirect('*/*/index');
|
192 |
-
}
|
193 |
-
}
|
194 |
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DCKAP_Faq_Adminhtml_FaqController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('faq/items')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
$faqEnable= Mage::getStoreConfig('faq/faq_group/faq_select');
|
16 |
+
if($faqEnable){
|
17 |
+
$this->_initAction()
|
18 |
+
->renderLayout();
|
19 |
+
}
|
20 |
+
else{
|
21 |
+
$this->_redirect('adminhtml/dashboard/index');
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
public function editAction() {
|
26 |
+
$id = $this->getRequest()->getParam('id');
|
27 |
+
$model = Mage::getModel('faq/faq')->load($id);
|
28 |
+
|
29 |
+
if ($model->getId() || $id == 0) {
|
30 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
31 |
+
$data1["store_set"]=",".$data["store_id"].",";
|
32 |
+
if (!empty($data)) {
|
33 |
+
$model->setData($data);
|
34 |
+
$model->setData($data1);
|
35 |
+
}
|
36 |
+
Mage::register('faq_data', $model);
|
37 |
+
|
38 |
+
$this->loadLayout();
|
39 |
+
$this->_setActiveMenu('faq/items');
|
40 |
+
|
41 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
42 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
43 |
+
|
44 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
45 |
+
|
46 |
+
$this->_addContent($this->getLayout()->createBlock('faq/adminhtml_faq_edit'))
|
47 |
+
->_addLeft($this->getLayout()->createBlock('faq/adminhtml_faq_edit_tabs'));
|
48 |
+
|
49 |
+
$this->renderLayout();
|
50 |
+
} else {
|
51 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Item does not exist'));
|
52 |
+
$this->_redirect('*/*/');
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
public function newAction() {
|
57 |
+
$this->_forward('edit');
|
58 |
+
}
|
59 |
+
|
60 |
+
public function saveAction() {
|
61 |
+
if ($data = $this->getRequest()->getPost()) {
|
62 |
+
|
63 |
+
|
64 |
+
if(isset($data['stores'])) {
|
65 |
+
if(in_array('0',$data['stores'])){
|
66 |
+
$data['store_id'] = '0';
|
67 |
+
}
|
68 |
+
else{
|
69 |
+
$data['store_id'] = implode(",", $data['stores']);
|
70 |
+
}
|
71 |
+
unset($data['stores']);
|
72 |
+
}
|
73 |
+
$data["store_set"]=",".$data["store_id"].",";
|
74 |
+
$customerData = Mage::getModel('faq/faq')->load($this->getRequest()->getParam('id'));
|
75 |
+
$notified = "";
|
76 |
+
if(Mage::getStoreConfig('faq/notifications/mail_enable') && !$customerData->getNotified() && $customerData->getCustomerEmail() && $data['status']){
|
77 |
+
$email = Mage::getModel('core/email_template')->loadDefault(Mage::getStoreConfig('faq/notifications/emailtemplate'));
|
78 |
+
|
79 |
+
$question = $data["question"];
|
80 |
+
$receiver = $customerData->getCustomerName();
|
81 |
+
$sendto = $customerData->getCustomerEmail();
|
82 |
+
|
83 |
+
$email->setTemplateSubject(Mage::getStoreConfig('faq/notifications/mail_subject'));
|
84 |
+
$email->setSenderName(Mage::getStoreConfig('faq/notifications/mail_sendername'));
|
85 |
+
$email->setSenderEmail(Mage::getStoreConfig('faq/notifications/mail_sendermail'));
|
86 |
+
$faqurl = str_replace("/index.php", "", Mage::getBaseUrl())."index.php/faq";
|
87 |
+
$data1 = array('question' => $question,'faq_url' => $faqurl,'receiver' => $receiver);
|
88 |
+
|
89 |
+
$notified = $email->send($sendto, $receiver, $data1);
|
90 |
+
}
|
91 |
+
|
92 |
+
$model = Mage::getModel('faq/faq');
|
93 |
+
if($notified){
|
94 |
+
$data['notified'] = 1;
|
95 |
+
}
|
96 |
+
|
97 |
+
$model->setData($data)
|
98 |
+
->setId($this->getRequest()->getParam('id'));
|
99 |
+
|
100 |
+
try {
|
101 |
+
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
102 |
+
$model->setCreatedTime(now())
|
103 |
+
->setUpdateTime(now());
|
104 |
+
} else {
|
105 |
+
$model->setUpdateTime(now());
|
106 |
+
}
|
107 |
+
|
108 |
+
$model->save();
|
109 |
+
|
110 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('faq')->__('Item was successfully saved'));
|
111 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
112 |
+
|
113 |
+
if ($this->getRequest()->getParam('back')) {
|
114 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
115 |
+
return;
|
116 |
+
}
|
117 |
+
$this->_redirect('*/*/');
|
118 |
+
return;
|
119 |
+
} catch (Exception $e) {
|
120 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
121 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
122 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
123 |
+
return;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Unable to find item to save'));
|
127 |
+
$this->_redirect('*/*/');
|
128 |
+
}
|
129 |
+
|
130 |
+
public function deleteAction() {
|
131 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
132 |
+
try {
|
133 |
+
$model = Mage::getModel('faq/faq');
|
134 |
+
|
135 |
+
$model->setId($this->getRequest()->getParam('id'))
|
136 |
+
->delete();
|
137 |
+
|
138 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
139 |
+
$this->_redirect('*/*/');
|
140 |
+
} catch (Exception $e) {
|
141 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
142 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
143 |
+
}
|
144 |
+
}
|
145 |
+
$this->_redirect('*/*/');
|
146 |
+
}
|
147 |
+
|
148 |
+
public function massDeleteAction() {
|
149 |
+
$questionIds = $this->getRequest()->getParam('faq');
|
150 |
+
if(!is_array($questionIds)) {
|
151 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
152 |
+
} else {
|
153 |
+
try {
|
154 |
+
foreach ($questionIds as $questionId) {
|
155 |
+
$question = Mage::getModel('faq/faq')->load($questionId);
|
156 |
+
$question->delete();
|
157 |
+
}
|
158 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
159 |
+
Mage::helper('adminhtml')->__(
|
160 |
+
'Total of %d record(s) were successfully deleted', count($questionIds)
|
161 |
+
)
|
162 |
+
);
|
163 |
+
} catch (Exception $e) {
|
164 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
165 |
+
}
|
166 |
+
}
|
167 |
+
$this->_redirect('*/*/index');
|
168 |
+
}
|
169 |
+
|
170 |
+
public function massStatusAction()
|
171 |
+
{
|
172 |
+
$questionIds = $this->getRequest()->getParam('faq');
|
173 |
+
if(!is_array($questionIds)) {
|
174 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
175 |
+
} else {
|
176 |
+
try {
|
177 |
+
foreach ($questionIds as $questionId) {
|
178 |
+
$question = Mage::getSingleton('faq/faq')
|
179 |
+
->load($questionId)
|
180 |
+
->setStatus($this->getRequest()->getParam('status'))
|
181 |
+
->setIsMassupdate(true)
|
182 |
+
->save();
|
183 |
+
}
|
184 |
+
$this->_getSession()->addSuccess(
|
185 |
+
$this->__('Total of %d record(s) were successfully updated', count($questionIds))
|
186 |
+
);
|
187 |
+
} catch (Exception $e) {
|
188 |
+
$this->_getSession()->addError($e->getMessage());
|
189 |
+
}
|
190 |
+
}
|
191 |
+
$this->_redirect('*/*/index');
|
192 |
+
}
|
193 |
+
}
|
194 |
|
app/code/community/DCKAP/Faq/controllers/Adminhtml/FaqController.php~
DELETED
@@ -1,193 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class DCKAP_Faq_Adminhtml_FaqController extends Mage_Adminhtml_Controller_action
|
4 |
-
{
|
5 |
-
|
6 |
-
protected function _initAction() {
|
7 |
-
$this->loadLayout()
|
8 |
-
->_setActiveMenu('faq/items')
|
9 |
-
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
-
|
11 |
-
return $this;
|
12 |
-
}
|
13 |
-
|
14 |
-
public function indexAction() {
|
15 |
-
$faqEnable= Mage::getStoreConfig('faq/faq_group/faq_select');
|
16 |
-
if($faqEnable){
|
17 |
-
$this->_initAction()
|
18 |
-
->renderLayout();
|
19 |
-
}
|
20 |
-
else{
|
21 |
-
$this->_redirect('adminhtml/dashboard/index');
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
public function editAction() {
|
26 |
-
$id = $this->getRequest()->getParam('id');
|
27 |
-
$model = Mage::getModel('faq/faq')->load($id);
|
28 |
-
|
29 |
-
if ($model->getId() || $id == 0) {
|
30 |
-
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
31 |
-
$data1["store_set"]=",".$data["store_id"].",";
|
32 |
-
if (!empty($data)) {
|
33 |
-
$model->setData($data);
|
34 |
-
$model->setData($data1);
|
35 |
-
}
|
36 |
-
Mage::register('faq_data', $model);
|
37 |
-
|
38 |
-
$this->loadLayout();
|
39 |
-
$this->_setActiveMenu('faq/items');
|
40 |
-
|
41 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
42 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
43 |
-
|
44 |
-
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
45 |
-
|
46 |
-
$this->_addContent($this->getLayout()->createBlock('faq/adminhtml_faq_edit'))
|
47 |
-
->_addLeft($this->getLayout()->createBlock('faq/adminhtml_faq_edit_tabs'));
|
48 |
-
|
49 |
-
$this->renderLayout();
|
50 |
-
} else {
|
51 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Item does not exist'));
|
52 |
-
$this->_redirect('*/*/');
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
public function newAction() {
|
57 |
-
$this->_forward('edit');
|
58 |
-
}
|
59 |
-
|
60 |
-
public function saveAction() {
|
61 |
-
if ($data = $this->getRequest()->getPost()) {
|
62 |
-
|
63 |
-
|
64 |
-
if(isset($data['stores'])) {
|
65 |
-
if(in_array('0',$data['stores'])){
|
66 |
-
$data['store_id'] = '0';
|
67 |
-
}
|
68 |
-
else{
|
69 |
-
$data['store_id'] = implode(",", $data['stores']);
|
70 |
-
}
|
71 |
-
unset($data['stores']);
|
72 |
-
}
|
73 |
-
$data["store_set"]=",".$data["store_id"].",";
|
74 |
-
$customerData = Mage::getModel('faq/faq')->load($this->getRequest()->getParam('id'));
|
75 |
-
$notified = "";
|
76 |
-
if(Mage::getStoreConfig('faq/notifications/mail_enable') && !$customerData->getNotified() && $customerData->getCustomerEmail() && $data['status']){
|
77 |
-
$email = Mage::getModel('core/email_template')->loadDefault(Mage::getStoreConfig('faq/notifications/emailtemplate'));
|
78 |
-
|
79 |
-
$question = $data["question"];
|
80 |
-
$receiver = $customerData->getCustomerName();
|
81 |
-
$sendto = $customerData->getCustomerEmail();
|
82 |
-
|
83 |
-
$email->setTemplateSubject(Mage::getStoreConfig('faq/notifications/mail_subject'));
|
84 |
-
$email->setSenderName(Mage::getStoreConfig('faq/notifications/mail_sendername'));
|
85 |
-
$email->setSenderEmail(Mage::getStoreConfig('faq/notifications/mail_sendermail'));
|
86 |
-
$faqurl = str_replace("/index.php", "", Mage::getBaseUrl())."index.php/faq";
|
87 |
-
$data1 = array('question' => $question,'faq_url' => $faqurl,'receiver' => $receiver);
|
88 |
-
$notified = $email->send($sendto, $receiver, $data);
|
89 |
-
}
|
90 |
-
|
91 |
-
$model = Mage::getModel('faq/faq');
|
92 |
-
if($notified){
|
93 |
-
$data['notified'] = 1;
|
94 |
-
}
|
95 |
-
|
96 |
-
$model->setData($data)
|
97 |
-
->setId($this->getRequest()->getParam('id'));
|
98 |
-
|
99 |
-
try {
|
100 |
-
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
101 |
-
$model->setCreatedTime(now())
|
102 |
-
->setUpdateTime(now());
|
103 |
-
} else {
|
104 |
-
$model->setUpdateTime(now());
|
105 |
-
}
|
106 |
-
|
107 |
-
$model->save();
|
108 |
-
|
109 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('faq')->__('Item was successfully saved'));
|
110 |
-
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
111 |
-
|
112 |
-
if ($this->getRequest()->getParam('back')) {
|
113 |
-
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
114 |
-
return;
|
115 |
-
}
|
116 |
-
$this->_redirect('*/*/');
|
117 |
-
return;
|
118 |
-
} catch (Exception $e) {
|
119 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
120 |
-
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
121 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
122 |
-
return;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Unable to find item to save'));
|
126 |
-
$this->_redirect('*/*/');
|
127 |
-
}
|
128 |
-
|
129 |
-
public function deleteAction() {
|
130 |
-
if( $this->getRequest()->getParam('id') > 0 ) {
|
131 |
-
try {
|
132 |
-
$model = Mage::getModel('faq/faq');
|
133 |
-
|
134 |
-
$model->setId($this->getRequest()->getParam('id'))
|
135 |
-
->delete();
|
136 |
-
|
137 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
138 |
-
$this->_redirect('*/*/');
|
139 |
-
} catch (Exception $e) {
|
140 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
141 |
-
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
142 |
-
}
|
143 |
-
}
|
144 |
-
$this->_redirect('*/*/');
|
145 |
-
}
|
146 |
-
|
147 |
-
public function massDeleteAction() {
|
148 |
-
$questionIds = $this->getRequest()->getParam('faq');
|
149 |
-
if(!is_array($questionIds)) {
|
150 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
151 |
-
} else {
|
152 |
-
try {
|
153 |
-
foreach ($questionIds as $questionId) {
|
154 |
-
$question = Mage::getModel('faq/faq')->load($questionId);
|
155 |
-
$question->delete();
|
156 |
-
}
|
157 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(
|
158 |
-
Mage::helper('adminhtml')->__(
|
159 |
-
'Total of %d record(s) were successfully deleted', count($questionIds)
|
160 |
-
)
|
161 |
-
);
|
162 |
-
} catch (Exception $e) {
|
163 |
-
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
164 |
-
}
|
165 |
-
}
|
166 |
-
$this->_redirect('*/*/index');
|
167 |
-
}
|
168 |
-
|
169 |
-
public function massStatusAction()
|
170 |
-
{
|
171 |
-
$questionIds = $this->getRequest()->getParam('faq');
|
172 |
-
if(!is_array($questionIds)) {
|
173 |
-
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
174 |
-
} else {
|
175 |
-
try {
|
176 |
-
foreach ($questionIds as $questionId) {
|
177 |
-
$question = Mage::getSingleton('faq/faq')
|
178 |
-
->load($questionId)
|
179 |
-
->setStatus($this->getRequest()->getParam('status'))
|
180 |
-
->setIsMassupdate(true)
|
181 |
-
->save();
|
182 |
-
}
|
183 |
-
$this->_getSession()->addSuccess(
|
184 |
-
$this->__('Total of %d record(s) were successfully updated', count($questionIds))
|
185 |
-
);
|
186 |
-
} catch (Exception $e) {
|
187 |
-
$this->_getSession()->addError($e->getMessage());
|
188 |
-
}
|
189 |
-
}
|
190 |
-
$this->_redirect('*/*/index');
|
191 |
-
}
|
192 |
-
}
|
193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/DCKAP/Faq/controllers/IndexController.php
CHANGED
@@ -1,109 +1,109 @@
|
|
1 |
-
<?php
|
2 |
-
class DCKAP_Faq_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
-
{
|
4 |
-
private static $_signupUrl = "https://www.google.com/recaptcha/admin";
|
5 |
-
private static $_siteVerifyUrl =
|
6 |
-
"https://www.google.com/recaptcha/api/siteverify?";
|
7 |
-
private $_secret;
|
8 |
-
private static $_version = "php_1.0";
|
9 |
-
|
10 |
-
public function indexAction()
|
11 |
-
{
|
12 |
-
$faqEnable= Mage::getStoreConfig('faq/faq_group/faq_select');
|
13 |
-
if($faqEnable){
|
14 |
-
$this->_title(Mage::helper('faq')->__("Frequently Asked Questions"));
|
15 |
-
$this->loadLayout();
|
16 |
-
$this->renderLayout();
|
17 |
-
}
|
18 |
-
else{
|
19 |
-
$this->norouteAction();
|
20 |
-
}
|
21 |
-
}
|
22 |
-
public function clickAction()
|
23 |
-
{
|
24 |
-
$id = $this->getRequest()->getParam('id');
|
25 |
-
$model = Mage::getModel('faq/faq')->load($id);
|
26 |
-
if($model->getViews()){
|
27 |
-
$views = $model->getViews() + 1;
|
28 |
-
}else{
|
29 |
-
$views = 1;
|
30 |
-
}
|
31 |
-
$model->setViews($views);
|
32 |
-
$model->save();
|
33 |
-
}
|
34 |
-
public function proceedAction()
|
35 |
-
{
|
36 |
-
$pass = 0;
|
37 |
-
$question = $this->getRequest()->getParam('question');
|
38 |
-
$category = $this->getRequest()->getParam('category');
|
39 |
-
$answers = array();
|
40 |
-
$answers["success"] = false;
|
41 |
-
if(Mage::getStoreConfig('faq/faq_recaptcha/faq_recaptchaselect')) {
|
42 |
-
|
43 |
-
$captcha = $this->getRequest()->getParam('g-recaptcha-response');
|
44 |
-
$secret = Mage::getStoreConfig('faq/faq_recaptcha/faq_secretkey');
|
45 |
-
|
46 |
-
$response = null;
|
47 |
-
|
48 |
-
$path = self::$_siteVerifyUrl;
|
49 |
-
$data = array (
|
50 |
-
'secret' => $secret,
|
51 |
-
'remoteip' => $_SERVER["REMOTE_ADDR"],
|
52 |
-
'v' => self::$_version,
|
53 |
-
'response' => $captcha
|
54 |
-
);
|
55 |
-
$req = "";
|
56 |
-
foreach ($data as $key => $value) {
|
57 |
-
$req .= $key . '=' . urlencode(stripslashes($value)) . '&';
|
58 |
-
}
|
59 |
-
// Cut the last '&'
|
60 |
-
$req = substr($req, 0, strlen($req)-1);
|
61 |
-
$response = file_get_contents($path . $req);
|
62 |
-
|
63 |
-
$answers = json_decode($response, true);
|
64 |
-
}else{
|
65 |
-
$pass = 1;
|
66 |
-
}
|
67 |
-
if (trim($answers['success']) == true || $pass == 1) {
|
68 |
-
date_default_timezone_set(Mage::getStoreConfig("general/locale/timezone"));
|
69 |
-
$time = date("Y-m-d H:i:s");
|
70 |
-
$ucustomer = 1;$cname="";$cemail="";$customerID="";
|
71 |
-
if(Mage::getSingleton('customer/session')->isLoggedIn()){
|
72 |
-
$ucustomer = 2;
|
73 |
-
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
74 |
-
$customerData = Mage::getModel('customer/customer')->load($customer->getId());
|
75 |
-
$customerID = $customerData->getId();
|
76 |
-
$cname = $customerData->getFirstname() . ' ' . $customerData->getLastname();
|
77 |
-
$cemail = $customerData->getEmail();
|
78 |
-
}
|
79 |
-
if($this->getRequest()->getParam('guest-email')){
|
80 |
-
$cname = $this->getRequest()->getParam('guest-name');
|
81 |
-
$cemail = $this->getRequest()->getParam('guest-email');
|
82 |
-
}
|
83 |
-
|
84 |
-
try{
|
85 |
-
$model = Mage::getModel('faq/faq');
|
86 |
-
$model->setQuestion($question);
|
87 |
-
$model->setStatus(2);
|
88 |
-
$model->setStoreSet("");
|
89 |
-
$model->setByuser($ucustomer);
|
90 |
-
$model->setCustomerId($customerID);
|
91 |
-
$model->setCustomerName($cname);
|
92 |
-
$model->setCustomerEmail($cemail);
|
93 |
-
$model->setCategory($category);
|
94 |
-
$model->setStoreId(Mage::app()->getStore(true)->getId());
|
95 |
-
$model->setCreatedTime($time);
|
96 |
-
$model->setUpdateTime($time);
|
97 |
-
$model->save();
|
98 |
-
Mage::getModel('adminnotification/inbox')->addNotice("DCKAP FAQ: New Question(ID:".$model->getId().") is added by a guest user at ".$time.".","New Question is added by a unknown guest user. Please review and update the question with answer.");
|
99 |
-
echo 1;
|
100 |
-
}
|
101 |
-
catch(Exception $e){
|
102 |
-
echo $e;
|
103 |
-
}
|
104 |
-
} else {
|
105 |
-
echo 2;
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
}
|
1 |
+
<?php
|
2 |
+
class DCKAP_Faq_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
private static $_signupUrl = "https://www.google.com/recaptcha/admin";
|
5 |
+
private static $_siteVerifyUrl =
|
6 |
+
"https://www.google.com/recaptcha/api/siteverify?";
|
7 |
+
private $_secret;
|
8 |
+
private static $_version = "php_1.0";
|
9 |
+
|
10 |
+
public function indexAction()
|
11 |
+
{
|
12 |
+
$faqEnable= Mage::getStoreConfig('faq/faq_group/faq_select');
|
13 |
+
if($faqEnable){
|
14 |
+
$this->_title(Mage::helper('faq')->__("Frequently Asked Questions"));
|
15 |
+
$this->loadLayout();
|
16 |
+
$this->renderLayout();
|
17 |
+
}
|
18 |
+
else{
|
19 |
+
$this->norouteAction();
|
20 |
+
}
|
21 |
+
}
|
22 |
+
public function clickAction()
|
23 |
+
{
|
24 |
+
$id = $this->getRequest()->getParam('id');
|
25 |
+
$model = Mage::getModel('faq/faq')->load($id);
|
26 |
+
if($model->getViews()){
|
27 |
+
$views = $model->getViews() + 1;
|
28 |
+
}else{
|
29 |
+
$views = 1;
|
30 |
+
}
|
31 |
+
$model->setViews($views);
|
32 |
+
$model->save();
|
33 |
+
}
|
34 |
+
public function proceedAction()
|
35 |
+
{
|
36 |
+
$pass = 0;
|
37 |
+
$question = $this->getRequest()->getParam('question');
|
38 |
+
$category = $this->getRequest()->getParam('category');
|
39 |
+
$answers = array();
|
40 |
+
$answers["success"] = false;
|
41 |
+
if(Mage::getStoreConfig('faq/faq_recaptcha/faq_recaptchaselect')) {
|
42 |
+
|
43 |
+
$captcha = $this->getRequest()->getParam('g-recaptcha-response');
|
44 |
+
$secret = Mage::getStoreConfig('faq/faq_recaptcha/faq_secretkey');
|
45 |
+
|
46 |
+
$response = null;
|
47 |
+
|
48 |
+
$path = self::$_siteVerifyUrl;
|
49 |
+
$data = array (
|
50 |
+
'secret' => $secret,
|
51 |
+
'remoteip' => $_SERVER["REMOTE_ADDR"],
|
52 |
+
'v' => self::$_version,
|
53 |
+
'response' => $captcha
|
54 |
+
);
|
55 |
+
$req = "";
|
56 |
+
foreach ($data as $key => $value) {
|
57 |
+
$req .= $key . '=' . urlencode(stripslashes($value)) . '&';
|
58 |
+
}
|
59 |
+
// Cut the last '&'
|
60 |
+
$req = substr($req, 0, strlen($req)-1);
|
61 |
+
$response = file_get_contents($path . $req);
|
62 |
+
|
63 |
+
$answers = json_decode($response, true);
|
64 |
+
}else{
|
65 |
+
$pass = 1;
|
66 |
+
}
|
67 |
+
if (trim($answers['success']) == true || $pass == 1) {
|
68 |
+
date_default_timezone_set(Mage::getStoreConfig("general/locale/timezone"));
|
69 |
+
$time = date("Y-m-d H:i:s");
|
70 |
+
$ucustomer = 1;$cname="";$cemail="";$customerID="";
|
71 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn()){
|
72 |
+
$ucustomer = 2;
|
73 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
74 |
+
$customerData = Mage::getModel('customer/customer')->load($customer->getId());
|
75 |
+
$customerID = $customerData->getId();
|
76 |
+
$cname = $customerData->getFirstname() . ' ' . $customerData->getLastname();
|
77 |
+
$cemail = $customerData->getEmail();
|
78 |
+
}
|
79 |
+
if($this->getRequest()->getParam('guest-email')){
|
80 |
+
$cname = $this->getRequest()->getParam('guest-name');
|
81 |
+
$cemail = $this->getRequest()->getParam('guest-email');
|
82 |
+
}
|
83 |
+
|
84 |
+
try{
|
85 |
+
$model = Mage::getModel('faq/faq');
|
86 |
+
$model->setQuestion($question);
|
87 |
+
$model->setStatus(2);
|
88 |
+
$model->setStoreSet("");
|
89 |
+
$model->setByuser($ucustomer);
|
90 |
+
$model->setCustomerId($customerID);
|
91 |
+
$model->setCustomerName($cname);
|
92 |
+
$model->setCustomerEmail($cemail);
|
93 |
+
$model->setCategory($category);
|
94 |
+
$model->setStoreId(Mage::app()->getStore(true)->getId());
|
95 |
+
$model->setCreatedTime($time);
|
96 |
+
$model->setUpdateTime($time);
|
97 |
+
$model->save();
|
98 |
+
Mage::getModel('adminnotification/inbox')->addNotice("DCKAP FAQ: New Question(ID:".$model->getId().") is added by a guest user at ".$time.".","New Question is added by a unknown guest user. Please review and update the question with answer.");
|
99 |
+
echo 1;
|
100 |
+
}
|
101 |
+
catch(Exception $e){
|
102 |
+
echo $e;
|
103 |
+
}
|
104 |
+
} else {
|
105 |
+
echo 2;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
app/code/community/DCKAP/Faq/etc/config.xml
CHANGED
@@ -1,206 +1,206 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<DCKAP_Faq>
|
5 |
-
<version>
|
6 |
-
</DCKAP_Faq>
|
7 |
-
</modules>
|
8 |
-
<frontend>
|
9 |
-
<routers>
|
10 |
-
<faq>
|
11 |
-
<use>standard</use>
|
12 |
-
<args>
|
13 |
-
<module>DCKAP_Faq</module>
|
14 |
-
<frontName>faq</frontName>
|
15 |
-
</args>
|
16 |
-
</faq>
|
17 |
-
</routers>
|
18 |
-
<layout>
|
19 |
-
<updates>
|
20 |
-
<faq>
|
21 |
-
<file>faq.xml</file>
|
22 |
-
</faq>
|
23 |
-
</updates>
|
24 |
-
</layout>
|
25 |
-
</frontend>
|
26 |
-
<admin>
|
27 |
-
<routers>
|
28 |
-
<faq>
|
29 |
-
<use>admin</use>
|
30 |
-
<args>
|
31 |
-
<module>DCKAP_Faq</module>
|
32 |
-
<frontName>faq</frontName>
|
33 |
-
</args>
|
34 |
-
</faq>
|
35 |
-
</routers>
|
36 |
-
</admin>
|
37 |
-
<adminhtml>
|
38 |
-
<menu>
|
39 |
-
<dckap module="faq">
|
40 |
-
<title>DCKAP</title>
|
41 |
-
<sort_order>
|
42 |
-
<children>
|
43 |
-
<faq translate="title" module="faq">
|
44 |
-
<title>FAQ's Manager</title>
|
45 |
-
<sort_order>0</sort_order>
|
46 |
-
<depends>
|
47 |
-
<config>faq/faq_group/faq_select</config>
|
48 |
-
</depends>
|
49 |
-
<children>
|
50 |
-
<items translate="title" module="faq">
|
51 |
-
<title>Manage FAQ's</title>
|
52 |
-
<sort_order>0</sort_order>
|
53 |
-
<action>faq/adminhtml_faq</action>
|
54 |
-
</items>
|
55 |
-
<categoryitems translate="title" module="faq">
|
56 |
-
<title>Manage Categories</title>
|
57 |
-
<sort_order>1</sort_order>
|
58 |
-
<action>faq/adminhtml_category</action>
|
59 |
-
<depends>
|
60 |
-
<config>faq/faq_group/category_enabled</config>
|
61 |
-
</depends>
|
62 |
-
</categoryitems>
|
63 |
-
<settings translate="title" module="faq">
|
64 |
-
<title>Settings</title>
|
65 |
-
<sort_order>2</sort_order>
|
66 |
-
<action>adminhtml/system_config/edit/section/faq/</action>
|
67 |
-
</settings>
|
68 |
-
</children>
|
69 |
-
</faq>
|
70 |
-
</children>
|
71 |
-
</dckap>
|
72 |
-
</menu>
|
73 |
-
<acl>
|
74 |
-
<resources>
|
75 |
-
<admin>
|
76 |
-
<children>
|
77 |
-
<system>
|
78 |
-
<children>
|
79 |
-
<config>
|
80 |
-
<children>
|
81 |
-
<faq>
|
82 |
-
<title>Faq
|
83 |
-
</faq>
|
84 |
-
</children>
|
85 |
-
</config>
|
86 |
-
</children>
|
87 |
-
</system>
|
88 |
-
<dckap translate="title" module="faq">
|
89 |
-
<title>
|
90 |
-
<sort_order>
|
91 |
-
<children>
|
92 |
-
<faq translate="title" module="faq">
|
93 |
-
<title>FAQ's Manager</title>
|
94 |
-
<sort_order>0</sort_order>
|
95 |
-
<children>
|
96 |
-
<items translate="title" module="faq">
|
97 |
-
<title>Manage FAQ'
|
98 |
-
<sort_order>0</sort_order>
|
99 |
-
<action>faq/adminhtml_faq</action>
|
100 |
-
</items>
|
101 |
-
<categoryitems translate="title" module="faq">
|
102 |
-
<title>Manage Categories</title>
|
103 |
-
<sort_order>1</sort_order>
|
104 |
-
<action>faq/adminhtml_category</action>
|
105 |
-
|
106 |
-
</categoryitems>
|
107 |
-
<settings translate="title" module="faq">
|
108 |
-
<title>Settings</title>
|
109 |
-
<sort_order>2</sort_order>
|
110 |
-
<action>adminhtml/system_config/edit/section/faq/</action>
|
111 |
-
</settings>
|
112 |
-
</children>
|
113 |
-
</faq>
|
114 |
-
</children>
|
115 |
-
</dckap>
|
116 |
-
</children>
|
117 |
-
</admin>
|
118 |
-
</resources>
|
119 |
-
</acl>
|
120 |
-
<layout>
|
121 |
-
<updates>
|
122 |
-
<faq>
|
123 |
-
<file>faq.xml</file>
|
124 |
-
</faq>
|
125 |
-
</updates>
|
126 |
-
</layout>
|
127 |
-
</adminhtml>
|
128 |
-
<global>
|
129 |
-
<models>
|
130 |
-
<faq>
|
131 |
-
<class>DCKAP_Faq_Model</class>
|
132 |
-
<resourceModel>faq_mysql4</resourceModel>
|
133 |
-
</faq>
|
134 |
-
<faq_mysql4>
|
135 |
-
<class>DCKAP_Faq_Model_Mysql4</class>
|
136 |
-
<entities>
|
137 |
-
<faq>
|
138 |
-
<table>dckap_faq</table>
|
139 |
-
</faq>
|
140 |
-
<category>
|
141 |
-
<table>dckap_category</table>
|
142 |
-
</category>
|
143 |
-
</entities>
|
144 |
-
</faq_mysql4>
|
145 |
-
</models>
|
146 |
-
<resources>
|
147 |
-
<dckap_faq_setup>
|
148 |
-
<setup>
|
149 |
-
<module>DCKAP_Faq</module>
|
150 |
-
</setup>
|
151 |
-
<connection>
|
152 |
-
<use>core_setup</use>
|
153 |
-
</connection>
|
154 |
-
</dckap_faq_setup>
|
155 |
-
<faq_write>
|
156 |
-
<connection>
|
157 |
-
<use>core_write</use>
|
158 |
-
</connection>
|
159 |
-
</faq_write>
|
160 |
-
<faq_read>
|
161 |
-
<connection>
|
162 |
-
<use>core_read</use>
|
163 |
-
</connection>
|
164 |
-
</faq_read>
|
165 |
-
</resources>
|
166 |
-
<template>
|
167 |
-
<email>
|
168 |
-
<faq_notifications_emailtemplate>
|
169 |
-
<label>Customer/Guest Notification</label>
|
170 |
-
<file>faq_notification.html</file>
|
171 |
-
<type>html</type>
|
172 |
-
</faq_notifications_emailtemplate>
|
173 |
-
</email>
|
174 |
-
</template>
|
175 |
-
<blocks>
|
176 |
-
<faq>
|
177 |
-
<class>DCKAP_Faq_Block</class>
|
178 |
-
</faq>
|
179 |
-
</blocks>
|
180 |
-
<helpers>
|
181 |
-
<faq>
|
182 |
-
<class>DCKAP_Faq_Helper</class>
|
183 |
-
</faq>
|
184 |
-
</helpers>
|
185 |
-
</global>
|
186 |
-
<default>
|
187 |
-
<faq>
|
188 |
-
<faq_group>
|
189 |
-
<faq_select>1</faq_select>
|
190 |
-
<category_enabled>0</category_enabled>
|
191 |
-
<viewsorter>0</viewsorter>
|
192 |
-
<faq_text>5</faq_text>
|
193 |
-
</faq_group>
|
194 |
-
<faq_recaptcha>
|
195 |
-
<faq_user>0</faq_user>
|
196 |
-
<faq_customer>0</faq_customer>
|
197 |
-
<faq_text>Is the question that you are looking for, not here? No need to worry. Ask your questions here.</faq_text>
|
198 |
-
<faq_btnlabel>Ask new Question</faq_btnlabel>
|
199 |
-
</faq_recaptcha>
|
200 |
-
<notifications>
|
201 |
-
<emailtemplate>faq_notifications_emailtemplate</emailtemplate>
|
202 |
-
<mail_subject>Your question is answered</mail_subject>
|
203 |
-
</notifications>
|
204 |
-
</faq>
|
205 |
-
</default>
|
206 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<DCKAP_Faq>
|
5 |
+
<version>1.0.4</version>
|
6 |
+
</DCKAP_Faq>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<faq>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>DCKAP_Faq</module>
|
14 |
+
<frontName>faq</frontName>
|
15 |
+
</args>
|
16 |
+
</faq>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<faq>
|
21 |
+
<file>faq.xml</file>
|
22 |
+
</faq>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<faq>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>DCKAP_Faq</module>
|
32 |
+
<frontName>faq</frontName>
|
33 |
+
</args>
|
34 |
+
</faq>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<adminhtml>
|
38 |
+
<menu>
|
39 |
+
<dckap module="faq">
|
40 |
+
<title>DCKAP</title>
|
41 |
+
<sort_order>60</sort_order>
|
42 |
+
<children>
|
43 |
+
<faq translate="title" module="faq">
|
44 |
+
<title>FAQ's Manager</title>
|
45 |
+
<sort_order>0</sort_order>
|
46 |
+
<depends>
|
47 |
+
<config>faq/faq_group/faq_select</config>
|
48 |
+
</depends>
|
49 |
+
<children>
|
50 |
+
<items translate="title" module="faq">
|
51 |
+
<title>Manage FAQ's</title>
|
52 |
+
<sort_order>0</sort_order>
|
53 |
+
<action>faq/adminhtml_faq</action>
|
54 |
+
</items>
|
55 |
+
<categoryitems translate="title" module="faq">
|
56 |
+
<title>Manage Categories</title>
|
57 |
+
<sort_order>1</sort_order>
|
58 |
+
<action>faq/adminhtml_category</action>
|
59 |
+
<depends>
|
60 |
+
<config>faq/faq_group/category_enabled</config>
|
61 |
+
</depends>
|
62 |
+
</categoryitems>
|
63 |
+
<settings translate="title" module="faq">
|
64 |
+
<title>Settings</title>
|
65 |
+
<sort_order>2</sort_order>
|
66 |
+
<action>adminhtml/system_config/edit/section/faq/</action>
|
67 |
+
</settings>
|
68 |
+
</children>
|
69 |
+
</faq>
|
70 |
+
</children>
|
71 |
+
</dckap>
|
72 |
+
</menu>
|
73 |
+
<acl>
|
74 |
+
<resources>
|
75 |
+
<admin>
|
76 |
+
<children>
|
77 |
+
<system>
|
78 |
+
<children>
|
79 |
+
<config>
|
80 |
+
<children>
|
81 |
+
<faq>
|
82 |
+
<title>Faq - All</title>
|
83 |
+
</faq>
|
84 |
+
</children>
|
85 |
+
</config>
|
86 |
+
</children>
|
87 |
+
</system>
|
88 |
+
<dckap translate="title" module="faq">
|
89 |
+
<title>Faq</title>
|
90 |
+
<sort_order>10</sort_order>
|
91 |
+
<children>
|
92 |
+
<faq translate="title" module="faq">
|
93 |
+
<title>FAQ's Manager</title>
|
94 |
+
<sort_order>0</sort_order>
|
95 |
+
<children>
|
96 |
+
<items translate="title" module="faq">
|
97 |
+
<title>Manage FAQ'settings</title>
|
98 |
+
<sort_order>0</sort_order>
|
99 |
+
<action>faq/adminhtml_faq</action>
|
100 |
+
</items>
|
101 |
+
<categoryitems translate="title" module="faq">
|
102 |
+
<title>Manage Categories</title>
|
103 |
+
<sort_order>1</sort_order>
|
104 |
+
<action>faq/adminhtml_category</action>
|
105 |
+
|
106 |
+
</categoryitems>
|
107 |
+
<settings translate="title" module="faq">
|
108 |
+
<title>Settings</title>
|
109 |
+
<sort_order>2</sort_order>
|
110 |
+
<action>adminhtml/system_config/edit/section/faq/</action>
|
111 |
+
</settings>
|
112 |
+
</children>
|
113 |
+
</faq>
|
114 |
+
</children>
|
115 |
+
</dckap>
|
116 |
+
</children>
|
117 |
+
</admin>
|
118 |
+
</resources>
|
119 |
+
</acl>
|
120 |
+
<layout>
|
121 |
+
<updates>
|
122 |
+
<faq>
|
123 |
+
<file>faq.xml</file>
|
124 |
+
</faq>
|
125 |
+
</updates>
|
126 |
+
</layout>
|
127 |
+
</adminhtml>
|
128 |
+
<global>
|
129 |
+
<models>
|
130 |
+
<faq>
|
131 |
+
<class>DCKAP_Faq_Model</class>
|
132 |
+
<resourceModel>faq_mysql4</resourceModel>
|
133 |
+
</faq>
|
134 |
+
<faq_mysql4>
|
135 |
+
<class>DCKAP_Faq_Model_Mysql4</class>
|
136 |
+
<entities>
|
137 |
+
<faq>
|
138 |
+
<table>dckap_faq</table>
|
139 |
+
</faq>
|
140 |
+
<category>
|
141 |
+
<table>dckap_category</table>
|
142 |
+
</category>
|
143 |
+
</entities>
|
144 |
+
</faq_mysql4>
|
145 |
+
</models>
|
146 |
+
<resources>
|
147 |
+
<dckap_faq_setup>
|
148 |
+
<setup>
|
149 |
+
<module>DCKAP_Faq</module>
|
150 |
+
</setup>
|
151 |
+
<connection>
|
152 |
+
<use>core_setup</use>
|
153 |
+
</connection>
|
154 |
+
</dckap_faq_setup>
|
155 |
+
<faq_write>
|
156 |
+
<connection>
|
157 |
+
<use>core_write</use>
|
158 |
+
</connection>
|
159 |
+
</faq_write>
|
160 |
+
<faq_read>
|
161 |
+
<connection>
|
162 |
+
<use>core_read</use>
|
163 |
+
</connection>
|
164 |
+
</faq_read>
|
165 |
+
</resources>
|
166 |
+
<template>
|
167 |
+
<email>
|
168 |
+
<faq_notifications_emailtemplate>
|
169 |
+
<label>Customer/Guest Notification</label>
|
170 |
+
<file>faq_notification.html</file>
|
171 |
+
<type>html</type>
|
172 |
+
</faq_notifications_emailtemplate>
|
173 |
+
</email>
|
174 |
+
</template>
|
175 |
+
<blocks>
|
176 |
+
<faq>
|
177 |
+
<class>DCKAP_Faq_Block</class>
|
178 |
+
</faq>
|
179 |
+
</blocks>
|
180 |
+
<helpers>
|
181 |
+
<faq>
|
182 |
+
<class>DCKAP_Faq_Helper</class>
|
183 |
+
</faq>
|
184 |
+
</helpers>
|
185 |
+
</global>
|
186 |
+
<default>
|
187 |
+
<faq>
|
188 |
+
<faq_group>
|
189 |
+
<faq_select>1</faq_select>
|
190 |
+
<category_enabled>0</category_enabled>
|
191 |
+
<viewsorter>0</viewsorter>
|
192 |
+
<faq_text>5</faq_text>
|
193 |
+
</faq_group>
|
194 |
+
<faq_recaptcha>
|
195 |
+
<faq_user>0</faq_user>
|
196 |
+
<faq_customer>0</faq_customer>
|
197 |
+
<faq_text>Is the question that you are looking for, not here? No need to worry. Ask your questions here.</faq_text>
|
198 |
+
<faq_btnlabel>Ask new Question</faq_btnlabel>
|
199 |
+
</faq_recaptcha>
|
200 |
+
<notifications>
|
201 |
+
<emailtemplate>faq_notifications_emailtemplate</emailtemplate>
|
202 |
+
<mail_subject>Your question is answered</mail_subject>
|
203 |
+
</notifications>
|
204 |
+
</faq>
|
205 |
+
</default>
|
206 |
</config>
|
app/code/community/DCKAP/Faq/etc/system.xml
CHANGED
@@ -1,241 +1,241 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<config>
|
3 |
-
<tabs>
|
4 |
-
<dckap translate="label" module="faq">
|
5 |
-
<label>DCKAP</label>
|
6 |
-
<sort_order>100</sort_order>
|
7 |
-
</dckap>
|
8 |
-
</tabs>
|
9 |
-
<sections>
|
10 |
-
<faq translate="label" module="faq">
|
11 |
-
<label>FAQ's Manager</label>
|
12 |
-
<tab>dckap</tab>
|
13 |
-
<sort_order>10</sort_order>
|
14 |
-
<show_in_default>1</show_in_default>
|
15 |
-
<show_in_website>1</show_in_website>
|
16 |
-
<show_in_store>1</show_in_store>
|
17 |
-
<groups>
|
18 |
-
<faq_group translate="label" module="faq">
|
19 |
-
<label>General</label>
|
20 |
-
<frontend_type>text</frontend_type>
|
21 |
-
<sort_order>100</sort_order>
|
22 |
-
<show_in_default>1</show_in_default>
|
23 |
-
<show_in_website>1</show_in_website>
|
24 |
-
<show_in_store>1</show_in_store>
|
25 |
-
<fields>
|
26 |
-
<faq_select translate="label">
|
27 |
-
<label>Enabled</label>
|
28 |
-
<frontend_type>select</frontend_type>
|
29 |
-
<sort_order>90</sort_order>
|
30 |
-
<show_in_default>1</show_in_default>
|
31 |
-
<show_in_website>1</show_in_website>
|
32 |
-
<show_in_store>1</show_in_store>
|
33 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
34 |
-
</faq_select>
|
35 |
-
<category_enabled translate="label">
|
36 |
-
<label>Enable Category Mode</label>
|
37 |
-
<frontend_type>select</frontend_type>
|
38 |
-
<sort_order>91</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 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
43 |
-
<depends>
|
44 |
-
<faq_select>1</faq_select>
|
45 |
-
</depends>
|
46 |
-
<comment>Allows to group the questions and answers.</comment>
|
47 |
-
</category_enabled>
|
48 |
-
<description translate="label">
|
49 |
-
<label>Description</label>
|
50 |
-
<frontend_type>textarea</frontend_type>
|
51 |
-
<sort_order>92</sort_order>
|
52 |
-
<show_in_default>1</show_in_default>
|
53 |
-
<show_in_website>1</show_in_website>
|
54 |
-
<show_in_store>1</show_in_store>
|
55 |
-
<depends>
|
56 |
-
<faq_select>1</faq_select>
|
57 |
-
</depends>
|
58 |
-
<comment>This is general description and will be displayed in FAQ homepage.</comment>
|
59 |
-
</description>
|
60 |
-
<viewsorter translate="label">
|
61 |
-
<label>Sort questions by number of views / clicks</label>
|
62 |
-
<frontend_type>select</frontend_type>
|
63 |
-
<sort_order>94</sort_order>
|
64 |
-
<show_in_default>1</show_in_default>
|
65 |
-
<show_in_website>1</show_in_website>
|
66 |
-
<show_in_store>1</show_in_store>
|
67 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
68 |
-
<depends>
|
69 |
-
<faq_select>1</faq_select>
|
70 |
-
</depends>
|
71 |
-
<comment>If No selected, It will sorted by given Priority.</comment>
|
72 |
-
</viewsorter>
|
73 |
-
<faq_text translate="label">
|
74 |
-
<label>Pagination List</label>
|
75 |
-
<frontend_type>text</frontend_type>
|
76 |
-
<sort_order>95</sort_order>
|
77 |
-
<show_in_default>1</show_in_default>
|
78 |
-
<show_in_website>1</show_in_website>
|
79 |
-
<show_in_store>1</show_in_store>
|
80 |
-
<depends>
|
81 |
-
<faq_select>1</faq_select>
|
82 |
-
</depends>
|
83 |
-
<comment>By default, 5 will be taken for pagination.</comment>
|
84 |
-
</faq_text>
|
85 |
-
|
86 |
-
</fields>
|
87 |
-
</faq_group>
|
88 |
-
<faq_recaptcha translate="label" module="faq">
|
89 |
-
<label>User Questions and Google reCaptcha</label>
|
90 |
-
<frontend_type>text</frontend_type>
|
91 |
-
<sort_order>101</sort_order>
|
92 |
-
<show_in_default>1</show_in_default>
|
93 |
-
<show_in_website>1</show_in_website>
|
94 |
-
<show_in_store>1</show_in_store>
|
95 |
-
<fields>
|
96 |
-
<faq_user translate="label">
|
97 |
-
<label>Enable User to ask questions from frontend</label>
|
98 |
-
<frontend_type>select</frontend_type>
|
99 |
-
<sort_order>90</sort_order>
|
100 |
-
<show_in_default>1</show_in_default>
|
101 |
-
<show_in_website>1</show_in_website>
|
102 |
-
<show_in_store>1</show_in_store>
|
103 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
104 |
-
</faq_user>
|
105 |
-
<faq_customer translate="label">
|
106 |
-
<label>Allow only loggedin customers to ask questions</label>
|
107 |
-
<frontend_type>select</frontend_type>
|
108 |
-
<sort_order>90</sort_order>
|
109 |
-
<show_in_default>1</show_in_default>
|
110 |
-
<show_in_website>1</show_in_website>
|
111 |
-
<show_in_store>1</show_in_store>
|
112 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
113 |
-
</faq_customer>
|
114 |
-
<faq_text translate="label">
|
115 |
-
<label>Description to ask new question</label>
|
116 |
-
<frontend_type>textarea</frontend_type>
|
117 |
-
<sort_order>91</sort_order>
|
118 |
-
<show_in_default>1</show_in_default>
|
119 |
-
<show_in_website>1</show_in_website>
|
120 |
-
<show_in_store>1</show_in_store>
|
121 |
-
<depends>
|
122 |
-
<faq_user>1</faq_user>
|
123 |
-
</depends>
|
124 |
-
</faq_text>
|
125 |
-
<faq_btnlabel translate="label">
|
126 |
-
<label>Ask question button label</label>
|
127 |
-
<frontend_type>text</frontend_type>
|
128 |
-
<sort_order>92</sort_order>
|
129 |
-
<show_in_default>1</show_in_default>
|
130 |
-
<show_in_website>1</show_in_website>
|
131 |
-
<show_in_store>1</show_in_store>
|
132 |
-
<depends>
|
133 |
-
<faq_user>1</faq_user>
|
134 |
-
</depends>
|
135 |
-
</faq_btnlabel>
|
136 |
-
<faq_recaptchaselect translate="label">
|
137 |
-
<label>Enable captcha</label>
|
138 |
-
<frontend_type>select</frontend_type>
|
139 |
-
<sort_order>100</sort_order>
|
140 |
-
<show_in_default>1</show_in_default>
|
141 |
-
<show_in_website>1</show_in_website>
|
142 |
-
<show_in_store>1</show_in_store>
|
143 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
144 |
-
<depends>
|
145 |
-
<faq_user>1</faq_user>
|
146 |
-
</depends>
|
147 |
-
</faq_recaptchaselect>
|
148 |
-
<faq_sitekey translate="label">
|
149 |
-
<label>Site Key</label>
|
150 |
-
<frontend_type>text</frontend_type>
|
151 |
-
<sort_order>110</sort_order>
|
152 |
-
<show_in_default>1</show_in_default>
|
153 |
-
<show_in_website>1</show_in_website>
|
154 |
-
<show_in_store>1</show_in_store>
|
155 |
-
<depends>
|
156 |
-
<faq_user>1</faq_user>
|
157 |
-
<faq_recaptchaselect>1</faq_recaptchaselect>
|
158 |
-
</depends>
|
159 |
-
</faq_sitekey>
|
160 |
-
<faq_secretkey translate="label">
|
161 |
-
<label>Secret Key</label>
|
162 |
-
<frontend_type>text</frontend_type>
|
163 |
-
<sort_order>111</sort_order>
|
164 |
-
<show_in_default>1</show_in_default>
|
165 |
-
<show_in_website>1</show_in_website>
|
166 |
-
<show_in_store>1</show_in_store>
|
167 |
-
<depends>
|
168 |
-
<faq_user>1</faq_user>
|
169 |
-
<faq_recaptchaselect>1</faq_recaptchaselect>
|
170 |
-
</depends>
|
171 |
-
</faq_secretkey>
|
172 |
-
</fields>
|
173 |
-
</faq_recaptcha>
|
174 |
-
<notifications translate="label" module="faq">
|
175 |
-
<label>Email Notifications</label>
|
176 |
-
<frontend_type>text</frontend_type>
|
177 |
-
<sort_order>102</sort_order>
|
178 |
-
<show_in_default>1</show_in_default>
|
179 |
-
<show_in_website>1</show_in_website>
|
180 |
-
<show_in_store>1</show_in_store>
|
181 |
-
<fields>
|
182 |
-
<mail_enable translate="label">
|
183 |
-
<label>Send Mail to Customer/Guest if the question is answered.</label>
|
184 |
-
<frontend_type>select</frontend_type>
|
185 |
-
<sort_order>90</sort_order>
|
186 |
-
<show_in_default>1</show_in_default>
|
187 |
-
<show_in_website>1</show_in_website>
|
188 |
-
<show_in_store>1</show_in_store>
|
189 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
190 |
-
</mail_enable>
|
191 |
-
<emailtemplate translate="label">
|
192 |
-
<label>Email Template</label>
|
193 |
-
<frontend_type>select</frontend_type>
|
194 |
-
<sort_order>91</sort_order>
|
195 |
-
<show_in_default>1</show_in_default>
|
196 |
-
<show_in_website>1</show_in_website>
|
197 |
-
<show_in_store>1</show_in_store>
|
198 |
-
<source_model>adminhtml/system_config_source_email_template</source_model>
|
199 |
-
<depends>
|
200 |
-
<mail_enable>1</mail_enable>
|
201 |
-
</depends>
|
202 |
-
</emailtemplate>
|
203 |
-
<mail_subject translate="label">
|
204 |
-
<label>Subject</label>
|
205 |
-
<frontend_type>text</frontend_type>
|
206 |
-
<sort_order>92</sort_order>
|
207 |
-
<show_in_default>1</show_in_default>
|
208 |
-
<show_in_website>1</show_in_website>
|
209 |
-
<show_in_store>1</show_in_store>
|
210 |
-
<depends>
|
211 |
-
<mail_enable>1</mail_enable>
|
212 |
-
</depends>
|
213 |
-
</mail_subject>
|
214 |
-
<mail_sendername translate="label">
|
215 |
-
<label>Sender Name</label>
|
216 |
-
<frontend_type>text</frontend_type>
|
217 |
-
<sort_order>93</sort_order>
|
218 |
-
<show_in_default>1</show_in_default>
|
219 |
-
<show_in_website>1</show_in_website>
|
220 |
-
<show_in_store>1</show_in_store>
|
221 |
-
<depends>
|
222 |
-
<mail_enable>1</mail_enable>
|
223 |
-
</depends>
|
224 |
-
</mail_sendername>
|
225 |
-
<mail_sendermail translate="label">
|
226 |
-
<label>Sender Mail ID</label>
|
227 |
-
<frontend_type>text</frontend_type>
|
228 |
-
<sort_order>94</sort_order>
|
229 |
-
<show_in_default>1</show_in_default>
|
230 |
-
<show_in_website>1</show_in_website>
|
231 |
-
<show_in_store>1</show_in_store>
|
232 |
-
<depends>
|
233 |
-
<mail_enable>1</mail_enable>
|
234 |
-
</depends>
|
235 |
-
</mail_sendermail>
|
236 |
-
</fields>
|
237 |
-
</notifications>
|
238 |
-
</groups>
|
239 |
-
</faq>
|
240 |
-
</sections>
|
241 |
-
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<dckap translate="label" module="faq">
|
5 |
+
<label>DCKAP</label>
|
6 |
+
<sort_order>100</sort_order>
|
7 |
+
</dckap>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<faq translate="label" module="faq">
|
11 |
+
<label>FAQ's Manager</label>
|
12 |
+
<tab>dckap</tab>
|
13 |
+
<sort_order>10</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<faq_group translate="label" module="faq">
|
19 |
+
<label>General</label>
|
20 |
+
<frontend_type>text</frontend_type>
|
21 |
+
<sort_order>100</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<fields>
|
26 |
+
<faq_select translate="label">
|
27 |
+
<label>Enabled</label>
|
28 |
+
<frontend_type>select</frontend_type>
|
29 |
+
<sort_order>90</sort_order>
|
30 |
+
<show_in_default>1</show_in_default>
|
31 |
+
<show_in_website>1</show_in_website>
|
32 |
+
<show_in_store>1</show_in_store>
|
33 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
34 |
+
</faq_select>
|
35 |
+
<category_enabled translate="label">
|
36 |
+
<label>Enable Category Mode</label>
|
37 |
+
<frontend_type>select</frontend_type>
|
38 |
+
<sort_order>91</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 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
43 |
+
<depends>
|
44 |
+
<faq_select>1</faq_select>
|
45 |
+
</depends>
|
46 |
+
<comment>Allows to group the questions and answers.</comment>
|
47 |
+
</category_enabled>
|
48 |
+
<description translate="label">
|
49 |
+
<label>Description</label>
|
50 |
+
<frontend_type>textarea</frontend_type>
|
51 |
+
<sort_order>92</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
<depends>
|
56 |
+
<faq_select>1</faq_select>
|
57 |
+
</depends>
|
58 |
+
<comment>This is general description and will be displayed in FAQ homepage.</comment>
|
59 |
+
</description>
|
60 |
+
<viewsorter translate="label">
|
61 |
+
<label>Sort questions by number of views / clicks</label>
|
62 |
+
<frontend_type>select</frontend_type>
|
63 |
+
<sort_order>94</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
68 |
+
<depends>
|
69 |
+
<faq_select>1</faq_select>
|
70 |
+
</depends>
|
71 |
+
<comment>If No selected, It will sorted by given Priority.</comment>
|
72 |
+
</viewsorter>
|
73 |
+
<faq_text translate="label">
|
74 |
+
<label>Pagination List</label>
|
75 |
+
<frontend_type>text</frontend_type>
|
76 |
+
<sort_order>95</sort_order>
|
77 |
+
<show_in_default>1</show_in_default>
|
78 |
+
<show_in_website>1</show_in_website>
|
79 |
+
<show_in_store>1</show_in_store>
|
80 |
+
<depends>
|
81 |
+
<faq_select>1</faq_select>
|
82 |
+
</depends>
|
83 |
+
<comment>By default, 5 will be taken for pagination.</comment>
|
84 |
+
</faq_text>
|
85 |
+
|
86 |
+
</fields>
|
87 |
+
</faq_group>
|
88 |
+
<faq_recaptcha translate="label" module="faq">
|
89 |
+
<label>User Questions and Google reCaptcha</label>
|
90 |
+
<frontend_type>text</frontend_type>
|
91 |
+
<sort_order>101</sort_order>
|
92 |
+
<show_in_default>1</show_in_default>
|
93 |
+
<show_in_website>1</show_in_website>
|
94 |
+
<show_in_store>1</show_in_store>
|
95 |
+
<fields>
|
96 |
+
<faq_user translate="label">
|
97 |
+
<label>Enable User to ask questions from frontend</label>
|
98 |
+
<frontend_type>select</frontend_type>
|
99 |
+
<sort_order>90</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>1</show_in_store>
|
103 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
104 |
+
</faq_user>
|
105 |
+
<faq_customer translate="label">
|
106 |
+
<label>Allow only loggedin customers to ask questions</label>
|
107 |
+
<frontend_type>select</frontend_type>
|
108 |
+
<sort_order>90</sort_order>
|
109 |
+
<show_in_default>1</show_in_default>
|
110 |
+
<show_in_website>1</show_in_website>
|
111 |
+
<show_in_store>1</show_in_store>
|
112 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
113 |
+
</faq_customer>
|
114 |
+
<faq_text translate="label">
|
115 |
+
<label>Description to ask new question</label>
|
116 |
+
<frontend_type>textarea</frontend_type>
|
117 |
+
<sort_order>91</sort_order>
|
118 |
+
<show_in_default>1</show_in_default>
|
119 |
+
<show_in_website>1</show_in_website>
|
120 |
+
<show_in_store>1</show_in_store>
|
121 |
+
<depends>
|
122 |
+
<faq_user>1</faq_user>
|
123 |
+
</depends>
|
124 |
+
</faq_text>
|
125 |
+
<faq_btnlabel translate="label">
|
126 |
+
<label>Ask question button label</label>
|
127 |
+
<frontend_type>text</frontend_type>
|
128 |
+
<sort_order>92</sort_order>
|
129 |
+
<show_in_default>1</show_in_default>
|
130 |
+
<show_in_website>1</show_in_website>
|
131 |
+
<show_in_store>1</show_in_store>
|
132 |
+
<depends>
|
133 |
+
<faq_user>1</faq_user>
|
134 |
+
</depends>
|
135 |
+
</faq_btnlabel>
|
136 |
+
<faq_recaptchaselect translate="label">
|
137 |
+
<label>Enable captcha</label>
|
138 |
+
<frontend_type>select</frontend_type>
|
139 |
+
<sort_order>100</sort_order>
|
140 |
+
<show_in_default>1</show_in_default>
|
141 |
+
<show_in_website>1</show_in_website>
|
142 |
+
<show_in_store>1</show_in_store>
|
143 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
144 |
+
<depends>
|
145 |
+
<faq_user>1</faq_user>
|
146 |
+
</depends>
|
147 |
+
</faq_recaptchaselect>
|
148 |
+
<faq_sitekey translate="label">
|
149 |
+
<label>Site Key</label>
|
150 |
+
<frontend_type>text</frontend_type>
|
151 |
+
<sort_order>110</sort_order>
|
152 |
+
<show_in_default>1</show_in_default>
|
153 |
+
<show_in_website>1</show_in_website>
|
154 |
+
<show_in_store>1</show_in_store>
|
155 |
+
<depends>
|
156 |
+
<faq_user>1</faq_user>
|
157 |
+
<faq_recaptchaselect>1</faq_recaptchaselect>
|
158 |
+
</depends>
|
159 |
+
</faq_sitekey>
|
160 |
+
<faq_secretkey translate="label">
|
161 |
+
<label>Secret Key</label>
|
162 |
+
<frontend_type>text</frontend_type>
|
163 |
+
<sort_order>111</sort_order>
|
164 |
+
<show_in_default>1</show_in_default>
|
165 |
+
<show_in_website>1</show_in_website>
|
166 |
+
<show_in_store>1</show_in_store>
|
167 |
+
<depends>
|
168 |
+
<faq_user>1</faq_user>
|
169 |
+
<faq_recaptchaselect>1</faq_recaptchaselect>
|
170 |
+
</depends>
|
171 |
+
</faq_secretkey>
|
172 |
+
</fields>
|
173 |
+
</faq_recaptcha>
|
174 |
+
<notifications translate="label" module="faq">
|
175 |
+
<label>Email Notifications</label>
|
176 |
+
<frontend_type>text</frontend_type>
|
177 |
+
<sort_order>102</sort_order>
|
178 |
+
<show_in_default>1</show_in_default>
|
179 |
+
<show_in_website>1</show_in_website>
|
180 |
+
<show_in_store>1</show_in_store>
|
181 |
+
<fields>
|
182 |
+
<mail_enable translate="label">
|
183 |
+
<label>Send Mail to Customer/Guest if the question is answered.</label>
|
184 |
+
<frontend_type>select</frontend_type>
|
185 |
+
<sort_order>90</sort_order>
|
186 |
+
<show_in_default>1</show_in_default>
|
187 |
+
<show_in_website>1</show_in_website>
|
188 |
+
<show_in_store>1</show_in_store>
|
189 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
190 |
+
</mail_enable>
|
191 |
+
<emailtemplate translate="label">
|
192 |
+
<label>Email Template</label>
|
193 |
+
<frontend_type>select</frontend_type>
|
194 |
+
<sort_order>91</sort_order>
|
195 |
+
<show_in_default>1</show_in_default>
|
196 |
+
<show_in_website>1</show_in_website>
|
197 |
+
<show_in_store>1</show_in_store>
|
198 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
199 |
+
<depends>
|
200 |
+
<mail_enable>1</mail_enable>
|
201 |
+
</depends>
|
202 |
+
</emailtemplate>
|
203 |
+
<mail_subject translate="label">
|
204 |
+
<label>Subject</label>
|
205 |
+
<frontend_type>text</frontend_type>
|
206 |
+
<sort_order>92</sort_order>
|
207 |
+
<show_in_default>1</show_in_default>
|
208 |
+
<show_in_website>1</show_in_website>
|
209 |
+
<show_in_store>1</show_in_store>
|
210 |
+
<depends>
|
211 |
+
<mail_enable>1</mail_enable>
|
212 |
+
</depends>
|
213 |
+
</mail_subject>
|
214 |
+
<mail_sendername translate="label">
|
215 |
+
<label>Sender Name</label>
|
216 |
+
<frontend_type>text</frontend_type>
|
217 |
+
<sort_order>93</sort_order>
|
218 |
+
<show_in_default>1</show_in_default>
|
219 |
+
<show_in_website>1</show_in_website>
|
220 |
+
<show_in_store>1</show_in_store>
|
221 |
+
<depends>
|
222 |
+
<mail_enable>1</mail_enable>
|
223 |
+
</depends>
|
224 |
+
</mail_sendername>
|
225 |
+
<mail_sendermail translate="label">
|
226 |
+
<label>Sender Mail ID</label>
|
227 |
+
<frontend_type>text</frontend_type>
|
228 |
+
<sort_order>94</sort_order>
|
229 |
+
<show_in_default>1</show_in_default>
|
230 |
+
<show_in_website>1</show_in_website>
|
231 |
+
<show_in_store>1</show_in_store>
|
232 |
+
<depends>
|
233 |
+
<mail_enable>1</mail_enable>
|
234 |
+
</depends>
|
235 |
+
</mail_sendermail>
|
236 |
+
</fields>
|
237 |
+
</notifications>
|
238 |
+
</groups>
|
239 |
+
</faq>
|
240 |
+
</sections>
|
241 |
+
</config>
|
app/code/community/DCKAP/Faq/etc/widget.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<widgets>
|
3 |
+
<dc_faq_widget type="faq/widget" translate="faq" module="faq">
|
4 |
+
<name>FAQ - Ask Questions</name>
|
5 |
+
<description>Displays Frequently Asked Questions of the website / store. </description>
|
6 |
+
</dc_faq_widget>
|
7 |
+
</widgets>
|
app/code/community/DCKAP/Faq/sql/dckap_faq_setup/mysql4-install-0.1.0.php
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
$installer=$this;
|
3 |
-
$installer->startSetup();
|
4 |
-
$installer->run("
|
5 |
-
DROP TABLE IF EXISTS {$this->getTable('faq/faq')};
|
6 |
-
CREATE TABLE {$this->getTable('faq/faq')} (
|
7 |
-
`question_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
8 |
-
`category` varchar(11) NOT NULL,
|
9 |
-
`question` varchar(1000) NOT NULL DEFAULT '',
|
10 |
-
`answer` varchar(10000) NOT NULL DEFAULT '',
|
11 |
-
`status` smallint(6) NOT NULL DEFAULT '0',
|
12 |
-
`priority` int(10) DEFAULT '0',
|
13 |
-
`byuser` int(1) NOT NULL DEFAULT '0',
|
14 |
-
`customer_id` varchar(15) NOT NULL,
|
15 |
-
`customer_name` varchar(100) NOT NULL,
|
16 |
-
`customer_email` varchar(100) NOT NULL,
|
17 |
-
`notified` int(1) NOT NULL,
|
18 |
-
`store_id` varchar(30) NOT NULL DEFAULT '0',
|
19 |
-
`store_set` varchar(30) NOT NULL DEFAULT '0',
|
20 |
-
`created_time` datetime DEFAULT NULL,
|
21 |
-
`update_time` datetime DEFAULT NULL,
|
22 |
-
`views` varchar(1000) NOT NULL,
|
23 |
-
PRIMARY KEY (`question_id`)
|
24 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
25 |
-
DROP TABLE IF EXISTS {$this->getTable('faq/category')};
|
26 |
-
CREATE TABLE {$this->getTable('faq/category')} (
|
27 |
-
`cat_id` int(11) NOT NULL AUTO_INCREMENT,
|
28 |
-
`name` varchar(100) NOT NULL,
|
29 |
-
`description` varchar(1000) NOT NULL,
|
30 |
-
`status` smallint(6) NOT NULL DEFAULT '0',
|
31 |
-
`priority` int(10) NOT NULL DEFAULT '0',
|
32 |
-
`store_id` varchar(30) NOT NULL,
|
33 |
-
`store_set` varchar(30) NOT NULL,
|
34 |
-
PRIMARY KEY (`cat_id`)
|
35 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
36 |
-
");
|
37 |
-
$installer->endSetup();
|
38 |
-
?>
|
1 |
+
<?php
|
2 |
+
$installer=$this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$installer->run("
|
5 |
+
DROP TABLE IF EXISTS {$this->getTable('faq/faq')};
|
6 |
+
CREATE TABLE {$this->getTable('faq/faq')} (
|
7 |
+
`question_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
8 |
+
`category` varchar(11) NOT NULL,
|
9 |
+
`question` varchar(1000) NOT NULL DEFAULT '',
|
10 |
+
`answer` varchar(10000) NOT NULL DEFAULT '',
|
11 |
+
`status` smallint(6) NOT NULL DEFAULT '0',
|
12 |
+
`priority` int(10) DEFAULT '0',
|
13 |
+
`byuser` int(1) NOT NULL DEFAULT '0',
|
14 |
+
`customer_id` varchar(15) NOT NULL,
|
15 |
+
`customer_name` varchar(100) NOT NULL,
|
16 |
+
`customer_email` varchar(100) NOT NULL,
|
17 |
+
`notified` int(1) NOT NULL,
|
18 |
+
`store_id` varchar(30) NOT NULL DEFAULT '0',
|
19 |
+
`store_set` varchar(30) NOT NULL DEFAULT '0',
|
20 |
+
`created_time` datetime DEFAULT NULL,
|
21 |
+
`update_time` datetime DEFAULT NULL,
|
22 |
+
`views` varchar(1000) NOT NULL,
|
23 |
+
PRIMARY KEY (`question_id`)
|
24 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
25 |
+
DROP TABLE IF EXISTS {$this->getTable('faq/category')};
|
26 |
+
CREATE TABLE {$this->getTable('faq/category')} (
|
27 |
+
`cat_id` int(11) NOT NULL AUTO_INCREMENT,
|
28 |
+
`name` varchar(100) NOT NULL,
|
29 |
+
`description` varchar(1000) NOT NULL,
|
30 |
+
`status` smallint(6) NOT NULL DEFAULT '0',
|
31 |
+
`priority` int(10) NOT NULL DEFAULT '0',
|
32 |
+
`store_id` varchar(30) NOT NULL,
|
33 |
+
`store_set` varchar(30) NOT NULL,
|
34 |
+
PRIMARY KEY (`cat_id`)
|
35 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
36 |
+
");
|
37 |
+
$installer->endSetup();
|
38 |
+
?>
|
app/design/adminhtml/default/default/layout/faq.xml
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
|
3 |
-
<layout version="0.1.0">
|
4 |
-
<faq_adminhtml_faq_index>
|
5 |
-
<reference name="content">
|
6 |
-
<block type="faq/adminhtml_faq" name="faq" />
|
7 |
-
</reference>
|
8 |
-
</faq_adminhtml_faq_index>
|
9 |
-
<faq_adminhtml_category_index>
|
10 |
-
<reference name="content">
|
11 |
-
<block type="faq/adminhtml_category" name="category" />
|
12 |
-
</reference>
|
13 |
-
</faq_adminhtml_category_index>
|
14 |
-
<faq_adminhtml_faq_edit>
|
15 |
-
<update handle="editor"/>
|
16 |
-
</faq_adminhtml_faq_edit>
|
17 |
-
<faq_adminhtml_category_edit>
|
18 |
-
<update handle="editor"/>
|
19 |
-
</faq_adminhtml_category_edit>
|
20 |
-
</layout>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<layout version="0.1.0">
|
4 |
+
<faq_adminhtml_faq_index>
|
5 |
+
<reference name="content">
|
6 |
+
<block type="faq/adminhtml_faq" name="faq" />
|
7 |
+
</reference>
|
8 |
+
</faq_adminhtml_faq_index>
|
9 |
+
<faq_adminhtml_category_index>
|
10 |
+
<reference name="content">
|
11 |
+
<block type="faq/adminhtml_category" name="category" />
|
12 |
+
</reference>
|
13 |
+
</faq_adminhtml_category_index>
|
14 |
+
<faq_adminhtml_faq_edit>
|
15 |
+
<update handle="editor"/>
|
16 |
+
</faq_adminhtml_faq_edit>
|
17 |
+
<faq_adminhtml_category_edit>
|
18 |
+
<update handle="editor"/>
|
19 |
+
</faq_adminhtml_category_edit>
|
20 |
+
</layout>
|
app/design/frontend/base/default/layout/faq.xml
CHANGED
@@ -1,31 +1,32 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout version="0.1.0">
|
3 |
-
|
4 |
-
<reference name="head">
|
5 |
-
|
6 |
-
<
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
<
|
24 |
-
<
|
25 |
-
<
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
</
|
30 |
-
|
31 |
-
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<block type="core/text" name="recaptcha">
|
6 |
+
<action ifconfig="faq/faq_recaptcha/faq_recaptchaselect" method="setText"><text><![CDATA[<script src="https://www.google.com/recaptcha/api.js"></script>]]></text></action>
|
7 |
+
</block>
|
8 |
+
</reference>
|
9 |
+
</default>
|
10 |
+
<faq_index_index>
|
11 |
+
<reference name="root">
|
12 |
+
<action method="setTemplate">
|
13 |
+
<template>page/1column.phtml</template>
|
14 |
+
</action>
|
15 |
+
</reference>
|
16 |
+
<reference name="content">
|
17 |
+
<block type="faq/faq" name="faq" template="faq/faq.phtml" />
|
18 |
+
</reference>
|
19 |
+
</faq_index_index>
|
20 |
+
<default>
|
21 |
+
<reference name="footer_links">
|
22 |
+
<action method="addLink" translate="label title" ifconfig="faq/faq_group/faq_select">
|
23 |
+
<label>faq</label>
|
24 |
+
<url>faq</url>
|
25 |
+
<prepare>Frequently Asked Questions</prepare>
|
26 |
+
<title>faq</title>
|
27 |
+
</action>
|
28 |
+
</reference>
|
29 |
+
</default>
|
30 |
+
</layout>
|
31 |
+
|
32 |
+
|
app/design/frontend/base/default/template/faq/faq.phtml
CHANGED
@@ -1,327 +1,329 @@
|
|
1 |
-
<
|
2 |
-
<div class="
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
</div>
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
var
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
jQuery('
|
28 |
-
jQuery('#'+
|
29 |
-
|
30 |
-
var
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
jQuery(
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
$(".dckap_response").
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
$("
|
65 |
-
$("#
|
66 |
-
$("
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
$(".dckap_response").
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
$(".dckap_response").
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
$(".
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
$(".
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
$
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
<
|
112 |
-
|
113 |
-
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
if($
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
$
|
182 |
-
|
183 |
-
$
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
<?php
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
array(
|
201 |
-
array('eq'=>
|
202 |
-
array('like'=>'%,
|
203 |
-
)
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
array('
|
210 |
-
array(
|
211 |
-
)
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
<?php
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
<div
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
}
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
<
|
266 |
-
<
|
267 |
-
<div
|
268 |
-
<
|
269 |
-
<div
|
270 |
-
|
271 |
-
|
272 |
-
<?php
|
273 |
-
|
274 |
-
|
275 |
-
<
|
276 |
-
<
|
277 |
-
|
278 |
-
<option value="
|
279 |
-
<?php
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
<
|
307 |
-
<input type="
|
308 |
-
|
309 |
-
<
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
</div>
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
|
|
|
|
327 |
</script>
|
1 |
+
<link media="all" href="<?php echo $this->getSkinUrl('faq/css/dckap_faq.css'); ?>" type="text/css" rel="stylesheet">
|
2 |
+
<div class="dckap_faq">
|
3 |
+
<div class="page-title">
|
4 |
+
<h1>
|
5 |
+
<strong>
|
6 |
+
<span>
|
7 |
+
<?php echo $this->__('Frequently Asked Questions') ?>
|
8 |
+
</span>
|
9 |
+
</strong>
|
10 |
+
</h1>
|
11 |
+
<div class="catdescription">
|
12 |
+
<?php if(Mage::getStoreConfig('faq/faq_group/description')){
|
13 |
+
?>
|
14 |
+
<span><?php echo Mage::getStoreConfig('faq/faq_group/description'); ?></span>
|
15 |
+
<?php } ?>
|
16 |
+
</div>
|
17 |
+
</div>
|
18 |
+
<script>
|
19 |
+
jQuery(document).ready(function($){
|
20 |
+
jQuery("h4.dckap_questions").click(function() {
|
21 |
+
var state = true;
|
22 |
+
var questionClass = jQuery(this).attr("id");
|
23 |
+
var answerClass = questionClass.replace('question', 'answer');
|
24 |
+
state = $( "#"+answerClass ).is( ":visible" );
|
25 |
+
jQuery('h4.dckap_questions').removeClass("active");
|
26 |
+
if(!state){
|
27 |
+
jQuery('h6.dckap_answers').hide();
|
28 |
+
jQuery('#'+answerClass).toggle();
|
29 |
+
jQuery('#'+questionClass).addClass("active");
|
30 |
+
var url = "<?php echo Mage::getUrl('faq/index/click'); ?>";
|
31 |
+
var params = 'id='+jQuery(this).data("id");
|
32 |
+
$.ajax({
|
33 |
+
type: "POST",
|
34 |
+
url: url,
|
35 |
+
data: params
|
36 |
+
});
|
37 |
+
}else{
|
38 |
+
jQuery('h6.dckap_answers').hide();
|
39 |
+
}
|
40 |
+
});
|
41 |
+
jQuery("span.asknew").click(function() {
|
42 |
+
jQuery("form#dckap_askform").show();
|
43 |
+
jQuery(this).hide();
|
44 |
+
});
|
45 |
+
$("#dckap_askform").submit(function(){
|
46 |
+
if(!$("#dckapquestion").val()){
|
47 |
+
$(".dckap_response").html("Invalid Question.");
|
48 |
+
$(".dckap_response").css("color","crimson");
|
49 |
+
$(".dckap_response").show();
|
50 |
+
setTimeout(function() { $(".dckap_response").fadeOut(); }, 2000);
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
$(".dckap_overlay").show();
|
54 |
+
var url = $("#dckap_askform #dckap_url").val();
|
55 |
+
|
56 |
+
$.ajax({
|
57 |
+
type: "POST",
|
58 |
+
url: url,
|
59 |
+
data: $("#dckap_askform").serialize(),
|
60 |
+
success: function(data)
|
61 |
+
{
|
62 |
+
if(data == "1"){
|
63 |
+
$(".dckap_response").html("Your question is under review and it will be answered soon.");
|
64 |
+
$(".dckap_response").css("color","green");
|
65 |
+
$("form#dckap_askform").hide();
|
66 |
+
$("#dckapquestion").val('');
|
67 |
+
$("span.asknew").html("Ask another Question");
|
68 |
+
$("span.asknew").show();
|
69 |
+
}else if(data == "2"){
|
70 |
+
$(".dckap_response").html("Invalid Captcha. Please try again.");
|
71 |
+
$(".dckap_response").css("color","crimson");
|
72 |
+
}
|
73 |
+
else{
|
74 |
+
$(".dckap_response").html(data);
|
75 |
+
$(".dckap_response").css("color","crimson");
|
76 |
+
}
|
77 |
+
if($("#faqcaptcha").length){
|
78 |
+
grecaptcha.reset();
|
79 |
+
}
|
80 |
+
setTimeout(function() { $(".dckap_response").fadeOut(); }, 2000);
|
81 |
+
$(".dckap_response").show();
|
82 |
+
$(".dckap_overlay").hide();
|
83 |
+
},
|
84 |
+
error: function (xhr, ajaxOptions, thrownError) {
|
85 |
+
$(".dckap_response").html("Some unknown error occurred. Please try again.");
|
86 |
+
$(".dckap_response").css("color","crimson");
|
87 |
+
if($("#faqcaptcha").length){
|
88 |
+
grecaptcha.reset();
|
89 |
+
}
|
90 |
+
setTimeout(function() { $(".dckap_response").fadeOut(); }, 2000);
|
91 |
+
$(".dckap_response").show();
|
92 |
+
$(".dckap_overlay").hide();
|
93 |
+
}
|
94 |
+
});
|
95 |
+
|
96 |
+
return false;
|
97 |
+
});
|
98 |
+
});
|
99 |
+
</script>
|
100 |
+
<div class="dckap_wrap">
|
101 |
+
<?php
|
102 |
+
$categoryParam = 0;
|
103 |
+
$keywordParam = "";
|
104 |
+
if(isset($_REQUEST['category'])){
|
105 |
+
$categoryParam = $_REQUEST['category'];
|
106 |
+
}
|
107 |
+
if(isset($_REQUEST['keyword'])){
|
108 |
+
$keywordParam = $_REQUEST['keyword'];
|
109 |
+
}
|
110 |
+
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){ ?>
|
111 |
+
<div class="dckap_leftbar">
|
112 |
+
<ul>
|
113 |
+
<?php
|
114 |
+
$categoryvalues = $this->getCategories();
|
115 |
+
$ik = 0;
|
116 |
+
$licount = 3;
|
117 |
+
$lock = 1;
|
118 |
+
$urlFull = $this->helper('core/url')->getCurrentUrl();
|
119 |
+
$urlWithoutParameters = explode("?", $urlFull);
|
120 |
+
?>
|
121 |
+
<li <?php if(!$categoryParam){ $lock = 0;?>class="active"<?php } ?>><a href="<?php echo $urlWithoutParameters[0]; ?>" <?php if(!$categoryParam){ ?>onclick="return false"<?php } ?>>ALL FAQ's</a></li>
|
122 |
+
<?php foreach ($categoryvalues as $category) {
|
123 |
+
if($ik < $licount){
|
124 |
+
?>
|
125 |
+
<li <?php if($category->getId()==$categoryParam) { $lock = 0;?>class="active"<?php } ?>>
|
126 |
+
<a href="<?php echo $urlWithoutParameters[0].'?category='.$category->getId(); ?>" ><?php echo $category->getName(); ?>
|
127 |
+
</a>
|
128 |
+
</li>
|
129 |
+
<?php
|
130 |
+
}
|
131 |
+
$ik++;
|
132 |
+
}
|
133 |
+
if($categoryvalues->count() > $licount){
|
134 |
+
?>
|
135 |
+
<li class="more_menu <?php if($lock){ ?>active<?php } ?>">
|
136 |
+
<a id="more_menu">More <img src="<?php echo $this->getSkinUrl('faq/images/down.png') ?>" width="18"></a>
|
137 |
+
<ul>
|
138 |
+
<?php
|
139 |
+
$ik = 0;
|
140 |
+
foreach ($categoryvalues as $category) {
|
141 |
+
if($ik >= $licount){
|
142 |
+
?>
|
143 |
+
<li <?php if($category->getId()==$categoryParam) { ?>class="active"<?php } ?>><a href="<?php echo $urlWithoutParameters[0].'?category='.$category->getId(); ?>" ><?php echo $category->getName(); ?></a></li>
|
144 |
+
<?php } $ik++; } ?>
|
145 |
+
|
146 |
+
</ul>
|
147 |
+
</li>
|
148 |
+
<?php } ?>
|
149 |
+
</ul>
|
150 |
+
<div class="faq-search">
|
151 |
+
<form id="faq-searchform" method="GET" action="">
|
152 |
+
<input type="hidden" name="category" value="<?php echo $categoryParam; ?>" />
|
153 |
+
<input type="text" name="keyword" placeholder="Search here" value="<?php echo $keywordParam; ?>" />
|
154 |
+
<input type="submit" value="" class="btn-searchform">
|
155 |
+
</form>
|
156 |
+
</div>
|
157 |
+
</div>
|
158 |
+
<?php }else{ ?>
|
159 |
+
<div class="faq-search">
|
160 |
+
<form id="faq-searchform" method="GET" action="">
|
161 |
+
<input type="hidden" name="category" value="<?php echo $categoryParam; ?>" />
|
162 |
+
<input type="text" name="keyword" placeholder="Search here" value="<?php echo $keywordParam; ?>" />
|
163 |
+
<input type="submit" value="" class="btn-searchform">
|
164 |
+
</form>
|
165 |
+
</div>
|
166 |
+
<?php } ?>
|
167 |
+
<div style="clear: both;"></div>
|
168 |
+
<div class="dckap_content">
|
169 |
+
<?php
|
170 |
+
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
171 |
+
if($categoryParam){
|
172 |
+
$currentcat = Mage::getModel('faq/category')->load($categoryParam);
|
173 |
+
if($currentcat->description){
|
174 |
+
?>
|
175 |
+
<div class="catdescription"><span><?php echo $currentcat->description; ?></span></div>
|
176 |
+
<?php
|
177 |
+
} } }
|
178 |
+
|
179 |
+
$currentPage=1;
|
180 |
+
$_collections = $keywordParam ? $this->getFaq($keywordParam) : $this->getFaq();
|
181 |
+
$_productCollection = $this->getCollection($_collections);
|
182 |
+
|
183 |
+
$itemPerPage = Mage::getStoreConfig('faq/faq_group/faq_text');
|
184 |
+
$currentPage = $this->getCurrentPage();
|
185 |
+
$i = (!$currentPage || $currentPage == 1) ? 1 : $itemPerPage*($currentPage-1)+1;
|
186 |
+
if($this->getPagerHtml($this->getFaq($keywordParam))) { ?>
|
187 |
+
<div class="pages dckap_pager">
|
188 |
+
<?php echo $this->getPagerHtml($this->getFaq($keywordParam));?>
|
189 |
+
<span><b><?php echo $this->__('PAGE : ');?></b></span>
|
190 |
+
<?php
|
191 |
+
$pcollection = Mage::getModel('faq/faq')->getCollection();
|
192 |
+
if(Mage::getStoreConfig('faq/faq_group/category_enabled')){
|
193 |
+
if($categoryParam){
|
194 |
+
$pcollection->addFieldtoFilter('category',$categoryParam);
|
195 |
+
}
|
196 |
+
}
|
197 |
+
$pcollection->addFieldToFilter('answer', array('neq' => '' ));
|
198 |
+
$pcollection->addFieldToFilter(
|
199 |
+
array('store_id','store_set','store_id','store_set' ),
|
200 |
+
array(
|
201 |
+
array('eq'=>Mage::app()->getStore(true)->getId()),
|
202 |
+
array('like'=>'%,'.Mage::app()->getStore(true)->getId().',%'),
|
203 |
+
array('eq'=>'0'),
|
204 |
+
array('like'=>'%,0,%')
|
205 |
+
)
|
206 |
+
);
|
207 |
+
if($keywordParam){
|
208 |
+
$pcollection->addFieldToFilter(
|
209 |
+
array('question','answer' ),
|
210 |
+
array(
|
211 |
+
array('like'=>'%'.$keywordParam.'%'),
|
212 |
+
array('like'=>'%'.$keywordParam.'%')
|
213 |
+
)
|
214 |
+
);
|
215 |
+
}
|
216 |
+
$pcollection->addFieldToFilter('status',array('eq'=>1));
|
217 |
+
?>
|
218 |
+
<span class="totalitems"><b>Total:</b> <?php echo $pcollection->count(); ?> questions</span>
|
219 |
+
</div>
|
220 |
+
<?php } ?>
|
221 |
+
<div style="clear:both"></div>
|
222 |
+
<?php
|
223 |
+
if($_productCollection->count()){
|
224 |
+
foreach($_productCollection as $key)
|
225 |
+
{ ?>
|
226 |
+
<h4 id="<?php echo 'dckap_question'.$i; ?>" data-id="<?php echo $key->getId(); ?>" class="dckap_questions"><?php echo $i."  ".$key->getQuestion(); ?></h4>
|
227 |
+
<h6 id="<?php echo 'dckap_answer'.$i; ?>" class="dckap_answers" style="display:none"><?php
|
228 |
+
$_cmsHelper = Mage::helper('cms');
|
229 |
+
$_process = $_cmsHelper->getBlockTemplateProcessor();
|
230 |
+
echo $_process->filter($key->getAnswer());
|
231 |
+
?></h6>
|
232 |
+
<?php
|
233 |
+
|
234 |
+
$i++;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
else{ ?>
|
238 |
+
<span class="notfound">No questions available.</span>
|
239 |
+
<?php }
|
240 |
+
?>
|
241 |
+
<div style="clear:both"></div>
|
242 |
+
<?php if($this->getPagerHtml($this->getFaq($keywordParam))):?>
|
243 |
+
<div class="pages dckap_pager">
|
244 |
+
<?php echo $this->getPagerHtml($this->getFaq($keywordParam));?>
|
245 |
+
<span><b><?php echo $this->__('PAGE : ');?></b></span>
|
246 |
+
<span class="totalitems"><b>Total:</b> <?php echo $pcollection->count(); ?> questions</span>
|
247 |
+
</div>
|
248 |
+
<?php endif;?>
|
249 |
+
<div style="clear:both"></div>
|
250 |
+
</div>
|
251 |
+
<div style="clear:both"></div>
|
252 |
+
</div>
|
253 |
+
<?php
|
254 |
+
$guestalert = 0;
|
255 |
+
if(Mage::getStoreConfig('faq/faq_recaptcha/faq_customer')){
|
256 |
+
$condition = Mage::getSingleton('customer/session')->isLoggedIn();
|
257 |
+
if(!$condition && Mage::getStoreConfig('faq/faq_recaptcha/faq_user')){ ?>
|
258 |
+
<div class="guest-alert">Please sign in to ask questions.</div>
|
259 |
+
<?php }
|
260 |
+
}else{
|
261 |
+
$condition = true;
|
262 |
+
}
|
263 |
+
if(Mage::getStoreConfig('faq/faq_recaptcha/faq_user') && $condition) { ?>
|
264 |
+
<div class="dckap_new">
|
265 |
+
<h4 class="ask_title"><?php echo Mage::getStoreConfig('faq/faq_recaptcha/faq_text'); ?><br/>
|
266 |
+
<div style="clear:both"></div>
|
267 |
+
<div class="dckap_response"></div>
|
268 |
+
<span class="asknew"><?php echo Mage::getStoreConfig('faq/faq_recaptcha/faq_btnlabel'); ?></span></h4>
|
269 |
+
<div style="clear:both"></div>
|
270 |
+
<form id="dckap_askform" name="addnewquestion" method="POST" action="">
|
271 |
+
<div class="dckap_overlay">
|
272 |
+
<center><img width="40" src="<?php echo $this->getSkinUrl('faq/images/loading.gif') ?>"></center>
|
273 |
+
</div>
|
274 |
+
<?php if(Mage::getStoreConfig('faq/faq_group/category_enabled')){ ?>
|
275 |
+
<div class="fieldset">
|
276 |
+
<span>Category </span>
|
277 |
+
<select name="category">
|
278 |
+
<option value="">Select any</option>
|
279 |
+
<?php foreach ($categoryvalues as $category) { ?>
|
280 |
+
<option value="<?php echo $category->getId(); ?>"><?php echo $category->getName(); ?></option>
|
281 |
+
<?php } ?>
|
282 |
+
</select>
|
283 |
+
</div>
|
284 |
+
<?php } ?>
|
285 |
+
<?php if(!Mage::getSingleton('customer/session')->isLoggedIn()){ ?>
|
286 |
+
<div class="user-info">
|
287 |
+
<div class="fieldset-input">
|
288 |
+
<label>Name*</label>
|
289 |
+
<input type="text" name="guest-name" required />
|
290 |
+
</div>
|
291 |
+
<div class="fieldset-input">
|
292 |
+
<label>Email*</label>
|
293 |
+
<input type="email" name="guest-email" required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"/>
|
294 |
+
</div>
|
295 |
+
</div>
|
296 |
+
<?php } ?>
|
297 |
+
<div class="fieldset forminput">
|
298 |
+
<label>Question*</label>
|
299 |
+
<textarea id="dckapquestion" required name="question" style="width:440px;height:77px;"></textarea>
|
300 |
+
</div>
|
301 |
+
<?php if(Mage::getStoreConfig('faq/faq_recaptcha/faq_recaptchaselect') && Mage::getStoreConfig('faq/faq_recaptcha/faq_sitekey') && Mage::getStoreConfig('faq/faq_recaptcha/faq_secretkey')){ ?>
|
302 |
+
<center><div class="fieldset recap">
|
303 |
+
<div id="faqcaptcha" class="g-recaptcha" data-sitekey="<?php echo Mage::getStoreConfig('faq/faq_recaptcha/faq_sitekey'); ?>"></div>
|
304 |
+
</div></center>
|
305 |
+
<?php } ?>
|
306 |
+
<div class="fieldset">
|
307 |
+
<input type="hidden" value="<?php echo Mage::getUrl('faq/index/proceed'); ?>" id="dckap_url" />
|
308 |
+
<input type="submit"value="Submit" />
|
309 |
+
<input type="reset" value="Reset" />
|
310 |
+
</div>
|
311 |
+
<div style="clear:both"></div>
|
312 |
+
</form>
|
313 |
+
<div style="clear:both"></div>
|
314 |
+
</div>
|
315 |
+
<?php } ?>
|
316 |
+
</div>
|
317 |
+
<script type="text/javascript">
|
318 |
+
jQuery(document).ready(function(){
|
319 |
+
jQuery('.more_menu').on({
|
320 |
+
mouseover: function() {
|
321 |
+
jQuery('.more_menu ul').show();
|
322 |
+
},
|
323 |
+
mouseout: function(){
|
324 |
+
jQuery('.more_menu ul').hide();
|
325 |
+
},
|
326 |
+
|
327 |
+
});
|
328 |
+
});
|
329 |
</script>
|
app/etc/modules/DCKAP_Faq.xml
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<DCKAP_Faq>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>community</codePool>
|
7 |
-
<version>
|
8 |
-
</DCKAP_Faq>
|
9 |
-
</modules>
|
10 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<DCKAP_Faq>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>1.0.4</version>
|
8 |
+
</DCKAP_Faq>
|
9 |
+
</modules>
|
10 |
+
</config>
|
app/locale/en_US/template/email/faq_notification.html
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
{{template config_path="design/email/header"}}
|
2 |
-
{{inlinecss file="email-inline.css"}}
|
3 |
-
|
4 |
-
<table cellpadding="0" cellspacing="0" border="0">
|
5 |
-
<tr>
|
6 |
-
<td class="action-content">
|
7 |
-
<h1>Hello {{var receiver}},</h1>
|
8 |
-
<p style="font-size: 14px;margin-bottom: 25px;line-height: 1.5;" > We are glad to notify you that the question ( <b>{{var question}}</b> ) posted by you on our website has been answered. And also we added that question with answer into our website frequently asked question's page.
|
9 |
-
<br /><br />To know the answer, kindly check our <a href="{{var faq_url}}">faq page</a>.</p>
|
10 |
-
<p>If you have any questions, please feel free to contact us at <a href="mailto:{{var store_email}}">{{var store_email}}</a> {{depend store_phone}} or by phone at <a href="tel:{{var phone}}">{{var store_phone}}</a>{{/depend}}.</p>
|
11 |
-
</td>
|
12 |
-
</tr>
|
13 |
-
</table>
|
14 |
-
|
15 |
-
{{template config_path="design/email/footer"}}
|
1 |
+
{{template config_path="design/email/header"}}
|
2 |
+
{{inlinecss file="email-inline.css"}}
|
3 |
+
|
4 |
+
<table cellpadding="0" cellspacing="0" border="0">
|
5 |
+
<tr>
|
6 |
+
<td class="action-content">
|
7 |
+
<h1>Hello {{var receiver}},</h1>
|
8 |
+
<p style="font-size: 14px;margin-bottom: 25px;line-height: 1.5;" > We are glad to notify you that the question ( <b>{{var question}}</b> ) posted by you on our website has been answered. And also we added that question with answer into our website frequently asked question's page.
|
9 |
+
<br /><br />To know the answer, kindly check our <a href="{{var faq_url}}">faq page</a>.</p>
|
10 |
+
<p>If you have any questions, please feel free to contact us at <a href="mailto:{{var store_email}}">{{var store_email}}</a> {{depend store_phone}} or by phone at <a href="tel:{{var phone}}">{{var store_phone}}</a>{{/depend}}.</p>
|
11 |
+
</td>
|
12 |
+
</tr>
|
13 |
+
</table>
|
14 |
+
|
15 |
+
{{template config_path="design/email/footer"}}
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>DCKAP_Faq</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>FAQ - Ask Questions used to manage the Frequently Asked Questions from magento back end and also user can ask their own questions from front end.</summary>
|
10 |
<description>FAQ - Ask Questions used to manage the Frequently Asked Questions from magento back end and also user can ask their own questions from front end.once user asked the questions, it will be reviewed by admin and update to FAQ section.</description>
|
11 |
-
<notes
|
12 |
<authors><author><name>DCKAP</name><user>DCKAP</user><email>extensions@dckap.com</email></author></authors>
|
13 |
-
<date>2016-
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageetc"><dir name="modules"><file name="DCKAP_Faq.xml" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>DCKAP_Faq</name>
|
4 |
+
<version>1.0.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>FAQ - Ask Questions used to manage the Frequently Asked Questions from magento back end and also user can ask their own questions from front end.</summary>
|
10 |
<description>FAQ - Ask Questions used to manage the Frequently Asked Questions from magento back end and also user can ask their own questions from front end.once user asked the questions, it will be reviewed by admin and update to FAQ section.</description>
|
11 |
+
<notes>* Widget Support</notes>
|
12 |
<authors><author><name>DCKAP</name><user>DCKAP</user><email>extensions@dckap.com</email></author></authors>
|
13 |
+
<date>2016-03-10</date>
|
14 |
+
<time>10:27:57</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="DCKAP_Faq.xml" hash="003aa93017a99aa7c9cb1e1b81c9b766"/></dir></target><target name="magecommunity"><dir name="DCKAP"><dir name="Faq"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="5100426f24dd3d347ac139bd820568cf"/><dir name="Tab"><file name="Form.php" hash="62586ac139c3f72406fc3db853cc5711"/></dir><file name="Tabs.php" hash="ccdb783b2b20bd8f3f5cd89cb22a8fdb"/></dir><file name="Edit.php" hash="55dd66ac90e54c18167495388c79bf01"/><file name="Grid.php" hash="f4480b27dcc18e4506828b04cab65029"/></dir><file name="Category.php" hash="970ea3ec42aebc32e841c19654fb1246"/><dir name="Faq"><dir name="Edit"><file name="Form.php" hash="78ce50012a871ed064fb02562326d887"/><dir name="Tab"><file name="Form.php" hash="e02c913c1b5060e32faf8dae18da6cef"/></dir><file name="Tabs.php" hash="13e5cb3fc754c70ea07a712d2fa80a5a"/></dir><file name="Edit.php" hash="1c615dd028527fc1bc9a29fe98a6a99b"/><file name="Grid.php" hash="7a8580a742a64702ebae9d9f2cde8771"/></dir><file name="Faq.php" hash="7b38a9c3b608490a5185596d6daef37a"/></dir><file name="Faq.php" hash="59f7c6ac79e32585f7e875288af1c5cb"/><file name="Widget.php" hash="eaa176d5d6c52b2701adf6e021cfd9f4"/></dir><dir name="Helper"><file name="Data.php" hash="d63940886d43e282183371967bfb0933"/></dir><dir name="Model"><file name="Category.php" hash="d0b2ce3765b98d8d03b62e44392c0c96"/><file name="Faq.php" hash="11a92ef3df1c01a22fd59698488305e1"/><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="e1a034e04cd4575d74f43d1953fc50e9"/></dir><file name="Category.php" hash="a43d99a938e3522093f976c7191483f1"/><dir name="Faq"><file name="Collection.php" hash="6ed81dffe0ef1a133fe67d79dc20a1bc"/></dir><file name="Faq.php" hash="f3fe9f805a7c8a5d601a17088513f598"/></dir><file name="Status.php" hash="8ddc01a29c931434b8d30b22229554ac"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategoryController.php" hash="f9b33fc003b36b8df27fc12c49c4e77f"/><file name="FaqController.php" hash="5aac93b5698e12efba56ed23b4dc5e1e"/></dir><file name="IndexController.php" hash="40bb96111e20c6921beba03386330f23"/></dir><dir name="etc"><file name="config.xml" hash="1d318ae16bc955eb8ee4f6166a60b83a"/><file name="system.xml" hash="c1f435c1b70fbefdb21bb208a5cd4557"/><file name="widget.xml" hash="31cbdd469a660f17d8114672dcd67e9e"/></dir><dir name="sql"><dir name="dckap_faq_setup"><file name="mysql4-install-0.1.0.php" hash="84044a7cd221bc98247f5d73b4be87a9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="faq.xml" hash="5a688c80d0906488bd43b5c25944aea0"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="faq.xml" hash="fdc6a1e4a523cd6a13c848ef024a70bd"/></dir><dir name="template"><dir name="faq"><file name="faq.phtml" hash="7fe20ec449efc78128616e1588a01428"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="faq"><dir name="css"><file name="dckap_faq.css" hash="c972f2237808e4e71cf98a23669e6c63"/></dir><dir name="images"><file name="down.png" hash="67b2ce8412797c81aa1233f7ec0fbf82"/><file name="faq-logo.jpg" hash="ee323cb9d91166da3f6984f761befa91"/><file name="loading.gif" hash="365d3e659634df5d5289f14e1855e714"/><file name="search.png" hash="3b5540ee0c7010b840e5514716f23114"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="faq_notification.html" hash="83e76840577a30326278df0319254921"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/frontend/base/default/faq/css/dckap_faq.css
CHANGED
@@ -1,382 +1,392 @@
|
|
1 |
-
.dckap_faq {
|
2 |
-
margin-bottom: 50px;
|
3 |
-
}
|
4 |
-
.dckap_faq .page-title h1{
|
5 |
-
|
6 |
-
}
|
7 |
-
.pages.dckap_pager {g
|
8 |
-
width: 100%;
|
9 |
-
}
|
10 |
-
.pages.dckap_pager > span {
|
11 |
-
display: block;
|
12 |
-
float: right;
|
13 |
-
margin-right: 5px;
|
14 |
-
margin-top: 4px;
|
15 |
-
}
|
16 |
-
.pages.dckap_pager > ol {
|
17 |
-
float: right;
|
18 |
-
}
|
19 |
-
|
20 |
-
.dckap_faq .dckap_answers {
|
21 |
-
background: none repeat scroll 0 0 #f7f7f7;
|
22 |
-
border-radius: 2px;
|
23 |
-
font-size: 14px;
|
24 |
-
font-weight: normal;
|
25 |
-
line-height: 1.8;
|
26 |
-
margin-left: 26px;
|
27 |
-
padding: 10px;
|
28 |
-
text-transform: inherit;
|
29 |
-
}
|
30 |
-
.dckap_faq .page-title {
|
31 |
-
color: #39c;
|
32 |
-
font-size: 40px;
|
33 |
-
text-align: center;
|
34 |
-
}
|
35 |
-
.dckap_faq .ask_title {
|
36 |
-
margin-top: 20px;
|
37 |
-
text-transform: inherit;
|
38 |
-
margin-bottom: 20px;
|
39 |
-
}
|
40 |
-
.dckap_new .ask_title .asknew:hover {
|
41 |
-
background: none repeat scroll 0 0 #343434;
|
42 |
-
border-color: #333;
|
43 |
-
}
|
44 |
-
#dckap_askform {
|
45 |
-
margin: 25px 0 0;
|
46 |
-
text-align: center;
|
47 |
-
display: none;
|
48 |
-
}
|
49 |
-
#dckap_askform .fieldset label {
|
50 |
-
display: inline-block;
|
51 |
-
width: 125px;
|
52 |
-
}
|
53 |
-
#dckap_askform .fieldset textarea {
|
54 |
-
border: 1px solid #ccc;
|
55 |
-
}
|
56 |
-
#dckap_askform .fieldset input {
|
57 |
-
border: 1px solid #ccc;
|
58 |
-
padding: 5px 15px;
|
59 |
-
}
|
60 |
-
#dckap_askform .fieldset input:hover {
|
61 |
-
border-color: #888;
|
62 |
-
}
|
63 |
-
.dckap_pager span {
|
64 |
-
color: #444;
|
65 |
-
}
|
66 |
-
.dckap_overlay {
|
67 |
-
background: none repeat scroll 0 0 rgba(255, 255, 255, 0.8);
|
68 |
-
display: none;
|
69 |
-
height: 100%;
|
70 |
-
padding-top: 40px;
|
71 |
-
position: absolute;
|
72 |
-
width: 100%;
|
73 |
-
}
|
74 |
-
.dckap_response {
|
75 |
-
border: 2px solid;
|
76 |
-
display: none;
|
77 |
-
margin-bottom: 15px;
|
78 |
-
margin-top: 15px;
|
79 |
-
padding: 10px;
|
80 |
-
}
|
81 |
-
#dckap_askform .fieldset select {
|
82 |
-
cursor: pointer;
|
83 |
-
font-size: 16px;
|
84 |
-
padding: 3px;
|
85 |
-
width: 443px;
|
86 |
-
}
|
87 |
-
#dckap_askform .fieldset select option {
|
88 |
-
padding: 3px;
|
89 |
-
}
|
90 |
-
#dckap_askform .fieldset > span {
|
91 |
-
font-size: 20px;
|
92 |
-
}
|
93 |
-
#dckap_askform .fieldset.forminput {
|
94 |
-
margin-top: 0px;
|
95 |
-
}
|
96 |
-
.dckap_leftbar a:hover {
|
97 |
-
text-decoration: none;
|
98 |
-
}
|
99 |
-
.pages.dckap_pager a:hover {
|
100 |
-
text-decoration: none;
|
101 |
-
border-color: #777;
|
102 |
-
}
|
103 |
-
.pages.dckap_pager li.current {
|
104 |
-
background: none repeat scroll 0 0 #777;
|
105 |
-
border: 1px solid #777;
|
106 |
-
color: #fff;
|
107 |
-
line-height: 27px;
|
108 |
-
}
|
109 |
-
.pages.dckap_pager a {
|
110 |
-
background: none repeat scroll 0 0 #f2f2f2;
|
111 |
-
border: 1px solid #ddd;
|
112 |
-
color: #000;
|
113 |
-
width: 30px;
|
114 |
-
line-height: 27px;
|
115 |
-
}
|
116 |
-
.dckap_content span.notfound {
|
117 |
-
display: block;
|
118 |
-
margin: 10px 0;
|
119 |
-
}
|
120 |
-
.dckap_wrap a:focus{
|
121 |
-
outline: none;
|
122 |
-
}
|
123 |
-
.pages.dckap_pager .totalitems {
|
124 |
-
color: #444;
|
125 |
-
margin-right: 15px;
|
126 |
-
text-transform: uppercase;
|
127 |
-
}
|
128 |
-
.user-info {
|
129 |
-
clear: both;
|
130 |
-
display: block;
|
131 |
-
width: 100%;
|
132 |
-
}
|
133 |
-
.user-info .fieldset-input {
|
134 |
-
float: left;
|
135 |
-
}
|
136 |
-
.user-info .fieldset-input input {
|
137 |
-
border: 1px solid #ccc;
|
138 |
-
border-radius: 0;
|
139 |
-
height: 40px;
|
140 |
-
margin-right: 5px;
|
141 |
-
width: 300px;
|
142 |
-
}
|
143 |
-
.
|
144 |
-
|
145 |
-
}
|
146 |
-
.dckap_faq .page-title h1 {
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
}
|
248 |
-
#faq-searchform
|
249 |
-
|
250 |
-
border
|
251 |
-
height: 36px;
|
252 |
-
margin-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
font-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
font-
|
282 |
-
font-
|
283 |
-
padding:
|
284 |
-
text-transform: uppercase;
|
285 |
-
width: 125px;
|
286 |
-
}
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
margin:
|
327 |
-
padding:
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
margin: 10px 0;
|
337 |
-
padding:
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
border-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
382 |
}
|
1 |
+
.dckap_faq {
|
2 |
+
margin-bottom: 50px;
|
3 |
+
}
|
4 |
+
.dckap_faq .page-title h1{
|
5 |
+
border: none;
|
6 |
+
}
|
7 |
+
.pages.dckap_pager {g
|
8 |
+
width: 100%;
|
9 |
+
}
|
10 |
+
.pages.dckap_pager > span {
|
11 |
+
display: block;
|
12 |
+
float: right;
|
13 |
+
margin-right: 5px;
|
14 |
+
margin-top: 4px;
|
15 |
+
}
|
16 |
+
.pages.dckap_pager > ol {
|
17 |
+
float: right;
|
18 |
+
}
|
19 |
+
|
20 |
+
.dckap_faq .dckap_answers {
|
21 |
+
background: none repeat scroll 0 0 #f7f7f7;
|
22 |
+
border-radius: 2px;
|
23 |
+
font-size: 14px;
|
24 |
+
font-weight: normal;
|
25 |
+
line-height: 1.8;
|
26 |
+
margin-left: 26px;
|
27 |
+
padding: 10px;
|
28 |
+
text-transform: inherit;
|
29 |
+
}
|
30 |
+
.dckap_faq .page-title {
|
31 |
+
color: #39c;
|
32 |
+
font-size: 40px;
|
33 |
+
text-align: center;
|
34 |
+
}
|
35 |
+
.dckap_faq .ask_title {
|
36 |
+
margin-top: 20px;
|
37 |
+
text-transform: inherit;
|
38 |
+
margin-bottom: 20px;
|
39 |
+
}
|
40 |
+
.dckap_new .ask_title .asknew:hover {
|
41 |
+
background: none repeat scroll 0 0 #343434;
|
42 |
+
border-color: #333;
|
43 |
+
}
|
44 |
+
#dckap_askform {
|
45 |
+
margin: 25px 0 0;
|
46 |
+
text-align: center;
|
47 |
+
display: none;
|
48 |
+
}
|
49 |
+
#dckap_askform .fieldset label {
|
50 |
+
display: inline-block;
|
51 |
+
width: 125px;
|
52 |
+
}
|
53 |
+
#dckap_askform .fieldset textarea {
|
54 |
+
border: 1px solid #ccc;
|
55 |
+
}
|
56 |
+
#dckap_askform .fieldset input {
|
57 |
+
border: 1px solid #ccc;
|
58 |
+
padding: 5px 15px;
|
59 |
+
}
|
60 |
+
#dckap_askform .fieldset input:hover {
|
61 |
+
border-color: #888;
|
62 |
+
}
|
63 |
+
.dckap_pager span {
|
64 |
+
color: #444;
|
65 |
+
}
|
66 |
+
.dckap_overlay {
|
67 |
+
background: none repeat scroll 0 0 rgba(255, 255, 255, 0.8);
|
68 |
+
display: none;
|
69 |
+
height: 100%;
|
70 |
+
padding-top: 40px;
|
71 |
+
position: absolute;
|
72 |
+
width: 100%;
|
73 |
+
}
|
74 |
+
.dckap_response {
|
75 |
+
border: 2px solid;
|
76 |
+
display: none;
|
77 |
+
margin-bottom: 15px;
|
78 |
+
margin-top: 15px;
|
79 |
+
padding: 10px;
|
80 |
+
}
|
81 |
+
#dckap_askform .fieldset select {
|
82 |
+
cursor: pointer;
|
83 |
+
font-size: 16px;
|
84 |
+
padding: 3px;
|
85 |
+
width: 443px;
|
86 |
+
}
|
87 |
+
#dckap_askform .fieldset select option {
|
88 |
+
padding: 3px;
|
89 |
+
}
|
90 |
+
#dckap_askform .fieldset > span {
|
91 |
+
font-size: 20px;
|
92 |
+
}
|
93 |
+
#dckap_askform .fieldset.forminput {
|
94 |
+
margin-top: 0px;
|
95 |
+
}
|
96 |
+
.dckap_leftbar a:hover {
|
97 |
+
text-decoration: none;
|
98 |
+
}
|
99 |
+
.pages.dckap_pager a:hover {
|
100 |
+
text-decoration: none;
|
101 |
+
border-color: #777;
|
102 |
+
}
|
103 |
+
.pages.dckap_pager li.current {
|
104 |
+
background: none repeat scroll 0 0 #777;
|
105 |
+
border: 1px solid #777;
|
106 |
+
color: #fff;
|
107 |
+
line-height: 27px;
|
108 |
+
}
|
109 |
+
.pages.dckap_pager a {
|
110 |
+
background: none repeat scroll 0 0 #f2f2f2;
|
111 |
+
border: 1px solid #ddd;
|
112 |
+
color: #000;
|
113 |
+
width: 30px;
|
114 |
+
line-height: 27px;
|
115 |
+
}
|
116 |
+
.dckap_content span.notfound {
|
117 |
+
display: block;
|
118 |
+
margin: 10px 0;
|
119 |
+
}
|
120 |
+
.dckap_wrap a:focus{
|
121 |
+
outline: none;
|
122 |
+
}
|
123 |
+
.pages.dckap_pager .totalitems {
|
124 |
+
color: #444;
|
125 |
+
margin-right: 15px;
|
126 |
+
text-transform: uppercase;
|
127 |
+
}
|
128 |
+
.user-info {
|
129 |
+
clear: both;
|
130 |
+
display: block;
|
131 |
+
width: 100%;
|
132 |
+
}
|
133 |
+
.user-info .fieldset-input {
|
134 |
+
float: left;
|
135 |
+
}
|
136 |
+
.user-info .fieldset-input input {
|
137 |
+
border: 1px solid #ccc;
|
138 |
+
border-radius: 0;
|
139 |
+
height: 40px;
|
140 |
+
margin-right: 5px;
|
141 |
+
width: 300px;
|
142 |
+
}
|
143 |
+
.dckap_answers > p {
|
144 |
+
margin: 0;
|
145 |
+
}
|
146 |
+
.dckap_faq .page-title h1 strong {
|
147 |
+
font-weight: normal;
|
148 |
+
}
|
149 |
+
.dckap_faq .page-title h1 {
|
150 |
+
border: medium none;
|
151 |
+
color: #000;
|
152 |
+
font-family: Arial;
|
153 |
+
font-size: 44px;
|
154 |
+
font-weight: normal !important;
|
155 |
+
letter-spacing: 2px;
|
156 |
+
margin: 0 auto;
|
157 |
+
padding: 0;
|
158 |
+
}
|
159 |
+
.dckap_faq .page-title .catdescription {
|
160 |
+
color: #555;
|
161 |
+
font-size: 14px;
|
162 |
+
line-height: 2;
|
163 |
+
margin: 0 auto;
|
164 |
+
padding: 10px 0 20px;
|
165 |
+
text-transform: uppercase;
|
166 |
+
}
|
167 |
+
.dckap_faq .dckap_wrap .catdescription {
|
168 |
+
clear: both;
|
169 |
+
color: #555;
|
170 |
+
display: block;
|
171 |
+
font-size: 14px;
|
172 |
+
margin: 0 auto;
|
173 |
+
padding: 15px 0 10px;
|
174 |
+
line-height: 2;
|
175 |
+
}
|
176 |
+
.dckap_faq .dckap_content {
|
177 |
+
border: medium none;
|
178 |
+
float: none;
|
179 |
+
margin: 0 auto;
|
180 |
+
}
|
181 |
+
.dckap_faq .dckap_questions {
|
182 |
+
border-radius: 5px;
|
183 |
+
color: #10827d;
|
184 |
+
cursor: pointer;
|
185 |
+
font-family: arial;
|
186 |
+
font-size: 18px;
|
187 |
+
font-weight: normal;
|
188 |
+
margin: 5px 0 0;
|
189 |
+
padding: 7px;
|
190 |
+
text-transform: inherit;
|
191 |
+
}
|
192 |
+
|
193 |
+
#more_menu > img {
|
194 |
+
float: right;
|
195 |
+
margin-left: 8px;
|
196 |
+
margin-top: 2px;
|
197 |
+
}
|
198 |
+
.dckap_wrap .dckap_leftbar {
|
199 |
+
background: none repeat scroll 0 0 #f2f2f2;
|
200 |
+
border: 1px solid #c3c3c3;
|
201 |
+
margin-bottom: 5px;
|
202 |
+
float: left;
|
203 |
+
padding: 0;
|
204 |
+
width: 100%;
|
205 |
+
}
|
206 |
+
.dckap_leftbar > ul {
|
207 |
+
margin: 0;
|
208 |
+
}
|
209 |
+
.dckap_wrap .dckap_leftbar li {
|
210 |
+
background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
|
211 |
+
float: left;
|
212 |
+
height: 40px;
|
213 |
+
list-style: outside none none;
|
214 |
+
margin: 0;
|
215 |
+
padding: 0;
|
216 |
+
width: auto;
|
217 |
+
}
|
218 |
+
.dckap_wrap .dckap_leftbar li.active > a {
|
219 |
+
color: #A61B1B;
|
220 |
+
}
|
221 |
+
.dckap_wrap .dckap_leftbar a:hover {
|
222 |
+
color: #A61B1B;
|
223 |
+
background: #f2f2f2;
|
224 |
+
}
|
225 |
+
.dckap_wrap .dckap_leftbar li a {
|
226 |
+
border-bottom: medium none;
|
227 |
+
border-right: 1px solid rgb(195, 195, 195);
|
228 |
+
color: rgb(0, 0, 0);
|
229 |
+
cursor: pointer;
|
230 |
+
display: block;
|
231 |
+
font-family: arial,sans-serif;
|
232 |
+
font-size: 14px;
|
233 |
+
font-style: normal;
|
234 |
+
height: 40px;
|
235 |
+
padding: 10px 30px;
|
236 |
+
position: relative;
|
237 |
+
text-transform: uppercase;
|
238 |
+
width: auto;
|
239 |
+
}
|
240 |
+
.faq-search {
|
241 |
+
float: right;
|
242 |
+
position: relative;
|
243 |
+
}
|
244 |
+
.dckap_faq .guest-alert {
|
245 |
+
font-size: 16px;
|
246 |
+
margin-top: 5px;
|
247 |
+
}
|
248 |
+
#faq-searchform .btn-searchform {
|
249 |
+
background: url("../images/search.png") no-repeat scroll 0 0 / 36px auto rgba(0, 0, 0, 0);
|
250 |
+
border: 0 none;
|
251 |
+
height: 36px;
|
252 |
+
margin-top: 2px;
|
253 |
+
position: absolute;
|
254 |
+
top: 0;
|
255 |
+
right: 2px;
|
256 |
+
width: 36px;
|
257 |
+
}
|
258 |
+
#faq-searchform > input[type="text"] {
|
259 |
+
border: 1px solid #c3c3c3;
|
260 |
+
border-radius: 2px;
|
261 |
+
height: 36px;
|
262 |
+
margin-right: 2px;
|
263 |
+
margin-top: 2px;
|
264 |
+
padding-right: 38px;
|
265 |
+
width: 250px;
|
266 |
+
}
|
267 |
+
.dckap_new {
|
268 |
+
margin: 0 auto;
|
269 |
+
}
|
270 |
+
.dckap_new .ask_title {
|
271 |
+
color: #a61b1b;
|
272 |
+
font-family: arial;
|
273 |
+
font-size: 17px;
|
274 |
+
font-weight: lighter;
|
275 |
+
text-align: center;
|
276 |
+
text-transform: uppercase;
|
277 |
+
}
|
278 |
+
|
279 |
+
.dckap_new #dckap_askform .fieldset span {
|
280 |
+
display: inline-block;
|
281 |
+
font-family: arial;
|
282 |
+
font-size: 12px !important;
|
283 |
+
padding: 9px 0;
|
284 |
+
text-transform: uppercase;
|
285 |
+
width: 125px;
|
286 |
+
}
|
287 |
+
|
288 |
+
#dckap_askform .user-info .fieldset-input > label {
|
289 |
+
display: inline-block;
|
290 |
+
font-family: arial;
|
291 |
+
font-size: 12px;
|
292 |
+
font-weight: normal;
|
293 |
+
padding: 8px 0;
|
294 |
+
text-transform: uppercase;
|
295 |
+
width: 125px;
|
296 |
+
}
|
297 |
+
.user-info .fieldset-input {
|
298 |
+
float: none;
|
299 |
+
margin-bottom: 11px;
|
300 |
+
}
|
301 |
+
#dckap_askform .fieldset {
|
302 |
+
clear: both;
|
303 |
+
float: none;
|
304 |
+
margin-bottom: 13px;
|
305 |
+
}
|
306 |
+
#dckap_askform .fieldset textarea {
|
307 |
+
border: 1px solid #dddddd;
|
308 |
+
}
|
309 |
+
.user-info .fieldset-input input {
|
310 |
+
border: 1px solid #dddddd;
|
311 |
+
height: 35px;
|
312 |
+
width: 440px;
|
313 |
+
}
|
314 |
+
.dckap_faq #dckap_askform .fieldset.recap {
|
315 |
+
margin: 0 auto;
|
316 |
+
}
|
317 |
+
.dckap_new .ask_title .asknew {
|
318 |
+
background: none repeat scroll 0 0 #484847;
|
319 |
+
border: 1px solid;
|
320 |
+
border-radius: 2px;
|
321 |
+
color: #ffffff;
|
322 |
+
cursor: pointer;
|
323 |
+
display: inline-block;
|
324 |
+
font-size: 14px;
|
325 |
+
font-weight: bold;
|
326 |
+
margin-top: 15px;
|
327 |
+
padding: 8px 15px;
|
328 |
+
}
|
329 |
+
.dckap_questions.active {
|
330 |
+
background: none;
|
331 |
+
border: none;
|
332 |
+
}
|
333 |
+
.pages.dckap_pager {
|
334 |
+
background: none repeat scroll 0 0 #f7f7f7;
|
335 |
+
border: 1px solid #c3c3c3;
|
336 |
+
margin: 10px 0;
|
337 |
+
padding: 2px;
|
338 |
+
width: 100%;
|
339 |
+
}
|
340 |
+
#dckap_askform .fieldset input {
|
341 |
+
background: none repeat scroll 0 0 #484847;
|
342 |
+
border: 1px solid #555555;
|
343 |
+
border-radius: 3px;
|
344 |
+
color: #fff;
|
345 |
+
font-size: 16px;
|
346 |
+
margin: 10px 0;
|
347 |
+
padding: 5px 30px;
|
348 |
+
position: relative;
|
349 |
+
text-transform: uppercase;
|
350 |
+
}
|
351 |
+
#dckap_askform .fieldset input:hover {
|
352 |
+
background: none repeat scroll 0 0 #343433;
|
353 |
+
border-color: #333;
|
354 |
+
}
|
355 |
+
#search-box > input {
|
356 |
+
background: #000000 none repeat scroll 0 0;
|
357 |
+
border: medium none;
|
358 |
+
border-radius: 4px;
|
359 |
+
color: #ffffff;
|
360 |
+
float: right;
|
361 |
+
height: 32px;
|
362 |
+
margin-right: 15%;
|
363 |
+
margin-top: 4px;
|
364 |
+
width: 230px;
|
365 |
+
}
|
366 |
+
.pages.dckap_pager > span.totalitems {
|
367 |
+
float: none;
|
368 |
+
margin-left: 10px;
|
369 |
+
}
|
370 |
+
.dckap_faq .more_menu > ul li {
|
371 |
+
background: none repeat scroll 0 0 #f2f2f2;
|
372 |
+
border-left: 1px solid #c3c3c3;
|
373 |
+
clear: left;
|
374 |
+
left: 0;
|
375 |
+
position: relative;
|
376 |
+
width: 180px;
|
377 |
+
}
|
378 |
+
.dckap_faq .more_menu > ul {
|
379 |
+
background: none repeat scroll 0 0 #f2f2f2;
|
380 |
+
display: none;
|
381 |
+
left: -1px;
|
382 |
+
position: relative;
|
383 |
+
top: 0px;
|
384 |
+
width: 123px;
|
385 |
+
}
|
386 |
+
.dckap_faq .more_menu > ul li a {
|
387 |
+
border-top: 1px solid #dddddd;
|
388 |
+
padding: 8px 20px;
|
389 |
+
}
|
390 |
+
.dckap_faq .more_menu > ul li:last-child a {
|
391 |
+
border-bottom: 1px solid #c3c3c3;
|
392 |
}
|