Version Notes
Later after testing
Download this release
Release Info
Developer | Brijesh Mishra |
Extension | Brijesh_Scrolltext |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Brijesh/Scrolltext/Block/Scrolltext.php +37 -0
- app/code/local/Brijesh/Scrolltext/Block/Scrolltextblock.php +5 -0
- app/code/local/Brijesh/Scrolltext/Block/Scrolltextsidebar.php +13 -0
- app/code/local/Brijesh/Scrolltext/Helper/Data.php +8 -0
- app/code/local/Brijesh/Scrolltext/Model/System/Config/Direction.php +15 -0
- app/code/local/Brijesh/Scrolltext/Model/System/Config/Position.php +15 -0
- app/code/local/Brijesh/Scrolltext/controllers/IndexController.php +11 -0
- app/code/local/Brijesh/Scrolltext/etc/config.xml +65 -0
- app/code/local/Brijesh/Scrolltext/etc/system.xml +73 -0
- app/design/frontend/base/default/layout/scrolltext.xml +25 -0
- app/design/frontend/base/default/template/scrolltext/scrolltext.phtml +43 -0
- app/etc/modules/Brijesh_Scrolltext.xml +9 -0
- package.xml +33 -0
app/code/local/Brijesh/Scrolltext/Block/Scrolltext.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Brijesh_Scrolltext_Block_Scrolltext extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
|
5 |
+
public function leftSidebarBlock() {
|
6 |
+
$block = $this->getParentBlock();
|
7 |
+
if($block) {
|
8 |
+
if(Mage::getStoreConfig('scrolltext_sections/scrolltext_group/scrolltext_position') == 'left') {
|
9 |
+
$sidebarBlock = $this->getLayout()->createBlock('scrolltext/scrolltextsidebar');
|
10 |
+
$block->insert($sidebarBlock,'', true, 'scrolltext-sidebar');
|
11 |
+
}
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
public function rightSidebarBlock() {
|
17 |
+
$block = $this->getParentBlock();
|
18 |
+
if($block) {
|
19 |
+
if(Mage::getStoreConfig('scrolltext_sections/scrolltext_group/scrolltext_position') == 'right') {
|
20 |
+
$sidebarBlock = $this->getLayout()->createBlock('scrolltext/scrolltextsidebar');
|
21 |
+
|
22 |
+
$block->insert($sidebarBlock, '', true, 'scrolltext-sidebar');
|
23 |
+
}
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
public function footerBlock() {
|
28 |
+
$block = $this->getParentBlock();
|
29 |
+
if($block) {
|
30 |
+
if(Mage::getStoreConfig('scrolltext_sections/scrolltext_group/scrolltext_position') == 'footer') {
|
31 |
+
$sidebarBlock = $this->getLayout()->createBlock('scrolltext/scrolltextsidebar');
|
32 |
+
|
33 |
+
$block->insert($sidebarBlock, '', true, 'scrolltext-sidebar');
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
app/code/local/Brijesh/Scrolltext/Block/Scrolltextblock.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Brijesh_Scrolltext_Block_Scrolltextblock extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/local/Brijesh/Scrolltext/Block/Scrolltextsidebar.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Brijesh_Scrolltext_Block_Scrolltextsidebar extends Brijesh_Scrolltext_Block_Scrolltext
|
3 |
+
{
|
4 |
+
public function _construct() {
|
5 |
+
$this->setTemplate('scrolltext/scrolltext.phtml');
|
6 |
+
return parent::_construct();
|
7 |
+
}
|
8 |
+
public function _prepareLayout()
|
9 |
+
{
|
10 |
+
return parent::_prepareLayout();
|
11 |
+
}
|
12 |
+
}
|
13 |
+
?>
|
app/code/local/Brijesh/Scrolltext/Helper/Data.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Brijesh_Scrolltext_Helper_Data
|
3 |
+
extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function displayOnSideBar(){
|
6 |
+
return (string)Mage::getStoreConfig('scrolltext/general/position');
|
7 |
+
}
|
8 |
+
}
|
app/code/local/Brijesh/Scrolltext/Model/System/Config/Direction.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Brijesh_Scrolltext_Model_System_Config_Direction
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
$options = array(
|
8 |
+
array('value'=>'up','label'=> Mage::helper('scrolltext')->__('Scroll Up')),
|
9 |
+
array('value'=>'down','label'=> Mage::helper('scrolltext')->__('Scroll Down')),
|
10 |
+
|
11 |
+
);
|
12 |
+
|
13 |
+
return $options;
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Brijesh/Scrolltext/Model/System/Config/Position.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Brijesh_Scrolltext_Model_System_Config_Position
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
$options = array(
|
8 |
+
array('value'=>'left','label'=> Mage::helper('scrolltext')->__('Left Sidebar')),
|
9 |
+
array('value'=>'right','label'=> Mage::helper('scrolltext')->__('Right Sidebar')),
|
10 |
+
array('value'=>'footer','label'=> Mage::helper('scrolltext')->__('Footer Position'))
|
11 |
+
);
|
12 |
+
|
13 |
+
return $options;
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Brijesh/Scrolltext/controllers/IndexController.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Brijesh_Scrolltext_IndexController
|
3 |
+
extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
public function indexAction()
|
6 |
+
{
|
7 |
+
$this->loadLayout();
|
8 |
+
$this->renderLayout();
|
9 |
+
echo "string";
|
10 |
+
}
|
11 |
+
}
|
app/code/local/Brijesh/Scrolltext/etc/config.xml
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Brijesh_Scrolltext>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Brijesh_Scrolltext>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<scrolltext>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Brijesh_Scrolltext</module>
|
14 |
+
<frontName>scrolltext</frontName>
|
15 |
+
</args>
|
16 |
+
</scrolltext>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<scrolltext>
|
21 |
+
<file>scrolltext.xml</file>
|
22 |
+
</scrolltext>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<adminhtml>
|
27 |
+
<acl>
|
28 |
+
<resources>
|
29 |
+
<admin>
|
30 |
+
<children>
|
31 |
+
<system>
|
32 |
+
<children>
|
33 |
+
<config>
|
34 |
+
<children>
|
35 |
+
<scrolltext_sections>
|
36 |
+
<title>Scroll Text</title>
|
37 |
+
<sort_order>100</sort_order>
|
38 |
+
</scrolltext_sections>
|
39 |
+
</children>
|
40 |
+
</config>
|
41 |
+
</children>
|
42 |
+
</system>
|
43 |
+
</children>
|
44 |
+
</admin>
|
45 |
+
</resources>
|
46 |
+
</acl>
|
47 |
+
</adminhtml>
|
48 |
+
<global>
|
49 |
+
<models>
|
50 |
+
<scrolltext>
|
51 |
+
<class>Brijesh_Scrolltext_Model</class>
|
52 |
+
</scrolltext>
|
53 |
+
</models>
|
54 |
+
<blocks>
|
55 |
+
<scrolltext>
|
56 |
+
<class>Brijesh_Scrolltext_Block</class>
|
57 |
+
</scrolltext>
|
58 |
+
</blocks>
|
59 |
+
<helpers>
|
60 |
+
<scrolltext>
|
61 |
+
<class>Brijesh_Scrolltext_Helper</class>
|
62 |
+
</scrolltext>
|
63 |
+
</helpers>
|
64 |
+
</global>
|
65 |
+
</config>
|
app/code/local/Brijesh/Scrolltext/etc/system.xml
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<scrolltext_tabs translate="label" module="scrolltext">
|
5 |
+
<label>Brijesh Scroll Text</label>
|
6 |
+
<sort_order>100</sort_order>
|
7 |
+
</scrolltext_tabs>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<scrolltext_sections translate="label" module="scrolltext">
|
11 |
+
<label>Scroll text options</label>
|
12 |
+
<tab>scrolltext_tabs</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>200</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<scrolltext_group translate="label">
|
20 |
+
<label>Scroll Text Settings</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
|
23 |
+
<sort_order>1</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<fields>
|
28 |
+
<scrolltext_content_text translate="label">
|
29 |
+
<label>Content Text</label>
|
30 |
+
<frontend_type>textarea</frontend_type>
|
31 |
+
<sort_order>3</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>0</show_in_store>
|
35 |
+
<comment>The text in this box will scroll</comment>
|
36 |
+
</scrolltext_content_text>
|
37 |
+
<scrolltext_direction translate="label">
|
38 |
+
<label>Scrolling Direction</label>
|
39 |
+
<frontend_type>select</frontend_type>
|
40 |
+
<source_model>scrolltext/system_config_direction</source_model>
|
41 |
+
<sort_order>2</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>0</show_in_store>
|
45 |
+
<comment>Scroll upside or downside</comment>
|
46 |
+
</scrolltext_direction>
|
47 |
+
<scrolltext_position translate="label">
|
48 |
+
<label>Position</label>
|
49 |
+
<frontend_type>select</frontend_type>
|
50 |
+
<source_model>scrolltext/system_config_position</source_model>
|
51 |
+
<sort_order>2</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>0</show_in_store>
|
55 |
+
<comment>Display scrollbar left or right or footer</comment>
|
56 |
+
</scrolltext_position>
|
57 |
+
<scrolltext_title translate="label">
|
58 |
+
<label>Title</label>
|
59 |
+
<frontend_type>text</frontend_type>
|
60 |
+
<sort_order>1</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>1</show_in_website>
|
63 |
+
<show_in_store>0</show_in_store>
|
64 |
+
|
65 |
+
</scrolltext_title>
|
66 |
+
|
67 |
+
</fields>
|
68 |
+
</scrolltext_group>
|
69 |
+
</groups>
|
70 |
+
</scrolltext_sections>
|
71 |
+
</sections>
|
72 |
+
|
73 |
+
</config>
|
app/design/frontend/base/default/layout/scrolltext.xml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<layout version="0.1.0">
|
2 |
+
<default>
|
3 |
+
|
4 |
+
<!-- <reference name="content">
|
5 |
+
<block type="scrolltext/scrolltextblock" name="scrolltext_block"
|
6 |
+
template="scrolltext/scrolltext.phtml" />
|
7 |
+
</reference> -->
|
8 |
+
|
9 |
+
<reference name="left">
|
10 |
+
<block type="scrolltext/scrolltext" name="scrolltext.sidebar.left" before="-">
|
11 |
+
<action method="leftSidebarBlock" />
|
12 |
+
</block>
|
13 |
+
</reference>
|
14 |
+
<reference name="right">
|
15 |
+
<block type="scrolltext/scrolltext" name="scrolltext.sidebar.right" before="-">
|
16 |
+
<action method="rightSidebarBlock" />
|
17 |
+
</block>
|
18 |
+
</reference>
|
19 |
+
<reference name="footer">
|
20 |
+
<block type="scrolltext/scrolltext" name="scrolltext.sidebar.footer" before="-">
|
21 |
+
<action method="footerBlock" />
|
22 |
+
</block>
|
23 |
+
</reference>
|
24 |
+
</default>
|
25 |
+
</layout>
|
app/design/frontend/base/default/template/scrolltext/scrolltext.phtml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
|
4 |
+
$title = Mage::getStoreConfig('scrolltext_sections/scrolltext_group/scrolltext_title');
|
5 |
+
$scrollcontent = Mage::getStoreConfig('scrolltext_sections/scrolltext_group/scrolltext_content_text');
|
6 |
+
$scrolldirection = Mage::getStoreConfig('scrolltext_sections/scrolltext_group/scrolltext_direction');
|
7 |
+
$scrollPosition = Mage::getStoreConfig('scrolltext_sections/scrolltext_group/scrolltext_position');
|
8 |
+
?>
|
9 |
+
|
10 |
+
|
11 |
+
<?php
|
12 |
+
if($scrollPosition == 'footer'){
|
13 |
+
?>
|
14 |
+
|
15 |
+
<div class="links">
|
16 |
+
<div class="block-title">
|
17 |
+
<strong>
|
18 |
+
<span><?php echo $title; ?></span>
|
19 |
+
</strong>
|
20 |
+
</div>
|
21 |
+
<p><?php echo $scrollcontent; ?></p>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<?php
|
25 |
+
|
26 |
+
|
27 |
+
}else{
|
28 |
+
?>
|
29 |
+
<div class="block-title">
|
30 |
+
<strong>
|
31 |
+
<span><?php echo $title; ?></span>
|
32 |
+
</strong>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div class="block-content">
|
36 |
+
<marquee behavior="scroll" scrollAmount="2" direction="<?php echo $scrolldirection; ?>"><?php echo $scrollcontent; ?></marquee>
|
37 |
+
</div>
|
38 |
+
<?php
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
|
42 |
+
|
43 |
+
|
app/etc/modules/Brijesh_Scrolltext.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Brijesh_Scrolltext>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Brijesh_Scrolltext>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Brijesh_Scrolltext</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Highlight news, links or any content that you want to highlight on the page using scrolling effect.</summary>
|
10 |
+
<description>This extension allows to create scrolling text that can be displayed on frontend of your store.
|
11 |
+

|
12 |
+
The extensions can be used to display news, links or any content that you want to highlight on the page.
|
13 |
+

|
14 |
+
Display of title and content is matched with sidebar and footer links respectively.
|
15 |
+

|
16 |
+
Options to set title
|
17 |
+
Options to set content
|
18 |
+
Options to set position (right, left or footer)
|
19 |
+
Two direction scrolling, select to scroll up or scroll down.
|
20 |
+

|
21 |
+

|
22 |
+
Note: Scrolling feature is disabled in footer section
|
23 |
+
Note: If you click on scroll text options in System Configuration and it shows "404 Error Page not found". Simply logout and login. This happens because system has not yet updated configuration.
|
24 |
+

|
25 |
+
</description>
|
26 |
+
<notes>Later after testing</notes>
|
27 |
+
<authors><author><name>Brijesh Mishra</name><user>brijeshmkt</user><email>brijeshmkt@gmail.com</email></author></authors>
|
28 |
+
<date>2014-11-08</date>
|
29 |
+
<time>20:50:48</time>
|
30 |
+
<contents><target name="magelocal"><dir name="Brijesh"><dir name="Scrolltext"><dir name="Block"><file name="Scrolltext.php" hash="d3e9572de76d6e5522a7991d51d53fce"/><file name="Scrolltextblock.php" hash="8db7d7c0cca3872b479f017c8d5e419e"/><file name="Scrolltextsidebar.php" hash="dda116fa92cde220e2628f3aa6676652"/></dir><dir name="Helper"><file name="Data.php" hash="415a88c31d33392b321be6e025015a1b"/></dir><dir name="Model"><dir name="System"><dir name="Config"><file name="Direction.php" hash="3881bfc09677dda042992f07d7db0a40"/><file name="Position.php" hash="e97be197e57b386e194def0610677190"/></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="132cee87577c13b2a7e2b155aac96240"/></dir><dir name="etc"><file name="config.xml" hash="cde65ba6c4bc1bc139fca8938e91922d"/><file name="system.xml" hash="94a7ca8a122fe3d027f7afcbb515ccd5"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="scrolltext.xml" hash="1bdac0adf986257311faf7b471472298"/></dir><dir name="template"><dir name="scrolltext"><file name="scrolltext.phtml" hash="8ae753367265c2286e56e1c98ba58150"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Brijesh_Scrolltext.xml" hash="d43093ef76dac2db386cde021e2bfe4b"/></dir></target></contents>
|
31 |
+
<compatible/>
|
32 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
33 |
+
</package>
|