Version Notes
Second Release
Download this release
Release Info
Developer | Chandan Kumar Singh |
Extension | Frequently_Asked_Question |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/community/Chandan/FAQ/Block/Adminhtml/FAQ.php +0 -12
- app/code/community/Chandan/FAQ/Helper/Data.php +0 -6
- app/code/community/Chandan/FAQ/controllers/IndexController.php +0 -13
- app/code/community/Chandan/Faq/Block/Adminhtml/Faq.php +12 -0
- app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit.php +5 -5
- app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit/Form.php +1 -1
- app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit/Tab/Form.php +7 -9
- app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit/Tabs.php +23 -23
- app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Grid.php +2 -1
- app/code/community/Chandan/{FAQ/Block/FAQ.php → Faq/Block/Faq.php} +2 -2
- app/code/community/Chandan/Faq/Helper/Data.php +6 -0
- app/code/community/Chandan/{FAQ/Model/FAQ.php → Faq/Model/Faq.php} +1 -1
- app/code/community/Chandan/{FAQ/Model/Mysql4/FAQ.php → Faq/Model/Mysql4/Faq.php} +1 -1
- app/code/community/Chandan/{FAQ/Model/Mysql4/FAQ → Faq/Model/Mysql4/Faq}/Collection.php +1 -1
- app/code/community/Chandan/{FAQ → Faq}/Model/Status.php +1 -1
- app/code/community/Chandan/{FAQ/controllers/Adminhtml/FAQController.php → Faq/controllers/Adminhtml/FaqController.php} +9 -11
- app/code/community/Chandan/Faq/controllers/IndexController.php +13 -0
- app/code/community/Chandan/{FAQ → Faq}/etc/config.xml +19 -17
- app/code/community/Chandan/{FAQ → Faq}/etc/system.xml +5 -5
- app/code/community/Chandan/{FAQ → Faq}/sql/faq_setup/mysql4-install-1.0.0.php +6 -0
- app/etc/modules/{Chandan_FAQ.xml → Chandan_Faq.xml} +2 -2
- package.xml +6 -6
app/code/community/Chandan/FAQ/Block/Adminhtml/FAQ.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Chandan_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 Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('faq')->__('Add FAQ');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Chandan/FAQ/Helper/Data.php
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Chandan_FAQ_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
-
{
|
5 |
-
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Chandan/FAQ/controllers/IndexController.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Chandan_FAQ_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
-
{
|
4 |
-
public function indexAction()
|
5 |
-
{
|
6 |
-
if(Mage::getStoreConfig('chandan_faq/faq_select/chandan_select') == 0){
|
7 |
-
$this->_redirect("/");
|
8 |
-
}
|
9 |
-
$this->loadLayout();
|
10 |
-
$this->getLayout()->getBlock('head')->setTitle('FAQ');
|
11 |
-
$this->renderLayout();
|
12 |
-
}
|
13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Chandan/Faq/Block/Adminhtml/Faq.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Chandan_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 Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('faq')->__('Add Faq');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
}
|
app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit.php
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function __construct()
|
6 |
{
|
@@ -10,8 +10,8 @@ class Chandan_FAQ_Block_Adminhtml_FAQ_Edit extends Mage_Adminhtml_Block_Widget_F
|
|
10 |
$this->_blockGroup = 'faq';
|
11 |
$this->_controller = 'adminhtml_faq';
|
12 |
|
13 |
-
$this->_updateButton('save', 'label', Mage::helper('faq')->__('Save
|
14 |
-
$this->_updateButton('delete', 'label', Mage::helper('faq')->__('Delete
|
15 |
|
16 |
$this->_addButton('saveandcontinue', array(
|
17 |
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
@@ -37,9 +37,9 @@ class Chandan_FAQ_Block_Adminhtml_FAQ_Edit extends Mage_Adminhtml_Block_Widget_F
|
|
37 |
public function getHeaderText()
|
38 |
{
|
39 |
if( Mage::registry('faq_data') && Mage::registry('faq_data')->getId() ) {
|
40 |
-
return Mage::helper('faq')->__("Edit
|
41 |
} else {
|
42 |
-
return Mage::helper('faq')->__('Add
|
43 |
}
|
44 |
}
|
45 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class Chandan_Faq_Block_Adminhtml_Faq_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
{
|
5 |
public function __construct()
|
6 |
{
|
10 |
$this->_blockGroup = 'faq';
|
11 |
$this->_controller = 'adminhtml_faq';
|
12 |
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('faq')->__('Save Faq'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('faq')->__('Delete Faq'));
|
15 |
|
16 |
$this->_addButton('saveandcontinue', array(
|
17 |
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
37 |
public function getHeaderText()
|
38 |
{
|
39 |
if( Mage::registry('faq_data') && Mage::registry('faq_data')->getId() ) {
|
40 |
+
return Mage::helper('faq')->__("Edit Faq '%s'", $this->htmlEscape(Mage::registry('faq_data')->getTitle()));
|
41 |
} else {
|
42 |
+
return Mage::helper('faq')->__('Add Faq');
|
43 |
}
|
44 |
}
|
45 |
}
|
app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit/Form.php
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
protected function _prepareForm()
|
6 |
{
|
1 |
<?php
|
2 |
|
3 |
+
class Chandan_Faq_Block_Adminhtml_Faq_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
{
|
5 |
protected function _prepareForm()
|
6 |
{
|
app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit/Tab/Form.php
RENAMED
@@ -1,14 +1,13 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
class Chandan_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 |
-
$fieldset = $form->addFieldset('faq_form', array('legend'=>Mage::helper('faq')->__('
|
10 |
|
11 |
-
|
12 |
'label' => Mage::helper('faq')->__('Question'),
|
13 |
'class' => 'required-entry',
|
14 |
'required' => true,
|
@@ -19,7 +18,7 @@ class Chandan_FAQ_Block_Adminhtml_FAQ_Edit_Tab_Form extends Mage_Adminhtml_Block
|
|
19 |
'name' => 'answer',
|
20 |
'label' => Mage::helper('faq')->__('Answer'),
|
21 |
'title' => Mage::helper('faq')->__('Answer'),
|
22 |
-
'style' => 'width:
|
23 |
'wysiwyg' => false,
|
24 |
'required' => true,
|
25 |
));
|
@@ -39,11 +38,10 @@ class Chandan_FAQ_Block_Adminhtml_FAQ_Edit_Tab_Form extends Mage_Adminhtml_Block
|
|
39 |
),
|
40 |
),
|
41 |
));
|
42 |
-
|
43 |
-
if ( Mage::getSingleton('adminhtml/session')->getFAQData() )
|
44 |
{
|
45 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->
|
46 |
-
Mage::getSingleton('adminhtml/session')->
|
47 |
} elseif ( Mage::registry('faq_data') ) {
|
48 |
$form->setValues(Mage::registry('faq_data')->getData());
|
49 |
}
|
1 |
<?php
|
2 |
+
class Chandan_Faq_Block_Adminhtml_Faq_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
|
|
3 |
{
|
4 |
protected function _prepareForm()
|
5 |
{
|
6 |
$form = new Varien_Data_Form();
|
7 |
$this->setForm($form);
|
8 |
+
$fieldset = $form->addFieldset('faq_form', array('legend'=>Mage::helper('faq')->__('Item information')));
|
9 |
|
10 |
+
$fieldset->addField('question', 'text', array(
|
11 |
'label' => Mage::helper('faq')->__('Question'),
|
12 |
'class' => 'required-entry',
|
13 |
'required' => true,
|
18 |
'name' => 'answer',
|
19 |
'label' => Mage::helper('faq')->__('Answer'),
|
20 |
'title' => Mage::helper('faq')->__('Answer'),
|
21 |
+
'style' => 'width:500px; height:300px;',
|
22 |
'wysiwyg' => false,
|
23 |
'required' => true,
|
24 |
));
|
38 |
),
|
39 |
),
|
40 |
));
|
41 |
+
if ( Mage::getSingleton('adminhtml/session')->getFaqData() )
|
|
|
42 |
{
|
43 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getFaqData());
|
44 |
+
Mage::getSingleton('adminhtml/session')->setFaqData(null);
|
45 |
} elseif ( Mage::registry('faq_data') ) {
|
46 |
$form->setValues(Mage::registry('faq_data')->getData());
|
47 |
}
|
app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Edit/Tabs.php
RENAMED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class
|
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')->__('
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('faq')->__('
|
18 |
-
'title' => Mage::helper('faq')->__('
|
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 Chandan_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 Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('faq')->__('Faq Information'),
|
18 |
+
'title' => Mage::helper('faq')->__('Faq Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('faq/adminhtml_faq_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
return parent::_beforeToHtml();
|
23 |
+
}
|
24 |
}
|
app/code/community/Chandan/{FAQ/Block/Adminhtml/FAQ → Faq/Block/Adminhtml/Faq}/Grid.php
RENAMED
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
3 |
{
|
4 |
public function __construct()
|
5 |
{
|
1 |
<?php
|
2 |
+
|
3 |
+
class Chandan_Faq_Block_Adminhtml_Faq_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
{
|
5 |
public function __construct()
|
6 |
{
|
app/code/community/Chandan/{FAQ/Block/FAQ.php → Faq/Block/Faq.php}
RENAMED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
{
|
4 |
public function _prepareLayout()
|
5 |
{
|
6 |
return parent::_prepareLayout();
|
7 |
}
|
8 |
|
9 |
-
public function
|
10 |
{
|
11 |
if (!$this->hasData('faq')) {
|
12 |
$this->setData('faq', Mage::registry('faq'));
|
1 |
<?php
|
2 |
+
class Chandan_Faq_Block_Faq extends Mage_Core_Block_Template
|
3 |
{
|
4 |
public function _prepareLayout()
|
5 |
{
|
6 |
return parent::_prepareLayout();
|
7 |
}
|
8 |
|
9 |
+
public function getFaq()
|
10 |
{
|
11 |
if (!$this->hasData('faq')) {
|
12 |
$this->setData('faq', Mage::registry('faq'));
|
app/code/community/Chandan/Faq/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Chandan_Faq_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Chandan/{FAQ/Model/FAQ.php → Faq/Model/Faq.php}
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function _construct()
|
6 |
{
|
1 |
<?php
|
2 |
|
3 |
+
class Chandan_Faq_Model_Faq extends Mage_Core_Model_Abstract
|
4 |
{
|
5 |
public function _construct()
|
6 |
{
|
app/code/community/Chandan/{FAQ/Model/Mysql4/FAQ.php → Faq/Model/Mysql4/Faq.php}
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function _construct()
|
6 |
{
|
1 |
<?php
|
2 |
|
3 |
+
class Chandan_Faq_Model_Mysql4_Faq extends Mage_Core_Model_Mysql4_Abstract
|
4 |
{
|
5 |
public function _construct()
|
6 |
{
|
app/code/community/Chandan/{FAQ/Model/Mysql4/FAQ → Faq/Model/Mysql4/Faq}/Collection.php
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function _construct()
|
6 |
{
|
1 |
<?php
|
2 |
|
3 |
+
class Chandan_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
{
|
5 |
public function _construct()
|
6 |
{
|
app/code/community/Chandan/{FAQ → Faq}/Model/Status.php
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
const STATUS_ENABLED = 1;
|
6 |
const STATUS_DISABLED = 2;
|
1 |
<?php
|
2 |
|
3 |
+
class Chandan_Faq_Model_Status extends Varien_Object
|
4 |
{
|
5 |
const STATUS_ENABLED = 1;
|
6 |
const STATUS_DISABLED = 2;
|
app/code/community/Chandan/{FAQ/controllers/Adminhtml/FAQController.php → Faq/controllers/Adminhtml/FaqController.php}
RENAMED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
|
6 |
protected function _initAction() {
|
7 |
$this->loadLayout()
|
8 |
->_setActiveMenu('faq/items')
|
9 |
-
->_addBreadcrumb(Mage::helper('adminhtml')->__('
|
10 |
|
11 |
return $this;
|
12 |
}
|
@@ -31,8 +31,8 @@ class Chandan_FAQ_Adminhtml_FAQController extends Mage_Adminhtml_Controller_acti
|
|
31 |
$this->loadLayout();
|
32 |
$this->_setActiveMenu('faq/items');
|
33 |
|
34 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('
|
35 |
-
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('
|
36 |
|
37 |
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
|
@@ -41,7 +41,7 @@ class Chandan_FAQ_Adminhtml_FAQController extends Mage_Adminhtml_Controller_acti
|
|
41 |
|
42 |
$this->renderLayout();
|
43 |
} else {
|
44 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('
|
45 |
$this->_redirect('*/*/');
|
46 |
}
|
47 |
}
|
@@ -51,8 +51,7 @@ class Chandan_FAQ_Adminhtml_FAQController extends Mage_Adminhtml_Controller_acti
|
|
51 |
}
|
52 |
|
53 |
public function saveAction() {
|
54 |
-
if ($data = $this->getRequest()->getPost()) {
|
55 |
-
|
56 |
$model = Mage::getModel('faq/faq');
|
57 |
$model->setData($data)
|
58 |
->setId($this->getRequest()->getParam('id'));
|
@@ -66,7 +65,7 @@ class Chandan_FAQ_Adminhtml_FAQController extends Mage_Adminhtml_Controller_acti
|
|
66 |
}
|
67 |
|
68 |
$model->save();
|
69 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('faq')->__('
|
70 |
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
71 |
|
72 |
if ($this->getRequest()->getParam('back')) {
|
@@ -94,7 +93,7 @@ class Chandan_FAQ_Adminhtml_FAQController extends Mage_Adminhtml_Controller_acti
|
|
94 |
$model->setId($this->getRequest()->getParam('id'))
|
95 |
->delete();
|
96 |
|
97 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('
|
98 |
$this->_redirect('*/*/');
|
99 |
} catch (Exception $e) {
|
100 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
@@ -180,7 +179,6 @@ class Chandan_FAQ_Adminhtml_FAQController extends Mage_Adminhtml_Controller_acti
|
|
180 |
$response->setHeader('Content-Length', strlen($content));
|
181 |
$response->setHeader('Content-type', $contentType);
|
182 |
$response->setBody($content);
|
183 |
-
$response->sendResponse();
|
184 |
-
die;
|
185 |
}
|
186 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class Chandan_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')->__('Faqs Manager'), Mage::helper('adminhtml')->__('Faq Manager'));
|
10 |
|
11 |
return $this;
|
12 |
}
|
31 |
$this->loadLayout();
|
32 |
$this->_setActiveMenu('faq/items');
|
33 |
|
34 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Faq Manager'), Mage::helper('adminhtml')->__('Faq Manager'));
|
35 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Faq News'), Mage::helper('adminhtml')->__('Faq News'));
|
36 |
|
37 |
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
|
41 |
|
42 |
$this->renderLayout();
|
43 |
} else {
|
44 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('faq')->__('Faq does not exist'));
|
45 |
$this->_redirect('*/*/');
|
46 |
}
|
47 |
}
|
51 |
}
|
52 |
|
53 |
public function saveAction() {
|
54 |
+
if ($data = $this->getRequest()->getPost()) {
|
|
|
55 |
$model = Mage::getModel('faq/faq');
|
56 |
$model->setData($data)
|
57 |
->setId($this->getRequest()->getParam('id'));
|
65 |
}
|
66 |
|
67 |
$model->save();
|
68 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('faq')->__('Faq was successfully saved'));
|
69 |
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
70 |
|
71 |
if ($this->getRequest()->getParam('back')) {
|
93 |
$model->setId($this->getRequest()->getParam('id'))
|
94 |
->delete();
|
95 |
|
96 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Faq was successfully deleted'));
|
97 |
$this->_redirect('*/*/');
|
98 |
} catch (Exception $e) {
|
99 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
179 |
$response->setHeader('Content-Length', strlen($content));
|
180 |
$response->setHeader('Content-type', $contentType);
|
181 |
$response->setBody($content);
|
182 |
+
$response->sendResponse();
|
|
|
183 |
}
|
184 |
}
|
app/code/community/Chandan/Faq/controllers/IndexController.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Chandan_Faq_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
if(Mage::getStoreConfig('chandan/faq_select/chandan_select') == 0){
|
7 |
+
$this->_redirect("/");
|
8 |
+
}
|
9 |
+
$this->loadLayout();
|
10 |
+
$this->getLayout()->getBlock('head')->setTitle('FAQ');
|
11 |
+
$this->renderLayout();
|
12 |
+
}
|
13 |
+
}
|
app/code/community/Chandan/{FAQ → Faq}/etc/config.xml
RENAMED
@@ -1,16 +1,16 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<modules>
|
4 |
-
<
|
5 |
<version>1.0.0</version>
|
6 |
-
</
|
7 |
</modules>
|
8 |
<frontend>
|
9 |
<routers>
|
10 |
<faq>
|
11 |
<use>standard</use>
|
12 |
<args>
|
13 |
-
<module>
|
14 |
<frontName>faq</frontName>
|
15 |
</args>
|
16 |
</faq>
|
@@ -28,7 +28,7 @@
|
|
28 |
<faq>
|
29 |
<use>admin</use>
|
30 |
<args>
|
31 |
-
<module>
|
32 |
<frontName>faq</frontName>
|
33 |
</args>
|
34 |
</faq>
|
@@ -37,7 +37,7 @@
|
|
37 |
<adminhtml>
|
38 |
<menu>
|
39 |
<faq module="faq">
|
40 |
-
<title>
|
41 |
<sort_order>71</sort_order>
|
42 |
<children>
|
43 |
<items module="faq">
|
@@ -53,10 +53,10 @@
|
|
53 |
<all>
|
54 |
<title>Allow Everything</title>
|
55 |
</all>
|
56 |
-
<admin>
|
57 |
-
<children>
|
58 |
<faq module="faq">
|
59 |
-
<title>
|
60 |
<sort_order>71</sort_order>
|
61 |
<children>
|
62 |
<items module="faq">
|
@@ -66,19 +66,21 @@
|
|
66 |
</items>
|
67 |
</children>
|
68 |
</faq>
|
69 |
-
|
70 |
<system>
|
71 |
<children>
|
72 |
<config>
|
73 |
<children>
|
74 |
-
<
|
75 |
<title>FAQ - All</title>
|
76 |
-
</
|
77 |
</children>
|
78 |
</config>
|
79 |
</children>
|
80 |
</system>
|
81 |
-
|
|
|
|
|
82 |
</admin>
|
83 |
</resources>
|
84 |
</acl>
|
@@ -93,11 +95,11 @@
|
|
93 |
<global>
|
94 |
<models>
|
95 |
<faq>
|
96 |
-
<class>
|
97 |
<resourceModel>faq_mysql4</resourceModel>
|
98 |
</faq>
|
99 |
<faq_mysql4>
|
100 |
-
<class>
|
101 |
<entities>
|
102 |
<faq>
|
103 |
<table>faq</table>
|
@@ -108,7 +110,7 @@
|
|
108 |
<resources>
|
109 |
<faq_setup>
|
110 |
<setup>
|
111 |
-
<module>
|
112 |
</setup>
|
113 |
<connection>
|
114 |
<use>core_setup</use>
|
@@ -127,12 +129,12 @@
|
|
127 |
</resources>
|
128 |
<blocks>
|
129 |
<faq>
|
130 |
-
<class>
|
131 |
</faq>
|
132 |
</blocks>
|
133 |
<helpers>
|
134 |
<faq>
|
135 |
-
<class>
|
136 |
</faq>
|
137 |
</helpers>
|
138 |
</global>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<modules>
|
4 |
+
<Chandan_Faq>
|
5 |
<version>1.0.0</version>
|
6 |
+
</Chandan_Faq>
|
7 |
</modules>
|
8 |
<frontend>
|
9 |
<routers>
|
10 |
<faq>
|
11 |
<use>standard</use>
|
12 |
<args>
|
13 |
+
<module>Chandan_Faq</module>
|
14 |
<frontName>faq</frontName>
|
15 |
</args>
|
16 |
</faq>
|
28 |
<faq>
|
29 |
<use>admin</use>
|
30 |
<args>
|
31 |
+
<module>Chandan_Faq</module>
|
32 |
<frontName>faq</frontName>
|
33 |
</args>
|
34 |
</faq>
|
37 |
<adminhtml>
|
38 |
<menu>
|
39 |
<faq module="faq">
|
40 |
+
<title>Faq</title>
|
41 |
<sort_order>71</sort_order>
|
42 |
<children>
|
43 |
<items module="faq">
|
53 |
<all>
|
54 |
<title>Allow Everything</title>
|
55 |
</all>
|
56 |
+
<admin>
|
57 |
+
<children>
|
58 |
<faq module="faq">
|
59 |
+
<title>Faq</title>
|
60 |
<sort_order>71</sort_order>
|
61 |
<children>
|
62 |
<items module="faq">
|
66 |
</items>
|
67 |
</children>
|
68 |
</faq>
|
69 |
+
|
70 |
<system>
|
71 |
<children>
|
72 |
<config>
|
73 |
<children>
|
74 |
+
<chandan>
|
75 |
<title>FAQ - All</title>
|
76 |
+
</chandan>
|
77 |
</children>
|
78 |
</config>
|
79 |
</children>
|
80 |
</system>
|
81 |
+
|
82 |
+
|
83 |
+
</children>
|
84 |
</admin>
|
85 |
</resources>
|
86 |
</acl>
|
95 |
<global>
|
96 |
<models>
|
97 |
<faq>
|
98 |
+
<class>Chandan_Faq_Model</class>
|
99 |
<resourceModel>faq_mysql4</resourceModel>
|
100 |
</faq>
|
101 |
<faq_mysql4>
|
102 |
+
<class>Chandan_Faq_Model_Mysql4</class>
|
103 |
<entities>
|
104 |
<faq>
|
105 |
<table>faq</table>
|
110 |
<resources>
|
111 |
<faq_setup>
|
112 |
<setup>
|
113 |
+
<module>Chandan_Faq</module>
|
114 |
</setup>
|
115 |
<connection>
|
116 |
<use>core_setup</use>
|
129 |
</resources>
|
130 |
<blocks>
|
131 |
<faq>
|
132 |
+
<class>Chandan_Faq_Block</class>
|
133 |
</faq>
|
134 |
</blocks>
|
135 |
<helpers>
|
136 |
<faq>
|
137 |
+
<class>Chandan_Faq_Helper</class>
|
138 |
</faq>
|
139 |
</helpers>
|
140 |
</global>
|
app/code/community/Chandan/{FAQ → Faq}/etc/system.xml
RENAMED
@@ -1,15 +1,15 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
<tabs>
|
4 |
-
<
|
5 |
<label>FAQ Setting</label>
|
6 |
<sort_order>100</sort_order>
|
7 |
-
</
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
-
<
|
11 |
<label>FAQ Options</label>
|
12 |
-
<tab>
|
13 |
<sort_order>1</sort_order>
|
14 |
<show_in_default>1</show_in_default>
|
15 |
<show_in_website>1</show_in_website>
|
@@ -36,6 +36,6 @@
|
|
36 |
</fields>
|
37 |
</faq_select>
|
38 |
</groups>
|
39 |
-
</
|
40 |
</sections>
|
41 |
</config>
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<config>
|
3 |
<tabs>
|
4 |
+
<chandan translate="label" module="faq">
|
5 |
<label>FAQ Setting</label>
|
6 |
<sort_order>100</sort_order>
|
7 |
+
</chandan>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
+
<chandan translate="label" module="faq">
|
11 |
<label>FAQ Options</label>
|
12 |
+
<tab>chandan</tab>
|
13 |
<sort_order>1</sort_order>
|
14 |
<show_in_default>1</show_in_default>
|
15 |
<show_in_website>1</show_in_website>
|
36 |
</fields>
|
37 |
</faq_select>
|
38 |
</groups>
|
39 |
+
</chandan>
|
40 |
</sections>
|
41 |
</config>
|
app/code/community/Chandan/{FAQ → Faq}/sql/faq_setup/mysql4-install-1.0.0.php
RENAMED
@@ -1,7 +1,11 @@
|
|
1 |
<?php
|
|
|
2 |
$installer = $this;
|
|
|
3 |
$installer->startSetup();
|
|
|
4 |
$installer->run("
|
|
|
5 |
-- DROP TABLE IF EXISTS {$this->getTable('faq')};
|
6 |
CREATE TABLE {$this->getTable('faq')} (
|
7 |
`faq_id` int(11) unsigned NOT NULL auto_increment,
|
@@ -12,5 +16,7 @@ CREATE TABLE {$this->getTable('faq')} (
|
|
12 |
`update_time` datetime NULL,
|
13 |
PRIMARY KEY (`faq_id`)
|
14 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
15 |
");
|
|
|
16 |
$installer->endSetup();
|
1 |
<?php
|
2 |
+
|
3 |
$installer = $this;
|
4 |
+
|
5 |
$installer->startSetup();
|
6 |
+
|
7 |
$installer->run("
|
8 |
+
|
9 |
-- DROP TABLE IF EXISTS {$this->getTable('faq')};
|
10 |
CREATE TABLE {$this->getTable('faq')} (
|
11 |
`faq_id` int(11) unsigned NOT NULL auto_increment,
|
16 |
`update_time` datetime NULL,
|
17 |
PRIMARY KEY (`faq_id`)
|
18 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
19 |
+
|
20 |
");
|
21 |
+
|
22 |
$installer->endSetup();
|
app/etc/modules/{Chandan_FAQ.xml → Chandan_Faq.xml}
RENAMED
@@ -1,9 +1,9 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<modules>
|
4 |
-
<
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
-
</
|
8 |
</modules>
|
9 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
<modules>
|
4 |
+
<Chandan_Faq>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
+
</Chandan_Faq>
|
8 |
</modules>
|
9 |
</config>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Frequently_Asked_Question</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>frequently asked question</summary>
|
10 |
<description>frequently asked question</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>Chandan Kumar Singh</name><user>chandan8050</user><email>chandankumar8050@gmail.com</email></author></authors>
|
13 |
-
<date>2017-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Chandan"><dir name="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.2.0</min><max>7.1.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Frequently_Asked_Question</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>frequently asked question</summary>
|
10 |
<description>frequently asked question</description>
|
11 |
+
<notes>Second Release</notes>
|
12 |
<authors><author><name>Chandan Kumar Singh</name><user>chandan8050</user><email>chandankumar8050@gmail.com</email></author></authors>
|
13 |
+
<date>2017-02-28</date>
|
14 |
+
<time>02:46:54</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Chandan_Faq.xml" hash="d85a8892158a0ad18150614ae1bbbe7f"/></dir></target><target name="magecommunity"><dir name="Chandan"><dir name="Faq"><dir name="Block"><dir name="Adminhtml"><dir name="Faq"><dir name="Edit"><file name="Form.php" hash="526eecca3567be5f0fae376f0dc60a6f"/><dir name="Tab"><file name="Form.php" hash="0af98ec1799e7ca14b1324521bab0868"/></dir><file name="Tabs.php" hash="9778106aa6d484385f0ff91a85f7ef33"/></dir><file name="Edit.php" hash="9e022a39e6cdab5510d419bde275fe02"/><file name="Grid.php" hash="496c2211292bc677de549c6ea20ce272"/></dir><file name="Faq.php" hash="8d351e5cc373ab8ca5710a85176e5c23"/></dir><file name="Faq.php" hash="3eeb7ebc1be2e61b7208180b34091eac"/></dir><dir name="Helper"><file name="Data.php" hash="db53e906bd8ff18d77131f375c9184fd"/></dir><dir name="Model"><file name="Faq.php" hash="add16af10ac06203847ad3a0c3827fd6"/><dir name="Mysql4"><dir name="Faq"><file name="Collection.php" hash="a2710b2675532351be44aefa1644ed1b"/></dir><file name="Faq.php" hash="8db1f416661b5d88aeb54ab5b50404af"/></dir><file name="Status.php" hash="0ce68391e0390f475adfdfd348a5f2e5"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FaqController.php" hash="cf3523fe63d15142592efa1425658c7d"/></dir><file name="IndexController.php" hash="e52608cf2b8fba8a503a734b413c0aac"/></dir><dir name="etc"><file name="config.xml" hash="8f645cfbce96d4db521c767d90e1104c"/><file name="system.xml" hash="ddb55f8b1db0e55d452d66a8d4b156ab"/></dir><dir name="sql"><dir name="faq_setup"><file name="mysql4-install-1.0.0.php" hash="d3abfbc284d6c38a1f5c967893a5b990"/></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="366af823c15070f095fc7e99889e3d4b"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="faq.xml" hash="613513df8bbbd516ec393c0b3c2109c8"/></dir><dir name="template"><dir name="faq"><file name="faq.phtml" hash="643be8d243a1bb412937195e39dec399"/></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="bootstrap.min.css" hash="78e7f91c0c4cca415e0683626aa23925"/></dir><dir name="js"><file name="bootstrap.min.js" hash="281cd50dd9f58c5550620fc148a7bc39"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>7.1.1</max></php></required></dependencies>
|
18 |
</package>
|