Version Notes
Floating Banner V 0.1.0
Download this release
Release Info
Developer | Stanislav |
Extension | Floating_banner |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/community/Stasevic/Banner/Adminhtml/Model/System/Config/Source/Leftright.php +11 -0
- app/code/community/Stasevic/Banner/Helper/Data.php +7 -0
- app/code/community/Stasevic/Banner/etc/adminhtml.xml +22 -0
- app/code/community/Stasevic/Banner/etc/config.xml +30 -0
- app/code/community/Stasevic/Banner/etc/system.xml +185 -0
- app/design/frontend/default/default/template/Stasevic/floatbanner.phtml +21 -0
- package.xml +18 -0
- skin/frontend/default/default/css/stasevic-banner.css +20 -0
app/code/community/Stasevic/Banner/Adminhtml/Model/System/Config/Source/Leftright.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Stasevic_Banner_Adminhtml_Model_System_Config_Source_leftright
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value' => 'left' , 'label' => Mage::helper("adminhtml")->__('Left')),
|
8 |
+
array('value' => 'right' , 'label' => Mage::helper("adminhtml")->__('Right')),
|
9 |
+
);
|
10 |
+
}
|
11 |
+
}
|
app/code/community/Stasevic/Banner/Helper/Data.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Stasevic_Banner_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
7 |
+
?>
|
app/code/community/Stasevic/Banner/etc/adminhtml.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<stasevic_banner translate="title" module="stasevic_banner">
|
12 |
+
<title>Configuration Stasevic Banner Section</title>
|
13 |
+
</stasevic_banner>
|
14 |
+
</children>
|
15 |
+
</config>
|
16 |
+
</children>
|
17 |
+
</system>
|
18 |
+
</children>
|
19 |
+
</admin>
|
20 |
+
</resources>
|
21 |
+
</acl>
|
22 |
+
</config>
|
app/code/community/Stasevic/Banner/etc/config.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Stasevic_Banner>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Stasevic_Banner>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
<models>
|
11 |
+
<Stasevic_Banner>
|
12 |
+
<class>Stasevic_Banner_Adminhtml_Model</class>
|
13 |
+
</Stasevic_Banner>
|
14 |
+
</models>
|
15 |
+
<helpers>
|
16 |
+
<stasevic_banner>
|
17 |
+
<class>Stasevic_Banner_Helper</class>
|
18 |
+
</stasevic_banner>
|
19 |
+
</helpers>
|
20 |
+
</global>
|
21 |
+
<frontend>
|
22 |
+
<layout>
|
23 |
+
<updates>
|
24 |
+
<stasevic_banner>
|
25 |
+
<file>stasevic-banner.xml</file>
|
26 |
+
</stasevic_banner>
|
27 |
+
</updates>
|
28 |
+
</layout>
|
29 |
+
</frontend>
|
30 |
+
</config>
|
app/code/community/Stasevic/Banner/etc/system.xml
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<sbanner translate="label" module="stasevic_banner">
|
5 |
+
<label>Stasevic Moduls</label>
|
6 |
+
</sbanner>
|
7 |
+
</tabs>
|
8 |
+
|
9 |
+
<sections>
|
10 |
+
<stasevic_banner translate="label" module="stasevic_banner">
|
11 |
+
<label>Banner Configuration</label>
|
12 |
+
<tab>sbanner</tab>
|
13 |
+
<sort_order>150</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<general translate="label" module="stasevic_banner">
|
19 |
+
<label>General Configuration</label>
|
20 |
+
<sort_order>10</sort_order>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<fields>
|
23 |
+
<enabled translate="label">
|
24 |
+
<label>Enable Stasevic Banner</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>1</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
</enabled>
|
30 |
+
<bfloat translate="label">
|
31 |
+
<label>Banner Float</label>
|
32 |
+
<frontend_type>select</frontend_type>
|
33 |
+
<source_model>Stasevic_Banner/system_config_source_leftright</source_model>
|
34 |
+
<sort_order>2</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
</bfloat>
|
37 |
+
</fields>
|
38 |
+
</general>
|
39 |
+
<images translate="label" module="stasevic_banner">
|
40 |
+
<label>Banners</label>
|
41 |
+
<sort_order>20</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<fields>
|
44 |
+
<image1_link translate="lable" module="stasevic_banner">
|
45 |
+
<label>Image Number 1 link</label>
|
46 |
+
<frontend_type>text</frontend_type>
|
47 |
+
<sort_order>2</sort_order>
|
48 |
+
<show_in_default>1</show_in_default>
|
49 |
+
<!--depends>
|
50 |
+
<general_enabled>1</general_enabled>
|
51 |
+
</depends-->
|
52 |
+
</image1_link>
|
53 |
+
<image1 translate="label comment">
|
54 |
+
<label>Image Number 1</label>
|
55 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
56 |
+
<frontend_type>image</frontend_type>
|
57 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
58 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
59 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
60 |
+
<sort_order>3</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
</image1>
|
63 |
+
<image2_link translate="lable" module="stasevic_banner">
|
64 |
+
<label>Image Number 2 link</label>
|
65 |
+
<frontend_type>text</frontend_type>
|
66 |
+
<sort_order>4</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
</image2_link>
|
69 |
+
<image2 translate="label comment">
|
70 |
+
<label>Image Number 2</label>
|
71 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
72 |
+
<frontend_type>image</frontend_type>
|
73 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
74 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
75 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
76 |
+
<sort_order>5</sort_order>
|
77 |
+
<show_in_default>1</show_in_default>
|
78 |
+
</image2>
|
79 |
+
<image3_link translate="lable" module="stasevic_banner">
|
80 |
+
<label>Image Number 3 link</label>
|
81 |
+
<frontend_type>text</frontend_type>
|
82 |
+
<sort_order>6</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
</image3_link>
|
85 |
+
<image3 translate="label comment">
|
86 |
+
<label>Image Number 3</label>
|
87 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
88 |
+
<frontend_type>image</frontend_type>
|
89 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
90 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
91 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
92 |
+
<sort_order>7</sort_order>
|
93 |
+
<show_in_default>1</show_in_default>
|
94 |
+
</image3>
|
95 |
+
<image4_link translate="lable" module="stasevic_banner">
|
96 |
+
<label>Image Number 4 link</label>
|
97 |
+
<frontend_type>text</frontend_type>
|
98 |
+
<sort_order>8</sort_order>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
</image4_link>
|
101 |
+
<image4 translate="label comment">
|
102 |
+
<label>Image Number 4</label>
|
103 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
104 |
+
<frontend_type>image</frontend_type>
|
105 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
106 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
107 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
108 |
+
<sort_order>9</sort_order>
|
109 |
+
<show_in_default>1</show_in_default>
|
110 |
+
</image4>
|
111 |
+
<image5_link translate="lable" module="stasevic_banner">
|
112 |
+
<label>Image Number 5 link</label>
|
113 |
+
<frontend_type>text</frontend_type>
|
114 |
+
<sort_order>10</sort_order>
|
115 |
+
<show_in_default>1</show_in_default>
|
116 |
+
</image5_link>
|
117 |
+
<image5 translate="label comment">
|
118 |
+
<label>Image Number 5</label>
|
119 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
120 |
+
<frontend_type>image</frontend_type>
|
121 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
122 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
123 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
124 |
+
<sort_order>11</sort_order>
|
125 |
+
<show_in_default>1</show_in_default>
|
126 |
+
</image5>
|
127 |
+
<image6_link translate="lable" module="stasevic_banner">
|
128 |
+
<label>Image Number 6 link</label>
|
129 |
+
<frontend_type>text</frontend_type>
|
130 |
+
<sort_order>12</sort_order>
|
131 |
+
<show_in_default>1</show_in_default>
|
132 |
+
</image6_link>
|
133 |
+
<image6 translate="label comment">
|
134 |
+
<label>Image Number 6</label>
|
135 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
136 |
+
<frontend_type>image</frontend_type>
|
137 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
138 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
139 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
140 |
+
<sort_order>13</sort_order>
|
141 |
+
<show_in_default>1</show_in_default>
|
142 |
+
</image6>
|
143 |
+
|
144 |
+
<image7_link translate="lable" module="stasevic_banner">
|
145 |
+
<label>Image Number 7 link</label>
|
146 |
+
<frontend_type>text</frontend_type>
|
147 |
+
<sort_order>14</sort_order>
|
148 |
+
<show_in_default>1</show_in_default>
|
149 |
+
</image7_link>
|
150 |
+
<image7 translate="label comment">
|
151 |
+
<label>Image Number 7</label>
|
152 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
153 |
+
<frontend_type>image</frontend_type>
|
154 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
155 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
156 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
157 |
+
<sort_order>15</sort_order>
|
158 |
+
<show_in_default>1</show_in_default>
|
159 |
+
</image7>
|
160 |
+
|
161 |
+
<image8_link translate="lable" module="stasevic_banner">
|
162 |
+
<label>Image Number 8 link</label>
|
163 |
+
<frontend_type>text</frontend_type>
|
164 |
+
<sort_order>16</sort_order>
|
165 |
+
<show_in_default>1</show_in_default>
|
166 |
+
</image8_link>
|
167 |
+
<image8 translate="label comment">
|
168 |
+
<label>Image Number 8</label>
|
169 |
+
<comment>Allowed file types: jpeg, gif, png.</comment>
|
170 |
+
<frontend_type>image</frontend_type>
|
171 |
+
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
172 |
+
<upload_dir config="system/filesystem/media" scope_info="1">stasevic</upload_dir>
|
173 |
+
<base_url type="media" scope_info="1">stasevic</base_url>
|
174 |
+
<sort_order>17</sort_order>
|
175 |
+
<show_in_default>1</show_in_default>
|
176 |
+
|
177 |
+
</image8>
|
178 |
+
|
179 |
+
</fields>
|
180 |
+
</images>
|
181 |
+
|
182 |
+
</groups>
|
183 |
+
</stasevic_banner>
|
184 |
+
</sections>
|
185 |
+
</config>
|
app/design/frontend/default/default/template/Stasevic/floatbanner.phtml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<pre>
|
2 |
+
<?php //print_r(Mage::getConfig('Stasevic_banner')); ?>
|
3 |
+
</pre>
|
4 |
+
|
5 |
+
|
6 |
+
<?php if(Mage::getStoreConfig('stasevic_banner/general/enabled') == true){?>
|
7 |
+
<?php $arr = Mage::getStoreConfig('stasevic_banner/images');?>
|
8 |
+
<div class="floatmenu <?php echo Mage::getStoreConfig('stasevic_banner/general/bfloat') == 'left' ? 'fleft' : 'fright'; ?>">
|
9 |
+
<ul>
|
10 |
+
<?php for($i=1; $i<count($arr); $i++){?>
|
11 |
+
<?php if(array_key_exists('image'. $i, $arr) && $arr['image'. $i] <> '' ){?>
|
12 |
+
<?php if(array_key_exists('image'. $i .'_link', $arr) && $arr['image'. $i .'_link'] <> '' ){?>
|
13 |
+
<li><a href="<?php echo $arr['image'. $i .'_link'];?>"><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'stasevic/'.$arr['image'. $i ] ; ?>'/></a></li>
|
14 |
+
<?php }else{?>
|
15 |
+
<li><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'stasevic/'.$arr['image'. $i ] ; ?>'/></li>
|
16 |
+
<?php }?>
|
17 |
+
<?php }?>
|
18 |
+
<?php }?>
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
<?php } ?>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Floating_banner</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Floating banner </summary>
|
10 |
+
<description>Floating Banner is simply keeps elements in the browsers viewport when a user scrolls down a web page. It is often used to keep banners in the user's view while the scrolling down long pages.</description>
|
11 |
+
<notes>Floating Banner V 0.1.0</notes>
|
12 |
+
<authors><author><name>Stanislav</name><user>Stasevi4</user><email>stas19882004@gmail.com</email></author></authors>
|
13 |
+
<date>2013-03-11</date>
|
14 |
+
<time>18:28:01</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Stasevic"><dir name="Banner"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Leftright.php" hash="65103739767437a531eece3c9c2bdebe"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="3f36e81c19ede19ab7f6533587e6d351"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d80445709651d1d4a291cec51a666291"/><file name="config.xml" hash="0f6b3ad139d9640cd5d4edef43093924"/><file name="system.xml" hash="c1b6247983aa3a5f50c0a097056a9215"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="stasevi4_banner.xml" hash=""/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="stasevic_banner.xml" hash=""/></dir><dir name="template"><dir name="Stasevic"><file name="floatbanner.phtml" hash="a1377ba914d71f2cd199d23e2344d376"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="stasevic-banner.css" hash="d70de05ff087786d7023cad3a1955027"/></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/default/default/css/stasevic-banner.css
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.floatmenu
|
2 |
+
{ position:fixed;
|
3 |
+
bottom:40%;
|
4 |
+
index-z:100;
|
5 |
+
}
|
6 |
+
|
7 |
+
.floatmenu a {display:block;}
|
8 |
+
.fleft{left:5px;}
|
9 |
+
.fright{ right:5px;}
|
10 |
+
.floatmenu ul{
|
11 |
+
list-style-type:none;
|
12 |
+
}
|
13 |
+
|
14 |
+
.floatmenu ul li{
|
15 |
+
padding:5px;
|
16 |
+
|
17 |
+
margin-top:2px;
|
18 |
+
background-color: #ffffff;
|
19 |
+
border:1px solid #dddddd;
|
20 |
+
}
|