Version Notes
- Moved the extension to the community folder.
- Updated the database design. Updated the table name with prefix inc_advance.
- Solved the acl problem.
- Added sorting, Filter , Pagination , Mass update functionality to both category and item grid.
- Updated the Item grid with category display.
- Assign category to the item on the basis of store-view selected.
- Solve the wysiwyg editor image upload issue.
Download this release
Release Info
Developer | indianic |
Extension | inic_faq |
Version | 1.1.3.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.3 to 1.1.3.1
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit/Form.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit/Tab/Main.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit/Tabs.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Grid.php +44 -11
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit/Form.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit/Tab/Main.php +47 -28
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit/Tabs.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Grid.php +59 -12
- app/code/community/Inic/Faq/Block/Adminhtml/Widget/Form/Element/Selectdependence.php +98 -0
- app/code/community/Inic/Faq/Block/Adminhtml/Widget/Grid/Column/Renderer/Category.php +49 -0
- app/code/{local → community}/Inic/Faq/Block/Frontend/Category.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Frontend/Detail.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Frontend/FaqSearch/Result.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Frontend/FaqSearch/Search.php +0 -0
- app/code/{local → community}/Inic/Faq/Block/Frontend/List.php +0 -0
- app/code/{local → community}/Inic/Faq/Helper/Data.php +8 -0
- app/code/{local → community}/Inic/Faq/Model/Category.php +0 -0
- app/code/{local → community}/Inic/Faq/Model/Faq.php +0 -0
- app/code/{local → community}/Inic/Faq/Model/Mysql4/Category.php +1 -1
- app/code/{local → community}/Inic/Faq/Model/Mysql4/Category/Collection.php +15 -8
- app/code/{local → community}/Inic/Faq/Model/Mysql4/Faq.php +30 -4
- app/code/{local → community}/Inic/Faq/Model/Mysql4/Faq/Collection.php +12 -9
- app/code/community/Inic/Faq/Model/Status.php +15 -0
- app/code/{local → community}/Inic/Faq/Model/System/Config/Source/View.php +0 -0
- app/code/{local → community}/Inic/Faq/controllers/Adminhtml/Faq/CategoryController.php +3 -3
- app/code/{local → community}/Inic/Faq/controllers/Adminhtml/FaqController.php +53 -5
- app/code/{local → community}/Inic/Faq/controllers/IndexController.php +0 -0
- app/code/community/Inic/Faq/etc/adminhtml.xml +68 -0
- app/code/{local → community}/Inic/Faq/etc/config.xml +16 -8
- app/code/{local → community}/Inic/Faq/etc/system.xml +9 -8
- app/code/{local → community}/Inic/Faq/sql/faq_setup/mysql4-install-0.1.0.php +0 -0
- app/code/{local/Inic/Faq/sql/faq_setup/mysql4-install-1.0.7.php → community/Inic/Faq/sql/faq_setup/mysql4-install-0.1.7.php} +0 -0
- app/code/community/Inic/Faq/sql/faq_setup/mysql4-install-1.1.3.1.php +71 -0
- app/code/{local/Inic/Faq/sql/faq_setup/mysql4-upgrade-1.0.6-1.0.7.php → community/Inic/Faq/sql/faq_setup/mysql4-upgrade-0.1.6-0.1.7.php} +0 -0
- app/code/community/Inic/Faq/sql/faq_setup/mysql4-upgrade-1.1.3-1.1.3.1.php +71 -0
- app/code/local/Inic/Faq/Block/Adminhtml/Form_/Edit/Renderer/Label.php +0 -16
- app/code/local/Inic/Faq/etc/adminhtml.xml +0 -63
- app/design/frontend/{base/default/layout → default/default/layout/inic}/faq.xml +14 -14
- app/design/frontend/{base/default/template → default/default/template/inic}/faq/categoty.phtml +2 -2
- app/design/frontend/{base/default/template → default/default/template/inic}/faq/detail.phtml +1 -1
- app/design/frontend/{base/default/template → default/default/template/inic}/faq/list.phtml +4 -4
- app/design/frontend/{base/default/template → default/default/template/inic}/faq/search/result.phtml +1 -1
- app/design/frontend/{base/default/template → default/default/template/inic}/faq/search/search.phtml +0 -0
- app/etc/modules/Inic_Faq.xml +2 -2
- app/locale/en_US/Inic_Faq.csv +18 -0
- package.xml +11 -6
- skin/adminhtml/default/default/inic/faq/multiSelectUpdater.js +67 -0
- skin/frontend/{base/default/css → default/default/css/inic}/faq/faq.css +4 -5
- skin/frontend/{base/default/images → default/default/images/inic}/faq/faq_search_bar.png +0 -0
- skin/frontend/{base/default/images → default/default/images/inic}/faq/minus.png +0 -0
- skin/frontend/{base/default/images → default/default/images/inic}/faq/plus.png +0 -0
- skin/frontend/{base/default/images → default/default/images/inic}/faq/search.gif +0 -0
- skin/frontend/{base/default/js → default/default/js/inic}/faq/faq.js +6 -18
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit/Form.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit/Tab/Main.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Edit/Tabs.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Category/Grid.php
RENAMED
@@ -25,7 +25,7 @@ class Inic_Faq_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget
|
|
25 |
parent::__construct();
|
26 |
$this->setId('faq_grid');
|
27 |
$this->setUseAjax(false);
|
28 |
-
$this->setDefaultSort('
|
29 |
$this->setDefaultDir('DESC');
|
30 |
$this->setSaveParametersInSession(true);
|
31 |
}
|
@@ -52,8 +52,19 @@ class Inic_Faq_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget
|
|
52 |
$this->addColumn('category_id', array (
|
53 |
'header' => Mage::helper('faq')->__('Category #'),
|
54 |
'width' => '80px',
|
55 |
-
'type' => '
|
56 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
if (!Mage::app()->isSingleStoreMode()) {
|
59 |
$this->addColumn('store_id',
|
@@ -69,14 +80,6 @@ class Inic_Faq_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget
|
|
69 |
'_filterStoreCondition' ) ));
|
70 |
}
|
71 |
|
72 |
-
$this->addColumn(
|
73 |
-
'category_name',
|
74 |
-
array(
|
75 |
-
'header' => Mage::helper('faq')->__('Category Name'),
|
76 |
-
'index' => 'category_name',
|
77 |
-
)
|
78 |
-
);
|
79 |
-
|
80 |
$this->addColumn('is_active',
|
81 |
array (
|
82 |
'header' => Mage::helper('faq')->__('Active'),
|
@@ -164,4 +167,34 @@ class Inic_Faq_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget
|
|
164 |
)
|
165 |
);
|
166 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
}
|
25 |
parent::__construct();
|
26 |
$this->setId('faq_grid');
|
27 |
$this->setUseAjax(false);
|
28 |
+
$this->setDefaultSort('category_id');
|
29 |
$this->setDefaultDir('DESC');
|
30 |
$this->setSaveParametersInSession(true);
|
31 |
}
|
52 |
$this->addColumn('category_id', array (
|
53 |
'header' => Mage::helper('faq')->__('Category #'),
|
54 |
'width' => '80px',
|
55 |
+
'type' => 'int',
|
56 |
+
'sortable' => true,
|
57 |
+
'index' => 'category_id',
|
58 |
+
'filter_index' => 'main_table.category_id',
|
59 |
+
));
|
60 |
+
|
61 |
+
$this->addColumn(
|
62 |
+
'category_name',
|
63 |
+
array(
|
64 |
+
'header' => Mage::helper('faq')->__('Category Name'),
|
65 |
+
'index' => 'category_name',
|
66 |
+
)
|
67 |
+
);
|
68 |
|
69 |
if (!Mage::app()->isSingleStoreMode()) {
|
70 |
$this->addColumn('store_id',
|
80 |
'_filterStoreCondition' ) ));
|
81 |
}
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
$this->addColumn('is_active',
|
84 |
array (
|
85 |
'header' => Mage::helper('faq')->__('Active'),
|
167 |
)
|
168 |
);
|
169 |
}
|
170 |
+
|
171 |
+
protected function _prepareMassaction()
|
172 |
+
{
|
173 |
+
$this->setMassactionIdField('category_id');
|
174 |
+
$this->getMassactionBlock()->setFormFieldName('category_id');
|
175 |
+
|
176 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
177 |
+
'label' => Mage::helper('faq')->__('Delete'),
|
178 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
179 |
+
'confirm' => Mage::helper('faq')->__('Are you sure?')
|
180 |
+
));
|
181 |
+
|
182 |
+
$statuses = Mage::getSingleton('faq/status')->getOptionArray();
|
183 |
+
|
184 |
+
$this->getMassactionBlock()->addItem('status', array(
|
185 |
+
'label'=> Mage::helper('faq')->__('Change status'),
|
186 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
187 |
+
'additional' => array(
|
188 |
+
'visibility' => array(
|
189 |
+
'name' => 'is_active',
|
190 |
+
'type' => 'select',
|
191 |
+
'class' => 'required-entry',
|
192 |
+
'label' => Mage::helper('faq')->__('Status'),
|
193 |
+
'values' => $statuses
|
194 |
+
)
|
195 |
+
)
|
196 |
+
));
|
197 |
+
return $this;
|
198 |
+
}
|
199 |
+
|
200 |
}
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit/Form.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit/Tab/Main.php
RENAMED
@@ -25,8 +25,8 @@ class Inic_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_W
|
|
25 |
*/
|
26 |
protected function _prepareLayout()
|
27 |
{
|
28 |
-
|
29 |
-
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
30 |
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
31 |
}
|
32 |
return $return;
|
@@ -38,7 +38,7 @@ class Inic_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_W
|
|
38 |
* @return Inic_Faq_Block_Admin_Edit_Tab_Main Self
|
39 |
*/
|
40 |
protected function _prepareForm()
|
41 |
-
{
|
42 |
$model = Mage::registry('faq');
|
43 |
|
44 |
$form = new Varien_Data_Form();
|
@@ -53,32 +53,38 @@ class Inic_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_W
|
|
53 |
'name' => 'faq_id' ));
|
54 |
}
|
55 |
|
56 |
-
$fieldset->addField('question', 'text',
|
|
|
57 |
'name' => 'question',
|
58 |
'label' => Mage::helper('faq')->__('FAQ item question'),
|
59 |
'title' => Mage::helper('faq')->__('FAQ item question'),
|
60 |
-
'required' => true
|
61 |
-
|
|
|
62 |
/**
|
63 |
* Check is single store mode
|
64 |
*/
|
65 |
if (!Mage::app()->isSingleStoreMode()) {
|
66 |
-
$fieldset->addField('store_id', 'multiselect',
|
67 |
array (
|
68 |
-
'name' => '
|
69 |
'label' => Mage::helper('faq')->__('Store view'),
|
70 |
'title' => Mage::helper('faq')->__('Store view'),
|
71 |
'required' => true,
|
72 |
-
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)
|
|
|
|
|
73 |
}
|
74 |
else {
|
75 |
-
$fieldset->addField('store_id', 'hidden',
|
76 |
-
|
77 |
-
'
|
|
|
|
|
78 |
$model->setStoreId(Mage::app()->getStore(true)->getId());
|
79 |
}
|
80 |
|
81 |
-
$fieldset->addField('is_active', 'select',
|
82 |
array (
|
83 |
'label' => Mage::helper('faq')->__('Status'),
|
84 |
'title' => Mage::helper('faq')->__('Item status'),
|
@@ -86,7 +92,8 @@ class Inic_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_W
|
|
86 |
'required' => true,
|
87 |
'options' => array (
|
88 |
'1' => Mage::helper('faq')->__('Enabled'),
|
89 |
-
'0' => Mage::helper('faq')->__('Disabled') )
|
|
|
90 |
|
91 |
$fieldset->addField('is_most_frequent', 'select',
|
92 |
array (
|
@@ -98,16 +105,17 @@ class Inic_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_W
|
|
98 |
'1' => Mage::helper('faq')->__('Yes'),
|
99 |
'0' => Mage::helper('faq')->__('No') ) ));
|
100 |
|
101 |
-
$fieldset->addField('category_id', 'multiselect',
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
111 |
$fieldset->addField('answer', 'editor',
|
112 |
array (
|
113 |
'name' => 'answer',
|
@@ -115,11 +123,22 @@ class Inic_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_W
|
|
115 |
'title' => Mage::helper('faq')->__('Content'),
|
116 |
'style' => 'height:36em;',
|
117 |
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
|
118 |
-
'
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
$this->setForm($form);
|
122 |
|
|
|
|
|
|
|
|
|
|
|
123 |
return parent::_prepareForm();
|
124 |
}
|
125 |
-
}
|
25 |
*/
|
26 |
protected function _prepareLayout()
|
27 |
{
|
28 |
+
parent::_prepareLayout();
|
29 |
+
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
30 |
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
31 |
}
|
32 |
return $return;
|
38 |
* @return Inic_Faq_Block_Admin_Edit_Tab_Main Self
|
39 |
*/
|
40 |
protected function _prepareForm()
|
41 |
+
{
|
42 |
$model = Mage::registry('faq');
|
43 |
|
44 |
$form = new Varien_Data_Form();
|
53 |
'name' => 'faq_id' ));
|
54 |
}
|
55 |
|
56 |
+
$approveInfo= $fieldset->addField('question', 'text',
|
57 |
+
array (
|
58 |
'name' => 'question',
|
59 |
'label' => Mage::helper('faq')->__('FAQ item question'),
|
60 |
'title' => Mage::helper('faq')->__('FAQ item question'),
|
61 |
+
'required' => true
|
62 |
+
));
|
63 |
+
|
64 |
/**
|
65 |
* Check is single store mode
|
66 |
*/
|
67 |
if (!Mage::app()->isSingleStoreMode()) {
|
68 |
+
$store_id = $fieldset->addField('store_id', 'multiselect',
|
69 |
array (
|
70 |
+
'name' => 'store_id[]',
|
71 |
'label' => Mage::helper('faq')->__('Store view'),
|
72 |
'title' => Mage::helper('faq')->__('Store view'),
|
73 |
'required' => true,
|
74 |
+
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true)
|
75 |
+
));
|
76 |
+
|
77 |
}
|
78 |
else {
|
79 |
+
$store_id = $fieldset->addField('store_id', 'hidden',
|
80 |
+
array (
|
81 |
+
'name' => 'store_id[]',
|
82 |
+
'value' => Mage::app()->getStore(true)->getId()
|
83 |
+
));
|
84 |
$model->setStoreId(Mage::app()->getStore(true)->getId());
|
85 |
}
|
86 |
|
87 |
+
$status =$fieldset->addField('is_active', 'select',
|
88 |
array (
|
89 |
'label' => Mage::helper('faq')->__('Status'),
|
90 |
'title' => Mage::helper('faq')->__('Item status'),
|
92 |
'required' => true,
|
93 |
'options' => array (
|
94 |
'1' => Mage::helper('faq')->__('Enabled'),
|
95 |
+
'0' => Mage::helper('faq')->__('Disabled') )
|
96 |
+
));
|
97 |
|
98 |
$fieldset->addField('is_most_frequent', 'select',
|
99 |
array (
|
105 |
'1' => Mage::helper('faq')->__('Yes'),
|
106 |
'0' => Mage::helper('faq')->__('No') ) ));
|
107 |
|
108 |
+
$category_id = $fieldset->addField('category_id', 'multiselect',
|
109 |
+
array (
|
110 |
+
'label' => Mage::helper('faq')->__('Category'),
|
111 |
+
'title' => Mage::helper('faq')->__('Category'),
|
112 |
+
'name' => 'categories[]',
|
113 |
+
'required' => false,
|
114 |
+
'values' => Mage::getResourceSingleton('faq/category_collection')->toOptionArray(),
|
115 |
+
)
|
116 |
+
);
|
117 |
+
|
118 |
+
|
119 |
$fieldset->addField('answer', 'editor',
|
120 |
array (
|
121 |
'name' => 'answer',
|
123 |
'title' => Mage::helper('faq')->__('Content'),
|
124 |
'style' => 'height:36em;',
|
125 |
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
|
126 |
+
'state' => 'html',
|
127 |
+
'required' => true,
|
128 |
+
));
|
129 |
+
$data = $model->getData();
|
130 |
+
if(!count($data))
|
131 |
+
{
|
132 |
+
$data['store_id'] = 0;
|
133 |
+
}
|
134 |
+
$form->setValues($data);
|
135 |
$this->setForm($form);
|
136 |
|
137 |
+
$cat_id =$model->getData('category_id');
|
138 |
+
$selected = $cat_id ? $cat_id : "";
|
139 |
+
$this->setChild('form_after', $this->getLayout()->createBlock('faq/adminhtml_widget_form_element_selectdependence')
|
140 |
+
->addFieldMap($store_id->getHtmlId(), $category_id->getHtmlId(),$selected)
|
141 |
+
);
|
142 |
return parent::_prepareForm();
|
143 |
}
|
144 |
+
}
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Edit/Tabs.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Adminhtml/Item/Grid.php
RENAMED
@@ -40,7 +40,7 @@ class Inic_Faq_Block_Adminhtml_Item_Grid extends Mage_Adminhtml_Block_Widget_Gri
|
|
40 |
//TODO: add full name logic
|
41 |
$collection = Mage::getResourceModel('faq/faq_collection');
|
42 |
$this->setCollection($collection);
|
43 |
-
|
44 |
return parent::_prepareCollection();
|
45 |
}
|
46 |
|
@@ -54,33 +54,50 @@ class Inic_Faq_Block_Adminhtml_Item_Grid extends Mage_Adminhtml_Block_Widget_Gri
|
|
54 |
$this->addColumn('faq_id', array (
|
55 |
'header' => Mage::helper('faq')->__('FAQ #'),
|
56 |
'width' => '80px',
|
57 |
-
'type' => 'text',
|
58 |
-
'index' => 'faq_id'
|
|
|
|
|
59 |
|
60 |
if (!Mage::app()->isSingleStoreMode()) {
|
61 |
$this->addColumn('store_id',
|
62 |
-
|
63 |
'header' => Mage::helper('faq')->__('Store view'),
|
64 |
'index' => 'store_id',
|
65 |
'type' => 'store',
|
66 |
'store_all' => true,
|
67 |
'store_view' => true,
|
68 |
-
'sortable' => false,
|
69 |
-
'
|
70 |
-
|
71 |
-
|
|
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
$this->addColumn('question', array (
|
75 |
'header' => Mage::helper('faq')->__('Question'),
|
76 |
-
'index' => 'question'
|
|
|
77 |
|
78 |
$this->addColumn('is_active',
|
79 |
array (
|
80 |
'header' => Mage::helper('faq')->__('Active'),
|
81 |
'index' => 'is_active',
|
82 |
-
'type' => 'options',
|
83 |
-
'width' => '70px',
|
84 |
'options' => array (
|
85 |
0 => Mage::helper('faq')->__('No'),
|
86 |
1 => Mage::helper('faq')->__('Yes') ) ));
|
@@ -126,7 +143,6 @@ class Inic_Faq_Block_Adminhtml_Item_Grid extends Mage_Adminhtml_Block_Widget_Gri
|
|
126 |
if (!$value = $column->getFilter()->getValue()) {
|
127 |
return;
|
128 |
}
|
129 |
-
|
130 |
$this->getCollection()->addStoreFilter($value);
|
131 |
}
|
132 |
|
@@ -152,4 +168,35 @@ class Inic_Faq_Block_Adminhtml_Item_Grid extends Mage_Adminhtml_Block_Widget_Gri
|
|
152 |
return $this->getUrl('adminhtml/faq/index', array (
|
153 |
'_current' => true ));
|
154 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
40 |
//TODO: add full name logic
|
41 |
$collection = Mage::getResourceModel('faq/faq_collection');
|
42 |
$this->setCollection($collection);
|
43 |
+
|
44 |
return parent::_prepareCollection();
|
45 |
}
|
46 |
|
54 |
$this->addColumn('faq_id', array (
|
55 |
'header' => Mage::helper('faq')->__('FAQ #'),
|
56 |
'width' => '80px',
|
57 |
+
'type' => 'text',
|
58 |
+
'index' => 'faq_id',
|
59 |
+
'filter_index' => 'main_table.faq_id',
|
60 |
+
));
|
61 |
|
62 |
if (!Mage::app()->isSingleStoreMode()) {
|
63 |
$this->addColumn('store_id',
|
64 |
+
array (
|
65 |
'header' => Mage::helper('faq')->__('Store view'),
|
66 |
'index' => 'store_id',
|
67 |
'type' => 'store',
|
68 |
'store_all' => true,
|
69 |
'store_view' => true,
|
70 |
+
'sortable' => false,
|
71 |
+
//'display_deleted' => true,
|
72 |
+
'filter_condition_callback' => array($this,'_filterStoreCondition'),
|
73 |
+
)
|
74 |
+
);
|
75 |
}
|
76 |
+
$this->addColumn('category_name',
|
77 |
+
array (
|
78 |
+
'header' => Mage::helper('faq')->__('Category'),
|
79 |
+
'index' => 'category_name',
|
80 |
+
'sortable' => false,
|
81 |
+
'filter' => false,
|
82 |
+
'renderer' => 'faq/adminhtml_widget_grid_column_renderer_category',
|
83 |
+
//'nl2br' => true,
|
84 |
+
//'filter_condition_callback' => array($this,'_filterCategoryCondition'),
|
85 |
+
)
|
86 |
+
);
|
87 |
+
|
88 |
+
|
89 |
|
90 |
$this->addColumn('question', array (
|
91 |
'header' => Mage::helper('faq')->__('Question'),
|
92 |
+
'index' => 'question'
|
93 |
+
));
|
94 |
|
95 |
$this->addColumn('is_active',
|
96 |
array (
|
97 |
'header' => Mage::helper('faq')->__('Active'),
|
98 |
'index' => 'is_active',
|
99 |
+
'type' => 'options',
|
100 |
+
'width' => '70px',
|
101 |
'options' => array (
|
102 |
0 => Mage::helper('faq')->__('No'),
|
103 |
1 => Mage::helper('faq')->__('Yes') ) ));
|
143 |
if (!$value = $column->getFilter()->getValue()) {
|
144 |
return;
|
145 |
}
|
|
|
146 |
$this->getCollection()->addStoreFilter($value);
|
147 |
}
|
148 |
|
168 |
return $this->getUrl('adminhtml/faq/index', array (
|
169 |
'_current' => true ));
|
170 |
}
|
171 |
+
|
172 |
+
|
173 |
+
protected function _prepareMassaction()
|
174 |
+
{
|
175 |
+
$this->setMassactionIdField('faq_id');
|
176 |
+
$this->getMassactionBlock()->setFormFieldName('faq_id');
|
177 |
+
|
178 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
179 |
+
'label' => Mage::helper('faq')->__('Delete'),
|
180 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
181 |
+
'confirm' => Mage::helper('faq')->__('Are you sure?')
|
182 |
+
));
|
183 |
+
|
184 |
+
$statuses = Mage::getSingleton('faq/status')->getOptionArray();
|
185 |
+
|
186 |
+
$this->getMassactionBlock()->addItem('status', array(
|
187 |
+
'label'=> Mage::helper('faq')->__('Change status'),
|
188 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
189 |
+
'additional' => array(
|
190 |
+
'visibility' => array(
|
191 |
+
'name' => 'is_active',
|
192 |
+
'type' => 'select',
|
193 |
+
'class' => 'required-entry',
|
194 |
+
'label' => Mage::helper('faq')->__('Status'),
|
195 |
+
'values' => $statuses
|
196 |
+
)
|
197 |
+
)
|
198 |
+
));
|
199 |
+
return $this;
|
200 |
+
}
|
201 |
+
|
202 |
}
|
app/code/community/Inic/Faq/Block/Adminhtml/Widget/Form/Element/Selectdependence.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FAQ for Magento
|
4 |
+
*
|
5 |
+
* @category Inic
|
6 |
+
* @package Inic_Faq
|
7 |
+
* @copyright Copyright (c) 2013 Indianic
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Form Selectelement/multiselect dependencies mapper
|
11 |
+
* Assumes that one element may depend on other element values.
|
12 |
+
* Will toggle as "enabled" only if all elements it depends from toggle as true.
|
13 |
+
*/
|
14 |
+
class Inic_Faq_Block_Adminhtml_Widget_Form_Element_Selectdependence extends Mage_Adminhtml_Block_Abstract
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* Parent id mapper
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
protected $fieldIdFrom;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* dependent id mapper
|
24 |
+
*
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
+
protected $fieldIdTo;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Dependencies mapper (by names)
|
31 |
+
* array(
|
32 |
+
* 'dependent_name' => array(
|
33 |
+
* 'depends_from_1_name' => 'mixed value',
|
34 |
+
* 'depends_from_2_name' => 'some another value',
|
35 |
+
* ...
|
36 |
+
* )
|
37 |
+
* )
|
38 |
+
* @var array
|
39 |
+
*/
|
40 |
+
protected $_depends = array();
|
41 |
+
|
42 |
+
/**
|
43 |
+
* selected options
|
44 |
+
*
|
45 |
+
* @var array
|
46 |
+
*/
|
47 |
+
protected $selectedField = array();
|
48 |
+
/**
|
49 |
+
* Add name => id mapping
|
50 |
+
*
|
51 |
+
* @param string $fieldIdFrom - Parent id mapper
|
52 |
+
* @param string $fieldIdTo - dependent id mapper
|
53 |
+
* @param string $selectedField - current Selected field
|
54 |
+
* @return Mage_Adminhtml_Block_Widget_Form_Element_Dependence
|
55 |
+
*/
|
56 |
+
public function addFieldMap($fieldIdFrom, $fieldIdTo,$selectedField)
|
57 |
+
{
|
58 |
+
$this->_fieldIdFrom = $fieldIdFrom;
|
59 |
+
$this->_fieldIdTo = $fieldIdTo;
|
60 |
+
$this->_selectedField = Mage::helper('core')->jsonEncode($selectedField);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* HTML output getter
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
protected function _toHtml()
|
70 |
+
{
|
71 |
+
return '<script type="text/javascript">
|
72 |
+
new SelectAutoUpdater('.$this->_fieldIdFrom.','.$this->_fieldIdTo.',"","",'. $this->_getDependsJson().','.$this->_selectedField. ');
|
73 |
+
</script>';
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Field dependences JSON map generator
|
78 |
+
* @return string
|
79 |
+
*/
|
80 |
+
protected function _getDependsJson()
|
81 |
+
{
|
82 |
+
$stores=Mage::app()->getStores();
|
83 |
+
$this->_depends[0] = Mage::getModel('faq/category')
|
84 |
+
->getCollection()
|
85 |
+
->toOptionHash();
|
86 |
+
foreach ($stores as $id => $value){
|
87 |
+
$_storeId = Mage::app()->getStore($id)->getId();
|
88 |
+
$category = Mage::getModel('faq/category')
|
89 |
+
->getCollection()
|
90 |
+
->addStoreFilter($_storeId)
|
91 |
+
->toOptionHash();
|
92 |
+
$this->_depends[$id] = $category;
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
return Mage::helper('core')->jsonEncode($this->_depends);
|
97 |
+
}
|
98 |
+
}
|
app/code/community/Inic/Faq/Block/Adminhtml/Widget/Grid/Column/Renderer/Category.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Adminhtml
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Store grid column filter
|
30 |
+
*
|
31 |
+
* @category Inic
|
32 |
+
* @package Inic_Adminhtml
|
33 |
+
* @author Inic Team <www.indianic.com>
|
34 |
+
*/
|
35 |
+
class Inic_Faq_Block_Adminhtml_Widget_Grid_Column_Renderer_Category
|
36 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
37 |
+
{
|
38 |
+
/**
|
39 |
+
* Render row store views
|
40 |
+
*
|
41 |
+
* @param Varien_Object $row
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function render(Varien_Object $row)
|
45 |
+
{
|
46 |
+
$value = $row->getData($this->getColumn()->getIndex());
|
47 |
+
return $value;
|
48 |
+
}
|
49 |
+
}
|
app/code/{local → community}/Inic/Faq/Block/Frontend/Category.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Frontend/Detail.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Frontend/FaqSearch/Result.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Frontend/FaqSearch/Search.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Block/Frontend/List.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Helper/Data.php
RENAMED
@@ -36,4 +36,12 @@ class Inic_Faq_Helper_Data extends Mage_Core_Helper_Abstract
|
|
36 |
public function getQuestionView(){
|
37 |
return (Mage::getStoreConfig('faq_section/general/view_style')==1 ? 'grid' : 'list');
|
38 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
36 |
public function getQuestionView(){
|
37 |
return (Mage::getStoreConfig('faq_section/general/view_style')==1 ? 'grid' : 'list');
|
38 |
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Returns the parsed wyswing editor directives
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function filter($content){
|
45 |
+
return Mage::helper('cms')->getBlockTemplateProcessor()->filter($content);
|
46 |
+
}
|
47 |
}
|
app/code/{local → community}/Inic/Faq/Model/Category.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Model/Faq.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/Model/Mysql4/Category.php
RENAMED
@@ -40,7 +40,7 @@ class Inic_Faq_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract
|
|
40 |
array('nns' => $this->getTable('faq/category_store')),
|
41 |
$this->getMainTable() . '.item_id = `nns`.category_id'
|
42 |
)->where('is_active=1 AND `nns`.store_id in (0, ?) ',
|
43 |
-
$object->getStoreId())->order('
|
44 |
}
|
45 |
return $select;
|
46 |
}
|
40 |
array('nns' => $this->getTable('faq/category_store')),
|
41 |
$this->getMainTable() . '.item_id = `nns`.category_id'
|
42 |
)->where('is_active=1 AND `nns`.store_id in (0, ?) ',
|
43 |
+
$object->getStoreId())->order('category_id DESC')->limit(1);
|
44 |
}
|
45 |
return $select;
|
46 |
}
|
app/code/{local → community}/Inic/Faq/Model/Mysql4/Category/Collection.php
RENAMED
@@ -33,11 +33,18 @@ class Inic_Faq_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_C
|
|
33 |
* @param int|Mage_Core_Model_Store $store Store to be filtered
|
34 |
* @return Inic_Faq_Model_Mysql4_Category_Collection
|
35 |
*/
|
36 |
-
public function addStoreFilter($store)
|
37 |
{
|
38 |
-
|
39 |
-
$store = array($store->getId());
|
40 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
$this->getSelect()->join(
|
43 |
array('store_table' => $this->getTable('faq/category_store')),
|
@@ -46,11 +53,11 @@ class Inic_Faq_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_C
|
|
46 |
)->where('store_table.store_id in (?)', array (
|
47 |
0,
|
48 |
$store
|
49 |
-
))
|
50 |
-
|
51 |
return $this;
|
52 |
}
|
53 |
-
|
54 |
|
55 |
/**
|
56 |
* After load processing - adds store information to the datasets
|
@@ -59,7 +66,7 @@ class Inic_Faq_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_C
|
|
59 |
protected function _afterLoad()
|
60 |
{
|
61 |
if ($this->_previewFlag) {
|
62 |
-
$items = $this->getColumnValues('
|
63 |
if (count($items)) {
|
64 |
$select = $this->getConnection()->select()->from(
|
65 |
$this->getTable('faq/category_store')
|
@@ -106,4 +113,4 @@ class Inic_Faq_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_C
|
|
106 |
$this->addFilter('is_active', 1);
|
107 |
return $this;
|
108 |
}
|
109 |
-
}
|
33 |
* @param int|Mage_Core_Model_Store $store Store to be filtered
|
34 |
* @return Inic_Faq_Model_Mysql4_Category_Collection
|
35 |
*/
|
36 |
+
public function addStoreFilter($store,$withAdmin = true)
|
37 |
{
|
38 |
+
if ($store instanceof Mage_Core_Model_Store) {
|
39 |
+
$store = array ($store->getId());
|
40 |
}
|
41 |
+
/*if (!is_array($store)) {
|
42 |
+
$store = array($store);
|
43 |
+
}
|
44 |
+
if ($withAdmin) {
|
45 |
+
$store[] = Mage_Core_Model_App::ADMIN_STORE_ID;
|
46 |
+
}
|
47 |
+
$this->addFilter('store_id', array('in' => $store),'public');*/
|
48 |
|
49 |
$this->getSelect()->join(
|
50 |
array('store_table' => $this->getTable('faq/category_store')),
|
53 |
)->where('store_table.store_id in (?)', array (
|
54 |
0,
|
55 |
$store
|
56 |
+
));
|
57 |
+
//->group('main_table.category_id');
|
58 |
return $this;
|
59 |
}
|
60 |
+
|
61 |
|
62 |
/**
|
63 |
* After load processing - adds store information to the datasets
|
66 |
protected function _afterLoad()
|
67 |
{
|
68 |
if ($this->_previewFlag) {
|
69 |
+
$items = $this->getColumnValues('category_id');
|
70 |
if (count($items)) {
|
71 |
$select = $this->getConnection()->select()->from(
|
72 |
$this->getTable('faq/category_store')
|
113 |
$this->addFilter('is_active', 1);
|
114 |
return $this;
|
115 |
}
|
116 |
+
}
|
app/code/{local → community}/Inic/Faq/Model/Mysql4/Faq.php
RENAMED
@@ -83,7 +83,7 @@ class Inic_Faq_Model_Mysql4_Faq extends Mage_Core_Model_Mysql4_Abstract {
|
|
83 |
|
84 |
// process faq item to store relation
|
85 |
$this->_getWriteAdapter()->delete($this->getTable('faq/faq_store'), $condition);
|
86 |
-
foreach ((array) $object->getData('
|
87 |
$storeArray = array ();
|
88 |
$storeArray['faq_id'] = $object->getId();
|
89 |
$storeArray['store_id'] = $store;
|
@@ -127,7 +127,32 @@ class Inic_Faq_Model_Mysql4_Faq extends Mage_Core_Model_Mysql4_Abstract {
|
|
127 |
}
|
128 |
|
129 |
// process faq item to category relation
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
$this->getTable('faq/category_item')
|
132 |
)->where('faq_id = ?', $object->getId());
|
133 |
|
@@ -137,8 +162,9 @@ class Inic_Faq_Model_Mysql4_Faq extends Mage_Core_Model_Mysql4_Abstract {
|
|
137 |
$categoryArray[] = $row['category_id'];
|
138 |
}
|
139 |
$object->setData('category_id', $categoryArray);
|
140 |
-
}
|
141 |
-
|
|
|
142 |
return parent::_afterLoad($object);
|
143 |
}
|
144 |
}
|
83 |
|
84 |
// process faq item to store relation
|
85 |
$this->_getWriteAdapter()->delete($this->getTable('faq/faq_store'), $condition);
|
86 |
+
foreach ((array) $object->getData('store_id') as $store) {
|
87 |
$storeArray = array ();
|
88 |
$storeArray['faq_id'] = $object->getId();
|
89 |
$storeArray['store_id'] = $store;
|
127 |
}
|
128 |
|
129 |
// process faq item to category relation
|
130 |
+
$CategoryItemSelect=$this->_getReadAdapter()->select()->from(
|
131 |
+
$this->getTable('faq/category_item')
|
132 |
+
)->where('faq_id = '.$object->getId());
|
133 |
+
|
134 |
+
if ($data = $this->_getReadAdapter()->fetchAll($CategoryItemSelect)) {
|
135 |
+
$categoryArray = "";
|
136 |
+
$categoryId = array ();
|
137 |
+
foreach ($data as $row) {
|
138 |
+
$categorySelect=$this->_getReadAdapter()->select()->from(
|
139 |
+
$this->getTable('faq/category')
|
140 |
+
)->where($row['category_id'].' = category_id');
|
141 |
+
if ($categoryData = $this->_getReadAdapter()->fetchAll($categorySelect)) {
|
142 |
+
foreach ($categoryData as $categoryRow) {
|
143 |
+
$categoryArray.= $categoryRow['category_name']."<br/>";
|
144 |
+
$categoryId[]= $categoryRow['category_id'];
|
145 |
+
}
|
146 |
+
}
|
147 |
+
}
|
148 |
+
//For Grid
|
149 |
+
$object->setData('category_name', $categoryArray);
|
150 |
+
|
151 |
+
//For main Form
|
152 |
+
$object->setData('category_id', $categoryId);
|
153 |
+
}
|
154 |
+
|
155 |
+
/*$select = $this->_getReadAdapter()->select()->from(
|
156 |
$this->getTable('faq/category_item')
|
157 |
)->where('faq_id = ?', $object->getId());
|
158 |
|
162 |
$categoryArray[] = $row['category_id'];
|
163 |
}
|
164 |
$object->setData('category_id', $categoryArray);
|
165 |
+
}*/
|
166 |
+
|
167 |
+
|
168 |
return parent::_afterLoad($object);
|
169 |
}
|
170 |
}
|
app/code/{local → community}/Inic/Faq/Model/Mysql4/Faq/Collection.php
RENAMED
@@ -24,8 +24,7 @@ class Inic_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collec
|
|
24 |
*/
|
25 |
protected function _construct()
|
26 |
{
|
27 |
-
$this->_init('faq/faq')
|
28 |
-
->setOrder('question', 'ASC');
|
29 |
}
|
30 |
|
31 |
/**
|
@@ -74,14 +73,18 @@ class Inic_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collec
|
|
74 |
* @param int|Mage_Core_Model_Store $store Store to be filtered
|
75 |
* @return Inic_Faq_Model_Mysql4_Faq_Collection Self
|
76 |
*/
|
77 |
-
public function addStoreFilter($store)
|
78 |
{
|
79 |
if ($store instanceof Mage_Core_Model_Store) {
|
80 |
-
$store = array (
|
81 |
-
$store->getId()
|
82 |
-
);
|
83 |
}
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
$this->getSelect()->join(
|
86 |
array('store_table' => $this->getTable('faq/faq_store')),
|
87 |
'main_table.faq_id = store_table.faq_id',
|
@@ -89,11 +92,11 @@ class Inic_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collec
|
|
89 |
)->where('store_table.store_id in (?)', array (
|
90 |
0,
|
91 |
$store
|
92 |
-
))
|
|
|
93 |
|
94 |
return $this;
|
95 |
}
|
96 |
-
|
97 |
|
98 |
/**
|
99 |
* After load processing - adds store information to the datasets
|
24 |
*/
|
25 |
protected function _construct()
|
26 |
{
|
27 |
+
$this->_init('faq/faq');
|
|
|
28 |
}
|
29 |
|
30 |
/**
|
73 |
* @param int|Mage_Core_Model_Store $store Store to be filtered
|
74 |
* @return Inic_Faq_Model_Mysql4_Faq_Collection Self
|
75 |
*/
|
76 |
+
public function addStoreFilter($store,$withAdmin = true)
|
77 |
{
|
78 |
if ($store instanceof Mage_Core_Model_Store) {
|
79 |
+
$store = array ($store->getId());
|
|
|
|
|
80 |
}
|
81 |
+
/*if (!is_array($store)) {
|
82 |
+
$store = array($store);
|
83 |
+
}
|
84 |
+
if ($withAdmin) {
|
85 |
+
$store[] = Mage_Core_Model_App::ADMIN_STORE_ID;
|
86 |
+
}
|
87 |
+
$this->addFilter('store_id', array('in' => $store),'public');*/
|
88 |
$this->getSelect()->join(
|
89 |
array('store_table' => $this->getTable('faq/faq_store')),
|
90 |
'main_table.faq_id = store_table.faq_id',
|
92 |
)->where('store_table.store_id in (?)', array (
|
93 |
0,
|
94 |
$store
|
95 |
+
));
|
96 |
+
//->group('main_table.faq_id');
|
97 |
|
98 |
return $this;
|
99 |
}
|
|
|
100 |
|
101 |
/**
|
102 |
* After load processing - adds store information to the datasets
|
app/code/community/Inic/Faq/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Inic_Faq_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 0;
|
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/{local → community}/Inic/Faq/Model/System/Config/Source/View.php
RENAMED
File without changes
|
app/code/{local → community}/Inic/Faq/controllers/Adminhtml/Faq/CategoryController.php
RENAMED
@@ -26,8 +26,8 @@ class Inic_Faq_Adminhtml_Faq_CategoryController extends Mage_Adminhtml_Controlle
|
|
26 |
$this->_usedModuleName = 'faq';
|
27 |
|
28 |
$this->loadLayout()
|
29 |
-
->_setActiveMenu('
|
30 |
-
->_addBreadcrumb($this->__('
|
31 |
->_addBreadcrumb($this->__('FAQ'), $this->__('FAQ'));
|
32 |
|
33 |
return $this;
|
@@ -188,6 +188,6 @@ class Inic_Faq_Adminhtml_Faq_CategoryController extends Mage_Adminhtml_Controlle
|
|
188 |
*/
|
189 |
protected function _isAllowed()
|
190 |
{
|
191 |
-
return Mage::getSingleton('admin/session')->isAllowed('admin/
|
192 |
}
|
193 |
}
|
26 |
$this->_usedModuleName = 'faq';
|
27 |
|
28 |
$this->loadLayout()
|
29 |
+
->_setActiveMenu('inic/faq')
|
30 |
+
->_addBreadcrumb($this->__('Inic'), $this->__('Inic'))
|
31 |
->_addBreadcrumb($this->__('FAQ'), $this->__('FAQ'));
|
32 |
|
33 |
return $this;
|
188 |
*/
|
189 |
protected function _isAllowed()
|
190 |
{
|
191 |
+
return Mage::getSingleton('admin/session')->isAllowed('admin/inic/faq');
|
192 |
}
|
193 |
}
|
app/code/{local → community}/Inic/Faq/controllers/Adminhtml/FaqController.php
RENAMED
@@ -26,10 +26,10 @@ class Inic_Faq_Adminhtml_FaqController extends Mage_Adminhtml_Controller_Action
|
|
26 |
$this->_usedModuleName = 'faq';
|
27 |
|
28 |
$this->loadLayout()
|
29 |
-
->_setActiveMenu('
|
30 |
-
->_addBreadcrumb($this->__('
|
31 |
->_addBreadcrumb($this->__('FAQ'), $this->__('FAQ'));
|
32 |
-
|
33 |
return $this;
|
34 |
}
|
35 |
|
@@ -105,7 +105,6 @@ class Inic_Faq_Adminhtml_FaqController extends Mage_Adminhtml_Controller_Action
|
|
105 |
{
|
106 |
// check if data sent
|
107 |
if ($data = $this->getRequest()->getPost()) {
|
108 |
-
|
109 |
// init model and set data
|
110 |
$model = Mage::getModel('faq/faq');
|
111 |
$model->setData($data);
|
@@ -154,7 +153,7 @@ class Inic_Faq_Adminhtml_FaqController extends Mage_Adminhtml_Controller_Action
|
|
154 |
*/
|
155 |
protected function _isAllowed()
|
156 |
{
|
157 |
-
return Mage::getSingleton('admin/session')->isAllowed('admin/
|
158 |
}
|
159 |
|
160 |
/**
|
@@ -197,4 +196,53 @@ class Inic_Faq_Adminhtml_FaqController extends Mage_Adminhtml_Controller_Action
|
|
197 |
// go to grid
|
198 |
$this->_redirect('*/*/');
|
199 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
}
|
26 |
$this->_usedModuleName = 'faq';
|
27 |
|
28 |
$this->loadLayout()
|
29 |
+
->_setActiveMenu('inic/faq')
|
30 |
+
->_addBreadcrumb($this->__('Inic'), $this->__('Inic'))
|
31 |
->_addBreadcrumb($this->__('FAQ'), $this->__('FAQ'));
|
32 |
+
|
33 |
return $this;
|
34 |
}
|
35 |
|
105 |
{
|
106 |
// check if data sent
|
107 |
if ($data = $this->getRequest()->getPost()) {
|
|
|
108 |
// init model and set data
|
109 |
$model = Mage::getModel('faq/faq');
|
110 |
$model->setData($data);
|
153 |
*/
|
154 |
protected function _isAllowed()
|
155 |
{
|
156 |
+
return Mage::getSingleton('admin/session')->isAllowed('admin/inic/faq');
|
157 |
}
|
158 |
|
159 |
/**
|
196 |
// go to grid
|
197 |
$this->_redirect('*/*/');
|
198 |
}
|
199 |
+
|
200 |
+
public function massDeleteAction() {
|
201 |
+
$faqIds = $this->getRequest()->getParam('faq_id');
|
202 |
+
if(!is_array($faqIds)) {
|
203 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
204 |
+
} else {
|
205 |
+
try {
|
206 |
+
|
207 |
+
foreach ($faqIds as $faqId) {
|
208 |
+
$faqItem = Mage::getModel('faq/faq')->load($faqId);
|
209 |
+
$faqItem->delete();
|
210 |
+
}
|
211 |
+
|
212 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
213 |
+
Mage::helper('adminhtml')->__(
|
214 |
+
'Total of %d record(s) were successfully deleted', count($faqIds)
|
215 |
+
)
|
216 |
+
);
|
217 |
+
} catch (Exception $e) {
|
218 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
219 |
+
}
|
220 |
+
}
|
221 |
+
$this->_redirect('*/*/index');
|
222 |
+
}
|
223 |
+
|
224 |
+
public function massStatusAction()
|
225 |
+
{
|
226 |
+
$faqIds = $this->getRequest()->getParam('faq_id');
|
227 |
+
if(!is_array($faqIds)) {
|
228 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
229 |
+
} else {
|
230 |
+
try {
|
231 |
+
foreach ($faqIds as $faqId) {
|
232 |
+
$faqItem = Mage::getSingleton('faq/faq')
|
233 |
+
->load($faqId)
|
234 |
+
->setIsActive($this->getRequest()->getParam('is_active'))
|
235 |
+
->setIsMassupdate(true)
|
236 |
+
->save();
|
237 |
+
}
|
238 |
+
$this->_getSession()->addSuccess(
|
239 |
+
$this->__('Total of %d record(s) were successfully updated', count($faqIds))
|
240 |
+
);
|
241 |
+
} catch (Exception $e) {
|
242 |
+
$this->_getSession()->addError($e->getMessage());
|
243 |
+
}
|
244 |
+
}
|
245 |
+
$this->_redirect('*/*/index');
|
246 |
+
}
|
247 |
+
|
248 |
}
|
app/code/{local → community}/Inic/Faq/controllers/IndexController.php
RENAMED
File without changes
|
app/code/community/Inic/Faq/etc/adminhtml.xml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<inic translate="title" module="faq">
|
5 |
+
<title>Inic Extensions</title>
|
6 |
+
<sort_order>80</sort_order>
|
7 |
+
<children>
|
8 |
+
<faq translate="title" module="faq">
|
9 |
+
<title>FAQ</title>
|
10 |
+
<sort_order>1</sort_order>
|
11 |
+
<children>
|
12 |
+
<item translate="title" module="faq">
|
13 |
+
<title>Manage Items</title>
|
14 |
+
<action>adminhtml/faq</action>
|
15 |
+
</item>
|
16 |
+
<category translate="title" module="faq">
|
17 |
+
<title>Manage Categories</title>
|
18 |
+
<action>adminhtml/faq_category</action>
|
19 |
+
</category>
|
20 |
+
</children>
|
21 |
+
</faq>
|
22 |
+
</children>
|
23 |
+
</inic>
|
24 |
+
</menu>
|
25 |
+
<acl>
|
26 |
+
<resources>
|
27 |
+
<all>
|
28 |
+
<title>Allow Everything</title>
|
29 |
+
</all>
|
30 |
+
<admin>
|
31 |
+
<children>
|
32 |
+
<inic>
|
33 |
+
<title>Inic Extensions</title>
|
34 |
+
<sort_order>80</sort_order>
|
35 |
+
<children>
|
36 |
+
<faq>
|
37 |
+
<title>FAQ</title>
|
38 |
+
<sort_order>1</sort_order>
|
39 |
+
<children>
|
40 |
+
<item translate="title" module="faq">
|
41 |
+
<title>Manage Items</title>
|
42 |
+
</item>
|
43 |
+
<category translate="title" module="faq">
|
44 |
+
<title>Manage Categories</title>
|
45 |
+
</category>
|
46 |
+
</children>
|
47 |
+
</faq>
|
48 |
+
</children>
|
49 |
+
</inic>
|
50 |
+
</children>
|
51 |
+
<children>
|
52 |
+
<system>
|
53 |
+
<children>
|
54 |
+
<config>
|
55 |
+
<children>
|
56 |
+
<faq_section translate="title">
|
57 |
+
<title>FAQ Settings</title>
|
58 |
+
<sort_order>1</sort_order>
|
59 |
+
</faq_section>
|
60 |
+
</children>
|
61 |
+
</config>
|
62 |
+
</children>
|
63 |
+
</system>
|
64 |
+
</children>
|
65 |
+
</admin>
|
66 |
+
</resources>
|
67 |
+
</acl>
|
68 |
+
</config>
|
app/code/{local → community}/Inic/Faq/etc/config.xml
RENAMED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Inic_Faq>
|
5 |
-
<version>1.1.3</version>
|
6 |
</Inic_Faq>
|
7 |
</modules>
|
8 |
|
@@ -17,7 +17,15 @@
|
|
17 |
</adminhtml>
|
18 |
</routers>
|
19 |
</admin>
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
<frontend>
|
22 |
<routers>
|
23 |
<faq>
|
@@ -40,7 +48,7 @@
|
|
40 |
<layout>
|
41 |
<updates>
|
42 |
<faq>
|
43 |
-
<file>faq.xml</file>
|
44 |
</faq>
|
45 |
</updates>
|
46 |
</layout>
|
@@ -68,19 +76,19 @@
|
|
68 |
<class>Inic_Faq_Model_Mysql4</class>
|
69 |
<entities>
|
70 |
<category>
|
71 |
-
<table>
|
72 |
</category>
|
73 |
<category_item>
|
74 |
-
<table>
|
75 |
</category_item>
|
76 |
<category_store>
|
77 |
-
<table>
|
78 |
</category_store>
|
79 |
<faq>
|
80 |
-
<table>
|
81 |
</faq>
|
82 |
<faq_store>
|
83 |
-
<table>
|
84 |
</faq_store>
|
85 |
</entities>
|
86 |
</faq_mysql4>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Inic_Faq>
|
5 |
+
<version>1.1.3.1</version>
|
6 |
</Inic_Faq>
|
7 |
</modules>
|
8 |
|
17 |
</adminhtml>
|
18 |
</routers>
|
19 |
</admin>
|
20 |
+
<adminhtml>
|
21 |
+
<layout>
|
22 |
+
<updates>
|
23 |
+
<faq>
|
24 |
+
<file>inic/faq.xml</file>
|
25 |
+
</faq>
|
26 |
+
</updates>
|
27 |
+
</layout>
|
28 |
+
</adminhtml>
|
29 |
<frontend>
|
30 |
<routers>
|
31 |
<faq>
|
48 |
<layout>
|
49 |
<updates>
|
50 |
<faq>
|
51 |
+
<file>inic/faq.xml</file>
|
52 |
</faq>
|
53 |
</updates>
|
54 |
</layout>
|
76 |
<class>Inic_Faq_Model_Mysql4</class>
|
77 |
<entities>
|
78 |
<category>
|
79 |
+
<table>inic_advance_faq_category</table>
|
80 |
</category>
|
81 |
<category_item>
|
82 |
+
<table>inic_advance_faq_category_item</table>
|
83 |
</category_item>
|
84 |
<category_store>
|
85 |
+
<table>inic_advance_faq_category_store</table>
|
86 |
</category_store>
|
87 |
<faq>
|
88 |
+
<table>inic_advance_faq</table>
|
89 |
</faq>
|
90 |
<faq_store>
|
91 |
+
<table>inic_advance_faq_store</table>
|
92 |
</faq_store>
|
93 |
</entities>
|
94 |
</faq_mysql4>
|
app/code/{local → community}/Inic/Faq/etc/system.xml
RENAMED
@@ -1,24 +1,25 @@
|
|
1 |
<?xml version="1.0" ?>
|
2 |
<config>
|
3 |
-
|
4 |
-
<
|
5 |
-
<label>
|
6 |
-
<sort_order>
|
7 |
-
</
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<faq_section translate="label">
|
11 |
<label>Faq</label>
|
12 |
-
<sort_order>
|
13 |
<show_in_default>1</show_in_default>
|
14 |
<show_in_website>1</show_in_website>
|
15 |
<show_in_store>1</show_in_store>
|
16 |
-
<tab>
|
17 |
<groups>
|
18 |
<general translate="label">
|
19 |
<label>FAQ Configuration</label>
|
20 |
-
<sort_order>
|
21 |
<show_in_default>1</show_in_default>
|
|
|
22 |
<fields>
|
23 |
<frequent_enable translate="label">
|
24 |
<label>Show Frequently Questions</label>
|
1 |
<?xml version="1.0" ?>
|
2 |
<config>
|
3 |
+
<tabs>
|
4 |
+
<inic translate="label" module="faq">
|
5 |
+
<label>Inic Extensions</label>
|
6 |
+
<sort_order>150</sort_order>
|
7 |
+
</inic>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<faq_section translate="label">
|
11 |
<label>Faq</label>
|
12 |
+
<sort_order>1</sort_order>
|
13 |
<show_in_default>1</show_in_default>
|
14 |
<show_in_website>1</show_in_website>
|
15 |
<show_in_store>1</show_in_store>
|
16 |
+
<tab>inic</tab>
|
17 |
<groups>
|
18 |
<general translate="label">
|
19 |
<label>FAQ Configuration</label>
|
20 |
+
<sort_order>10</sort_order>
|
21 |
<show_in_default>1</show_in_default>
|
22 |
+
<expanded>1</expanded>
|
23 |
<fields>
|
24 |
<frequent_enable translate="label">
|
25 |
<label>Show Frequently Questions</label>
|
app/code/{local → community}/Inic/Faq/sql/faq_setup/mysql4-install-0.1.0.php
RENAMED
File without changes
|
app/code/{local/Inic/Faq/sql/faq_setup/mysql4-install-1.0.7.php → community/Inic/Faq/sql/faq_setup/mysql4-install-0.1.7.php}
RENAMED
File without changes
|
app/code/community/Inic/Faq/sql/faq_setup/mysql4-install-1.1.3.1.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FAQ for Magento
|
4 |
+
*
|
5 |
+
* @category Inic
|
6 |
+
* @package Inic_Faq
|
7 |
+
* @copyright Copyright (c) 2013 Indianic
|
8 |
+
*/
|
9 |
+
|
10 |
+
$installer = $this;
|
11 |
+
|
12 |
+
$installer->startSetup();
|
13 |
+
$installer->run("
|
14 |
+
-- DROP TABLE IF EXISTS {$this->getTable('faq/faq')};
|
15 |
+
CREATE TABLE IF NOT EXISTS {$this->getTable('faq/faq')} (
|
16 |
+
`faq_id` int(10) unsigned NOT NULL auto_increment,
|
17 |
+
`question` tinytext NOT NULL default '',
|
18 |
+
`answer` text NOT NULL default '',
|
19 |
+
`creation_time` datetime default NULL,
|
20 |
+
`update_time` datetime default NULL,
|
21 |
+
`is_active` tinyint(1) NOT NULL default '1',
|
22 |
+
`is_most_frequent` tinyint(1) NOT NULL default '1',
|
23 |
+
PRIMARY KEY (`faq_id`)
|
24 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='FAQ items' AUTO_INCREMENT=1 ;
|
25 |
+
|
26 |
+
ALTER TABLE `{$this->getTable('faq/faq')}`
|
27 |
+
MODIFY COLUMN `creation_time` DATETIME NOT NULL;
|
28 |
+
ALTER TABLE `{$this->getTable('faq/faq')}`
|
29 |
+
MODIFY COLUMN `update_time` DATETIME NOT NULL;
|
30 |
+
|
31 |
+
-- DROP TABLE IF EXISTS {$this->getTable('faq/faq_store')};
|
32 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/faq_store')}` (
|
33 |
+
`faq_id` int(10) unsigned NOT NULL,
|
34 |
+
`store_id` smallint(5) unsigned NOT NULL,
|
35 |
+
PRIMARY KEY (`faq_id`,`store_id`),
|
36 |
+
CONSTRAINT `FK_FAQ_FAQ_STORE_FAQ` FOREIGN KEY (`faq_id`) REFERENCES `{$this->getTable('faq/faq')}` (`faq_id`) ON UPDATE CASCADE ON DELETE CASCADE,
|
37 |
+
CONSTRAINT `FK_FAQ_FAQ_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
|
38 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='FAQ items to Stores';
|
39 |
+
|
40 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/category')}` (
|
41 |
+
`category_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
42 |
+
`parent_id` INT(10) UNSIGNED NULL,
|
43 |
+
`category_name` VARCHAR(255) NOT NULL,
|
44 |
+
`creation_time` DATETIME NOT NULL,
|
45 |
+
`update_time` DATETIME NOT NULL,
|
46 |
+
`is_active` TINYINT(1) NOT NULL DEFAULT 1,
|
47 |
+
PRIMARY KEY (`category_id`),
|
48 |
+
CONSTRAINT `FK_FAQ_CATEGORY_PARENT_ID` FOREIGN KEY (`parent_id`) REFERENCES `{$this->getTable('faq/category')}` (`category_id`) ON DELETE SET NULL
|
49 |
+
) ENGINE=InnoDB COMMENT='FAQ Categories';
|
50 |
+
|
51 |
+
-- DROP TABLE IF EXISTS `{$this->getTable('faq/category_item')}`;
|
52 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/category_item')}` (
|
53 |
+
`category_id` INT(10) UNSIGNED NOT NULL,
|
54 |
+
`faq_id` INT(10) UNSIGNED NOT NULL,
|
55 |
+
PRIMARY KEY (`category_id`,`faq_id`),
|
56 |
+
CONSTRAINT `FK_FAQ_CATEGORY_ITEM_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `{$this->getTable('faq/category')}` (`category_id`) ON UPDATE CASCADE ON DELETE CASCADE,
|
57 |
+
CONSTRAINT `FK_FAQ_CATEGORY_ITEM_ITEM` FOREIGN KEY (`faq_id`) REFERENCES `{$this->getTable('faq/faq')}` (`faq_id`) ON UPDATE CASCADE ON DELETE CASCADE
|
58 |
+
) ENGINE=InnoDB COMMENT='FAQ Items to Cateories';
|
59 |
+
|
60 |
+
-- DROP TABLE IF EXISTS `{$this->getTable('faq/category_store')}`;
|
61 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/category_store')}` (
|
62 |
+
`category_id` INT(10) UNSIGNED NOT NULL,
|
63 |
+
`store_id` SMALLINT(5) UNSIGNED NOT NULL,
|
64 |
+
PRIMARY KEY (`category_id`,`store_id`),
|
65 |
+
CONSTRAINT `FK_FAQ_CATEGORY_STORE_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `{$this->getTable('faq/category')}` (`category_id`) ON UPDATE CASCADE ON DELETE CASCADE,
|
66 |
+
CONSTRAINT `FK_FAQ_CATEGORY_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
|
67 |
+
) ENGINE=InnoDB COMMENT='FAQ Categories to Stores';
|
68 |
+
|
69 |
+
");
|
70 |
+
|
71 |
+
$installer->endSetup();
|
app/code/{local/Inic/Faq/sql/faq_setup/mysql4-upgrade-1.0.6-1.0.7.php → community/Inic/Faq/sql/faq_setup/mysql4-upgrade-0.1.6-0.1.7.php}
RENAMED
File without changes
|
app/code/community/Inic/Faq/sql/faq_setup/mysql4-upgrade-1.1.3-1.1.3.1.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FAQ for Magento
|
4 |
+
*
|
5 |
+
* @category Inic
|
6 |
+
* @package Inic_Faq
|
7 |
+
* @copyright Copyright (c) 2013 Indianic
|
8 |
+
*/
|
9 |
+
|
10 |
+
$installer = $this;
|
11 |
+
|
12 |
+
$installer->startSetup();
|
13 |
+
$installer->run("
|
14 |
+
-- DROP TABLE IF EXISTS {$this->getTable('faq/faq')};
|
15 |
+
CREATE TABLE IF NOT EXISTS {$this->getTable('faq/faq')} (
|
16 |
+
`faq_id` int(10) unsigned NOT NULL auto_increment,
|
17 |
+
`question` tinytext NOT NULL default '',
|
18 |
+
`answer` text NOT NULL default '',
|
19 |
+
`creation_time` datetime default NULL,
|
20 |
+
`update_time` datetime default NULL,
|
21 |
+
`is_active` tinyint(1) NOT NULL default '1',
|
22 |
+
`is_most_frequent` tinyint(1) NOT NULL default '1',
|
23 |
+
PRIMARY KEY (`faq_id`)
|
24 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='FAQ items' AUTO_INCREMENT=1 ;
|
25 |
+
|
26 |
+
ALTER TABLE `{$this->getTable('faq/faq')}`
|
27 |
+
MODIFY COLUMN `creation_time` DATETIME NOT NULL;
|
28 |
+
ALTER TABLE `{$this->getTable('faq/faq')}`
|
29 |
+
MODIFY COLUMN `update_time` DATETIME NOT NULL;
|
30 |
+
|
31 |
+
-- DROP TABLE IF EXISTS {$this->getTable('faq/faq_store')};
|
32 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/faq_store')}` (
|
33 |
+
`faq_id` int(10) unsigned NOT NULL,
|
34 |
+
`store_id` smallint(5) unsigned NOT NULL,
|
35 |
+
PRIMARY KEY (`faq_id`,`store_id`),
|
36 |
+
CONSTRAINT `FK_FAQ_FAQ_STORE_FAQ` FOREIGN KEY (`faq_id`) REFERENCES `{$this->getTable('faq/faq')}` (`faq_id`) ON UPDATE CASCADE ON DELETE CASCADE,
|
37 |
+
CONSTRAINT `FK_FAQ_FAQ_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
|
38 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='FAQ items to Stores';
|
39 |
+
|
40 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/category')}` (
|
41 |
+
`category_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
42 |
+
`parent_id` INT(10) UNSIGNED NULL,
|
43 |
+
`category_name` VARCHAR(255) NOT NULL,
|
44 |
+
`creation_time` DATETIME NOT NULL,
|
45 |
+
`update_time` DATETIME NOT NULL,
|
46 |
+
`is_active` TINYINT(1) NOT NULL DEFAULT 1,
|
47 |
+
PRIMARY KEY (`category_id`),
|
48 |
+
CONSTRAINT `FK_FAQ_CATEGORY_PARENT_ID` FOREIGN KEY (`parent_id`) REFERENCES `{$this->getTable('faq/category')}` (`category_id`) ON DELETE SET NULL
|
49 |
+
) ENGINE=InnoDB COMMENT='FAQ Categories';
|
50 |
+
|
51 |
+
-- DROP TABLE IF EXISTS `{$this->getTable('faq/category_item')}`;
|
52 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/category_item')}` (
|
53 |
+
`category_id` INT(10) UNSIGNED NOT NULL,
|
54 |
+
`faq_id` INT(10) UNSIGNED NOT NULL,
|
55 |
+
PRIMARY KEY (`category_id`,`faq_id`),
|
56 |
+
CONSTRAINT `FK_FAQ_CATEGORY_ITEM_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `{$this->getTable('faq/category')}` (`category_id`) ON UPDATE CASCADE ON DELETE CASCADE,
|
57 |
+
CONSTRAINT `FK_FAQ_CATEGORY_ITEM_ITEM` FOREIGN KEY (`faq_id`) REFERENCES `{$this->getTable('faq/faq')}` (`faq_id`) ON UPDATE CASCADE ON DELETE CASCADE
|
58 |
+
) ENGINE=InnoDB COMMENT='FAQ Items to Cateories';
|
59 |
+
|
60 |
+
-- DROP TABLE IF EXISTS `{$this->getTable('faq/category_store')}`;
|
61 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('faq/category_store')}` (
|
62 |
+
`category_id` INT(10) UNSIGNED NOT NULL,
|
63 |
+
`store_id` SMALLINT(5) UNSIGNED NOT NULL,
|
64 |
+
PRIMARY KEY (`category_id`,`store_id`),
|
65 |
+
CONSTRAINT `FK_FAQ_CATEGORY_STORE_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `{$this->getTable('faq/category')}` (`category_id`) ON UPDATE CASCADE ON DELETE CASCADE,
|
66 |
+
CONSTRAINT `FK_FAQ_CATEGORY_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
|
67 |
+
) ENGINE=InnoDB COMMENT='FAQ Categories to Stores';
|
68 |
+
|
69 |
+
");
|
70 |
+
|
71 |
+
$installer->endSetup();
|
app/code/local/Inic/Faq/Block/Adminhtml/Form_/Edit/Renderer/Label.php
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Inic_Faq_Block_Adminhtml_Form_Edit_Renderer_Label extends Varien_Data_Form_Element_Multiselect
|
3 |
-
{
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Retrieve Element HTML fragment
|
7 |
-
*
|
8 |
-
* @return string
|
9 |
-
*/
|
10 |
-
public function getElementHtml()
|
11 |
-
{
|
12 |
-
//print_r($this->getCheckboxLabel());exit;
|
13 |
-
$html ="hi";
|
14 |
-
return $html;
|
15 |
-
}
|
16 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Inic/Faq/etc/adminhtml.xml
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<config>
|
3 |
-
<menu>
|
4 |
-
<cms>
|
5 |
-
<children>
|
6 |
-
<faq translate="title" module="faq">
|
7 |
-
<title>FAQ</title>
|
8 |
-
<sort_order>60</sort_order>
|
9 |
-
<children>
|
10 |
-
<item translate="title" module="faq">
|
11 |
-
<title>Manage Items</title>
|
12 |
-
<action>adminhtml/faq</action>
|
13 |
-
</item>
|
14 |
-
<category translate="title" module="faq">
|
15 |
-
<title>Manage Categories</title>
|
16 |
-
<action>adminhtml/faq_category</action>
|
17 |
-
</category>
|
18 |
-
</children>
|
19 |
-
</faq>
|
20 |
-
</children>
|
21 |
-
</cms>
|
22 |
-
</menu>
|
23 |
-
<!--
|
24 |
-
<acl>
|
25 |
-
<resources>
|
26 |
-
<admin>
|
27 |
-
<children>
|
28 |
-
<cms>
|
29 |
-
<children>
|
30 |
-
<faq translate="title" module="inic_faq">
|
31 |
-
<title>Faq</title>
|
32 |
-
<sort_order>50</sort_order>
|
33 |
-
</faq>
|
34 |
-
</children>
|
35 |
-
</cms>
|
36 |
-
</children>
|
37 |
-
</admin>
|
38 |
-
</resources>
|
39 |
-
</acl>
|
40 |
-
-->
|
41 |
-
|
42 |
-
|
43 |
-
<acl>
|
44 |
-
<resources>
|
45 |
-
<admin>
|
46 |
-
<children>
|
47 |
-
<system>
|
48 |
-
<children>
|
49 |
-
<config>
|
50 |
-
<children>
|
51 |
-
<faq_section translate="title">
|
52 |
-
<title>FAQ</title>
|
53 |
-
<sort_order>200</sort_order>
|
54 |
-
</faq_section>
|
55 |
-
</children>
|
56 |
-
</config>
|
57 |
-
</children>
|
58 |
-
</system>
|
59 |
-
</children>
|
60 |
-
</admin>
|
61 |
-
</resources>
|
62 |
-
</acl>
|
63 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/{base/default/layout → default/default/layout/inic}/faq.xml
RENAMED
@@ -33,57 +33,57 @@
|
|
33 |
</default>
|
34 |
<faq_index_index>
|
35 |
<reference name="head">
|
36 |
-
<action method="addItem"><type>skin_css</type><name>css/faq/faq.css</name><params/></action>
|
37 |
-
<action method="addItem"><type>skin_js</type><name>js/faq/faq.js</name><params/></action>
|
38 |
</reference>
|
39 |
<reference name="root">
|
40 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
41 |
</reference>
|
42 |
<reference name="content">
|
43 |
-
<block type="faq/frontend_list" name="faq_list" template="faq/list.phtml">
|
44 |
-
<block type="faq/frontend_faqSearch_search" name="search_form" as="search_form" template="faq/search/search.phtml"/>
|
45 |
</block>
|
46 |
</reference>
|
47 |
</faq_index_index>
|
48 |
|
49 |
<faq_index_show>
|
50 |
<reference name="head">
|
51 |
-
<action method="addItem"><type>skin_css</type><name>css/faq/faq.css</name><params/></action>
|
52 |
-
<action method="addItem"><type>skin_js</type><name>js/faq/faq.js</name><params/></action>
|
53 |
</reference>
|
54 |
<reference name="root">
|
55 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
56 |
</reference>
|
57 |
<reference name="content">
|
58 |
-
<block type="faq/frontend_detail" name="faq_detail" template="faq/detail.phtml"/>
|
59 |
</reference>
|
60 |
</faq_index_show>
|
61 |
|
62 |
<faq_index_categoryshow>
|
63 |
<reference name="head">
|
64 |
-
<action method="addItem"><type>skin_css</type><name>css/faq/faq.css</name><params/></action>
|
65 |
-
<action method="addItem"><type>skin_js</type><name>js/faq/faq.js</name><params/></action>
|
66 |
</reference>
|
67 |
<reference name="root">
|
68 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
69 |
</reference>
|
70 |
<reference name="content">
|
71 |
-
<block type="faq/frontend_category" name="faq_category" template="faq/categoty.phtml">
|
72 |
-
<block type="faq/frontend_faqSearch_search" name="cat_search_form" as="cat_search_form" template="faq/search/search.phtml"/>
|
73 |
</block>
|
74 |
</reference>
|
75 |
</faq_index_categoryshow>
|
76 |
|
77 |
<faq_index_result>
|
78 |
<reference name="head">
|
79 |
-
<action method="addItem"><type>skin_css</type><name>css/faq/faq.css</name><params/></action>
|
80 |
-
<action method="addItem"><type>skin_js</type><name>js/faq/faq.js</name><params/></action>
|
81 |
</reference>
|
82 |
<reference name="root">
|
83 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
84 |
</reference>
|
85 |
<reference name="content">
|
86 |
-
<block type="faq/frontend_faqSearch_result" name="faq_search_result" template="faq/search/result.phtml"/>
|
87 |
</reference>
|
88 |
</faq_index_result>
|
89 |
</layout>
|
33 |
</default>
|
34 |
<faq_index_index>
|
35 |
<reference name="head">
|
36 |
+
<action method="addItem"><type>skin_css</type><name>css/inic/faq/faq.css</name><params/></action>
|
37 |
+
<action method="addItem"><type>skin_js</type><name>js/inic/faq/faq.js</name><params/></action>
|
38 |
</reference>
|
39 |
<reference name="root">
|
40 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
41 |
</reference>
|
42 |
<reference name="content">
|
43 |
+
<block type="faq/frontend_list" name="faq_list" template="inic/faq/list.phtml">
|
44 |
+
<block type="faq/frontend_faqSearch_search" name="search_form" as="search_form" template="inic/faq/search/search.phtml"/>
|
45 |
</block>
|
46 |
</reference>
|
47 |
</faq_index_index>
|
48 |
|
49 |
<faq_index_show>
|
50 |
<reference name="head">
|
51 |
+
<action method="addItem"><type>skin_css</type><name>css/inic/faq/faq.css</name><params/></action>
|
52 |
+
<action method="addItem"><type>skin_js</type><name>js/inic/faq/faq.js</name><params/></action>
|
53 |
</reference>
|
54 |
<reference name="root">
|
55 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
56 |
</reference>
|
57 |
<reference name="content">
|
58 |
+
<block type="faq/frontend_detail" name="faq_detail" template="inic/faq/detail.phtml"/>
|
59 |
</reference>
|
60 |
</faq_index_show>
|
61 |
|
62 |
<faq_index_categoryshow>
|
63 |
<reference name="head">
|
64 |
+
<action method="addItem"><type>skin_css</type><name>css/inic/faq/faq.css</name><params/></action>
|
65 |
+
<action method="addItem"><type>skin_js</type><name>js/inic/faq/faq.js</name><params/></action>
|
66 |
</reference>
|
67 |
<reference name="root">
|
68 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
69 |
</reference>
|
70 |
<reference name="content">
|
71 |
+
<block type="faq/frontend_category" name="faq_category" template="inic/faq/categoty.phtml">
|
72 |
+
<block type="faq/frontend_faqSearch_search" name="cat_search_form" as="cat_search_form" template="inic/faq/search/search.phtml"/>
|
73 |
</block>
|
74 |
</reference>
|
75 |
</faq_index_categoryshow>
|
76 |
|
77 |
<faq_index_result>
|
78 |
<reference name="head">
|
79 |
+
<action method="addItem"><type>skin_css</type><name>css/inic/faq/faq.css</name><params/></action>
|
80 |
+
<action method="addItem"><type>skin_js</type><name>js/inic/faq/faq.js</name><params/></action>
|
81 |
</reference>
|
82 |
<reference name="root">
|
83 |
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
84 |
</reference>
|
85 |
<reference name="content">
|
86 |
+
<block type="inic/faq/frontend_faqSearch_result" name="faq_search_result" template="inic/faq/search/result.phtml"/>
|
87 |
</reference>
|
88 |
</faq_index_result>
|
89 |
</layout>
|
app/design/frontend/{base/default/template → default/default/template/inic}/faq/categoty.phtml
RENAMED
@@ -22,7 +22,7 @@
|
|
22 |
<tr class="faq-answer" style="display:none;">
|
23 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
24 |
<td>
|
25 |
-
<?php echo $item->getAnswer(); ?>
|
26 |
</td>
|
27 |
</tr>
|
28 |
</tbody>
|
@@ -53,7 +53,7 @@
|
|
53 |
<tr class="faq-answer" style="display:none;">
|
54 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
55 |
<td>
|
56 |
-
<?php echo $item->getAnswer(); ?>
|
57 |
</td>
|
58 |
</tr>
|
59 |
</tbody>
|
22 |
<tr class="faq-answer" style="display:none;">
|
23 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
24 |
<td>
|
25 |
+
<?php echo Mage::helper('faq')->filter($item->getAnswer()); ?>
|
26 |
</td>
|
27 |
</tr>
|
28 |
</tbody>
|
53 |
<tr class="faq-answer" style="display:none;">
|
54 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
55 |
<td>
|
56 |
+
<?php echo Mage::helper('faq')->filter($item->getAnswer()); ?>
|
57 |
</td>
|
58 |
</tr>
|
59 |
</tbody>
|
app/design/frontend/{base/default/template → default/default/template/inic}/faq/detail.phtml
RENAMED
@@ -10,7 +10,7 @@
|
|
10 |
<?php echo Mage :: getModel('core/date')->date('d.m.Y', $_faq->getPublicationTime()); ?>
|
11 |
</p>
|
12 |
|
13 |
-
<?php $_content = $_faq->getAnswer(); ?>
|
14 |
<?php if (!empty($_content)): ?>
|
15 |
<div class="faq-content">
|
16 |
<?php foreach (explode("\n", $_content) as $paragraph): ?>
|
10 |
<?php echo Mage :: getModel('core/date')->date('d.m.Y', $_faq->getPublicationTime()); ?>
|
11 |
</p>
|
12 |
|
13 |
+
<?php $_content = Mage::helper('faq')->filter($_faq->getAnswer()); ?>
|
14 |
<?php if (!empty($_content)): ?>
|
15 |
<div class="faq-content">
|
16 |
<?php foreach (explode("\n", $_content) as $paragraph): ?>
|
app/design/frontend/{base/default/template → default/default/template/inic}/faq/list.phtml
RENAMED
@@ -47,7 +47,7 @@
|
|
47 |
<tr class="faq-answer" style="display:none;">
|
48 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
49 |
<td>
|
50 |
-
<?php echo $faqItem->getAnswer(); ?>
|
51 |
</td>
|
52 |
</tr>
|
53 |
</tbody>
|
@@ -82,7 +82,7 @@
|
|
82 |
<tr class="faq-answer" style="display:none;">
|
83 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
84 |
<td>
|
85 |
-
<?php echo $item->getAnswer(); ?>
|
86 |
</td>
|
87 |
</tr>
|
88 |
</tbody>
|
@@ -112,7 +112,7 @@
|
|
112 |
<tr class="faq-answer" style="display:none;">
|
113 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
114 |
<td>
|
115 |
-
<?php echo $item->getAnswer(); ?>
|
116 |
</td>
|
117 |
</tr>
|
118 |
</tbody>
|
@@ -143,7 +143,7 @@
|
|
143 |
</a>
|
144 |
</li>
|
145 |
<li>
|
146 |
-
<?php echo $faqItem->getAnswer(); ?>
|
147 |
</li>
|
148 |
<?php endforeach; ?>
|
149 |
</ul>
|
47 |
<tr class="faq-answer" style="display:none;">
|
48 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
49 |
<td>
|
50 |
+
<?php echo Mage::helper('faq')->filter($faqItem->getAnswer()); ?>
|
51 |
</td>
|
52 |
</tr>
|
53 |
</tbody>
|
82 |
<tr class="faq-answer" style="display:none;">
|
83 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
84 |
<td>
|
85 |
+
<?php echo Mage::helper('faq')->filter($item->getAnswer()); ?>
|
86 |
</td>
|
87 |
</tr>
|
88 |
</tbody>
|
112 |
<tr class="faq-answer" style="display:none;">
|
113 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
114 |
<td>
|
115 |
+
<?php echo Mage::helper('faq')->filter($item->getAnswer()); ?>
|
116 |
</td>
|
117 |
</tr>
|
118 |
</tbody>
|
143 |
</a>
|
144 |
</li>
|
145 |
<li>
|
146 |
+
<?php echo Mage::helper('faq')->filter($faqItem->getAnswer()); ?>
|
147 |
</li>
|
148 |
<?php endforeach; ?>
|
149 |
</ul>
|
app/design/frontend/{base/default/template → default/default/template/inic}/faq/search/result.phtml
RENAMED
@@ -33,7 +33,7 @@
|
|
33 |
<tr class="faq-answer" style="display:none;">
|
34 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
35 |
<td>
|
36 |
-
<?php echo $item->getAnswer(); ?>
|
37 |
</td>
|
38 |
</tr>
|
39 |
</tbody>
|
33 |
<tr class="faq-answer" style="display:none;">
|
34 |
<td><span class="label success"><?php echo $this->__('A') ?></span></td>
|
35 |
<td>
|
36 |
+
<?php echo Mage::helper('faq')->filter($item->getAnswer()); ?>
|
37 |
</td>
|
38 |
</tr>
|
39 |
</tbody>
|
app/design/frontend/{base/default/template → default/default/template/inic}/faq/search/search.phtml
RENAMED
File without changes
|
app/etc/modules/Inic_Faq.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<modules>
|
4 |
<Inic_Faq>
|
5 |
<active>true</active>
|
6 |
-
<codePool>
|
7 |
</Inic_Faq>
|
8 |
</modules>
|
9 |
-
</config>
|
3 |
<modules>
|
4 |
<Inic_Faq>
|
5 |
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
</Inic_Faq>
|
8 |
</modules>
|
9 |
+
</config>
|
app/locale/en_US/Inic_Faq.csv
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Frequently Asked Questions,Frequently Asked Questions
|
2 |
+
Most Frequently Asked Questions,Most Frequently Asked Questions
|
3 |
+
FAQ Topics,FAQ Topics
|
4 |
+
There are no FAQ items at the moment.,There are no FAQ items at the moment.
|
5 |
+
Back to the FAQ overview,Back to the FAQ overview
|
6 |
+
The requested FAQ item could not be found!,The requested FAQ item could not be found!
|
7 |
+
Error,Error
|
8 |
+
Expand All,Expand All
|
9 |
+
The requested FAQ Category item could not be found!,The requested FAQ Category item could not be found!
|
10 |
+
Search FAQ,Search FAQ
|
11 |
+
GO,GO
|
12 |
+
"Search Result For - ""%s"" from category ""%s""","Search Result For - ""%s"" from category ""%s"""
|
13 |
+
"Search Result For : ""%s""","Search Result For : ""%s"""
|
14 |
+
There is no FAQ item found for search string!,There is no FAQ item found for search string!
|
15 |
+
Back,Back
|
16 |
+
Faq Item is not active,Faq Item is not active
|
17 |
+
Catagory is not active,Catagory is not active
|
18 |
+
Please Select Category,Please Select Category
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>inic_faq</name>
|
4 |
-
<version>1.1.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -11,12 +11,17 @@
|
|
11 |
- Allow to set the gird or list view on frontend.
|
12 |
- You can set the questions as the most frequently ask questions.
|
13 |
- Have configuration settings that allow to show/hide frequently ask questions.</description>
|
14 |
-
<notes>-
|
15 |
-
-
|
|
|
|
|
|
|
|
|
|
|
16 |
<authors><author><name>Enquiry Indianic</name><user>indianic</user><email>enquiry@indianic.com</email></author></authors>
|
17 |
-
<date>2013-
|
18 |
-
<time>
|
19 |
-
<contents><target name="
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>inic_faq</name>
|
4 |
+
<version>1.1.3.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
11 |
- Allow to set the gird or list view on frontend.
|
12 |
- You can set the questions as the most frequently ask questions.
|
13 |
- Have configuration settings that allow to show/hide frequently ask questions.</description>
|
14 |
+
<notes>- Moved the extension to the community folder.
|
15 |
+
- Updated the database design. Updated the table name with prefix inc_advance.
|
16 |
+
- Solved the acl problem.
|
17 |
+
- Added sorting, Filter , Pagination , Mass update functionality to both category and item grid.
|
18 |
+
- Updated the Item grid with category display.
|
19 |
+
- Assign category to the item on the basis of store-view selected.
|
20 |
+
- Solve the wysiwyg editor image upload issue.</notes>
|
21 |
<authors><author><name>Enquiry Indianic</name><user>indianic</user><email>enquiry@indianic.com</email></author></authors>
|
22 |
+
<date>2013-11-07</date>
|
23 |
+
<time>12:33:55</time>
|
24 |
+
<contents><target name="magecommunity"><dir name="Inic"><dir name="Faq"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="1565463e9373b4810beeb1f3ebf85ad4"/><dir name="Tab"><file name="Main.php" hash="d323226467086408db62b8cf1ab9deb2"/></dir><file name="Tabs.php" hash="f628c7c1c5a3262eba24ef6371789c9f"/></dir><file name="Edit.php" hash="43184dbc88660cf366e65daf88f7ad84"/><file name="Grid.php" hash="d882f5108cb2ec6da37d50c3d13303e0"/></dir><file name="Category.php" hash="6e530cf0006701fea820760eb05507b6"/><dir name="Item"><dir name="Edit"><file name="Form.php" hash="a28340f01594898277019fa465ab25c0"/><dir name="Tab"><file name="Main.php" hash="d996f8cb90d5a968fed8f485df0bedce"/></dir><file name="Tabs.php" hash="d16c4ed9085b1621e57b62b351c40fbe"/></dir><file name="Edit.php" hash="00074f16986ac40b52091c88358c627b"/><file name="Grid.php" hash="c7752450df739ed1b3de2c00ef3cce83"/></dir><file name="Item.php" hash="0ca3cce6235d990af1934f034194ae78"/><dir name="Widget"><dir name="Form"><dir name="Element"><file name="Selectdependence.php" hash="f653a53acb79dda0cb0887b3bc0682c8"/></dir></dir><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Category.php" hash="afa74e3f66e85e2b9144b944e34f8f70"/></dir></dir></dir></dir></dir><dir name="Frontend"><file name="Category.php" hash="65f740c1eebb588feccc25bf3c645fe3"/><file name="Detail.php" hash="578280e4e25723fa66346e1f4ec3950a"/><dir name="FaqSearch"><file name="Result.php" hash="18e9ad041f505428e5f1becccd63163c"/><file name="Search.php" hash="847fc5080ed8efacfd49ef9ccd2cf5bf"/></dir><file name="List.php" hash="1ec290553f7e77ce531a7d5656aa7952"/></dir></dir><dir name="Helper"><file name="Data.php" hash="47e9cb00584debcb268953b60492a4c3"/></dir><dir name="Model"><file name="Category.php" hash="76e90b0d41f2b1072bc7b218ad93703b"/><file name="Faq.php" hash="a343d1e09850bab571617089ef86fc14"/><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="5ff80d5d0266a1326235e5c1a03e1e19"/></dir><file name="Category.php" hash="da3eb57d1a1af165a270740e583a5256"/><dir name="Faq"><file name="Collection.php" hash="6d5e7eb2d9e0fca772072038b2f57a94"/></dir><file name="Faq.php" hash="998d279ff922e23dc6991a539d9fdf2c"/></dir><file name="Status.php" hash="fdb82086dda94ef9d17e547e832e0885"/><dir name="System"><dir name="Config"><dir name="Source"><file name="View.php" hash="b72c180084212d870be4dd2c840ab1c7"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Faq"><file name="CategoryController.php" hash="33925369786290190db21f3b43f5f192"/></dir><file name="FaqController.php" hash="e23cab26472fc4ca5f7c75db41c571ed"/></dir><file name="IndexController.php" hash="f8f0724405086edb37e5b82134cc232b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="31410f159ae4caa4e0ad08fa8506a851"/><file name="config.xml" hash="44cd849f6755a8d86079c596b98ac587"/><file name="system.xml" hash="cc68db4128b4001254f2df5c126b11de"/></dir><dir name="sql"><dir name="faq_setup"><file name="mysql4-install-0.1.0.php" hash="e40ffc8498343af1808bc37d060a1bde"/><file name="mysql4-install-0.1.7.php" hash="d906165a2d976a6b269995ca9d51d221"/><file name="mysql4-install-1.1.3.1.php" hash="9d310e289ae1d94fb17a1031563aeb54"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="31c535beec84b59a718aac6de0d0eb15"/><file name="mysql4-upgrade-1.1.3-1.1.3.1.php" hash="9d310e289ae1d94fb17a1031563aeb54"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Inic_Faq.xml" hash="1e84968e10409f9541e14b36c510f699"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="inic"><dir name="faq"><file name="faq.css" hash="b15fd1af1349e3bc3e4d8645330b1132"/></dir></dir></dir><dir name="images"><dir name="inic"><dir name="faq"><file name="faq_search_bar.png" hash="2f9360b3aaab98850694b7e4bb795179"/><file name="minus.png" hash="568c3964d6361fc065f61c9a7dd1cfde"/><file name="plus.png" hash="06a20e393a6aac4ae0bfb59b453f7a18"/><file name="search.gif" hash="798952b8b1ddd7c2f8d3d1ba11a1599c"/></dir></dir></dir><dir name="js"><dir name="inic"><dir name="faq"><file name="faq.js" hash="0b11f401ff33080a787aa5d5c3c63ce1"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="inic"><dir name="faq"><file name="multiSelectUpdater.js" hash="7ce0a1f972973b5bfcba2b461c5aa17c"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="inic"><file name="faq.xml" hash="6e54ae0ee04a46f937281e26ba7992c2"/></dir></dir><dir name="template"><dir name="inic"><dir name="faq"><file name="categoty.phtml" hash="f3d74e480ad38bb475e395df0441c382"/><file name="detail.phtml" hash="9d475dcbd446a777832adacb3dc20d2b"/><file name="list.phtml" hash="ffaa2434620954b2a431f6214ee3651c"/><dir name="search"><file name="result.phtml" hash="569097450254d6c0497da526ccdcb5a5"/><file name="search.phtml" hash="33ecd97803bff7a14e93e6a10a4ec026"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Inic_Faq.csv" hash="8db595c23035dbfdaa529054536b2b1a"/></dir></target></contents>
|
25 |
<compatible/>
|
26 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
27 |
</package>
|
skin/adminhtml/default/default/inic/faq/multiSelectUpdater.js
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the EULA that is bundled with this package in the file LICENSE.txt.
|
6 |
+
* It is also available through the world-wide-web at this URL:
|
7 |
+
* http://www.magesupport.com/license/
|
8 |
+
*
|
9 |
+
* @package Inic_Faq
|
10 |
+
* @copyright Copyright (c) 2013 Inic
|
11 |
+
* @license http://www.magesupport.com/license/
|
12 |
+
*/
|
13 |
+
SelectAutoUpdater = Class.create();
|
14 |
+
SelectAutoUpdater.prototype = {
|
15 |
+
initialize: function (firstSelect, secondSelect, selectFirstMessage, noValuesMessage, values, selected)
|
16 |
+
{
|
17 |
+
this.first = $(firstSelect);
|
18 |
+
this.second = $(secondSelect);
|
19 |
+
this.message = selectFirstMessage;
|
20 |
+
this.values = values;
|
21 |
+
this.noMessage = noValuesMessage;
|
22 |
+
this.selected = selected;
|
23 |
+
|
24 |
+
this.update();
|
25 |
+
|
26 |
+
Event.observe(this.first, 'change', this.update.bind(this));
|
27 |
+
},
|
28 |
+
|
29 |
+
update: function()
|
30 |
+
{
|
31 |
+
this.second.length = 0;
|
32 |
+
this.second.value = '';
|
33 |
+
|
34 |
+
if (this.first.value && this.values[this.first.value]) {
|
35 |
+
for (optionValue in this.values[this.first.value]) {
|
36 |
+
optionTitle = this.values[this.first.value][optionValue];
|
37 |
+
|
38 |
+
this.addOption(this.second, optionValue, optionTitle);
|
39 |
+
}
|
40 |
+
this.second.disabled = false;
|
41 |
+
} else if (this.first.value && !this.values[this.first.value]) {
|
42 |
+
this.addOption(this.second, '', this.noMessage);
|
43 |
+
} else {
|
44 |
+
this.addOption(this.second, '', this.message);
|
45 |
+
this.second.disabled = true;
|
46 |
+
}
|
47 |
+
},
|
48 |
+
|
49 |
+
addOption: function(select, value, text)
|
50 |
+
{
|
51 |
+
option = document.createElement('OPTION');
|
52 |
+
option.value = value;
|
53 |
+
option.text = text;
|
54 |
+
|
55 |
+
//if (this.selected && option.value == this.selected) {
|
56 |
+
if (this.selected && (this.selected).include(optionValue)) {
|
57 |
+
option.selected = true;
|
58 |
+
//this.selected = false;
|
59 |
+
}
|
60 |
+
|
61 |
+
if (select.options.add) {
|
62 |
+
select.options.add(option);
|
63 |
+
} else {
|
64 |
+
select.appendChild(option);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
skin/frontend/{base/default/css → default/default/css/inic}/faq/faq.css
RENAMED
@@ -1,5 +1,4 @@
|
|
1 |
/**
|
2 |
-
* MageSupport.com
|
3 |
*
|
4 |
* NOTICE OF LICENSE
|
5 |
*
|
@@ -100,13 +99,13 @@ color: #2F2F2F;
|
|
100 |
.expand, .collaps{
|
101 |
float:right;
|
102 |
}
|
103 |
-
.expand a{background: url("
|
104 |
|
105 |
-
.collaps a{background: url("
|
106 |
|
107 |
/*Search Area*/
|
108 |
.faq #searchform {
|
109 |
-
background: url("
|
110 |
height: 21px;
|
111 |
margin: 30px;
|
112 |
padding: 10px 10px 10px 30px;
|
@@ -125,7 +124,7 @@ color: #2F2F2F;
|
|
125 |
|
126 |
|
127 |
.faq #searchform .btnSearch {
|
128 |
-
background: url("
|
129 |
border: 0 none;
|
130 |
display: inline;
|
131 |
float: left;
|
1 |
/**
|
|
|
2 |
*
|
3 |
* NOTICE OF LICENSE
|
4 |
*
|
99 |
.expand, .collaps{
|
100 |
float:right;
|
101 |
}
|
102 |
+
.expand a{background: url("../../../images/inic/faq/plus.png") no-repeat left center; padding-left:20px; display:block;}
|
103 |
|
104 |
+
.collaps a{background: url("../../../images/inic/faq/minus.png") no-repeat left center; padding-left:20px; display:block;}
|
105 |
|
106 |
/*Search Area*/
|
107 |
.faq #searchform {
|
108 |
+
background: url("../../../images/inic/faq/faq_search_bar.png") no-repeat scroll left top #F5F5F5;
|
109 |
height: 21px;
|
110 |
margin: 30px;
|
111 |
padding: 10px 10px 10px 30px;
|
124 |
|
125 |
|
126 |
.faq #searchform .btnSearch {
|
127 |
+
background: url("../../../images/inic/faq/search.gif") no-repeat scroll left top transparent;
|
128 |
border: 0 none;
|
129 |
display: inline;
|
130 |
float: left;
|
skin/frontend/{base/default/images → default/default/images/inic}/faq/faq_search_bar.png
RENAMED
File without changes
|
skin/frontend/{base/default/images → default/default/images/inic}/faq/minus.png
RENAMED
File without changes
|
skin/frontend/{base/default/images → default/default/images/inic}/faq/plus.png
RENAMED
File without changes
|
skin/frontend/{base/default/images → default/default/images/inic}/faq/search.gif
RENAMED
File without changes
|
skin/frontend/{base/default/js → default/default/js/inic}/faq/faq.js
RENAMED
@@ -1,26 +1,14 @@
|
|
1 |
/**
|
2 |
-
* Magento
|
3 |
*
|
4 |
* NOTICE OF LICENSE
|
5 |
*
|
6 |
-
* This source file is subject to the
|
7 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
8 |
* It is also available through the world-wide-web at this URL:
|
9 |
-
* http://
|
10 |
-
*
|
11 |
-
*
|
12 |
-
*
|
13 |
-
*
|
14 |
-
* DISCLAIMER
|
15 |
-
*
|
16 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
17 |
-
* versions in the future. If you wish to customize Magento for your
|
18 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
19 |
-
*
|
20 |
-
* @category design
|
21 |
-
* @package base_default
|
22 |
-
* @copyright Copyright (c) 2013 Inic
|
23 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
24 |
*/
|
25 |
function setAllQuesTr(){
|
26 |
var parent_detail = $$(".faq-grid-list");
|
1 |
/**
|
|
|
2 |
*
|
3 |
* NOTICE OF LICENSE
|
4 |
*
|
5 |
+
* This source file is subject to the EULA that is bundled with this package in the file LICENSE.txt.
|
|
|
6 |
* It is also available through the world-wide-web at this URL:
|
7 |
+
* http://www.magesupport.com/license/
|
8 |
+
*
|
9 |
+
* @package Inic_Faq
|
10 |
+
* @copyright Copyright (c) 2013 Inic
|
11 |
+
* @license http://www.magesupport.com/license/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
function setAllQuesTr(){
|
14 |
var parent_detail = $$(".faq-grid-list");
|