Version Notes
-New Release
Download this release
Release Info
Developer | Biztech |
Extension | news_module |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Biztech/News/Block/Adminhtml/Model/System/Config/Source/PageLayout.php +14 -0
- app/code/local/Biztech/News/Block/Adminhtml/News.php +55 -0
- app/code/local/Biztech/News/Block/Adminhtml/News/Edit.php +53 -0
- app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Form.php +19 -0
- app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tab/Form.php +64 -0
- app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tab/Publishingoptions.php +43 -0
- app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tab/Seo.php +38 -0
- app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tabs.php +36 -0
- app/code/local/Biztech/News/Block/Adminhtml/News/Grid.php +108 -0
- app/code/local/Biztech/News/Block/Html/Topmenu.php +211 -0
- app/code/local/Biztech/News/Block/News.php +50 -0
- app/code/local/Biztech/News/Block/Product/Toolbar.php +70 -0
- app/code/local/Biztech/News/Helper/Data.php +35 -0
- app/code/local/Biztech/News/Helper/Toolbar.php +61 -0
- app/code/local/Biztech/News/Model/Mysql4/News.php +10 -0
- app/code/local/Biztech/News/Model/Mysql4/News/Collection.php +10 -0
- app/code/local/Biztech/News/Model/News.php +10 -0
- app/code/local/Biztech/News/Model/Status.php +15 -0
- app/code/local/Biztech/News/controllers/Adminhtml/NewsController.php +218 -0
- app/code/local/Biztech/News/controllers/IndexController.php +62 -0
- app/code/local/Biztech/News/etc/config.xml +162 -0
- app/code/local/Biztech/News/etc/system.xml +62 -0
- app/code/local/Biztech/News/sql/news_setup/mysql4-install-0.1.0.php +29 -0
- app/design/adminhtml/default/default/layout/news.xml +11 -0
- app/design/frontend/default/default/layout/news.xml +24 -0
- app/design/frontend/default/default/template/news/news.phtml +12 -0
- app/design/frontend/default/default/template/news/newslist.phtml +43 -0
- app/design/frontend/default/default/template/news/toolbar.phtml +28 -0
- app/etc/modules/Biztech_News.xml +17 -0
- app/locale/de_DE/Biztech_News.csv +28 -0
- app/locale/en_GB/Biztech_News.csv +28 -0
- app/locale/en_US/Biztech_News.csv +27 -0
- app/locale/fr_FR/Biztech_News.csv +28 -0
- app/locale/it_IT/Biztech_News.csv +28 -0
- app/locale/nl_NL/Biztech_News.csv +28 -0
- package.xml +30 -0
app/code/local/Biztech/News/Block/Adminhtml/Model/System/Config/Source/PageLayout.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_News_Block_Adminhtml_Model_System_Config_Source_PageLayout extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value' => 'page/1column.phtml', 'label'=>Mage::helper('adminhtml')->__('1column')),
|
8 |
+
array('value' => 'page/2columns-right.phtml', 'label'=>Mage::helper('adminhtml')->__('2columns-right')),
|
9 |
+
array('value' => 'page/2columns-left.phtml', 'label'=>Mage::helper('adminhtml')->__('2columns-left')),
|
10 |
+
array('value' => 'page/3columns.phtml', 'label'=>Mage::helper('adminhtml')->__('3columns')),
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_News_Block_Adminhtml_News extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = 'adminhtml_news';
|
7 |
+
$this->_blockGroup = 'news';
|
8 |
+
$this->_headerText = Mage::helper('news')->__('News Manager');
|
9 |
+
$this->_addButtonLabel = Mage::helper('news')->__('Add News');
|
10 |
+
parent::__construct();
|
11 |
+
}
|
12 |
+
public function _prepareLayout()
|
13 |
+
{
|
14 |
+
return parent::_prepareLayout();
|
15 |
+
}
|
16 |
+
|
17 |
+
public function getNews()
|
18 |
+
{
|
19 |
+
if (!$this->hasData('news')) {
|
20 |
+
$this->setData('news', Mage::registry('news'));
|
21 |
+
}
|
22 |
+
return $this->getData('news');
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
protected function _beforeToHtml()
|
27 |
+
{
|
28 |
+
Mage::helper('news/toolbar')->create($this, array(
|
29 |
+
'default_order' => 'created_time',
|
30 |
+
'dir' => 'asc',
|
31 |
+
'limits' => Mage::helper('news')->commentsPerPage(),
|
32 |
+
)
|
33 |
+
);
|
34 |
+
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getPreparedCollection()
|
39 |
+
{
|
40 |
+
return $this->_prepareCollection();
|
41 |
+
}
|
42 |
+
protected function _prepareCollection()
|
43 |
+
{
|
44 |
+
$collection=Mage::getModel('news/news')->getCollection()->addFieldToFilter("status",array("eq"=>1));
|
45 |
+
|
46 |
+
$collection->setPageSize(10);
|
47 |
+
|
48 |
+
if ($this->getRequest()->getParam('p') > 0)
|
49 |
+
$collection->setCurPage($this->getRequest()->getParam('p'));
|
50 |
+
|
51 |
+
$this->setData('cached_collection', $collection);
|
52 |
+
|
53 |
+
return $this->getData('cached_collection');
|
54 |
+
}
|
55 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News/Edit.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Adminhtml_News_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
|
9 |
+
$this->_objectId = 'id';
|
10 |
+
$this->_blockGroup = 'news';
|
11 |
+
$this->_controller = 'adminhtml_news';
|
12 |
+
|
13 |
+
$this->_updateButton('save', 'label', Mage::helper('news')->__('Save News'));
|
14 |
+
$this->_updateButton('delete', 'label', Mage::helper('news')->__('Delete News'));
|
15 |
+
|
16 |
+
$this->_addButton('saveandcontinue', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
+
'onclick' => 'saveAndContinueEdit()',
|
19 |
+
'class' => 'save',
|
20 |
+
), -100);
|
21 |
+
|
22 |
+
$this->_formScripts[] = "
|
23 |
+
function toggleEditor() {
|
24 |
+
if (tinyMCE.getInstanceById('news_content') == null) {
|
25 |
+
tinyMCE.execCommand('mceAddControl', false, 'news_content');
|
26 |
+
} else {
|
27 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'news_content');
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function saveAndContinueEdit(){
|
32 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
+
}
|
34 |
+
";
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getHeaderText()
|
38 |
+
{
|
39 |
+
if( Mage::registry('news_data') && Mage::registry('news_data')->getId() ) {
|
40 |
+
return Mage::helper('news')->__("Edit News '%s'", $this->htmlEscape(Mage::registry('news_data')->getTitle()));
|
41 |
+
} else {
|
42 |
+
return Mage::helper('news')->__('Add News');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
protected function _prepareLayout()
|
46 |
+
{
|
47 |
+
parent::_prepareLayout();
|
48 |
+
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
49 |
+
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Form.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Adminhtml_News_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form(array(
|
8 |
+
'id' => 'edit_form',
|
9 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
+
'method' => 'post',
|
11 |
+
'enctype' => 'multipart/form-data'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$form->setUseContainer(true);
|
16 |
+
$this->setForm($form);
|
17 |
+
return parent::_prepareForm();
|
18 |
+
}
|
19 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Adminhtml_News_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset('news_form', array('legend'=>Mage::helper('news')->__('News information')));
|
10 |
+
|
11 |
+
$fieldset->addField('title', 'text', array(
|
12 |
+
'label' => Mage::helper('news')->__('Title'),
|
13 |
+
'class' => 'required-entry',
|
14 |
+
'required' => true,
|
15 |
+
'name' => 'title',
|
16 |
+
));
|
17 |
+
|
18 |
+
$fieldset->addField('status', 'select', array(
|
19 |
+
'label' => Mage::helper('news')->__('Published?'),
|
20 |
+
'name' => 'status',
|
21 |
+
'values' => array(
|
22 |
+
array(
|
23 |
+
'value' => 1,
|
24 |
+
'label' => Mage::helper('news')->__('Yes'),
|
25 |
+
),
|
26 |
+
|
27 |
+
array(
|
28 |
+
'value' => 2,
|
29 |
+
'label' => Mage::helper('news')->__('No'),
|
30 |
+
),
|
31 |
+
),
|
32 |
+
));
|
33 |
+
|
34 |
+
$fieldset->addField('intro', 'editor', array(
|
35 |
+
'name' => 'intro',
|
36 |
+
'label' => Mage::helper('news')->__('Intro'),
|
37 |
+
'title' => Mage::helper('news')->__('Intro'),
|
38 |
+
'style' => 'width:700px; height:500px;',
|
39 |
+
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('files_browser_window_url'=> $this->getBaseUrl().'admin/cms_wysiwyg_images/index/',)),
|
40 |
+
'wysiwyg' => true,
|
41 |
+
'required' => true,
|
42 |
+
));
|
43 |
+
|
44 |
+
|
45 |
+
$fieldset->addField('news_content', 'editor', array(
|
46 |
+
'name' => 'news_content',
|
47 |
+
'label' => Mage::helper('news')->__('Content'),
|
48 |
+
'title' => Mage::helper('news')->__('Content'),
|
49 |
+
'style' => 'width:700px; height:500px;',
|
50 |
+
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('files_browser_window_url'=> $this->getBaseUrl().'admin/cms_wysiwyg_images/index/',)),
|
51 |
+
'wysiwyg' => true,
|
52 |
+
'required' => true,
|
53 |
+
));
|
54 |
+
|
55 |
+
if ( Mage::getSingleton('adminhtml/session')->getNewsData() )
|
56 |
+
{
|
57 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getNewsData());
|
58 |
+
Mage::getSingleton('adminhtml/session')->setNewsData(null);
|
59 |
+
} elseif ( Mage::registry('news_data') ) {
|
60 |
+
$form->setValues(Mage::registry('news_data')->getData());
|
61 |
+
}
|
62 |
+
return parent::_prepareForm();
|
63 |
+
}
|
64 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tab/Publishingoptions.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Adminhtml_News_Edit_Tab_Publishingoptions extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset('news_form', array('legend'=>Mage::helper('news')->__('News information')));
|
10 |
+
|
11 |
+
$fieldset->addField('date_to_publish', 'date', array(
|
12 |
+
'label' => Mage::helper('news')->__('Start publishing on'),
|
13 |
+
'tabindex' => 1,
|
14 |
+
'after_element_html' =>"<button type='button' class='scalable' onclick=\"$('date_to_publish').setValue('')\">Clear</button>",
|
15 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
16 |
+
'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
|
17 |
+
'required' => true,
|
18 |
+
'name' => 'date_to_publish',
|
19 |
+
));
|
20 |
+
|
21 |
+
$fieldset->addField('date_to_unpublish', 'date', array(
|
22 |
+
'label' => Mage::helper('news')->__('End publishing on'),
|
23 |
+
'tabindex' => 1,
|
24 |
+
'after_element_html' =>"<button type='button' class='scalable' onclick=\"$('date_to_unpublish').setValue('')\">Clear</button>",
|
25 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
26 |
+
'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
|
27 |
+
'required' => true,
|
28 |
+
'name' => 'date_to_unpublish',
|
29 |
+
));
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
if ( Mage::getSingleton('adminhtml/session')->getNewsData() )
|
35 |
+
{
|
36 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getNewsData());
|
37 |
+
Mage::getSingleton('adminhtml/session')->setNewsData(null);
|
38 |
+
} elseif ( Mage::registry('news_data') ) {
|
39 |
+
$form->setValues(Mage::registry('news_data')->getData());
|
40 |
+
}
|
41 |
+
return parent::_prepareForm();
|
42 |
+
}
|
43 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tab/Seo.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Adminhtml_News_Edit_Tab_Seo extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
protected function _prepareForm()
|
6 |
+
{
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset('news_form', array('legend'=>Mage::helper('news')->__('News information')));
|
10 |
+
|
11 |
+
|
12 |
+
$fieldset->addField('browser_title', 'text', array(
|
13 |
+
'label' => Mage::helper('news')->__('Browser Title'),
|
14 |
+
'required' => false,
|
15 |
+
'name' => 'browser_title',
|
16 |
+
));
|
17 |
+
$fieldset->addField('seo_keywords', 'text', array(
|
18 |
+
'label' => Mage::helper('news')->__('Keywords'),
|
19 |
+
'required' => false,
|
20 |
+
'name' => 'seo_keywords',
|
21 |
+
));
|
22 |
+
$fieldset->addField('seo_description', 'text', array(
|
23 |
+
'label' => Mage::helper('news')->__('Description'),
|
24 |
+
'required' => false,
|
25 |
+
'name' => 'seo_description',
|
26 |
+
));
|
27 |
+
|
28 |
+
|
29 |
+
if ( Mage::getSingleton('adminhtml/session')->getNewsData() )
|
30 |
+
{
|
31 |
+
$form->setValues(Mage::getSingleton('adminhtml/session')->getNewsData());
|
32 |
+
Mage::getSingleton('adminhtml/session')->setNewsData(null);
|
33 |
+
} elseif ( Mage::registry('news_data') ) {
|
34 |
+
$form->setValues(Mage::registry('news_data')->getData());
|
35 |
+
}
|
36 |
+
return parent::_prepareForm();
|
37 |
+
}
|
38 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News/Edit/Tabs.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Adminhtml_News_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId('news_tabs');
|
10 |
+
$this->setDestElementId('edit_form');
|
11 |
+
$this->setTitle(Mage::helper('news')->__('News Information'));
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('news')->__('News Information'),
|
18 |
+
'title' => Mage::helper('news')->__('News Information'),
|
19 |
+
'content' => $this->getLayout()->createBlock('news/adminhtml_news_edit_tab_form')->toHtml(),
|
20 |
+
));
|
21 |
+
|
22 |
+
$this->addTab('publishing_options', array(
|
23 |
+
'label' => Mage::helper('news')->__('Publishing Options'),
|
24 |
+
'title' => Mage::helper('news')->__('Publishing Options'),
|
25 |
+
'content' => $this->getLayout()->createBlock('news/adminhtml_news_edit_tab_publishingoptions')->toHtml(),
|
26 |
+
));
|
27 |
+
|
28 |
+
$this->addTab('seo', array(
|
29 |
+
'label' => Mage::helper('news')->__('Seo Options'),
|
30 |
+
'title' => Mage::helper('news')->__('Seo Options'),
|
31 |
+
'content' => $this->getLayout()->createBlock('news/adminhtml_news_edit_tab_seo')->toHtml(),
|
32 |
+
));
|
33 |
+
|
34 |
+
return parent::_beforeToHtml();
|
35 |
+
}
|
36 |
+
}
|
app/code/local/Biztech/News/Block/Adminhtml/News/Grid.php
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Adminhtml_News_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setId('newsGrid');
|
9 |
+
$this->setDefaultSort('news_id');
|
10 |
+
$this->setDefaultDir('ASC');
|
11 |
+
$this->setSaveParametersInSession(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
protected function _prepareCollection()
|
15 |
+
{
|
16 |
+
$collection = Mage::getModel('news/news')->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn('news_id', array(
|
24 |
+
'header' => Mage::helper('news')->__('ID'),
|
25 |
+
'align' =>'right',
|
26 |
+
'width' => '50px',
|
27 |
+
'index' => 'news_id',
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn('title', array(
|
31 |
+
'header' => Mage::helper('news')->__('Title'),
|
32 |
+
'align' =>'left',
|
33 |
+
'index' => 'title',
|
34 |
+
));
|
35 |
+
|
36 |
+
$this->addColumn('status', array(
|
37 |
+
'header' => Mage::helper('news')->__('Status'),
|
38 |
+
'align' => 'left',
|
39 |
+
'width' => '80px',
|
40 |
+
'index' => 'status',
|
41 |
+
'type' => 'options',
|
42 |
+
'options' => array(
|
43 |
+
1 => 'Enabled',
|
44 |
+
2 => 'Disabled',
|
45 |
+
),
|
46 |
+
));
|
47 |
+
|
48 |
+
$this->addColumn('action',
|
49 |
+
array(
|
50 |
+
'header' => Mage::helper('news')->__('Action'),
|
51 |
+
'width' => '100',
|
52 |
+
'type' => 'action',
|
53 |
+
'getter' => 'getId',
|
54 |
+
'actions' => array(
|
55 |
+
array(
|
56 |
+
'caption' => Mage::helper('news')->__('Edit'),
|
57 |
+
'url' => array('base'=> '*/*/edit'),
|
58 |
+
'field' => 'id'
|
59 |
+
)
|
60 |
+
),
|
61 |
+
'filter' => false,
|
62 |
+
'sortable' => false,
|
63 |
+
'index' => 'stores',
|
64 |
+
'is_system' => true,
|
65 |
+
));
|
66 |
+
|
67 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('news')->__('CSV'));
|
68 |
+
$this->addExportType('*/*/exportXml', Mage::helper('news')->__('XML'));
|
69 |
+
|
70 |
+
return parent::_prepareColumns();
|
71 |
+
}
|
72 |
+
|
73 |
+
protected function _prepareMassaction()
|
74 |
+
{
|
75 |
+
$this->setMassactionIdField('news_id');
|
76 |
+
$this->getMassactionBlock()->setFormFieldName('news');
|
77 |
+
|
78 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
79 |
+
'label' => Mage::helper('news')->__('Delete'),
|
80 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
81 |
+
'confirm' => Mage::helper('news')->__('Are you sure?')
|
82 |
+
));
|
83 |
+
|
84 |
+
$statuses = Mage::getSingleton('news/status')->getOptionArray();
|
85 |
+
|
86 |
+
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
87 |
+
$this->getMassactionBlock()->addItem('status', array(
|
88 |
+
'label'=> Mage::helper('news')->__('Change status'),
|
89 |
+
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
90 |
+
'additional' => array(
|
91 |
+
'visibility' => array(
|
92 |
+
'name' => 'status',
|
93 |
+
'type' => 'select',
|
94 |
+
'class' => 'required-entry',
|
95 |
+
'label' => Mage::helper('news')->__('Status'),
|
96 |
+
'values' => $statuses
|
97 |
+
)
|
98 |
+
)
|
99 |
+
));
|
100 |
+
return $this;
|
101 |
+
}
|
102 |
+
|
103 |
+
public function getRowUrl($row)
|
104 |
+
{
|
105 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
app/code/local/Biztech/News/Block/Html/Topmenu.php
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Page
|
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 |
+
* Top menu block
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_Page
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Biztech_News_Block_Html_Topmenu extends Mage_Core_Block_Template
|
35 |
+
{
|
36 |
+
/**
|
37 |
+
* Top menu data tree
|
38 |
+
*
|
39 |
+
* @var Varien_Data_Tree_Node
|
40 |
+
*/
|
41 |
+
protected $_menu;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Init top menu tree structure
|
45 |
+
*/
|
46 |
+
public function _construct()
|
47 |
+
{
|
48 |
+
$this->_menu = new Varien_Data_Tree_Node(array(), 'root', new Varien_Data_Tree());
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Get top menu html
|
53 |
+
*
|
54 |
+
* @param string $outermostClass
|
55 |
+
* @param string $childrenWrapClass
|
56 |
+
* @return string
|
57 |
+
*/
|
58 |
+
public function getHtml($outermostClass = '', $childrenWrapClass = '')
|
59 |
+
{
|
60 |
+
Mage::dispatchEvent('page_block_html_topmenu_gethtml_before', array(
|
61 |
+
'menu' => $this->_menu
|
62 |
+
));
|
63 |
+
|
64 |
+
$this->_menu->setOutermostClass($outermostClass);
|
65 |
+
$this->_menu->setChildrenWrapClass($childrenWrapClass);
|
66 |
+
|
67 |
+
$html = $this->_getHtml($this->_menu, $childrenWrapClass);
|
68 |
+
|
69 |
+
Mage::dispatchEvent('page_block_html_topmenu_gethtml_after', array(
|
70 |
+
'menu' => $this->_menu,
|
71 |
+
'html' => $html
|
72 |
+
));
|
73 |
+
|
74 |
+
if(Mage::getStoreConfig('news/news_general/enabled') == 1)
|
75 |
+
{
|
76 |
+
$active = ($this->getRequest()->getRouteName()=='news' ? 'active' : '');
|
77 |
+
$html .= "<li class='$outermostItemClass $active'><a class='$outermostItemClass' href='" . Mage::getUrl('news') . "'><span>" . Mage::helper('news')->__('News') . "</span></a></li>";
|
78 |
+
}
|
79 |
+
return $html;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Recursively generates top menu html from data that is specified in $menuTree
|
84 |
+
*
|
85 |
+
* @param Varien_Data_Tree_Node $menuTree
|
86 |
+
* @param string $childrenWrapClass
|
87 |
+
* @return string
|
88 |
+
*/
|
89 |
+
protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass)
|
90 |
+
{
|
91 |
+
$html = '';
|
92 |
+
|
93 |
+
$children = $menuTree->getChildren();
|
94 |
+
$parentLevel = $menuTree->getLevel();
|
95 |
+
$childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1;
|
96 |
+
|
97 |
+
$counter = 1;
|
98 |
+
$childrenCount = $children->count();
|
99 |
+
|
100 |
+
$parentPositionClass = $menuTree->getPositionClass();
|
101 |
+
$itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-';
|
102 |
+
|
103 |
+
foreach ($children as $child) {
|
104 |
+
|
105 |
+
$child->setLevel($childLevel);
|
106 |
+
$child->setIsFirst($counter == 1);
|
107 |
+
$child->setIsLast($counter == $childrenCount);
|
108 |
+
$child->setPositionClass($itemPositionClassPrefix . $counter);
|
109 |
+
|
110 |
+
$outermostClassCode = '';
|
111 |
+
$outermostClass = $menuTree->getOutermostClass();
|
112 |
+
|
113 |
+
if ($childLevel == 0 && $outermostClass) {
|
114 |
+
$outermostClassCode = ' class="' . $outermostClass . '" ';
|
115 |
+
$child->setClass($outermostClass);
|
116 |
+
}
|
117 |
+
|
118 |
+
$html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
|
119 |
+
$html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
|
120 |
+
. $this->escapeHtml($child->getName()) . '</span></a>';
|
121 |
+
|
122 |
+
if ($child->hasChildren()) {
|
123 |
+
if (!empty($childrenWrapClass)) {
|
124 |
+
$html .= '<div class="' . $childrenWrapClass . '">';
|
125 |
+
}
|
126 |
+
$html .= '<ul class="level' . $childLevel . '">';
|
127 |
+
$html .= $this->_getHtml($child, $childrenWrapClass);
|
128 |
+
$html .= '</ul>';
|
129 |
+
|
130 |
+
if (!empty($childrenWrapClass)) {
|
131 |
+
$html .= '</div>';
|
132 |
+
}
|
133 |
+
}
|
134 |
+
$html .= '</li>';
|
135 |
+
|
136 |
+
$counter++;
|
137 |
+
}
|
138 |
+
|
139 |
+
return $html;
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Generates string with all attributes that should be present in menu item element
|
144 |
+
*
|
145 |
+
* @param Varien_Data_Tree_Node $item
|
146 |
+
* @return string
|
147 |
+
*/
|
148 |
+
protected function _getRenderedMenuItemAttributes(Varien_Data_Tree_Node $item)
|
149 |
+
{
|
150 |
+
$html = '';
|
151 |
+
$attributes = $this->_getMenuItemAttributes($item);
|
152 |
+
|
153 |
+
foreach ($attributes as $attributeName => $attributeValue) {
|
154 |
+
$html .= ' ' . $attributeName . '="' . str_replace('"', '\"', $attributeValue) . '"';
|
155 |
+
}
|
156 |
+
|
157 |
+
return $html;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Returns array of menu item's attributes
|
162 |
+
*
|
163 |
+
* @param Varien_Data_Tree_Node $item
|
164 |
+
* @return array
|
165 |
+
*/
|
166 |
+
protected function _getMenuItemAttributes(Varien_Data_Tree_Node $item)
|
167 |
+
{
|
168 |
+
$menuItemClasses = $this->_getMenuItemClasses($item);
|
169 |
+
$attributes = array(
|
170 |
+
'class' => implode(' ', $menuItemClasses)
|
171 |
+
);
|
172 |
+
|
173 |
+
return $attributes;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Returns array of menu item's classes
|
178 |
+
*
|
179 |
+
* @param Varien_Data_Tree_Node $item
|
180 |
+
* @return array
|
181 |
+
*/
|
182 |
+
protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
|
183 |
+
{
|
184 |
+
$classes = array();
|
185 |
+
|
186 |
+
$classes[] = 'level' . $item->getLevel();
|
187 |
+
$classes[] = $item->getPositionClass();
|
188 |
+
|
189 |
+
if ($item->getIsFirst()) {
|
190 |
+
$classes[] = 'first';
|
191 |
+
}
|
192 |
+
|
193 |
+
if ($item->getIsActive()) {
|
194 |
+
$classes[] = 'active';
|
195 |
+
}
|
196 |
+
|
197 |
+
if ($item->getIsLast()) {
|
198 |
+
$classes[] = 'last';
|
199 |
+
}
|
200 |
+
|
201 |
+
if ($item->getClass()) {
|
202 |
+
$classes[] = $item->getClass();
|
203 |
+
}
|
204 |
+
|
205 |
+
if ($item->hasChildren()) {
|
206 |
+
$classes[] = 'parent';
|
207 |
+
}
|
208 |
+
|
209 |
+
return $classes;
|
210 |
+
}
|
211 |
+
}
|
app/code/local/Biztech/News/Block/News.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_News_Block_News extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
|
7 |
+
return parent::_prepareLayout();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getNews()
|
11 |
+
{
|
12 |
+
$id = $this->getRequest()->getParam("id");
|
13 |
+
$news = Mage::getModel('news/news')->load($id);
|
14 |
+
return $news;
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function _beforeToHtml()
|
19 |
+
{
|
20 |
+
Mage::helper('news/toolbar')->create($this, array(
|
21 |
+
'default_order' => 'created_time',
|
22 |
+
'dir' => 'asc',
|
23 |
+
'limits' => Mage::helper('news')->commentsPerPage(),
|
24 |
+
)
|
25 |
+
);
|
26 |
+
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getPreparedCollection()
|
31 |
+
{
|
32 |
+
return $this->_prepareCollection();
|
33 |
+
}
|
34 |
+
protected function _prepareCollection()
|
35 |
+
{
|
36 |
+
|
37 |
+
$collection=Mage::getModel('news/news')->getCollection()->addFieldToFilter("status",array("eq"=>1))->addFieldToFilter("date_to_unpublish",array("gteq"=>date('Y-m-d 00:00:00')))->addFieldToFilter("date_to_publish",array("lt"=>date('Y-m-d 23:59:59')));
|
38 |
+
|
39 |
+
$collection->setPageSize(10);
|
40 |
+
|
41 |
+
if ($this->getRequest()->getParam('p') > 0)
|
42 |
+
$collection->setCurPage($this->getRequest()->getParam('p'));
|
43 |
+
|
44 |
+
$this->setData('cached_collection', $collection);
|
45 |
+
|
46 |
+
|
47 |
+
return $this->getData('cached_collection');
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
app/code/local/Biztech/News/Block/Product/Toolbar.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Block_Product_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
|
8 |
+
$this->setTemplate('news/toolbar.phtml');
|
9 |
+
|
10 |
+
}
|
11 |
+
|
12 |
+
public function setCollection($collection)
|
13 |
+
{
|
14 |
+
parent::setCollection($collection);
|
15 |
+
if ($this->getCurrentOrder() && $this->getCurrentDirection()) {
|
16 |
+
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
|
17 |
+
}
|
18 |
+
|
19 |
+
return $this;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getCurrentOrder()
|
23 |
+
{
|
24 |
+
$order = $this->getRequest()->getParam($this->getOrderVarName());
|
25 |
+
|
26 |
+
if(!$order) {
|
27 |
+
return $this->_orderField;
|
28 |
+
}
|
29 |
+
|
30 |
+
if(array_key_exists($order, $this->getAvailableOrders())) {
|
31 |
+
return $order;
|
32 |
+
}
|
33 |
+
|
34 |
+
return $this->_orderField;
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getCurrentMode()
|
39 |
+
{
|
40 |
+
return null;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getAvailableLimit()
|
44 |
+
{
|
45 |
+
return $this->getPost()->getAvailLimits();
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getCurrentDirection()
|
49 |
+
{
|
50 |
+
$dir = $this->getRequest()->getParam($this->getDirectionVarName());
|
51 |
+
|
52 |
+
if(in_array($dir, array('asc', 'desc'))) {
|
53 |
+
return $dir;
|
54 |
+
}
|
55 |
+
|
56 |
+
return Mage::helper('news')->defaultPostSort(Mage::app()->getStore()->getId());
|
57 |
+
}
|
58 |
+
|
59 |
+
public function setDefaultOrder($field)
|
60 |
+
{
|
61 |
+
$this->_orderField = $field;
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
public function getLimit()
|
66 |
+
{
|
67 |
+
return $this->getRequest()->getParam($this->getLimitVarName());
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
app/code/local/Biztech/News/Helper/Data.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function getNewsUrl(){
|
6 |
+
return $this->_getUrl('news/index');
|
7 |
+
}
|
8 |
+
public function commentsPerPage($store = null)
|
9 |
+
{
|
10 |
+
$count = 10;
|
11 |
+
|
12 |
+
if (!$count) {
|
13 |
+
return self::DEFAULT_PAGE_COUNT;
|
14 |
+
}
|
15 |
+
|
16 |
+
return $count;
|
17 |
+
}
|
18 |
+
public function defaultPostSort($store = null)
|
19 |
+
{
|
20 |
+
return "ASC";
|
21 |
+
}
|
22 |
+
public function getEnabled()
|
23 |
+
{
|
24 |
+
return true;
|
25 |
+
}
|
26 |
+
public function filterWYS($text)
|
27 |
+
{
|
28 |
+
$processorModelName = version_compare(Mage::getVersion(), '1.3.3.0', '>') ? 'widget/template_filter' : 'core/email_template_filter';
|
29 |
+
$processor = Mage::getModel($processorModelName);
|
30 |
+
if ($processor instanceof Mage_Core_Model_Email_Template_Filter) {
|
31 |
+
return $processor->filter($text);
|
32 |
+
}
|
33 |
+
return $text;
|
34 |
+
}
|
35 |
+
}
|
app/code/local/Biztech/News/Helper/Toolbar.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_News_Helper_Toolbar extends Mage_Core_Block_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
public function create($block, $params = array())
|
6 |
+
{
|
7 |
+
$this->setToolbarParentBlock($block);
|
8 |
+
$this->setToolbarParams($params);
|
9 |
+
|
10 |
+
$toolbar = $this->getToolbarBlock();
|
11 |
+
if ($toolbar){
|
12 |
+
$toolbar->setPost($this);
|
13 |
+
$toolbar->setAvailableOrders($params['orders']);
|
14 |
+
$toolbar->setDefaultOrder($params['default_order']);
|
15 |
+
|
16 |
+
|
17 |
+
if (isset($params['dir'])) {
|
18 |
+
$toolbar->setDefaultDirection($params['dir']);
|
19 |
+
} else {
|
20 |
+
$toolbar->setDefaultDirection('ASC');
|
21 |
+
}
|
22 |
+
|
23 |
+
$toolbar->setCollection($block->getPreparedCollection());
|
24 |
+
|
25 |
+
$toolbar->disableViewSwitcher();
|
26 |
+
$block->setChild('Biztech_news_toolbar', $toolbar);
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getAvailLimits()
|
31 |
+
{
|
32 |
+
$params = $this->getToolbarParams();
|
33 |
+
|
34 |
+
$limits = array();
|
35 |
+
if (isset($params['limits'])) {
|
36 |
+
foreach (explode(',', $params['limits']) as $limit) {
|
37 |
+
$limit = (int) trim($limit);
|
38 |
+
|
39 |
+
if (!$limit) {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
|
43 |
+
$limits[$limit] = $limit;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
return $limits;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getToolbarBlock()
|
51 |
+
{
|
52 |
+
$block = $this->getToolbarParentBlock()->getLayout()->getBlock('Biztech_news_list_toolbar');
|
53 |
+
|
54 |
+
if (!$block) {
|
55 |
+
return $this->getToolbarParentBlock()->getLayout()->createBlock('news/product_toolbar', microtime());
|
56 |
+
}
|
57 |
+
|
58 |
+
return $block;
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
app/code/local/Biztech/News/Model/Mysql4/News.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Model_Mysql4_News extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
// Note that the news_id refers to the key field in your database table.
|
8 |
+
$this->_init('news/news', 'news_id');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/News/Model/Mysql4/News/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Model_Mysql4_News_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('news/news');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/News/Model/News.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Model_News extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('news/news');
|
9 |
+
}
|
10 |
+
}
|
app/code/local/Biztech/News/Model/Status.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Model_Status extends Varien_Object
|
4 |
+
{
|
5 |
+
const STATUS_ENABLED = 1;
|
6 |
+
const STATUS_DISABLED = 2;
|
7 |
+
|
8 |
+
static public function getOptionArray()
|
9 |
+
{
|
10 |
+
return array(
|
11 |
+
self::STATUS_ENABLED => Mage::helper('news')->__('Enabled'),
|
12 |
+
self::STATUS_DISABLED => Mage::helper('news')->__('Disabled')
|
13 |
+
);
|
14 |
+
}
|
15 |
+
}
|
app/code/local/Biztech/News/controllers/Adminhtml/NewsController.php
ADDED
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Biztech_News_Adminhtml_NewsController extends Mage_Adminhtml_Controller_action
|
4 |
+
{
|
5 |
+
|
6 |
+
protected function _initAction() {
|
7 |
+
$this->loadLayout()
|
8 |
+
->_setActiveMenu('news/items')
|
9 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
10 |
+
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function indexAction() {
|
15 |
+
$this->_initAction()
|
16 |
+
->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function editAction() {
|
20 |
+
$id = $this->getRequest()->getParam('id');
|
21 |
+
$model = Mage::getModel('news/news')->load($id);
|
22 |
+
|
23 |
+
if ($model->getId() || $id == 0) {
|
24 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
25 |
+
if (!empty($data)) {
|
26 |
+
$model->setData($data);
|
27 |
+
}
|
28 |
+
|
29 |
+
Mage::register('news_data', $model);
|
30 |
+
|
31 |
+
$this->loadLayout();
|
32 |
+
$this->_setActiveMenu('news/items');
|
33 |
+
|
34 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
35 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
36 |
+
|
37 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
38 |
+
|
39 |
+
$this->_addContent($this->getLayout()->createBlock('news/adminhtml_news_edit'))
|
40 |
+
->_addLeft($this->getLayout()->createBlock('news/adminhtml_news_edit_tabs'));
|
41 |
+
|
42 |
+
$this->renderLayout();
|
43 |
+
} else {
|
44 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('news')->__('Item does not exist'));
|
45 |
+
$this->_redirect('*/*/');
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function newAction() {
|
50 |
+
$this->_forward('edit');
|
51 |
+
}
|
52 |
+
|
53 |
+
public function saveAction() {
|
54 |
+
if ($data = $this->getRequest()->getPost()) {
|
55 |
+
|
56 |
+
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
|
57 |
+
try {
|
58 |
+
|
59 |
+
$uploader = new Varien_File_Uploader('filename');
|
60 |
+
|
61 |
+
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
|
62 |
+
$uploader->setAllowRenameFiles(false);
|
63 |
+
|
64 |
+
|
65 |
+
$uploader->setFilesDispersion(false);
|
66 |
+
|
67 |
+
$path = Mage::getBaseDir('media') . DS ;
|
68 |
+
$uploader->save($path, $_FILES['filename']['name'] );
|
69 |
+
|
70 |
+
} catch (Exception $e) {
|
71 |
+
|
72 |
+
}
|
73 |
+
$data['filename'] = $_FILES['filename']['name'];
|
74 |
+
}
|
75 |
+
|
76 |
+
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
77 |
+
try {
|
78 |
+
$publish_date = Mage::app()->getLocale()->date($data['date_to_publish'], $format, null, false);
|
79 |
+
$unpublish_date = Mage::app()->getLocale()->date($data['date_to_unpublish'], $format, null, false);
|
80 |
+
}
|
81 |
+
catch (Exception $e)
|
82 |
+
{
|
83 |
+
Mage::getSingleton('adminhtml/session')->addError("Invalid Date");
|
84 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
85 |
+
return;
|
86 |
+
}
|
87 |
+
|
88 |
+
$model = Mage::getModel('news/news');
|
89 |
+
$model->setData($data)
|
90 |
+
->setId($this->getRequest()->getParam('id'));
|
91 |
+
|
92 |
+
try {
|
93 |
+
if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
|
94 |
+
$model->setCreatedTime(now())
|
95 |
+
->setUpdateTime(now());
|
96 |
+
} else {
|
97 |
+
$model->setUpdateTime(now());
|
98 |
+
}
|
99 |
+
|
100 |
+
$model->save();
|
101 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('news')->__('News was successfully saved'));
|
102 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
103 |
+
|
104 |
+
if ($this->getRequest()->getParam('back')) {
|
105 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
106 |
+
return;
|
107 |
+
}
|
108 |
+
$this->_redirect('*/*/');
|
109 |
+
return;
|
110 |
+
} catch (Exception $e) {
|
111 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
112 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
113 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
114 |
+
return;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('news')->__('Unable to find item to save'));
|
118 |
+
$this->_redirect('*/*/');
|
119 |
+
}
|
120 |
+
|
121 |
+
public function deleteAction() {
|
122 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
123 |
+
try {
|
124 |
+
$model = Mage::getModel('news/news');
|
125 |
+
|
126 |
+
$model->setId($this->getRequest()->getParam('id'))
|
127 |
+
->delete();
|
128 |
+
|
129 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
130 |
+
$this->_redirect('*/*/');
|
131 |
+
} catch (Exception $e) {
|
132 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
133 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
134 |
+
}
|
135 |
+
}
|
136 |
+
$this->_redirect('*/*/');
|
137 |
+
}
|
138 |
+
|
139 |
+
public function massDeleteAction() {
|
140 |
+
$newsIds = $this->getRequest()->getParam('news');
|
141 |
+
if(!is_array($newsIds)) {
|
142 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
143 |
+
} else {
|
144 |
+
try {
|
145 |
+
foreach ($newsIds as $newsId) {
|
146 |
+
$news = Mage::getModel('news/news')->load($newsId);
|
147 |
+
$news->delete();
|
148 |
+
}
|
149 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
150 |
+
Mage::helper('adminhtml')->__(
|
151 |
+
'Total of %d record(s) were successfully deleted', count($newsIds)
|
152 |
+
)
|
153 |
+
);
|
154 |
+
} catch (Exception $e) {
|
155 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
156 |
+
}
|
157 |
+
}
|
158 |
+
$this->_redirect('*/*/index');
|
159 |
+
}
|
160 |
+
|
161 |
+
public function massStatusAction()
|
162 |
+
{
|
163 |
+
$newsIds = $this->getRequest()->getParam('news');
|
164 |
+
if(!is_array($newsIds)) {
|
165 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
166 |
+
} else {
|
167 |
+
try {
|
168 |
+
foreach ($newsIds as $newsId) {
|
169 |
+
$news = Mage::getSingleton('news/news')
|
170 |
+
->load($newsId)
|
171 |
+
->setStatus($this->getRequest()->getParam('status'))
|
172 |
+
->setIsMassupdate(true)
|
173 |
+
->save();
|
174 |
+
}
|
175 |
+
$this->_getSession()->addSuccess(
|
176 |
+
$this->__('Total of %d record(s) were successfully updated', count($newsIds))
|
177 |
+
);
|
178 |
+
} catch (Exception $e) {
|
179 |
+
$this->_getSession()->addError($e->getMessage());
|
180 |
+
}
|
181 |
+
}
|
182 |
+
$this->_redirect('*/*/index');
|
183 |
+
}
|
184 |
+
|
185 |
+
public function exportCsvAction()
|
186 |
+
{
|
187 |
+
$fileName = 'news.csv';
|
188 |
+
$content = $this->getLayout()->createBlock('news/adminhtml_news_grid')
|
189 |
+
->getCsv();
|
190 |
+
|
191 |
+
$this->_sendUploadResponse($fileName, $content);
|
192 |
+
}
|
193 |
+
|
194 |
+
public function exportXmlAction()
|
195 |
+
{
|
196 |
+
$fileName = 'news.xml';
|
197 |
+
$content = $this->getLayout()->createBlock('news/adminhtml_news_grid')
|
198 |
+
->getXml();
|
199 |
+
|
200 |
+
$this->_sendUploadResponse($fileName, $content);
|
201 |
+
}
|
202 |
+
|
203 |
+
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
204 |
+
{
|
205 |
+
$response = $this->getResponse();
|
206 |
+
$response->setHeader('HTTP/1.1 200 OK','');
|
207 |
+
$response->setHeader('Pragma', 'public', true);
|
208 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
209 |
+
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
210 |
+
$response->setHeader('Last-Modified', date('r'));
|
211 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
212 |
+
$response->setHeader('Content-Length', strlen($content));
|
213 |
+
$response->setHeader('Content-type', $contentType);
|
214 |
+
$response->setBody($content);
|
215 |
+
$response->sendResponse();
|
216 |
+
die;
|
217 |
+
}
|
218 |
+
}
|
app/code/local/Biztech/News/controllers/IndexController.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Biztech_News_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
|
7 |
+
$news_id = $this->getRequest()->getParam('id');
|
8 |
+
if($news_id != null && $news_id != '') {
|
9 |
+
$news = Mage::getModel('news/news')->load($news_id)->getData();
|
10 |
+
if($news['status']==2)
|
11 |
+
{
|
12 |
+
$this->_redirect('news.html');
|
13 |
+
}
|
14 |
+
} else {
|
15 |
+
$news = null;
|
16 |
+
}
|
17 |
+
|
18 |
+
if($news == null) {
|
19 |
+
$resource = Mage::getSingleton('core/resource');
|
20 |
+
$read= $resource->getConnection('core_read');
|
21 |
+
$newsTable = $resource->getTableName('news');
|
22 |
+
$select = $read->select()
|
23 |
+
->from($newsTable,array('news_id','title','news_content','status'))
|
24 |
+
->where('status',1)
|
25 |
+
->order('created_time DESC') ;
|
26 |
+
$news = $read->fetchRow($select);
|
27 |
+
}
|
28 |
+
Mage::register('news', $news);
|
29 |
+
$this->loadLayout();
|
30 |
+
|
31 |
+
$root = $this->getLayout()->getBlock('root');
|
32 |
+
$template = Mage::getStoreConfig('news/news_general/news_list_page_layout');
|
33 |
+
$root->setTemplate($template);
|
34 |
+
if($news['seo_keywords'] != "")
|
35 |
+
$this->getLayout()->getBlock('head')->setTitle($news['seo_keywords']);
|
36 |
+
if($news['seo_description'] != "")
|
37 |
+
$this->getLayout()->getBlock('head')->setKeywords($news['seo_description']);
|
38 |
+
$this->renderLayout();
|
39 |
+
}
|
40 |
+
|
41 |
+
public function viewAction()
|
42 |
+
{
|
43 |
+
$id = $this->getRequest()->getParam("id");
|
44 |
+
if($id)
|
45 |
+
{
|
46 |
+
$this->getLayout()->createBlock('news/news')->setData(array("id"=>$id))->setTemplate('news/news.phtml')->toHtml();
|
47 |
+
}
|
48 |
+
$this->loadLayout();
|
49 |
+
|
50 |
+
$root = $this->getLayout()->getBlock('root');
|
51 |
+
$template = Mage::getStoreConfig('news/news_general/news_detail_page_layout');
|
52 |
+
$root->setTemplate($template);
|
53 |
+
$news = Mage::getModel('news/news')->load($id)->getData();
|
54 |
+
if($news['browser_title'] != "")
|
55 |
+
$this->getLayout()->getBlock('head')->setTitle($news['browser_title']);
|
56 |
+
if($news['seo_keywords'] != "")
|
57 |
+
$this->getLayout()->getBlock('head')->setKeywords($news['seo_keywords']);
|
58 |
+
if($news['seo_description'] != "")
|
59 |
+
$this->getLayout()->getBlock('head')->setDescription($news['seo_description']);
|
60 |
+
$this->renderLayout();
|
61 |
+
}
|
62 |
+
}
|
app/code/local/Biztech/News/etc/config.xml
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Biztech_News>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Biztech_News>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<news>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Biztech_News</module>
|
14 |
+
<frontName>news</frontName>
|
15 |
+
</args>
|
16 |
+
</news>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<news>
|
21 |
+
<file>news.xml</file>
|
22 |
+
</news>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
<translate>
|
26 |
+
<modules>
|
27 |
+
<Biztech_News>
|
28 |
+
<files>
|
29 |
+
<default>Biztech_News.csv</default>
|
30 |
+
</files>
|
31 |
+
</Biztech_News>
|
32 |
+
</modules>
|
33 |
+
</translate>
|
34 |
+
</frontend>
|
35 |
+
<admin>
|
36 |
+
<routers>
|
37 |
+
<news>
|
38 |
+
<use>admin</use>
|
39 |
+
<args>
|
40 |
+
<module>Biztech_News</module>
|
41 |
+
<frontName>news</frontName>
|
42 |
+
</args>
|
43 |
+
</news>
|
44 |
+
</routers>
|
45 |
+
</admin>
|
46 |
+
<adminhtml>
|
47 |
+
<menu>
|
48 |
+
<news module="news">
|
49 |
+
<title>News</title>
|
50 |
+
<sort_order>71</sort_order>
|
51 |
+
<children>
|
52 |
+
<items module="news">
|
53 |
+
<title>Manage News</title>
|
54 |
+
<sort_order>0</sort_order>
|
55 |
+
<action>news/adminhtml_news</action>
|
56 |
+
</items>
|
57 |
+
</children>
|
58 |
+
</news>
|
59 |
+
</menu>
|
60 |
+
<acl>
|
61 |
+
<resources>
|
62 |
+
<all>
|
63 |
+
<title>Allow Everything</title>
|
64 |
+
</all>
|
65 |
+
<admin>
|
66 |
+
<children>
|
67 |
+
<Biztech_News>
|
68 |
+
<title>News Module</title>
|
69 |
+
<sort_order>10</sort_order>
|
70 |
+
</Biztech_News>
|
71 |
+
<system>
|
72 |
+
<children>
|
73 |
+
<config>
|
74 |
+
<children>
|
75 |
+
<news>
|
76 |
+
<title>News</title>
|
77 |
+
</news>
|
78 |
+
</children>
|
79 |
+
</config>
|
80 |
+
</children>
|
81 |
+
</system>
|
82 |
+
</children>
|
83 |
+
</admin>
|
84 |
+
</resources>
|
85 |
+
</acl>
|
86 |
+
<layout>
|
87 |
+
<updates>
|
88 |
+
<news>
|
89 |
+
<file>news.xml</file>
|
90 |
+
</news>
|
91 |
+
</updates>
|
92 |
+
</layout>
|
93 |
+
<translate>
|
94 |
+
<modules>
|
95 |
+
<Biztech_News>
|
96 |
+
<files>
|
97 |
+
<default>Biztech_News.csv</default>
|
98 |
+
</files>
|
99 |
+
</Biztech_News>
|
100 |
+
</modules>
|
101 |
+
</translate>
|
102 |
+
</adminhtml>
|
103 |
+
<global>
|
104 |
+
<models>
|
105 |
+
<news>
|
106 |
+
<class>Biztech_News_Model</class>
|
107 |
+
<resourceModel>news_mysql4</resourceModel>
|
108 |
+
</news>
|
109 |
+
<news_mysql4>
|
110 |
+
<class>Biztech_News_Model_Mysql4</class>
|
111 |
+
<entities>
|
112 |
+
<news>
|
113 |
+
<table>news</table>
|
114 |
+
</news>
|
115 |
+
</entities>
|
116 |
+
</news_mysql4>
|
117 |
+
</models>
|
118 |
+
<resources>
|
119 |
+
<news_setup>
|
120 |
+
<setup>
|
121 |
+
<module>Biztech_News</module>
|
122 |
+
</setup>
|
123 |
+
<connection>
|
124 |
+
<use>core_setup</use>
|
125 |
+
</connection>
|
126 |
+
</news_setup>
|
127 |
+
<news_write>
|
128 |
+
<connection>
|
129 |
+
<use>core_write</use>
|
130 |
+
</connection>
|
131 |
+
</news_write>
|
132 |
+
<news_read>
|
133 |
+
<connection>
|
134 |
+
<use>core_read</use>
|
135 |
+
</connection>
|
136 |
+
</news_read>
|
137 |
+
</resources>
|
138 |
+
<blocks>
|
139 |
+
<news>
|
140 |
+
<class>Biztech_News_Block</class>
|
141 |
+
</news>
|
142 |
+
<page>
|
143 |
+
<rewrite>
|
144 |
+
<html_topmenu>Biztech_News_Block_Html_Topmenu</html_topmenu>
|
145 |
+
</rewrite>
|
146 |
+
</page>
|
147 |
+
</blocks>
|
148 |
+
<helpers>
|
149 |
+
<news>
|
150 |
+
<class>Biztech_News_Helper</class>
|
151 |
+
</news>
|
152 |
+
</helpers>
|
153 |
+
</global>
|
154 |
+
<default>
|
155 |
+
<news>
|
156 |
+
<news_general>
|
157 |
+
<news_list_page_layout>1column</news_list_page_layout>
|
158 |
+
<news_detail_page_layout>1column</news_detail_page_layout>
|
159 |
+
</news_general>
|
160 |
+
</news>
|
161 |
+
</default>
|
162 |
+
</config>
|
app/code/local/Biztech/News/etc/system.xml
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<biztech translate="label" module="news">
|
5 |
+
<label>Biztech Extensions</label>
|
6 |
+
<sort_order>400</sort_order>
|
7 |
+
</biztech>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<news translate="label" module="news">
|
11 |
+
<label>News</label>
|
12 |
+
<tab>biztech</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>10</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 |
+
<news_general translate="label">
|
20 |
+
<label>General</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>10</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<enabled translate="label">
|
28 |
+
<label>Enabled</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>1</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<comment>Select Yes to enable this feature.</comment>
|
36 |
+
</enabled>
|
37 |
+
<news_list_page_layout translate="label">
|
38 |
+
<label>Page Layout for list page</label>
|
39 |
+
<frontend_type>select</frontend_type>
|
40 |
+
<source_model>Biztech_News_Block_Adminhtml_Model_System_Config_Source_PageLayout</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>1</show_in_store>
|
45 |
+
<comment>Choose page layout for news list page.</comment>
|
46 |
+
</news_list_page_layout>
|
47 |
+
<news_detail_page_layout translate="label">
|
48 |
+
<label>Page Layout for detail page</label>
|
49 |
+
<frontend_type>select</frontend_type>
|
50 |
+
<source_model>Biztech_News_Block_Adminhtml_Model_System_Config_Source_PageLayout</source_model>
|
51 |
+
<sort_order>3</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
<comment>Choose page layout for news detail page.</comment>
|
56 |
+
</news_detail_page_layout>
|
57 |
+
</fields>
|
58 |
+
</news_general>
|
59 |
+
</groups>
|
60 |
+
</news>
|
61 |
+
</sections>
|
62 |
+
</config>
|
app/code/local/Biztech/News/sql/news_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
-- DROP TABLE IF EXISTS {$this->getTable('news')};
|
10 |
+
CREATE TABLE {$this->getTable('news')} (
|
11 |
+
`news_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
+
`title` varchar(255) NOT NULL default '',
|
13 |
+
`filename` varchar(255) NOT NULL default '',
|
14 |
+
`news_content` text NOT NULL default '',
|
15 |
+
`status` smallint(6) NOT NULL default '0',
|
16 |
+
`created_time` datetime NULL,
|
17 |
+
`update_time` datetime NULL,
|
18 |
+
`intro` text NOT NULL default '',
|
19 |
+
`date_to_publish` datetime NULL,
|
20 |
+
`date_to_unpublish` datetime NULL,
|
21 |
+
`browser_title` varchar(255) NOT NULL default '',
|
22 |
+
`seo_keywords` varchar(255) NOT NULL default '',
|
23 |
+
`seo_description` varchar(255) NOT NULL default '',
|
24 |
+
PRIMARY KEY (`news_id`)
|
25 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
26 |
+
|
27 |
+
");
|
28 |
+
|
29 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/news.xml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<news_adminhtml_news_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="news/adminhtml_news" name="news" />
|
6 |
+
</reference>
|
7 |
+
</news_adminhtml_news_index>
|
8 |
+
<news_adminhtml_news_edit>
|
9 |
+
<update handle="editor" />
|
10 |
+
</news_adminhtml_news_edit>
|
11 |
+
</layout>
|
app/design/frontend/default/default/layout/news.xml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<default>
|
5 |
+
</default>
|
6 |
+
<news_index_index>
|
7 |
+
<reference name="root">
|
8 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
9 |
+
</reference>
|
10 |
+
<reference name="content">
|
11 |
+
<block type="news/news" name="news" template="news/newslist.phtml" />
|
12 |
+
</reference>
|
13 |
+
|
14 |
+
</news_index_index>
|
15 |
+
|
16 |
+
<news_index_view>
|
17 |
+
<reference name="root">
|
18 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
19 |
+
</reference>
|
20 |
+
<reference name="content">
|
21 |
+
<block type="news/news" name="news.view" template="news/news.phtml"/>
|
22 |
+
</reference>
|
23 |
+
</news_index_view>
|
24 |
+
</layout>
|
app/design/frontend/default/default/template/news/news.phtml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(Mage::getStoreConfig('news/news_general/enabled') == 1):
|
3 |
+
?>
|
4 |
+
<?php $news = $this->getNews(); ?>
|
5 |
+
<div class="page-title"><h1><?php echo $news['title'];?></h1></div>
|
6 |
+
<p><?php echo $news['news_content'];?></p>
|
7 |
+
<?php
|
8 |
+
else:
|
9 |
+
$url = Mage::getBaseUrl();
|
10 |
+
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
|
11 |
+
endif;
|
12 |
+
?>
|
app/design/frontend/default/default/template/news/newslist.phtml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(Mage::getStoreConfig('news/news_general/enabled') == 1):
|
3 |
+
$i = 0;
|
4 |
+
$collection = $this->getCachedCollection();
|
5 |
+
$count = count($collection);
|
6 |
+
if($count !==0):
|
7 |
+
?>
|
8 |
+
<?php
|
9 |
+
$breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
|
10 |
+
$breadcrumbs->addCrumb('home',array('label'=>Mage::helper('cms')->__('Home'), 'title'=>Mage::helper('cms')->__('Home Page'),'link'=>Mage::getBaseUrl()));
|
11 |
+
$breadcrumbs->addCrumb('News', array('label'=>'News','title'=>'News'));
|
12 |
+
echo $this->getLayout()->getBlock('breadcrumbs')->toHtml();
|
13 |
+
?>
|
14 |
+
|
15 |
+
<?php foreach ($collection as $news_item):
|
16 |
+
$class='';
|
17 |
+
|
18 |
+
if ($i==0):
|
19 |
+
$class='first';
|
20 |
+
elseif ($i==$count-1):
|
21 |
+
$class='last';
|
22 |
+
endif;
|
23 |
+
?>
|
24 |
+
<div class="<?php echo $class ?> news-block block">
|
25 |
+
<div class="copy">
|
26 |
+
<h3><?php echo $news_item->getTitle(); ?></h3><p><?php echo $news_item->getIntro(); ?></p>
|
27 |
+
<p class="read-more"><a href="<?php echo $this->getUrl('*/*/view').'?id='.$news_item->getNewsId(); ?>"><?php echo $this->__('Read more') ?></a></p>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
<?php endforeach; ?>
|
31 |
+
|
32 |
+
<?php echo $this->getChildHtml('Biztech_news_toolbar'); ?>
|
33 |
+
<?php
|
34 |
+
else:
|
35 |
+
?>
|
36 |
+
<div><h4><?php echo $this->__('No News to publish.'); ?></h4></div>
|
37 |
+
<?php endif; ?>
|
38 |
+
<?php
|
39 |
+
else:
|
40 |
+
$url = Mage::getBaseUrl();
|
41 |
+
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
|
42 |
+
endif;
|
43 |
+
?>
|
app/design/frontend/default/default/template/news/toolbar.phtml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if($this->getCollection()->getSize()): ?>
|
2 |
+
<div class="toolbar">
|
3 |
+
<div class="pager">
|
4 |
+
<p class="amount">
|
5 |
+
<?php if($this->getLastPageNum()>1): ?>
|
6 |
+
<?php echo $this->__('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
|
7 |
+
<?php else: ?>
|
8 |
+
<strong><?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?></strong>
|
9 |
+
<?php endif; ?>
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<div class="limiter">
|
13 |
+
<label><?php echo $this->__('Show') ?></label>
|
14 |
+
<select onchange="setLocation(this.value)">
|
15 |
+
<?php foreach ($this->getAvailableLimit() as $_key=>$_limit): ?>
|
16 |
+
<option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
|
17 |
+
<?php echo $_limit ?>
|
18 |
+
</option>
|
19 |
+
<?php endforeach; ?>
|
20 |
+
</select> <?php echo $this->__('per page') ?>
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<?php echo $this->getPagerHtml() ?>
|
24 |
+
|
25 |
+
</div>
|
26 |
+
|
27 |
+
</div>
|
28 |
+
<?php endif ?>
|
app/etc/modules/Biztech_News.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Biztech
|
5 |
+
* @package Biztech_News
|
6 |
+
* @author ModuleCreator
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Biztech_News>
|
13 |
+
<active>true</active>
|
14 |
+
<codePool>local</codePool>
|
15 |
+
</Biztech_News>
|
16 |
+
</modules>
|
17 |
+
</config>
|
app/locale/de_DE/Biztech_News.csv
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
General,Allgemeine
|
2 |
+
Enabled,Aktiviert
|
3 |
+
Page Layout for list page,Seitenlayout für Listen Seite
|
4 |
+
Page Layout for detail page,Seitenlayout für Detail-Seite
|
5 |
+
Select Yes to enable this feature.,"Wählen Sie Ja, um diese Funktion zu aktivieren"
|
6 |
+
Choose page layout for news list page.,Wählen Sie Seitenlayout für News-Liste Seite
|
7 |
+
Choose page layout for news detail page.,Wählen Sie Seitenlayout für Nachrichten Detailseite
|
8 |
+
News,Nachrichten
|
9 |
+
Yes,Ja
|
10 |
+
No,Keine
|
11 |
+
News Manager,Nachrichten-Manager
|
12 |
+
Add News,News hinzufügen
|
13 |
+
News Information,News Information
|
14 |
+
Publishing Options,Publishing-Optionen
|
15 |
+
Seo Options,Seo Optionen
|
16 |
+
Title,Titel
|
17 |
+
Published?,Veröffentlicht?
|
18 |
+
Intro,Intro
|
19 |
+
Content,Inhalt
|
20 |
+
Start publishing on,Starten Veröffentlichung auf
|
21 |
+
End publishing on,End-Publishing auf
|
22 |
+
Browser Title,Browser Titel
|
23 |
+
Keywords,Keywords
|
24 |
+
Description,Beschreibung
|
25 |
+
Save News,Speichern Nachrichten
|
26 |
+
Delete News,löschen Nachrichten
|
27 |
+
Edit News,Bearbeiten Nachrichten
|
28 |
+
News information,News information
|
app/locale/en_GB/Biztech_News.csv
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
General,General
|
2 |
+
Enabled,Enabled
|
3 |
+
Page Layout for list page,Page Layout for list page
|
4 |
+
Page Layout for detail page,Page Layout for detail page
|
5 |
+
Select Yes to enable this feature.,Select Yes to enable this feature.
|
6 |
+
Choose page layout for news list page.,Choose page layout for tidings list page.
|
7 |
+
Choose page layout for news detail page.,Choose page layout for tidings detail page.
|
8 |
+
News,tidings
|
9 |
+
Yes,Yes
|
10 |
+
No,No
|
11 |
+
News Manager,tidings Manager
|
12 |
+
Add News,Add tidings
|
13 |
+
News Information,tidings Information
|
14 |
+
Publishing Options,Publishing Options
|
15 |
+
Seo Options,Seo Options
|
16 |
+
Title,Title
|
17 |
+
Published?,Published?
|
18 |
+
Intro,Intro
|
19 |
+
Content,Content
|
20 |
+
Start publishing on,Start publishing on
|
21 |
+
End publishing on,End publishing on
|
22 |
+
Browser Title,Browser Title
|
23 |
+
Keywords,Keywords
|
24 |
+
Description,Description
|
25 |
+
Save News,Save tidings
|
26 |
+
Delete News,Delete tidings
|
27 |
+
Edit News,Edit tidings
|
28 |
+
News information,tidings information
|
app/locale/en_US/Biztech_News.csv
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
General,General
|
2 |
+
Enabled,Enabled
|
3 |
+
Page Layout for list page,Page Layout for list page
|
4 |
+
Page Layout for detail page,Page Layout for detail page
|
5 |
+
Select Yes to enable this feature,Select Yes to enable this feature
|
6 |
+
Choose page layout for news list page,Choose page layout for news list page
|
7 |
+
Choose page layout for news detail page,Choose page layout for news detail page
|
8 |
+
News,News
|
9 |
+
Yes,Yes
|
10 |
+
No,No
|
11 |
+
News Manager,News Manager
|
12 |
+
Add News,Add News
|
13 |
+
News Information,News Information
|
14 |
+
Publishing Options,Publishing Options
|
15 |
+
Seo Options,Seo Options
|
16 |
+
Title ,Title
|
17 |
+
Published?,Published?
|
18 |
+
Intro ,Intro
|
19 |
+
Content ,Content
|
20 |
+
Start publishing on,Start publishing on
|
21 |
+
End publishing on,End publishing on
|
22 |
+
Browser Title,Browser Title
|
23 |
+
Keywords,Keywords
|
24 |
+
Description,Description
|
25 |
+
Save News,Save News
|
26 |
+
Delete News,Delete News
|
27 |
+
Edit News,Edit News
|
app/locale/fr_FR/Biztech_News.csv
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
General,général
|
2 |
+
Enabled,activé
|
3 |
+
Page Layout for list page,Mise en page pour la page de liste
|
4 |
+
Page Layout for detail page,Mise en page pour la page de détail
|
5 |
+
Select Yes to enable this feature.,Sélectionnez Oui pour activer cette fonctionnalité
|
6 |
+
Choose page layout for news list page.,Choisissez la mise en page pour la page de la liste des nouvelles
|
7 |
+
Choose page layout for news detail page.,Choisissez la mise en page pour la page de détail de nouvelles
|
8 |
+
News,nouvelles
|
9 |
+
Yes,Oui
|
10 |
+
No,Non
|
11 |
+
News Manager,Gestionnaire de nouvelles
|
12 |
+
Add News,Ajouter Nouvelles
|
13 |
+
News Information,Nouvelles Informations
|
14 |
+
Publishing Options,Options de publication
|
15 |
+
Seo Options,options de Seo
|
16 |
+
Title ,Titre
|
17 |
+
Published?,Publié?
|
18 |
+
Intro,Intro
|
19 |
+
Content,Content
|
20 |
+
Start publishing on,Commencer � publier sur
|
21 |
+
End publishing on,édition de fin de
|
22 |
+
Browser Title,Titre du navigateur
|
23 |
+
Keywords,Mots-clés
|
24 |
+
Description,Description
|
25 |
+
Save News,Enregistrer Nouvelles
|
26 |
+
Delete News,supprimer Nouvelles
|
27 |
+
Edit News,Modifier Nouvelles
|
28 |
+
News information,Nouvelles informations
|
app/locale/it_IT/Biztech_News.csv
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
General,generale
|
2 |
+
Enabled,abilitato
|
3 |
+
Page Layout for list page,Layout di pagina per pagina di elenco
|
4 |
+
Page Layout for detail page,Layout di pagina per la pagina di dettaglio
|
5 |
+
Select Yes to enable this feature.,Selezionare Si per attivare questa funzione
|
6 |
+
Choose page layout for news list page.,Scegli layout di pagina per le notizie page elenco
|
7 |
+
Choose page layout for news detail page.,Scegli layout di pagina per le notizie pagina di dettaglio
|
8 |
+
News,notizie
|
9 |
+
Yes,Si
|
10 |
+
No,No
|
11 |
+
News Manager,Notizie Direttore
|
12 |
+
Add News,Aggiungi Notizie
|
13 |
+
News Information,Notizie Informazioni
|
14 |
+
Publishing Options,opzioni di pubblicazione
|
15 |
+
Seo Options,Seo Opzioni
|
16 |
+
Title ,titolo
|
17 |
+
Published?,Pubblicata?
|
18 |
+
Intro,Intro
|
19 |
+
Content,contenuto
|
20 |
+
Start publishing on,Inizio pubblicazione su
|
21 |
+
End publishing on,Fine pubblicazione su
|
22 |
+
Browser Title,Titolo Browser
|
23 |
+
Keywords,parole Chiave
|
24 |
+
Description,descrizione
|
25 |
+
Save News,Salva Notizie
|
26 |
+
Delete News,Elimina Notizie
|
27 |
+
Edit News,Modifica le news
|
28 |
+
News information,informazioni Notizie
|
app/locale/nl_NL/Biztech_News.csv
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
General,algemeen
|
2 |
+
Enabled,ingeschakeld
|
3 |
+
Page Layout for list page,Pagina-indeling voor lijstpagina
|
4 |
+
Page Layout for detail page,Pagina-indeling voor detailpagina
|
5 |
+
Select Yes to enable this feature.,Selecteer Ja om deze functie in te schakelen
|
6 |
+
Choose page layout for news list page.,Kies pagina-indeling voor nieuws overzicht pagina
|
7 |
+
Choose page layout for news detail page.,Kies pagina-indeling voor nieuws detailpagina
|
8 |
+
News,nieuws
|
9 |
+
Yes,ja
|
10 |
+
No,geen
|
11 |
+
News Manager,Nieuws Manager
|
12 |
+
Add News,Toevoegen Nieuws
|
13 |
+
News Information,Nieuws Informatie
|
14 |
+
Publishing Options,Publishing Opties
|
15 |
+
Seo Options,Seo Opties
|
16 |
+
Title ,titel
|
17 |
+
Published?,Gepubliceerd?
|
18 |
+
Intro,intro
|
19 |
+
Content,inhoud
|
20 |
+
Start publishing on,Start publiceren op
|
21 |
+
End publishing on,End publishing on
|
22 |
+
Browser Title,browser Titel
|
23 |
+
Keywords,trefwoorden
|
24 |
+
Description,beschrijving
|
25 |
+
Save News,Opslaan Nieuws
|
26 |
+
Delete News,Delete Nieuws
|
27 |
+
Edit News,Bewerken Nieuws
|
28 |
+
News information,Nieuws informatie
|
package.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>news_module</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>The News Module Extension allows you to display news on your website for viewers</summary>
|
10 |
+
<description>The News Module Extension allows you to display news on your website for viewers. News can be anything like if there is any update in your products, if you have included any new product in your e-store, if you are providing any special offers in any of your products etc all can be displayed in the news section.
|
11 |
+
A separate section for news helps your client to easily get through recent happenings in your online store. The extension is very easy to install, configure and use. It allows you to manage news from the admin panel. You can easily add and edit any news entries. It helps you to display various ads, products and news on your website effortlessly.
|
12 |
+
Features of News Module Extension.
|
13 |
+
• After installing this extension a separate menu will be created for News on your website that will help viewers to easily go to the News section of your website.
|
14 |
+
• News page will show latest ten updates and the details of the updates can be viewed by clicking on the read more link that will redirect the customers to the details page of that particular news.
|
15 |
+
• You can create news and it is up to you when you want to publish it. There is provision for this facility in the admin side, go to News->Manage News->News information, there specify yes/no in the published attribute as needed.
|
16 |
+
• Possibility for publishing a particular news for given period of time is also available. This can be set from News->Manage News->Publishing Options. Here set the start and end data for the news has to be published.
|
17 |
+
• The extension also allows you optimize your news page by allowing you to set the page title, keywords and description. 
|
18 |
+
• Page layout can be set both for the news list pages and news detail page as desired. The layouts that this extension provides are 1 column, 2columns-right, 2columns-left and 3columns
|
19 |
+

|
20 |
+

|
21 |
+
This extension can also be used as a blog on your website. Magento News Extension will help you make your store more interactive and will keep your visitors familiar with the latest business updates and developments.
|
22 |
+
</description>
|
23 |
+
<notes>-New Release</notes>
|
24 |
+
<authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
|
25 |
+
<date>2013-08-01</date>
|
26 |
+
<time>05:18:47</time>
|
27 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Biztech_News.xml" hash="2066527c7cb941ff29c3abc04cf2e1e7"/></dir></target><target name="magelocal"><dir name="Biztech"><dir name="News"><dir name="Block"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="PageLayout.php" hash="cb053c3354269872be9355a36f0bd7ca"/></dir></dir></dir></dir><dir name="News"><dir name="Edit"><file name="Form.php" hash="14e4a7813dd84774463806fd7b340a6a"/><dir name="Tab"><file name="Form.php" hash="01fb481131c9ed25d5e6219e8381f0dd"/><file name="Publishingoptions.php" hash="9266e52bcf666df0ac86b93077f755b2"/><file name="Seo.php" hash="ffa3f44dcd60584a58fa1accbd08978f"/></dir><file name="Tabs.php" hash="b7d5f7ba0923a08f9c7dda82ca9533dd"/></dir><file name="Edit.php" hash="9cc35195704b7980f8f1c4f996655d35"/><file name="Grid.php" hash="ebe5136870ab89a4b164c4af8b0dc5ae"/></dir><file name="News.php" hash="6d55288c8e492529babed70d7693cee3"/></dir><dir name="Html"><file name="Topmenu.php" hash="20ecd9eb22aea35a7c5c05afb180a5eb"/></dir><file name="News.php" hash="3e4c83c3038290af7f55232a1a8e0c13"/><dir name="Product"><file name="Toolbar.php" hash="5ea2be422632936d999f2feb662c5efb"/></dir></dir><dir name="Helper"><file name="Data.php" hash="041b029a330619d0410b9a10d97ff99a"/><file name="Toolbar.php" hash="f43815d9de8ec838ef60ac235b7ad87a"/></dir><dir name="Model"><dir name="Mysql4"><dir name="News"><file name="Collection.php" hash="d94ba8224386db37166a42c818741816"/></dir><file name="News.php" hash="105de65e8142848237a86c148d7c50a9"/></dir><file name="News.php" hash="8936030acfbccc9af2d2962ca14d4178"/><file name="Status.php" hash="fddbc75ce090257b57a1c6ca4e6c6f08"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="NewsController.php" hash="995ed407e8cb40cd19e47d733b7d252b"/></dir><file name="IndexController.php" hash="7b84f01a54d1b4155a1b5f8006a0c13d"/></dir><dir name="etc"><file name="config.xml" hash="1ca465b66dd547bf13f1622b22fd3835"/><file name="system.xml" hash="1bb49bcbdde576d08549701b4d3d9e4b"/></dir><dir name="sql"><dir name="news_setup"><file name="mysql4-install-0.1.0.php" hash="64b4d2aa617e50e51c5ab8bed45ce2af"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="news.xml" hash="a5d673a49630a02e12e16d3d20118e1f"/></dir><dir name="template"><dir name="news"><file name="news.phtml" hash="189b9c77d457d2c6a2609d5cf10e95c2"/><file name="newslist.phtml" hash="8184e2ad62b2660621c56179b2353b85"/><file name="toolbar.phtml" hash="0de79f32306c8132f346ec129a6677f3"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="news.xml" hash="71a6b06b143def9feaa53156aafe6bc2"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Biztech_News.csv" hash="c578fa43638898d8d2c1d65df58ff295"/></dir><dir name="de_DE"><file name="Biztech_News.csv" hash="62e4bad7e4e3f835a5813b63399cedd6"/></dir><dir name="it_IT"><file name="Biztech_News.csv" hash="c6beab4c9b1daa5d01833d94dd897bc6"/></dir><dir name="fr_FR"><file name="Biztech_News.csv" hash="d35888dc2041bd3fd59300c3cdd69c25"/></dir><dir name="nl_NL"><file name="Biztech_News.csv" hash="6dbc51ef667406f9663ae15531cd36d1"/></dir><dir name="en_GB"><file name="Biztech_News.csv" hash="574cce2d0ffc262275570ed185642bee"/></dir></target></contents>
|
28 |
+
<compatible/>
|
29 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
30 |
+
</package>
|