inic_faq - Version 1.1.3

Version Notes

- Solved the search functionality issue for the Ver-1.6
- Fixed minor bugs.

Download this release

Release Info

Developer indianic
Extension inic_faq
Version 1.1.3
Comparing to
See all releases


Code changes from version 1.1.2 to 1.1.3

app/code/local/Inic/Faq/Block/Frontend/FaqSearch/Result.php CHANGED
@@ -41,7 +41,7 @@ class Inic_Faq_Block_Frontend_FaqSearch_Result extends Mage_Core_Block_Template
41
  $category = Mage :: getModel('faq/category')->load($id);
42
  $this->_search=$category->getItemCollection()->addIsActiveFilter()->addStoreFilter(Mage::app()->getStore());
43
  }
44
- $this->_search=$this->_search->addFieldToFilter(array('question','answer'),array(array('question','like' => '%'.$keyword.'%'), array('answer', 'like' => '%'.$keyword.'%')));
45
  }
46
  return $this->_search;
47
  }
41
  $category = Mage :: getModel('faq/category')->load($id);
42
  $this->_search=$category->getItemCollection()->addIsActiveFilter()->addStoreFilter(Mage::app()->getStore());
43
  }
44
+ $this->_search->getSelect()->where("(question LIKE '%".$keyword."%') OR (answer LIKE '%".$keyword."%')");
45
  }
46
  return $this->_search;
47
  }
app/code/local/Inic/Faq/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Inic_Faq>
5
- <version>1.1.2</version>
6
  </Inic_Faq>
7
  </modules>
8
 
@@ -68,19 +68,19 @@
68
  <class>Inic_Faq_Model_Mysql4</class>
69
  <entities>
70
  <category>
71
- <table>faq_category</table>
72
  </category>
73
  <category_item>
74
- <table>faq_category_item</table>
75
  </category_item>
76
  <category_store>
77
- <table>faq_category_store</table>
78
  </category_store>
79
  <faq>
80
- <table>faq</table>
81
  </faq>
82
  <faq_store>
83
- <table>faq_store</table>
84
  </faq_store>
85
  </entities>
86
  </faq_mysql4>
2
  <config>
3
  <modules>
4
  <Inic_Faq>
5
+ <version>1.1.3</version>
6
  </Inic_Faq>
7
  </modules>
8
 
68
  <class>Inic_Faq_Model_Mysql4</class>
69
  <entities>
70
  <category>
71
+ <table>advance_faq_category</table>
72
  </category>
73
  <category_item>
74
+ <table>advance_faq_category_item</table>
75
  </category_item>
76
  <category_store>
77
+ <table>advance_faq_category_store</table>
78
  </category_store>
79
  <faq>
80
+ <table>advance_faq</table>
81
  </faq>
82
  <faq_store>
83
+ <table>advance_faq_store</table>
84
  </faq_store>
85
  </entities>
86
  </faq_mysql4>
app/design/frontend/base/default/template/faq/list(2).phtml DELETED
@@ -1,94 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-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 design_default
22
- * @package Inic
23
- * @copyright Copyright (c) 2013 Indianic
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- /* @var $this Inic_Faq_Block_Frontend_List */
27
- ?>
28
- <div class="page-title">
29
- <h1><?php echo $this->__('Frequently asked questions'); ?></h1>
30
- </div>
31
-
32
- <?php if ($this->hasFaq()): ?>
33
- <?php if($this->hasFrequent()): ?>
34
- <h2><?php echo $this->__('Most Frequently Asked Questions'); ?></h2>
35
- <dl class="faq-items">
36
- <?php foreach ($this->getFrequentFaqCollection() as $faqItem): ?>
37
- <dt>
38
- <a href="#faq-item-<?php echo $faqItem->getId() ?>">
39
- <?php echo $this->htmlEscape($faqItem->getQuestion()) ?>
40
- </a>
41
- </dt>
42
- <dd>
43
- <?php echo $faqItem->getAnswer(); ?>
44
- </dd>
45
- <?php endforeach; ?>
46
- </dl>
47
- <?php endif; ?>
48
-
49
-
50
- <h2><?php echo $this->__('Questions'); ?></h2>
51
- <?php if ($this->getCategoryCollection()) : ?>
52
- <dl class="faq-list">
53
- <?php foreach ($this->getCategoryCollection() as $category) : ?>
54
- <dt><b><?php echo $this->htmlEscape($category->getName()); ?></b></dt>
55
- <dd>
56
- <ul class="faq-list">
57
- <?php foreach ($this->getItemCollectionByCategory($category) as $item) : ?>
58
- <li>
59
- <a href="#faq-item-<?php echo $item->getId() ?>">
60
- <?php echo $this->htmlEscape($item->getQuestion()); ?>
61
- </a>
62
- </li>
63
- <li>
64
- <?php echo $item->getAnswer(); ?>
65
- </li>
66
- <?php endforeach; ?>
67
- <?php $collectionCount=$this->getItemCollectionByCategoryCount($category); ?>
68
- <?php if($collectionCount): ?>
69
- <li>
70
- <a href="<?php echo $this->getCategoryUrl($category) ?>" style="float:right;"><?php echo $this->__('more'); ?></a>
71
- </li>
72
- <?php endif; ?>
73
- </ul>
74
- </dd>
75
- <?php endforeach; ?>
76
- </dl>
77
- <?php else : ?>
78
- <ul class="faq-list">
79
- <?php foreach ($this->getFaqCollection() as $faqItem): ?>
80
- <li>
81
- <a href="#faq-item-<?php echo $faqItem->getId() ?>">
82
- <?php echo $this->htmlEscape($faqItem->getQuestion()) ?>
83
- </a>
84
- </li>
85
- <li>
86
- <?php echo $faqItem->getAnswer(); ?>
87
- </li>
88
- <?php endforeach; ?>
89
- </ul>
90
- <?php endif; ?>
91
-
92
- <?php else: ?>
93
- <p class="faq-items"><?php echo $this->__('There are no FAQ items at the moment.') ?></p>
94
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/faq/search/result.phtml CHANGED
@@ -1,4 +1,4 @@
1
- <?php $_faqCategory = $this->getSearch() ?>
2
  <?php
3
  $flg=false;
4
  $keyword=$this->getRequest()->getParam('keyword');
@@ -10,7 +10,7 @@
10
  }
11
  ?>
12
  <div class="calegory-faq-list">
13
- <?php if ($_faqCategory): ?>
14
  <div class="page-title" style="overflow: visible;">
15
  <?php if($id): ?>
16
  <h1><?php echo $this->__('Search Result For - "%s" from category "%s"',$keyword,$category->getName()); ?></h1>
@@ -20,7 +20,8 @@
20
  </div>
21
 
22
  <div class="faq-detail">
23
- <?php foreach ($_faqCategory as $item) : ?>
 
24
  <table class="faq-listdata-table">
25
  <tbody>
26
  <tr class="faq-question">
@@ -38,7 +39,10 @@
38
  </tbody>
39
  </table>
40
  <?php endforeach; ?>
41
- </div>
 
 
 
42
  <p>
43
  <a href="<?php if($flg): ?><?php echo $this->getUrl('faq/index/categoryshow',array('_secure'=>true,'cat_id'=>$id)) ?><?php else: ?><?php echo Mage :: app()->getStore()->getUrl('faq') ?><?php endif; ?>" title="<?php echo $this->__('Back') ?>"><?php echo $this->__('Back') ?></a>
44
  </p>
@@ -47,8 +51,6 @@
47
  <div class="page-title">
48
  <h1><?php echo $this->__('Error') ?></h1>
49
  </div>
50
-
51
- <p><?php echo $this->__('The no FAQ item could not be found for search string!') ?></p>
52
  <?php endif; ?>
53
  <script type="text/javascript">
54
  $$('.faq-question').each(function(element) {
1
+ <?php $_faqResult = $this->getSearch() ?>
2
  <?php
3
  $flg=false;
4
  $keyword=$this->getRequest()->getParam('keyword');
10
  }
11
  ?>
12
  <div class="calegory-faq-list">
13
+ <?php if ($_faqResult): ?>
14
  <div class="page-title" style="overflow: visible;">
15
  <?php if($id): ?>
16
  <h1><?php echo $this->__('Search Result For - "%s" from category "%s"',$keyword,$category->getName()); ?></h1>
20
  </div>
21
 
22
  <div class="faq-detail">
23
+ <?php if(count($_faqResult)): ?>
24
+ <?php foreach ($_faqResult as $item) : ?>
25
  <table class="faq-listdata-table">
26
  <tbody>
27
  <tr class="faq-question">
39
  </tbody>
40
  </table>
41
  <?php endforeach; ?>
42
+ <?php else: ?>
43
+ <p><?php echo $this->__('There is no FAQ item found for search string!') ?></p>
44
+ <?php endif; ?>
45
+ </div>
46
  <p>
47
  <a href="<?php if($flg): ?><?php echo $this->getUrl('faq/index/categoryshow',array('_secure'=>true,'cat_id'=>$id)) ?><?php else: ?><?php echo Mage :: app()->getStore()->getUrl('faq') ?><?php endif; ?>" title="<?php echo $this->__('Back') ?>"><?php echo $this->__('Back') ?></a>
48
  </p>
51
  <div class="page-title">
52
  <h1><?php echo $this->__('Error') ?></h1>
53
  </div>
 
 
54
  <?php endif; ?>
55
  <script type="text/javascript">
56
  $$('.faq-question').each(function(element) {
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>inic_faq</name>
4
- <version>1.1.2</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,11 +11,12 @@
11
  - Allow to set the gird or list view on frontend.&#xD;
12
  - You can set the questions as the most frequently ask questions.&#xD;
13
  - Have configuration settings that allow to show/hide frequently ask questions.</description>
14
- <notes>This extension allows the user to create the faq question and their categories.</notes>
15
- <authors><author><name>bejoy balan</name><user>bmca4u</user><email>bmca4u@gmail.com</email></author></authors>
16
- <date>2013-06-12</date>
17
- <time>06:20:39</time>
18
- <contents><target name="magelocal"><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="df850cac1895690e9ca2ed4458e4e8bb"/></dir><file name="Category.php" hash="6e530cf0006701fea820760eb05507b6"/><dir name="Form_"><dir name="Edit"><dir name="Renderer"><file name="Label.php" hash="9d71468d7b7d728ea0407e6043468fae"/></dir></dir></dir><dir name="Item"><dir name="Edit"><file name="Form.php" hash="a28340f01594898277019fa465ab25c0"/><dir name="Tab"><file name="Main.php" hash="533b56e09dd83d8b09b2ddfd2eb5df68"/></dir><file name="Tabs.php" hash="d16c4ed9085b1621e57b62b351c40fbe"/></dir><file name="Edit.php" hash="00074f16986ac40b52091c88358c627b"/><file name="Grid.php" hash="8b80cec312871f3c2d9e1bd2759f3090"/></dir><file name="Item.php" hash="0ca3cce6235d990af1934f034194ae78"/></dir><dir name="Frontend"><file name="Category.php" hash="65f740c1eebb588feccc25bf3c645fe3"/><file name="Detail.php" hash="578280e4e25723fa66346e1f4ec3950a"/><dir name="FaqSearch"><file name="Result.php" hash="b01a89659230f0c3571f2198a8b5246e"/><file name="Search.php" hash="847fc5080ed8efacfd49ef9ccd2cf5bf"/></dir><file name="List.php" hash="1ec290553f7e77ce531a7d5656aa7952"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Faq"><file name="CategoryController.php" hash="93ddd13375bb404963b68b919e4886bd"/></dir><file name="FaqController.php" hash="28de26f82936c5a8fb41f0fef1d371e9"/></dir><file name="IndexController.php" hash="f8f0724405086edb37e5b82134cc232b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="48f0e931787461a326ee80effbb5ea3e"/><file name="config.xml" hash="54cc5359c24841143d481a1dd3ac7de2"/><file name="system.xml" hash="796de1365ab3f8746edc399e30226a62"/></dir><dir name="Helper"><file name="Data.php" hash="cb910cc95b9ca17887b81db0c84f320c"/></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="4302d86bdae9b7e0a7b228a0c50da71f"/></dir><file name="Category.php" hash="0f6cb88b69eff537857ee0de991bf00d"/><dir name="Faq"><file name="Collection.php" hash="f7043e3ed81363dca7083bc2e360ac0e"/></dir><file name="Faq.php" hash="7b34ae72a182f427ee6f11dbb2e00d19"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="View.php" hash="b72c180084212d870be4dd2c840ab1c7"/></dir></dir></dir></dir><dir name="sql"><dir name="faq_setup"><file name="mysql4-install-0.1.0.php" hash="e40ffc8498343af1808bc37d060a1bde"/><file name="mysql4-install-1.0.7.php" hash="d906165a2d976a6b269995ca9d51d221"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="31c535beec84b59a718aac6de0d0eb15"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Inic_Faq.xml" hash="6e20d3392792573c752ee3a0b4c0f83a"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="faq"><file name="faq.css" hash="e817d938be8f4f25627fb4bce1e8b95f"/></dir></dir><dir name="images"><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 name="js"><dir name="faq"><file name="faq.js" hash="9fa39d036f2d0bbd4fc6a18af6738562"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="faq.xml" hash="156bd9df3158e66e212bd87f6ebb8041"/></dir><dir name="template"><dir name="faq"><file name="categoty.phtml" hash="563be74a1a302bc5e961adef443c1292"/><file name="detail.phtml" hash="71e0180427e6b92f6a728b496366bf58"/><file name="list(2).phtml" hash="b3f670a65f3423f584310d5a3e51a63c"/><file name="list.phtml" hash="ae30ee0da33769063f1951c5f03ec341"/><dir name="search"><file name="result.phtml" hash="ac6ec1ca7ffd0944d2e5ad28a837a796"/><file name="search.phtml" hash="33ecd97803bff7a14e93e6a10a4ec026"/></dir></dir></dir></dir></dir></dir></target></contents>
 
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>
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
  - Allow to set the gird or list view on frontend.&#xD;
12
  - You can set the questions as the most frequently ask questions.&#xD;
13
  - Have configuration settings that allow to show/hide frequently ask questions.</description>
14
+ <notes>- Solved the search functionality issue for the Ver-1.6&#xD;
15
+ - Fixed minor bugs.</notes>
16
+ <authors><author><name>Enquiry Indianic</name><user>indianic</user><email>enquiry@indianic.com</email></author></authors>
17
+ <date>2013-06-27</date>
18
+ <time>05:10:41</time>
19
+ <contents><target name="magelocal"><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="df850cac1895690e9ca2ed4458e4e8bb"/></dir><file name="Category.php" hash="6e530cf0006701fea820760eb05507b6"/><dir name="Form_"><dir name="Edit"><dir name="Renderer"><file name="Label.php" hash="9d71468d7b7d728ea0407e6043468fae"/></dir></dir></dir><dir name="Item"><dir name="Edit"><file name="Form.php" hash="a28340f01594898277019fa465ab25c0"/><dir name="Tab"><file name="Main.php" hash="533b56e09dd83d8b09b2ddfd2eb5df68"/></dir><file name="Tabs.php" hash="d16c4ed9085b1621e57b62b351c40fbe"/></dir><file name="Edit.php" hash="00074f16986ac40b52091c88358c627b"/><file name="Grid.php" hash="8b80cec312871f3c2d9e1bd2759f3090"/></dir><file name="Item.php" hash="0ca3cce6235d990af1934f034194ae78"/></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="controllers"><dir name="Adminhtml"><dir name="Faq"><file name="CategoryController.php" hash="93ddd13375bb404963b68b919e4886bd"/></dir><file name="FaqController.php" hash="28de26f82936c5a8fb41f0fef1d371e9"/></dir><file name="IndexController.php" hash="f8f0724405086edb37e5b82134cc232b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="48f0e931787461a326ee80effbb5ea3e"/><file name="config.xml" hash="074a3bcaab12d44fcac864cfd17b2c38"/><file name="system.xml" hash="796de1365ab3f8746edc399e30226a62"/></dir><dir name="Helper"><file name="Data.php" hash="cb910cc95b9ca17887b81db0c84f320c"/></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="4302d86bdae9b7e0a7b228a0c50da71f"/></dir><file name="Category.php" hash="0f6cb88b69eff537857ee0de991bf00d"/><dir name="Faq"><file name="Collection.php" hash="f7043e3ed81363dca7083bc2e360ac0e"/></dir><file name="Faq.php" hash="7b34ae72a182f427ee6f11dbb2e00d19"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="View.php" hash="b72c180084212d870be4dd2c840ab1c7"/></dir></dir></dir></dir><dir name="sql"><dir name="faq_setup"><file name="mysql4-install-0.1.0.php" hash="e40ffc8498343af1808bc37d060a1bde"/><file name="mysql4-install-1.0.7.php" hash="d906165a2d976a6b269995ca9d51d221"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="31c535beec84b59a718aac6de0d0eb15"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Inic_Faq.xml" hash="6e20d3392792573c752ee3a0b4c0f83a"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="faq"><file name="faq.css" hash="e817d938be8f4f25627fb4bce1e8b95f"/></dir></dir><dir name="images"><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 name="js"><dir name="faq"><file name="faq.js" hash="5666660af4c954d8e9f09b84044f368c"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="faq.xml" hash="156bd9df3158e66e212bd87f6ebb8041"/></dir><dir name="template"><dir name="faq"><file name="categoty.phtml" hash="563be74a1a302bc5e961adef443c1292"/><file name="detail.phtml" hash="71e0180427e6b92f6a728b496366bf58"/><file name="list.phtml" hash="ae30ee0da33769063f1951c5f03ec341"/><dir name="search"><file name="result.phtml" hash="ef2ef8c844e94e41c266d7a6e6f60a11"/><file name="search.phtml" hash="33ecd97803bff7a14e93e6a10a4ec026"/></dir></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>
skin/frontend/base/default/js/faq/faq.js CHANGED
@@ -55,12 +55,25 @@ function addLoadEvent(func) {
55
  }
56
 
57
  function expand(linkele){
 
58
  if(linkele.innerHTML=="Expand All"){
59
  linkele.innerHTML="Collaps All";
 
 
 
 
 
 
60
  $('expand-collaps').addClassName("collaps");
61
  $('expand-collaps').removeClassName("expand");
62
  }else{
63
  linkele.innerHTML="Expand All";
 
 
 
 
 
 
64
  $('expand-collaps').addClassName("expand");
65
  $('expand-collaps').removeClassName("collaps");
66
  }
55
  }
56
 
57
  function expand(linkele){
58
+
59
  if(linkele.innerHTML=="Expand All"){
60
  linkele.innerHTML="Collaps All";
61
+ //If any one element is already expanded then collaps it and then again expand
62
+ $$('.faq-question').each(function(element) {
63
+ if(element.next().clientHeight){
64
+ element.next().toggle();
65
+ }
66
+ })
67
  $('expand-collaps').addClassName("collaps");
68
  $('expand-collaps').removeClassName("expand");
69
  }else{
70
  linkele.innerHTML="Expand All";
71
+ //If any one element is already collapsed then expand it and then again collaps
72
+ $$('.faq-question').each(function(element) {
73
+ if(element.next().clientHeight==0){
74
+ element.next().toggle();
75
+ }
76
+ })
77
  $('expand-collaps').addClassName("expand");
78
  $('expand-collaps').removeClassName("collaps");
79
  }