Version Notes
To be continue
Download this release
Release Info
Developer | Rostislav |
Extension | Mageside_Fade_Description |
Version | 1.0.1 |
Comparing to | |
See all releases |
Version 1.0.1
- app/code/local/Mageside/Base/Block/Adminhtml/System/Config/Form/Field/Button.php +59 -0
- app/code/local/Mageside/Base/Helper/Data.php +38 -0
- app/code/local/Mageside/Base/etc/adminhtml.xml +22 -0
- app/code/local/Mageside/Base/etc/config.xml +38 -0
- app/code/local/Mageside/Base/etc/system.xml +19 -0
- app/code/local/Mageside/FadeDescription/Helper/Data.php +31 -0
- app/code/local/Mageside/FadeDescription/etc/adminhtml.xml +23 -0
- app/code/local/Mageside/FadeDescription/etc/config.xml +64 -0
- app/code/local/Mageside/FadeDescription/etc/system.xml +68 -0
- app/code/local/Mageside/FadeDescription/sql/mageside_fadedescription_setup/mysql4-install-1.0.0.php +70 -0
- app/design/frontend/base/default/layout/mageside/mageside_fadedescription.xml +19 -0
- app/design/frontend/base/default/template/mageside/fadedescription/js.phtml +71 -0
- app/etc/modules/Mageside_Base.xml +14 -0
- app/etc/modules/Mageside_FadeDescription.xml +20 -0
- package.xml +18 -0
- skin/adminhtml/default/default/images/mageside/base/mageside.png +0 -0
- skin/frontend/base/default/css/fadedescription.css +29 -0
- skin/frontend/base/default/images/category-fade-icon.png +0 -0
app/code/local/Mageside/Base/Block/Adminhtml/System/Config/Form/Field/Button.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Mageside
|
4 |
+
* Copyright (C) 2015-2016 Mageside <customercare@mageside.com>
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This program is free software: you can redistribute it and/or modify
|
9 |
+
* it under the terms of the GNU General Public License as published by
|
10 |
+
* the Free Software Foundation, either version 3 of the License, or
|
11 |
+
* (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This program is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
+
* GNU General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU General Public License
|
19 |
+
* along with this program. If not, see http://opensource.org/licenses/gpl-3.0.html.
|
20 |
+
*
|
21 |
+
* @category Mageside
|
22 |
+
* @package Mageside_Base
|
23 |
+
* @copyright Copyright (c) 2015-2016 Mageside Co. (http://mageside.com/)
|
24 |
+
* @license http://mageside.com/MS-LICENSE.txt
|
25 |
+
* @author Mageside <extensions@mageside.com>
|
26 |
+
*/
|
27 |
+
|
28 |
+
class Mageside_Base_Block_Adminhtml_System_Config_Form_Field_Button extends Mage_Adminhtml_Block_System_Config_Form_Field
|
29 |
+
{
|
30 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
31 |
+
{
|
32 |
+
$value = '';
|
33 |
+
$url = '';
|
34 |
+
$this->setElement($element);
|
35 |
+
|
36 |
+
$fieldConf = $element->getData('field_config');
|
37 |
+
|
38 |
+
if (isset($fieldConf->value)) {
|
39 |
+
$value = $fieldConf->value;
|
40 |
+
}
|
41 |
+
|
42 |
+
if (isset($fieldConf->onclickurl)) {
|
43 |
+
$url = $fieldConf->onclickurl;
|
44 |
+
if (substr($url, 0, 4) != 'http') {
|
45 |
+
$url = $this->getUrl($url);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
$html = $this->getLayout()->createBlock('adminhtml/widget_button')
|
50 |
+
->setType('button')
|
51 |
+
->setClass('scalable')
|
52 |
+
->setStyle('min-width: 60px;')
|
53 |
+
->setLabel($value)
|
54 |
+
->setOnClick("this.disabled=true; setLocation('$url');");
|
55 |
+
|
56 |
+
return $html->toHtml();
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
app/code/local/Mageside/Base/Helper/Data.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Mageside
|
4 |
+
* Copyright (C) 2015-2016 Mageside <customercare@mageside.com>
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This program is free software: you can redistribute it and/or modify
|
9 |
+
* it under the terms of the GNU General Public License as published by
|
10 |
+
* the Free Software Foundation, either version 3 of the License, or
|
11 |
+
* (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This program is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
+
* GNU General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU General Public License
|
19 |
+
* along with this program. If not, see http://opensource.org/licenses/gpl-3.0.html.
|
20 |
+
*
|
21 |
+
* @category Mageside
|
22 |
+
* @package Mageside_Base
|
23 |
+
* @copyright Copyright (c) 2015-2016 Mageside Co. (http://mageside.com/)
|
24 |
+
* @license http://mageside.com/MS-LICENSE.txt
|
25 |
+
* @author Mageside <extensions@mageside.com>
|
26 |
+
*/
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Mageside default helper class
|
30 |
+
*
|
31 |
+
* @category Mageside
|
32 |
+
* @package Mageside_Base
|
33 |
+
* @author Mageside Team
|
34 |
+
*/
|
35 |
+
|
36 |
+
class Mageside_Base_Helper_Data extends Mage_Core_Helper_Data
|
37 |
+
{
|
38 |
+
}
|
app/code/local/Mageside/Base/etc/adminhtml.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<mageside>
|
12 |
+
<title>Mageside Base</title>
|
13 |
+
</mageside>
|
14 |
+
</children>
|
15 |
+
</config>
|
16 |
+
</children>
|
17 |
+
</system>
|
18 |
+
</children>
|
19 |
+
</admin>
|
20 |
+
</resources>
|
21 |
+
</acl>
|
22 |
+
</config>
|
app/code/local/Mageside/Base/etc/config.xml
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mageside_Base>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Mageside_Base>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<adminhtml>
|
10 |
+
<translate>
|
11 |
+
<modules>
|
12 |
+
<mageside_base>
|
13 |
+
<files>
|
14 |
+
<default>mageside/Mageside_Base.csv</default>
|
15 |
+
</files>
|
16 |
+
</mageside_base>
|
17 |
+
</modules>
|
18 |
+
</translate>
|
19 |
+
</adminhtml>
|
20 |
+
|
21 |
+
<global>
|
22 |
+
<models>
|
23 |
+
<mageside_base>
|
24 |
+
<class>Mageside_Base_Model</class>
|
25 |
+
</mageside_base>
|
26 |
+
</models>
|
27 |
+
<helpers>
|
28 |
+
<mageside_base>
|
29 |
+
<class>Mageside_Base_Helper</class>
|
30 |
+
</mageside_base>
|
31 |
+
</helpers>
|
32 |
+
<blocks>
|
33 |
+
<mageside_base>
|
34 |
+
<class>Mageside_Base_Block</class>
|
35 |
+
</mageside_base>
|
36 |
+
</blocks>
|
37 |
+
</global>
|
38 |
+
</config>
|
app/code/local/Mageside/Base/etc/system.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<mageside translate="label" module="mageside_base">
|
5 |
+
<label>
|
6 |
+
<![CDATA[
|
7 |
+
<div style="position: absolute;">
|
8 |
+
<img id="mageside-tab" src="" alt="MageSide" width="99" height="17"/>
|
9 |
+
</div>
|
10 |
+
<script>
|
11 |
+
var subs = SKIN_URL.indexOf("adminhtml");
|
12 |
+
$('mageside-tab').src = SKIN_URL.substring(0, subs) + "adminhtml/default/default/images/mageside/base/mageside.png";
|
13 |
+
</script>
|
14 |
+
]]>
|
15 |
+
</label>
|
16 |
+
<sort_order>800</sort_order>
|
17 |
+
</mageside>
|
18 |
+
</tabs>
|
19 |
+
</config>
|
app/code/local/Mageside/FadeDescription/Helper/Data.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Mageside
|
4 |
+
* Copyright (C) 2015-2016 Mageside <customercare@mageside.com>
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This program is free software: you can redistribute it and/or modify
|
9 |
+
* it under the terms of the GNU General Public License as published by
|
10 |
+
* the Free Software Foundation, either version 3 of the License, or
|
11 |
+
* (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This program is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
+
* GNU General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU General Public License
|
19 |
+
* along with this program. If not, see http://opensource.org/licenses/gpl-3.0.html.
|
20 |
+
*
|
21 |
+
* @category Mageside
|
22 |
+
* @package Mageside_FadeDescription
|
23 |
+
* @copyright Copyright (c) 2015-2016 Mageside Co. (http://mageside.com/)
|
24 |
+
* @license http://mageside.com/MS-LICENSE.txt
|
25 |
+
* @author Mageside <extensions@mageside.com>
|
26 |
+
*/
|
27 |
+
|
28 |
+
class Mageside_FadeDescription_Helper_Data extends Mage_Core_Helper_Abstract
|
29 |
+
{
|
30 |
+
|
31 |
+
}
|
app/code/local/Mageside/FadeDescription/etc/adminhtml.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<acl>
|
5 |
+
<resources>
|
6 |
+
<admin>
|
7 |
+
<children>
|
8 |
+
<system>
|
9 |
+
<children>
|
10 |
+
<config>
|
11 |
+
<children>
|
12 |
+
<mageside_fadedescription>
|
13 |
+
<title>Fade Description</title>
|
14 |
+
</mageside_fadedescription>
|
15 |
+
</children>
|
16 |
+
</config>
|
17 |
+
</children>
|
18 |
+
</system>
|
19 |
+
</children>
|
20 |
+
</admin>
|
21 |
+
</resources>
|
22 |
+
</acl>
|
23 |
+
</config>
|
app/code/local/Mageside/FadeDescription/etc/config.xml
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mageside_FadeDescription>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Mageside_FadeDescription>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
|
11 |
+
<blocks>
|
12 |
+
<mageside_fadedescription>
|
13 |
+
<class>Mageside_FadeDescription_Block</class>
|
14 |
+
</mageside_fadedescription>
|
15 |
+
</blocks>
|
16 |
+
|
17 |
+
<helpers>
|
18 |
+
<mageside_fadedescription>
|
19 |
+
<class>Mageside_FadeDescription_Helper</class>
|
20 |
+
</mageside_fadedescription>
|
21 |
+
</helpers>
|
22 |
+
|
23 |
+
<models>
|
24 |
+
<mageside_fadedescription>
|
25 |
+
<class>Mageside_FadeDescription_Model</class>
|
26 |
+
</mageside_fadedescription>
|
27 |
+
</models>
|
28 |
+
|
29 |
+
<resources>
|
30 |
+
<mageside_fadedescription_setup>
|
31 |
+
<setup>
|
32 |
+
<module>Mageside_FadeDescription</module>
|
33 |
+
<class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
|
34 |
+
</setup>
|
35 |
+
<connection>
|
36 |
+
<use>core_setup</use>
|
37 |
+
</connection>
|
38 |
+
</mageside_fadedescription_setup>
|
39 |
+
</resources>
|
40 |
+
</global>
|
41 |
+
|
42 |
+
<frontend>
|
43 |
+
<layout>
|
44 |
+
<updates>
|
45 |
+
<mageside_fadedescription>
|
46 |
+
<file>mageside/mageside_fadedescription.xml</file>
|
47 |
+
</mageside_fadedescription>
|
48 |
+
</updates>
|
49 |
+
</layout>
|
50 |
+
</frontend>
|
51 |
+
|
52 |
+
<default>
|
53 |
+
<mageside_fadedescription>
|
54 |
+
<general>
|
55 |
+
<enabled>1</enabled>
|
56 |
+
<fade_descrip_height>100</fade_descrip_height>
|
57 |
+
<fade_descrip_show_text>Show More</fade_descrip_show_text>
|
58 |
+
<fade_descrip_hide_text>Show Less</fade_descrip_hide_text>
|
59 |
+
<fade_descrip_class>category-description</fade_descrip_class>
|
60 |
+
</general>
|
61 |
+
</mageside_fadedescription>
|
62 |
+
</default>
|
63 |
+
|
64 |
+
</config>
|
app/code/local/Mageside/FadeDescription/etc/system.xml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<mageside_fadedescription translate="label" module="mageside_fadedescription">
|
5 |
+
<label>Fade Description</label>
|
6 |
+
<tab>mageside</tab>
|
7 |
+
<frontend_type>text</frontend_type>
|
8 |
+
<sort_order>100</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>0</show_in_website>
|
11 |
+
<show_in_store>0</show_in_store>
|
12 |
+
<groups>
|
13 |
+
<general translate="label">
|
14 |
+
<label>General</label>
|
15 |
+
<frontend_type>text</frontend_type>
|
16 |
+
<sort_order>1</sort_order>
|
17 |
+
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>0</show_in_website>
|
19 |
+
<show_in_store>0</show_in_store>
|
20 |
+
<fields>
|
21 |
+
<enabled>
|
22 |
+
<label>Enabled</label>
|
23 |
+
<frontend_type>select</frontend_type>
|
24 |
+
<sort_order>5</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
29 |
+
</enabled>
|
30 |
+
<fade_descrip_height translate="label">
|
31 |
+
<label>Description Height (px)</label>
|
32 |
+
<frontend_type>text</frontend_type>
|
33 |
+
<sort_order>10</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</fade_descrip_height>
|
38 |
+
<fade_descrip_show_text translate="label">
|
39 |
+
<label>Show Description Link</label>
|
40 |
+
<frontend_type>text</frontend_type>
|
41 |
+
<sort_order>20</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
</fade_descrip_show_text>
|
46 |
+
<fade_descrip_hide_text translate="label">
|
47 |
+
<label>Hide Description Link</label>
|
48 |
+
<frontend_type>text</frontend_type>
|
49 |
+
<sort_order>30</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
</fade_descrip_hide_text>
|
54 |
+
<fade_descrip_class translate="label comment">
|
55 |
+
<label>Description Block Class</label>
|
56 |
+
<frontend_type>text</frontend_type>
|
57 |
+
<sort_order>40</sort_order>
|
58 |
+
<show_in_default>1</show_in_default>
|
59 |
+
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>1</show_in_store>
|
61 |
+
<comment>Change it only when default Magento class is changed</comment>
|
62 |
+
</fade_descrip_class>
|
63 |
+
</fields>
|
64 |
+
</general>
|
65 |
+
</groups>
|
66 |
+
</mageside_fadedescription>
|
67 |
+
</sections>
|
68 |
+
</config>
|
app/code/local/Mageside/FadeDescription/sql/mageside_fadedescription_setup/mysql4-install-1.0.0.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Mageside
|
4 |
+
* Copyright (C) 2015-2016 Mageside <customercare@mageside.com>
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This program is free software: you can redistribute it and/or modify
|
9 |
+
* it under the terms of the GNU General Public License as published by
|
10 |
+
* the Free Software Foundation, either version 3 of the License, or
|
11 |
+
* (at your option) any later version.
|
12 |
+
*
|
13 |
+
* This program is distributed in the hope that it will be useful,
|
14 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
+
* GNU General Public License for more details.
|
17 |
+
*
|
18 |
+
* You should have received a copy of the GNU General Public License
|
19 |
+
* along with this program. If not, see http://opensource.org/licenses/gpl-3.0.html.
|
20 |
+
*
|
21 |
+
* @category Mageside
|
22 |
+
* @package Mageside_FadeDescription
|
23 |
+
* @copyright Copyright (c) 2015-2016 Mageside Co. (http://mageside.com/)
|
24 |
+
* @license http://mageside.com/MS-LICENSE.txt
|
25 |
+
* @author Mageside <extensions@mageside.com>
|
26 |
+
*/
|
27 |
+
|
28 |
+
/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */
|
29 |
+
$installer = $this;
|
30 |
+
$installer->startSetup();
|
31 |
+
|
32 |
+
$entityTypeId = Mage_Catalog_Model_Category::ENTITY;
|
33 |
+
|
34 |
+
$installer->addAttribute($entityTypeId, 'fade_descrip_height', array(
|
35 |
+
'group' => 'Display Settings',
|
36 |
+
'type' => 'varchar',
|
37 |
+
'label' => 'Description Height (px)',
|
38 |
+
'input' => 'text',
|
39 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
|
40 |
+
'required' => false,
|
41 |
+
'user_defined' => false,
|
42 |
+
'default' => '',
|
43 |
+
'sort_order' => 100,
|
44 |
+
));
|
45 |
+
|
46 |
+
$installer->addAttribute($entityTypeId, 'fade_descrip_show_text', array(
|
47 |
+
'group' => 'Display Settings',
|
48 |
+
'type' => 'varchar',
|
49 |
+
'label' => 'Show Description Link',
|
50 |
+
'input' => 'text',
|
51 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
|
52 |
+
'required' => false,
|
53 |
+
'user_defined' => false,
|
54 |
+
'default' => '',
|
55 |
+
'sort_order' => 101,
|
56 |
+
));
|
57 |
+
|
58 |
+
$installer->addAttribute($entityTypeId, 'fade_descrip_hide_text', array(
|
59 |
+
'group' => 'Display Settings',
|
60 |
+
'type' => 'varchar',
|
61 |
+
'label' => 'Hide Description Link',
|
62 |
+
'input' => 'text',
|
63 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
|
64 |
+
'required' => false,
|
65 |
+
'user_defined' => false,
|
66 |
+
'default' => '',
|
67 |
+
'sort_order' => 102,
|
68 |
+
));
|
69 |
+
|
70 |
+
$installer->endSetup();
|
app/design/frontend/base/default/layout/mageside/mageside_fadedescription.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<catalog_category_default>
|
5 |
+
<reference name="head">
|
6 |
+
<action method="addCss"><stylesheet>css/fadedescription.css</stylesheet></action>
|
7 |
+
<block type="core/template" name="fadedescription" template="mageside/fadedescription/js.phtml" after="-"/>
|
8 |
+
</reference>
|
9 |
+
</catalog_category_default>
|
10 |
+
|
11 |
+
|
12 |
+
<catalog_category_layered>
|
13 |
+
<reference name="head">
|
14 |
+
<action method="addCss"><stylesheet>css/fadedescription.css</stylesheet></action>
|
15 |
+
<block type="core/template" name="fadedescription" template="mageside/fadedescription/js.phtml" after="-"/>
|
16 |
+
</reference>
|
17 |
+
</catalog_category_layered>
|
18 |
+
|
19 |
+
</layout>
|
app/design/frontend/base/default/template/mageside/fadedescription/js.phtml
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$_configPath = 'mageside_fadedescription/general/';
|
3 |
+
if (Mage::getStoreConfigFlag($_configPath . 'enabled')):
|
4 |
+
if (!$_category = Mage::registry('current_category')) { return; };
|
5 |
+
if (!$_pixels = $_category->getData('fade_descrip_height')) {
|
6 |
+
$_pixels = Mage::getStoreConfig($_configPath . 'fade_descrip_height');
|
7 |
+
}
|
8 |
+
if (!$_showText = $_category->getData('fade_descrip_show_text')) {
|
9 |
+
$_showText = Mage::getStoreConfig($_configPath . 'fade_descrip_show_text');
|
10 |
+
}
|
11 |
+
if (!$_hideText = $_category->getData('fade_descrip_hide_text')) {
|
12 |
+
$_hideText = Mage::getStoreConfig($_configPath . 'fade_descrip_hide_text');
|
13 |
+
}
|
14 |
+
$_class = Mage::getStoreConfig($_configPath . 'fade_descrip_class');
|
15 |
+
|
16 |
+
?>
|
17 |
+
<script type="text/javascript">
|
18 |
+
document.observe("dom:loaded", function() {
|
19 |
+
$$('.<?php echo $_class ?>').each(function(el){
|
20 |
+
if (el.getHeight() < <?php echo $_pixels ?>) {
|
21 |
+
return;
|
22 |
+
}
|
23 |
+
function fadeOut(elem) {
|
24 |
+
elem.setStyle({
|
25 |
+
position: 'relative',
|
26 |
+
height: '<?php echo $_pixels ?>px',
|
27 |
+
overflow: 'hidden'
|
28 |
+
});
|
29 |
+
}
|
30 |
+
function fadeIn(elem) {
|
31 |
+
elem.setStyle({
|
32 |
+
position: 'relative',
|
33 |
+
height: 'auto',
|
34 |
+
overflow: 'hidden'
|
35 |
+
});
|
36 |
+
}
|
37 |
+
|
38 |
+
fadeOut(el);
|
39 |
+
|
40 |
+
var bottomGradient = new Element('div', { 'class': 'descr-bottom-gradient' });
|
41 |
+
el.insert({after: bottomGradient});
|
42 |
+
|
43 |
+
var showButton = new Element('a', { href: 'javascript:void(0);' }).update('<?php echo $_showText ?>');
|
44 |
+
var showButtonDiv = new Element('div', { 'class': 'descr-show-button' });
|
45 |
+
showButtonDiv.insert(showButton);
|
46 |
+
bottomGradient.insert({after: showButtonDiv});
|
47 |
+
|
48 |
+
var hideButton = new Element('a', { href: 'javascript:void(0);' }).update('<?php echo $_hideText ?>');
|
49 |
+
var hideButtonDiv = new Element('div', { 'class': 'descr-hide-button' });
|
50 |
+
hideButtonDiv.insert(hideButton);
|
51 |
+
showButtonDiv.insert({after: hideButtonDiv});
|
52 |
+
|
53 |
+
hideButtonDiv.hide();
|
54 |
+
|
55 |
+
showButton.observe('click', function(event) {
|
56 |
+
showButtonDiv.hide();
|
57 |
+
hideButtonDiv.show();
|
58 |
+
bottomGradient.hide();
|
59 |
+
fadeIn(el);
|
60 |
+
});
|
61 |
+
|
62 |
+
hideButton.observe('click', function(event) {
|
63 |
+
hideButtonDiv.hide();
|
64 |
+
showButtonDiv.show();
|
65 |
+
bottomGradient.show();
|
66 |
+
fadeOut(el);
|
67 |
+
});
|
68 |
+
});
|
69 |
+
});
|
70 |
+
</script>
|
71 |
+
<?php endif; ?>
|
app/etc/modules/Mageside_Base.xml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Base module for mageside modules
|
5 |
+
*/
|
6 |
+
-->
|
7 |
+
<config>
|
8 |
+
<modules>
|
9 |
+
<Mageside_Base>
|
10 |
+
<active>true</active>
|
11 |
+
<codePool>local</codePool>
|
12 |
+
</Mageside_Base>
|
13 |
+
</modules>
|
14 |
+
</config>
|
app/etc/modules/Mageside_FadeDescription.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2 |
+
<!--
|
3 |
+
/*
|
4 |
+
*==Mageside License==
|
5 |
+
*Copyright (c) 2015-2016
|
6 |
+
*All rights reserved.
|
7 |
+
*
|
8 |
+
* @category Mageside
|
9 |
+
* @package Mageside_FadeDescription
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
-->
|
13 |
+
<config>
|
14 |
+
<modules>
|
15 |
+
<Mageside_FadeDescription>
|
16 |
+
<active>true</active>
|
17 |
+
<codePool>local</codePool>
|
18 |
+
</Mageside_FadeDescription>
|
19 |
+
</modules>
|
20 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mageside_FadeDescription</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://mageside.com/MS-LICENSE.txt">OSL 3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This module fade category description.</summary>
|
10 |
+
<description>This module fade category description.</description>
|
11 |
+
<notes>To be continue</notes>
|
12 |
+
<authors><author><name>Rostislav</name><user>rostislavs</user><email>rostislavs@mageside.com</email></author></authors>
|
13 |
+
<date>2016-06-13</date>
|
14 |
+
<time>15:19:16</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Mageside"><dir name="FadeDescription"><dir name="Helper"><file name="Data.php" hash="bdde0eee04d1d7fb79453926887f61d1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="72668d694a7f07e1cc5e2c7e9d893fca"/><file name="config.xml" hash="a7bd828177969d3e1b2de90ad0750c47"/><file name="system.xml" hash="ac9b51a61b32e8cd4fd7f85b82a3dea8"/></dir><dir name="sql"><dir name="mageside_fadedescription_setup"><file name="mysql4-install-1.0.0.php" hash="fd9e1f0d9d56b5be8c2d3c86c23b86e1"/></dir></dir></dir><dir name="Base"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Button.php" hash="4abb6e5993a6ed23e601be816eadfa0b"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="88a0d0e2beb4aeea42ee8055d83277fd"/></dir><dir name="etc"><file name="adminhtml.xml" hash="96ab8b8f5f2017fbd06bd4a0bb9da55a"/><file name="config.xml" hash="74314fcb2934219639eb3889e53efe07"/><file name="system.xml" hash="ca33f7d6ee8712d594127d35e1730baa"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mageside_FadeDescription.xml" hash="61b49d266399ad16fb3f4820e825ff68"/><file name="Mageside_Base.xml" hash="35a8e13cd3b65fc16aa76f6db937de5c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="mageside"><file name="mageside_fadedescription.xml" hash="0123236dd7c986316926e3d520057362"/></dir></dir><dir name="template"><dir name="mageside"><dir name="fadedescription"><file name="js.phtml" hash="0b6c2f2d0de76f4e8a110fb75a2d0195"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="mageside"><dir name="base"><file name="mageside.png" hash="ab6a2115bf3956f4a395b63286c7e5bd"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="fadedescription.css" hash="45ac6becc0621c1bedba4b308f76ba34"/></dir><dir name="images"><file name="category-fade-icon.png" hash="f96c1381e7c1a830eab65720ef6bd71a"/></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.3.0</min><max>5.6.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/adminhtml/default/default/images/mageside/base/mageside.png
ADDED
Binary file
|
skin/frontend/base/default/css/fadedescription.css
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
.descr-bottom-gradient {
|
3 |
+
z-index: 2;
|
4 |
+
position: relative;
|
5 |
+
height: 50px;
|
6 |
+
margin-top: -50px;
|
7 |
+
overflow: hidden;
|
8 |
+
background: -moz-linear-gradient( bottom, rgb(255, 255, 255) 15%, rgba(255, 255, 255, 0) 100% );
|
9 |
+
background: -webkit-gradient( linear, bottom, top, color-stop(15%, rgb(255, 255, 255)), color-stop(100%, rgba(255, 255, 255, 0)) );
|
10 |
+
background: -webkit-linear-gradient( bottom, rgb(255,255,255) 15%, rgba(255, 255, 255, 0) 100% );
|
11 |
+
background: -o-linear-gradient( bottom, rgb(255,255,255) 15%, rgba(255, 255, 255, 0) 100% );
|
12 |
+
background: -ms-linear-gradient( bottom, rgb(255,255,255) 15%, rgba(255, 255, 255, 0) 100% );
|
13 |
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#03ffffff', endColorstr='#ffffff', GradientType=0 );
|
14 |
+
background: linear-gradient( bottom, rgb(255, 255, 255) 15%, rgba(255, 255, 255, 0) 100% );
|
15 |
+
}
|
16 |
+
|
17 |
+
.descr-show-button,
|
18 |
+
.descr-hide-button {
|
19 |
+
z-index: 3;
|
20 |
+
position: relative;
|
21 |
+
height: 19px;
|
22 |
+
background: url(../images/category-fade-icon.png) 15px -21px no-repeat;
|
23 |
+
padding-left: 40px;
|
24 |
+
margin-top: 0;
|
25 |
+
margin-bottom: 10px;
|
26 |
+
}
|
27 |
+
.descr-hide-button {
|
28 |
+
background-position: 15px 0;
|
29 |
+
}
|
skin/frontend/base/default/images/category-fade-icon.png
ADDED
Binary file
|