Version Notes
Version number: 1.0.2
Stability: Stable
Compatibility: 1.4, 1.5, 1.6, 1.7
Download this release
Release Info
Developer | Magento Core Team |
Extension | CommerceLab_News |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/CommerceLab/News/Block/Adminhtml/Category/Edit.php +34 -3
- app/code/community/CommerceLab/News/Block/Adminhtml/Category/Edit/Form.php +140 -1
- app/code/community/CommerceLab/News/Block/Adminhtml/Category/Grid.php +12 -2
- app/code/community/CommerceLab/News/Block/Adminhtml/Category/Grid/Column/Renderer/Action.php +152 -0
- app/code/community/CommerceLab/News/Block/Adminhtml/Category/Grid/Column/Renderer/SubCategories.php +24 -0
- app/code/community/CommerceLab/News/Block/Adminhtml/News/Grid.php +1 -0
- app/code/community/CommerceLab/News/Block/News.php +1 -1
- app/code/community/CommerceLab/News/Model/Check.php +20 -0
- app/code/community/CommerceLab/News/controllers/Adminhtml/NewsController.php +65 -2
- app/code/community/CommerceLab/News/etc/config.xml +11 -3
- app/code/community/CommerceLab/News/etc/system.xml +19 -1
- app/code/community/CommerceLab/News/sql/clnews_setup/mysql4-upgrade-1.0.1-1.0.2.php +41 -0
- app/design/adminhtml/default/default/layout/clnews.xml +37 -0
- app/design/frontend/default/default/layout/clnews.xml +6 -2
- app/design/frontend/default/default/template/clnews/list.phtml +1 -1
- app/design/frontend/default/default/template/clnews/menu.phtml +31 -8
- app/design/frontend/default/default/template/clnews/newsitem.phtml +3 -3
- app/locale/en_US/CommerceLab_News.csv +1 -0
- js/commercelab/category_tree.js +15 -0
- js/commercelab/treeview/jquery.treeview.pack.js +16 -0
- js/prototype/windows/themes/commercelab/magento.css +39 -0
- js/prototype/windows/themes/commercelab/magento/btn_bg.gif +0 -0
- js/prototype/windows/themes/commercelab/magento/content_bg.gif +0 -0
- js/prototype/windows/themes/commercelab/magento/top_bg.gif +0 -0
- js/prototype/windows/themes/commercelab/magento/window_close.png +0 -0
- package.xml +7 -6
- skin/frontend/default/default/css/commercelab/treeview/images/file.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/folder-closed.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/folder.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/minus.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/plus.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-black-line.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-black.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-default-line.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-default.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-famfamfam-line.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-famfamfam.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-gray-line.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-gray.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-red-line.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/images/treeview-red.gif +0 -0
- skin/frontend/default/default/css/commercelab/treeview/jquery.treeview.css +72 -0
app/code/community/CommerceLab/News/Block/Adminhtml/Category/Edit.php
CHANGED
@@ -27,17 +27,31 @@ class CommerceLab_News_Block_Adminhtml_Category_Edit extends Mage_Adminhtml_Bloc
|
|
27 |
|
28 |
$this->_updateButton('save', 'label', Mage::helper('clnews')->__('Save Category'));
|
29 |
$this->_updateButton('delete', 'label', Mage::helper('clnews')->__('Delete Category'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
$this->_addButton('saveandcontinue', array(
|
32 |
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
33 |
'onclick' => 'saveAndContinueEdit()',
|
34 |
'class' => 'save',
|
35 |
-
), -
|
36 |
-
|
37 |
$this->_formScripts[] = "
|
38 |
-
|
|
|
39 |
editForm.submit($('edit_form').action+'back/edit/');
|
40 |
}
|
|
|
|
|
|
|
|
|
41 |
";
|
42 |
}
|
43 |
|
@@ -46,8 +60,25 @@ class CommerceLab_News_Block_Adminhtml_Category_Edit extends Mage_Adminhtml_Bloc
|
|
46 |
if ( Mage::registry('clnews_data') && Mage::registry('clnews_data')->getId() ) {
|
47 |
return Mage::helper('clnews')->__("Edit Category '%s'",
|
48 |
$this->htmlEscape(Mage::registry('clnews_data')->getTitle()));
|
|
|
|
|
49 |
} else {
|
50 |
return Mage::helper('clnews')->__('Add Category');
|
51 |
}
|
52 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
27 |
|
28 |
$this->_updateButton('save', 'label', Mage::helper('clnews')->__('Save Category'));
|
29 |
$this->_updateButton('delete', 'label', Mage::helper('clnews')->__('Delete Category'));
|
30 |
+
if ($this->checkLimit() < 5) {
|
31 |
+
if ($this->getRequest()->getParam('parent_id') == null && $this->getRequest()->getParam('id') != null) {
|
32 |
+
$this->_addButton('addsubcategory', array(
|
33 |
+
'label' => Mage::helper('adminhtml')->__('Add Sub Category'),
|
34 |
+
'onclick' => 'addSubCategory()',
|
35 |
+
'class' => 'save',
|
36 |
+
), -100);
|
37 |
+
}
|
38 |
+
}
|
39 |
|
40 |
$this->_addButton('saveandcontinue', array(
|
41 |
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
42 |
'onclick' => 'saveAndContinueEdit()',
|
43 |
'class' => 'save',
|
44 |
+
), -200);
|
45 |
+
$catId = $this->getUrl('*/*/new', array('parent_id' => $this->getRequest()->getParam('id')));
|
46 |
$this->_formScripts[] = "
|
47 |
+
var parent = '" . $catId . "';
|
48 |
+
function saveAndContinueEdit() {
|
49 |
editForm.submit($('edit_form').action+'back/edit/');
|
50 |
}
|
51 |
+
|
52 |
+
function addSubCategory() {
|
53 |
+
editForm.submit(parent);
|
54 |
+
}
|
55 |
";
|
56 |
}
|
57 |
|
60 |
if ( Mage::registry('clnews_data') && Mage::registry('clnews_data')->getId() ) {
|
61 |
return Mage::helper('clnews')->__("Edit Category '%s'",
|
62 |
$this->htmlEscape(Mage::registry('clnews_data')->getTitle()));
|
63 |
+
} else if ($this->getRequest()->getParam('parent_id')) {
|
64 |
+
return Mage::helper('clnews')->__('Add Sub Category');
|
65 |
} else {
|
66 |
return Mage::helper('clnews')->__('Add Category');
|
67 |
}
|
68 |
}
|
69 |
+
|
70 |
+
protected function checkLimit()
|
71 |
+
{
|
72 |
+
if ($id = $this->getRequest()->getParam('id')) {
|
73 |
+
$collection = Mage::getModel('clnews/category')->getCollection();
|
74 |
+
$collection->getSelect()->order('main_table.level DESC');
|
75 |
+
$collection->getSelect()->where('main_table.category_id =?', $id);
|
76 |
+
$collection->getSelect()->limit(1);
|
77 |
+
if (count($collection) > 0) {
|
78 |
+
$level = $collection->getData('level');
|
79 |
+
$level = $level[0]['level'];
|
80 |
+
return $level;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
}
|
84 |
}
|
app/code/community/CommerceLab/News/Block/Adminhtml/Category/Edit/Form.php
CHANGED
@@ -19,6 +19,7 @@ class CommerceLab_News_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml
|
|
19 |
{
|
20 |
protected function _prepareForm()
|
21 |
{
|
|
|
22 |
$form = new Varien_Data_Form(array(
|
23 |
'id' => 'edit_form',
|
24 |
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
@@ -47,16 +48,88 @@ class CommerceLab_News_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml
|
|
47 |
'name' => 'sort_order',
|
48 |
));
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/**
|
51 |
* Check is single store mode
|
52 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
if (!Mage::app()->isSingleStoreMode()) {
|
54 |
$fieldset->addField('store_id', 'multiselect', array(
|
55 |
'name' => 'stores[]',
|
56 |
'label' => Mage::helper('cms')->__('Store View'),
|
57 |
'title' => Mage::helper('cms')->__('Store View'),
|
58 |
'required' => true,
|
59 |
-
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
|
60 |
));
|
61 |
}
|
62 |
|
@@ -84,4 +157,70 @@ class CommerceLab_News_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml
|
|
84 |
|
85 |
return parent::_prepareForm();
|
86 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
19 |
{
|
20 |
protected function _prepareForm()
|
21 |
{
|
22 |
+
$this->getPosition();
|
23 |
$form = new Varien_Data_Form(array(
|
24 |
'id' => 'edit_form',
|
25 |
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
48 |
'name' => 'sort_order',
|
49 |
));
|
50 |
|
51 |
+
$fieldset->addField('sort_id', 'hidden', array(
|
52 |
+
'name' => 'sort_id',
|
53 |
+
'values' => $this->getPosition(),
|
54 |
+
));
|
55 |
+
if ($this->getRequest()->getParam('parent_id') == null) {
|
56 |
+
if (Mage::getSingleton('adminhtml/session')->getNewsData()) {
|
57 |
+
$data = array('sort_id' => $this->getPosition());
|
58 |
+
Mage::getSingleton('adminhtml/session')->setNewsData($data);
|
59 |
+
} else if ($data = Mage::registry('clnews_data')) {
|
60 |
+
if ($data->getSortId() == null) {
|
61 |
+
$params = array('sort_id' => $this->getPosition());
|
62 |
+
$data->setData($params);
|
63 |
+
Mage::unregister('clnews_data');
|
64 |
+
Mage::register('clnews_data', $data);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
/**
|
70 |
* Check is single store mode
|
71 |
*/
|
72 |
+
if ($pid = $this->getRequest()->getParam('parent_id')) {
|
73 |
+
$fieldset->addField('parent_id', 'hidden', array(
|
74 |
+
'name' => 'parent_id',
|
75 |
+
'values' => $pid,
|
76 |
+
));
|
77 |
+
$fieldset->addField('level', 'hidden', array(
|
78 |
+
'name' => 'level',
|
79 |
+
'values' => $level,
|
80 |
+
));
|
81 |
+
$category = Mage::getModel('clnews/category')->load($pid);
|
82 |
+
if ($lev = $category->getLevel()) {
|
83 |
+
$level = $lev + 1;
|
84 |
+
} else {
|
85 |
+
$level = '1';
|
86 |
+
}
|
87 |
+
if (Mage::getSingleton('adminhtml/session')->getNewsData()) {
|
88 |
+
$data = array('parent_id' => $pid, 'level' => $level, 'sort_id' => $this->getPosition());
|
89 |
+
Mage::getSingleton('adminhtml/session')->setNewsData($data);
|
90 |
+
} else if ($data = Mage::registry('clnews_data')) {
|
91 |
+
$params = array('parent_id' => $pid, 'level' => $level, 'sort_id' => $this->getPosition());
|
92 |
+
$data->setData($params);
|
93 |
+
Mage::unregister('clnews_data');
|
94 |
+
Mage::register('clnews_data', $data);
|
95 |
+
}
|
96 |
+
$store = $category->getStoreId();
|
97 |
+
|
98 |
+
$stores = Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true);
|
99 |
+
$parentStore = array();
|
100 |
+
foreach ($stores as $val) {
|
101 |
+
if (is_array($val['value'])) {
|
102 |
+
foreach ($val['value'] as $st) {
|
103 |
+
if ($st['value'] == $store[0]) {
|
104 |
+
$parentStore[] = $st;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
} else {
|
108 |
+
if ($val['value'] == $store[0]) {
|
109 |
+
$parentStore[] = $val;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
} else {
|
115 |
+
$fieldset->addField('level', 'hidden', array(
|
116 |
+
'name' => 'level',
|
117 |
+
'values' => 0,
|
118 |
+
));
|
119 |
+
|
120 |
+
$fieldset->addField('parent_id', 'hidden', array(
|
121 |
+
'name' => 'parent_id',
|
122 |
+
'values' => 0,
|
123 |
+
));
|
124 |
+
}
|
125 |
+
|
126 |
if (!Mage::app()->isSingleStoreMode()) {
|
127 |
$fieldset->addField('store_id', 'multiselect', array(
|
128 |
'name' => 'stores[]',
|
129 |
'label' => Mage::helper('cms')->__('Store View'),
|
130 |
'title' => Mage::helper('cms')->__('Store View'),
|
131 |
'required' => true,
|
132 |
+
'values' => $parentStore ? $parentStore : Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
|
133 |
));
|
134 |
}
|
135 |
|
157 |
|
158 |
return parent::_prepareForm();
|
159 |
}
|
160 |
+
|
161 |
+
protected function getPosition()
|
162 |
+
{
|
163 |
+
if ($id = $this->getRequest()->getParam('parent_id')) {
|
164 |
+
$collection = Mage::getModel('clnews/category')->getCollection();
|
165 |
+
$collection->getSelect()->order('main_table.sort_id DESC');
|
166 |
+
$collection->getSelect()->where('main_table.parent_id =?', $id);
|
167 |
+
$collection->getSelect()->limit(1);
|
168 |
+
$sortId = $collection->getData('sort_id');
|
169 |
+
if (count($sortId) < 1) {
|
170 |
+
unset($sortId);
|
171 |
+
$collectionNew = Mage::getModel('clnews/category')->getCollection();
|
172 |
+
$collectionNew->getSelect()->where('main_table.category_id =?', $id);
|
173 |
+
|
174 |
+
$sortId = $collectionNew->getData('sort_id');
|
175 |
+
}
|
176 |
+
$position = $sortId[0]['sort_id'] + 1;
|
177 |
+
if (count($this->checkPosition($position)) > 0) {
|
178 |
+
$this->updatePosition($position);
|
179 |
+
}
|
180 |
+
return $position;
|
181 |
+
} else if ($id = $this->getRequest()->getParam('id')) {
|
182 |
+
$collection = Mage::getModel('clnews/category')->getCollection();
|
183 |
+
$collection->getSelect()->where('main_table.category_id =?', $id);
|
184 |
+
$sortId = $collection->getData('sort_id');
|
185 |
+
$position = $sortId[0]['sort_id'];
|
186 |
+
return $position;
|
187 |
+
} else {
|
188 |
+
$collection = Mage::getModel('clnews/category')->getCollection();
|
189 |
+
$collection->getSelect()->order('main_table.sort_id DESC');
|
190 |
+
$collection->getSelect()->limit(1);
|
191 |
+
if (count($collection) < 1) {
|
192 |
+
$position = 0;
|
193 |
+
} else {
|
194 |
+
$sortId = $collection->getData('sort_id');
|
195 |
+
$position = $sortId[0]['sort_id'] + 1;
|
196 |
+
if (count($this->checkPosition($position)) > 0) {
|
197 |
+
$this->updatePosition($position);
|
198 |
+
}
|
199 |
+
}
|
200 |
+
return $position;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
protected function checkPosition($pos)
|
205 |
+
{
|
206 |
+
$collection = Mage::getModel('clnews/category')->getCollection();
|
207 |
+
$collection->getSelect()->where('sort_id =?', $pos);
|
208 |
+
return $collection->getData();
|
209 |
+
}
|
210 |
+
|
211 |
+
protected function updatePosition($pos)
|
212 |
+
{
|
213 |
+
$collection = Mage::getModel('clnews/category')->getCollection();
|
214 |
+
|
215 |
+
foreach ($collection as $category) {
|
216 |
+
if ($category->getSortId() >= $pos) {
|
217 |
+
$category->setSortId($category->getSortId() + 10);
|
218 |
+
try {
|
219 |
+
$category->save();
|
220 |
+
} catch (Exception $ex) {
|
221 |
+
echo 'you have a problem with saving category!!!!' . "\n";
|
222 |
+
}
|
223 |
+
}
|
224 |
+
}
|
225 |
+
}
|
226 |
}
|
app/code/community/CommerceLab/News/Block/Adminhtml/Category/Grid.php
CHANGED
@@ -31,6 +31,7 @@ class CommerceLab_News_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Bloc
|
|
31 |
$tableName = Mage::getSingleton('core/resource')->getTableName('clnews_category_store');
|
32 |
$collection->getSelect()->joinLeft($tableName, 'main_table.category_id = '. $tableName . '.category_id', array($tableName . '.store_id as store_id'));
|
33 |
}
|
|
|
34 |
$this->setCollection($collection);
|
35 |
return parent::_prepareCollection();
|
36 |
}
|
@@ -48,6 +49,7 @@ class CommerceLab_News_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Bloc
|
|
48 |
'header' => Mage::helper('clnews')->__('Title'),
|
49 |
'align' =>'left',
|
50 |
'index' => 'title',
|
|
|
51 |
));
|
52 |
|
53 |
$this->addColumn('url_key', array(
|
@@ -74,9 +76,9 @@ class CommerceLab_News_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Bloc
|
|
74 |
'align' => 'left',
|
75 |
'width' => '50',
|
76 |
'index' => 'sort_order',
|
77 |
-
|
78 |
|
79 |
-
|
80 |
array(
|
81 |
'header' => Mage::helper('clnews')->__('Action'),
|
82 |
'type' => 'action',
|
@@ -86,14 +88,22 @@ class CommerceLab_News_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Bloc
|
|
86 |
'caption' => Mage::helper('clnews')->__('Edit'),
|
87 |
'url' => array('base'=> '*/*/edit'),
|
88 |
'field' => 'id'
|
|
|
|
|
|
|
|
|
|
|
89 |
)
|
|
|
90 |
),
|
91 |
'width' => '70',
|
92 |
'index' => 'stores',
|
93 |
'is_system' => true,
|
94 |
'filter' => false,
|
95 |
'sortable' => false,
|
|
|
96 |
));
|
|
|
97 |
return parent::_prepareColumns();
|
98 |
}
|
99 |
|
31 |
$tableName = Mage::getSingleton('core/resource')->getTableName('clnews_category_store');
|
32 |
$collection->getSelect()->joinLeft($tableName, 'main_table.category_id = '. $tableName . '.category_id', array($tableName . '.store_id as store_id'));
|
33 |
}
|
34 |
+
$collection->getSelect()->order('main_table.sort_id ASC');
|
35 |
$this->setCollection($collection);
|
36 |
return parent::_prepareCollection();
|
37 |
}
|
49 |
'header' => Mage::helper('clnews')->__('Title'),
|
50 |
'align' =>'left',
|
51 |
'index' => 'title',
|
52 |
+
'renderer' => 'clnews/adminhtml_category_grid_column_renderer_subCategories',
|
53 |
));
|
54 |
|
55 |
$this->addColumn('url_key', array(
|
76 |
'align' => 'left',
|
77 |
'width' => '50',
|
78 |
'index' => 'sort_order',
|
79 |
+
));
|
80 |
|
81 |
+
$this->addColumn('action',
|
82 |
array(
|
83 |
'header' => Mage::helper('clnews')->__('Action'),
|
84 |
'type' => 'action',
|
88 |
'caption' => Mage::helper('clnews')->__('Edit'),
|
89 |
'url' => array('base'=> '*/*/edit'),
|
90 |
'field' => 'id'
|
91 |
+
),
|
92 |
+
array(
|
93 |
+
'caption' => Mage::helper('clnews')->__('Add Sub Category'),
|
94 |
+
'url' => array('base'=> '*/*/new'),
|
95 |
+
'field' => 'parent_id'
|
96 |
)
|
97 |
+
|
98 |
),
|
99 |
'width' => '70',
|
100 |
'index' => 'stores',
|
101 |
'is_system' => true,
|
102 |
'filter' => false,
|
103 |
'sortable' => false,
|
104 |
+
'renderer' => 'clnews/adminhtml_category_grid_column_renderer_action',
|
105 |
));
|
106 |
+
|
107 |
return parent::_prepareColumns();
|
108 |
}
|
109 |
|
app/code/community/CommerceLab/News/Block/Adminhtml/Category/Grid/Column/Renderer/Action.php
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class CommerceLab_News_Block_Adminhtml_Category_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Renders column
|
8 |
+
*
|
9 |
+
* @param Varien_Object $row
|
10 |
+
* @return string
|
11 |
+
*/
|
12 |
+
public function render(Varien_Object $row)
|
13 |
+
{
|
14 |
+
$actions = $this->getColumn()->getActions();
|
15 |
+
if ( empty($actions) || !is_array($actions) ) {
|
16 |
+
return ' ';
|
17 |
+
}
|
18 |
+
|
19 |
+
if(sizeof($actions)==1 && !$this->getColumn()->getNoLink()) {
|
20 |
+
foreach ($actions as $action) {
|
21 |
+
if ( is_array($action) ) {
|
22 |
+
return $this->_toLinkHtml($action, $row);
|
23 |
+
}
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
$out = '<select class="action-select" onchange="varienGridAction.execute(this);">'
|
28 |
+
. '<option value=""></option>';
|
29 |
+
$i = 0;
|
30 |
+
foreach ($actions as $action){
|
31 |
+
$i++;
|
32 |
+
if ( is_array($action) ) {
|
33 |
+
if ($this->checkLimit($row->getId()) < 5) {
|
34 |
+
$out .= $this->_toOptionHtml($action, $row);
|
35 |
+
} else {
|
36 |
+
if ($action['caption'] == 'Edit') {
|
37 |
+
$out .= $this->_toOptionHtml($action, $row);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
$out .= '</select>';
|
43 |
+
return $out;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Render single action as dropdown option html
|
48 |
+
*
|
49 |
+
* @param unknown_type $action
|
50 |
+
* @param Varien_Object $row
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
protected function _toOptionHtml($action, Varien_Object $row)
|
54 |
+
{
|
55 |
+
$actionAttributes = new Varien_Object();
|
56 |
+
|
57 |
+
$actionCaption = '';
|
58 |
+
$this->_transformActionData($action, $actionCaption, $row);
|
59 |
+
|
60 |
+
$htmlAttibutes = array('value'=>$this->htmlEscape(Mage::helper('core')->jsonEncode($action)));
|
61 |
+
$actionAttributes->setData($htmlAttibutes);
|
62 |
+
return '<option ' . $actionAttributes->serialize() . '>' . $actionCaption . '</option>';
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Render single action as link html
|
67 |
+
*
|
68 |
+
* @param array $action
|
69 |
+
* @param Varien_Object $row
|
70 |
+
* @return string
|
71 |
+
*/
|
72 |
+
protected function _toLinkHtml($action, Varien_Object $row)
|
73 |
+
{
|
74 |
+
$actionAttributes = new Varien_Object();
|
75 |
+
|
76 |
+
$actionCaption = '';
|
77 |
+
$this->_transformActionData($action, $actionCaption, $row);
|
78 |
+
|
79 |
+
if(isset($action['confirm'])) {
|
80 |
+
$action['onclick'] = 'return window.confirm(\''
|
81 |
+
. addslashes($this->htmlEscape($action['confirm']))
|
82 |
+
. '\')';
|
83 |
+
unset($action['confirm']);
|
84 |
+
}
|
85 |
+
|
86 |
+
$actionAttributes->setData($action);
|
87 |
+
return '<a ' . $actionAttributes->serialize() . '>' . $actionCaption . '</a>';
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Prepares action data for html render
|
92 |
+
*
|
93 |
+
* @param array $action
|
94 |
+
* @param string $actionCaption
|
95 |
+
* @param Varien_Object $row
|
96 |
+
* @return Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
|
97 |
+
*/
|
98 |
+
protected function _transformActionData(&$action, &$actionCaption, Varien_Object $row)
|
99 |
+
{
|
100 |
+
foreach ( $action as $attibute => $value ) {
|
101 |
+
if(isset($action[$attibute]) && !is_array($action[$attibute])) {
|
102 |
+
$this->getColumn()->setFormat($action[$attibute]);
|
103 |
+
$action[$attibute] = parent::render($row);
|
104 |
+
} else {
|
105 |
+
$this->getColumn()->setFormat(null);
|
106 |
+
}
|
107 |
+
|
108 |
+
switch ($attibute) {
|
109 |
+
case 'caption':
|
110 |
+
$actionCaption = $action['caption'];
|
111 |
+
unset($action['caption']);
|
112 |
+
break;
|
113 |
+
|
114 |
+
case 'url':
|
115 |
+
if(is_array($action['url'])) {
|
116 |
+
$params = array($action['field']=>$this->_getValue($row));
|
117 |
+
if(isset($action['url']['params'])) {
|
118 |
+
$params = array_merge($action['url']['params'], $params);
|
119 |
+
}
|
120 |
+
$action['href'] = $this->getUrl($action['url']['base'], $params);
|
121 |
+
unset($action['field']);
|
122 |
+
} else {
|
123 |
+
$action['href'] = $action['url'];
|
124 |
+
}
|
125 |
+
unset($action['url']);
|
126 |
+
break;
|
127 |
+
|
128 |
+
case 'popup':
|
129 |
+
$action['onclick'] = 'popWin(this.href, \'_blank\', \'width=800,height=700,resizable=1,scrollbars=1\');return false;';
|
130 |
+
break;
|
131 |
+
|
132 |
+
}
|
133 |
+
}
|
134 |
+
return $this;
|
135 |
+
}
|
136 |
+
|
137 |
+
protected function checkLimit($id)
|
138 |
+
{
|
139 |
+
if ($id) {
|
140 |
+
$collection = Mage::getModel('clnews/category')->getCollection();
|
141 |
+
$collection->getSelect()->order('main_table.level DESC');
|
142 |
+
$collection->getSelect()->where('main_table.category_id =?', $id);
|
143 |
+
$collection->getSelect()->limit(1);
|
144 |
+
if (count($collection) > 0) {
|
145 |
+
$level = $collection->getData('level');
|
146 |
+
$level = $level[0]['level'];
|
147 |
+
return $level;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
}
|
app/code/community/CommerceLab/News/Block/Adminhtml/Category/Grid/Column/Renderer/SubCategories.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class CommerceLab_News_Block_Adminhtml_Category_Grid_Column_Renderer_SubCategories extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
public function render(Varien_Object $row)
|
6 |
+
{
|
7 |
+
$value = $row->getData($this->getColumn()->getIndex());
|
8 |
+
if ($row->getData('level') == 1) {
|
9 |
+
return '<span>    '.$value.'</span>';
|
10 |
+
} else if ($row->getData('level') == 2) {
|
11 |
+
return '<span>        '.$value.'</span>';
|
12 |
+
} else if ($row->getData('level') == 3) {
|
13 |
+
return '<span>            '.$value.'</span>';
|
14 |
+
} else if ($row->getData('level') == 4) {
|
15 |
+
return '<span>                '.$value.'</span>';
|
16 |
+
} else if ($row->getData('level') == 5) {
|
17 |
+
return '<span>                    '.$value.'</span>';
|
18 |
+
} else {
|
19 |
+
return $value;
|
20 |
+
}
|
21 |
+
|
22 |
+
}
|
23 |
+
}
|
24 |
+
?>
|
app/code/community/CommerceLab/News/Block/Adminhtml/News/Grid.php
CHANGED
@@ -144,6 +144,7 @@ class CommerceLab_News_Block_Adminhtml_News_Grid extends Mage_Adminhtml_Block_Wi
|
|
144 |
'is_system' => true,
|
145 |
));
|
146 |
|
|
|
147 |
return parent::_prepareColumns();
|
148 |
}
|
149 |
|
144 |
'is_system' => true,
|
145 |
));
|
146 |
|
147 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
|
148 |
return parent::_prepareColumns();
|
149 |
}
|
150 |
|
app/code/community/CommerceLab/News/Block/News.php
CHANGED
@@ -184,7 +184,7 @@ class CommerceLab_News_Block_News extends Mage_Core_Block_Template
|
|
184 |
{
|
185 |
$collection = Mage::getModel('clnews/category')->getCollection()
|
186 |
->addStoreFilter(Mage::app()->getStore()->getId())
|
187 |
-
->setOrder('
|
188 |
|
189 |
foreach ($collection as $item) {
|
190 |
$item->setLink(Mage::getBaseUrl().$this->getAlias().'/category/'.$item->getUrlKey().'.html');
|
184 |
{
|
185 |
$collection = Mage::getModel('clnews/category')->getCollection()
|
186 |
->addStoreFilter(Mage::app()->getStore()->getId())
|
187 |
+
->setOrder('sort_id', 'asc');
|
188 |
|
189 |
foreach ($collection as $item) {
|
190 |
$item->setLink(Mage::getBaseUrl().$this->getAlias().'/category/'.$item->getUrlKey().'.html');
|
app/code/community/CommerceLab/News/Model/Check.php
CHANGED
@@ -77,5 +77,25 @@ class CommerceLab_News_Model_Check extends Mage_Core_Model_Abstract
|
|
77 |
return $this;
|
78 |
}
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
}
|
77 |
return $this;
|
78 |
}
|
79 |
|
80 |
+
public function checkConfiguration()
|
81 |
+
{
|
82 |
+
$coll = Mage::getModel('core/config_data')->getCollection();
|
83 |
+
$coll->getSelect()->where("path='clnews/news/showrightblock'");
|
84 |
+
foreach ($coll as $cd) {
|
85 |
+
if ($cd->getValue() == 1) {
|
86 |
+
$loll = Mage::getModel('core/config_data')->getCollection();
|
87 |
+
$loll->getSelect()->where("path='clnews/news/showleftblock'");
|
88 |
+
foreach ($loll as $ld) {
|
89 |
+
if ($ld->getValue() == 1) {
|
90 |
+
$ld->setValue(0)->save();
|
91 |
+
Mage::getSingleton('adminhtml/session')
|
92 |
+
->addSuccess(Mage::helper('clnews')->__('News category tree can be shown only in one column'));
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
|
101 |
}
|
app/code/community/CommerceLab/News/controllers/Adminhtml/NewsController.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @license http://commerce-lab.com/LICENSE.txt
|
16 |
*/
|
17 |
|
18 |
-
class CommerceLab_News_Adminhtml_NewsController extends
|
19 |
{
|
20 |
public function preDispatch() {
|
21 |
parent::preDispatch();
|
@@ -273,7 +273,7 @@ class CommerceLab_News_Adminhtml_NewsController extends Mage_Adminhtml_Controlle
|
|
273 |
$model->setNewsTime(now());
|
274 |
$model->setCreatedTime(now());
|
275 |
} else {
|
276 |
-
if (!$newsItemId = $arr[0]['news_id']) {
|
277 |
$model->setCreatedTime(now());
|
278 |
}
|
279 |
}
|
@@ -355,6 +355,69 @@ class CommerceLab_News_Adminhtml_NewsController extends Mage_Adminhtml_Controlle
|
|
355 |
$this->_redirect('*/*/index');
|
356 |
}
|
357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
public function massStatusAction()
|
359 |
{
|
360 |
$newsIds = $this->getRequest()->getParam('clnews');
|
15 |
* @license http://commerce-lab.com/LICENSE.txt
|
16 |
*/
|
17 |
|
18 |
+
class CommerceLab_News_Adminhtml_NewsController extends Mage_Adminhtml_Controller_Action
|
19 |
{
|
20 |
public function preDispatch() {
|
21 |
parent::preDispatch();
|
273 |
$model->setNewsTime(now());
|
274 |
$model->setCreatedTime(now());
|
275 |
} else {
|
276 |
+
if (isset($arr[0]) && (!$newsItemId = $arr[0]['news_id'])) {
|
277 |
$model->setCreatedTime(now());
|
278 |
}
|
279 |
}
|
355 |
$this->_redirect('*/*/index');
|
356 |
}
|
357 |
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Export order grid to CSV format
|
361 |
+
*/
|
362 |
+
public function exportCsvAction()
|
363 |
+
{
|
364 |
+
$fileName = 'news.csv';
|
365 |
+
$grid = $this->getLayout()
|
366 |
+
->createBlock('clnews/adminhtml_news_grid')
|
367 |
+
->addColumn('news_id', array(
|
368 |
+
'header' => Mage::helper('clnews')->__('ID'),
|
369 |
+
'align' =>'right',
|
370 |
+
'width' => '50',
|
371 |
+
'index' => 'news_id',
|
372 |
+
))->addColumn('title', array(
|
373 |
+
'header' => Mage::helper('clnews')->__('Title'),
|
374 |
+
'align' =>'left',
|
375 |
+
'index' => 'title',
|
376 |
+
))->addColumn('url_key', array(
|
377 |
+
'header' => Mage::helper('clnews')->__('URL Key'),
|
378 |
+
'align' => 'left',
|
379 |
+
'index' => 'url_key',
|
380 |
+
))->addColumn('author', array(
|
381 |
+
'header' => Mage::helper('clnews')->__('Author'),
|
382 |
+
'index' => 'author',
|
383 |
+
))->addColumn('short_content', array(
|
384 |
+
'header' => Mage::helper('clnews')->__('Short Content'),
|
385 |
+
'type' =>'text',
|
386 |
+
'index' => 'short_content',
|
387 |
+
))->addColumn('image_short_content', array(
|
388 |
+
'header' => Mage::helper('clnews')->__('Short Content Image'),
|
389 |
+
'type' =>'text',
|
390 |
+
'display' => 'none',
|
391 |
+
'index' => 'image_short_content',
|
392 |
+
))->addColumn('full_content', array(
|
393 |
+
'header' => Mage::helper('clnews')->__('Full Content'),
|
394 |
+
'type' =>'text',
|
395 |
+
'index' => 'full_content',
|
396 |
+
))->addColumn('image_full_content', array(
|
397 |
+
'header' => Mage::helper('clnews')->__('Full Content Image'),
|
398 |
+
'type' =>'text',
|
399 |
+
'index' => 'image_full_content',
|
400 |
+
))->addColumn('document', array(
|
401 |
+
'header' => Mage::helper('clnews')->__('Document'),
|
402 |
+
'type' =>'text',
|
403 |
+
'index' => 'document',
|
404 |
+
))->addColumn('meta_keywords', array(
|
405 |
+
'header' => Mage::helper('clnews')->__('Meta Keywords'),
|
406 |
+
'type' =>'text',
|
407 |
+
'index' => 'meta_keywords',
|
408 |
+
))->addColumn('meta_description', array(
|
409 |
+
'header' => Mage::helper('clnews')->__('Meta Description'),
|
410 |
+
'type' =>'text',
|
411 |
+
'index' => 'meta_description',
|
412 |
+
))->addColumn('tags', array(
|
413 |
+
'header' => Mage::helper('clnews')->__('Tags'),
|
414 |
+
'type' =>'text',
|
415 |
+
'index' => 'tags',
|
416 |
+
));
|
417 |
+
|
418 |
+
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
|
419 |
+
}
|
420 |
+
|
421 |
public function massStatusAction()
|
422 |
{
|
423 |
$newsIds = $this->getRequest()->getParam('clnews');
|
app/code/community/CommerceLab/News/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CommerceLab_News>
|
5 |
-
<version>1.0.
|
6 |
</CommerceLab_News>
|
7 |
</modules>
|
8 |
<admin>
|
@@ -145,6 +145,14 @@
|
|
145 |
</clnews>
|
146 |
</observers>
|
147 |
</controller_action_predispatch>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
</events>
|
149 |
</adminhtml>
|
150 |
<global>
|
@@ -168,9 +176,9 @@
|
|
168 |
<news_category>
|
169 |
<table>clnews_news_category</table>
|
170 |
</news_category>
|
171 |
-
|
172 |
<table>clnews_store</table>
|
173 |
-
</store
|
174 |
<news_store>
|
175 |
<table>clnews_news_store</table>
|
176 |
</news_store>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CommerceLab_News>
|
5 |
+
<version>1.0.2</version><platform>ce</platform>
|
6 |
</CommerceLab_News>
|
7 |
</modules>
|
8 |
<admin>
|
145 |
</clnews>
|
146 |
</observers>
|
147 |
</controller_action_predispatch>
|
148 |
+
<admin_system_config_changed_section_clnews>
|
149 |
+
<observers>
|
150 |
+
<admin_system_config_changed_section_clnews>
|
151 |
+
<class>clnews/check</class>
|
152 |
+
<method>checkConfiguration</method>
|
153 |
+
</admin_system_config_changed_section_clnews>
|
154 |
+
</observers>
|
155 |
+
</admin_system_config_changed_section_clnews>
|
156 |
</events>
|
157 |
</adminhtml>
|
158 |
<global>
|
176 |
<news_category>
|
177 |
<table>clnews_news_category</table>
|
178 |
</news_category>
|
179 |
+
<!--<store>
|
180 |
<table>clnews_store</table>
|
181 |
+
</store>-->
|
182 |
<news_store>
|
183 |
<table>clnews_news_store</table>
|
184 |
</news_store>
|
app/code/community/CommerceLab/News/etc/system.xml
CHANGED
@@ -59,11 +59,29 @@
|
|
59 |
<show_in_website>1</show_in_website>
|
60 |
<show_in_store>1</show_in_store>
|
61 |
</itemsperpage>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
<showlatestnews translate="label">
|
63 |
<label>Show Latest News Block</label>
|
64 |
<frontend_type>select</frontend_type>
|
65 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
66 |
-
<sort_order>
|
67 |
<show_in_default>1</show_in_default>
|
68 |
<show_in_website>1</show_in_website>
|
69 |
<show_in_store>1</show_in_store>
|
59 |
<show_in_website>1</show_in_website>
|
60 |
<show_in_store>1</show_in_store>
|
61 |
</itemsperpage>
|
62 |
+
<showrightblock translate="label">
|
63 |
+
<label>Show News Category Block in Right Column</label>
|
64 |
+
<frontend_type>select</frontend_type>
|
65 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
66 |
+
<sort_order>31</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>1</show_in_store>
|
70 |
+
</showrightblock>
|
71 |
+
<showleftblock translate="label">
|
72 |
+
<label>Show News Category Block in Left Column</label>
|
73 |
+
<frontend_type>select</frontend_type>
|
74 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
75 |
+
<sort_order>32</sort_order>
|
76 |
+
<show_in_default>1</show_in_default>
|
77 |
+
<show_in_website>1</show_in_website>
|
78 |
+
<show_in_store>1</show_in_store>
|
79 |
+
</showleftblock>
|
80 |
<showlatestnews translate="label">
|
81 |
<label>Show Latest News Block</label>
|
82 |
<frontend_type>select</frontend_type>
|
83 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
84 |
+
<sort_order>33</sort_order>
|
85 |
<show_in_default>1</show_in_default>
|
86 |
<show_in_website>1</show_in_website>
|
87 |
<show_in_store>1</show_in_store>
|
app/code/community/CommerceLab/News/sql/clnews_setup/mysql4-upgrade-1.0.1-1.0.2.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
/** @var $installer Enterprise_CatalogEvent_Model_Resource_Setup */
|
5 |
+
|
6 |
+
|
7 |
+
$installer->startSetup();
|
8 |
+
|
9 |
+
$installer->getConnection()
|
10 |
+
->addColumn($installer->getTable('clnews/category'),
|
11 |
+
'parent_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,
|
12 |
+
'nullable' => false,
|
13 |
+
'default' => '0',), 'Parent Category ID');
|
14 |
+
$installer->getConnection()
|
15 |
+
->addColumn($installer->getTable('clnews/category'),
|
16 |
+
'level', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
17 |
+
'nullable' => false,
|
18 |
+
'default' => '0',
|
19 |
+
), 'Tree Level');
|
20 |
+
|
21 |
+
$installer->getConnection()
|
22 |
+
->addColumn($installer->getTable('clnews/category'),
|
23 |
+
'sort_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,
|
24 |
+
'nullable' => false,
|
25 |
+
'default' => '0',), 'Sort ID');
|
26 |
+
|
27 |
+
|
28 |
+
$installer->getConnection()
|
29 |
+
->addIndex($installer->getTable('clnews/category'),
|
30 |
+
$installer->getIdxName('catalog/category', array('sort_id')),
|
31 |
+
array('sort_id'));
|
32 |
+
|
33 |
+
$installer->getConnection()
|
34 |
+
->addIndex($installer->getTable('clnews/category'),
|
35 |
+
$installer->getIdxName('catalog/category', array('level')),
|
36 |
+
array('level'));
|
37 |
+
|
38 |
+
$installer->run("update {$this->getTable('clnews/category')} set parent_id = 0 where parent_id is null");
|
39 |
+
$installer->run("update {$this->getTable('clnews/category')} set sort_id = 0 where sort_id is null");
|
40 |
+
$installer->run("update {$this->getTable('clnews/category')} set level = 0 where level is null");
|
41 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/clnews.xml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category design_default
|
17 |
+
* @package Mage
|
18 |
+
* @copyright Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<layout version="0.1.0">
|
23 |
+
<default>
|
24 |
+
<reference name="head">
|
25 |
+
<action method="setCanLoadExtJs"><flag>1</flag></action>
|
26 |
+
<action method="addJs"><script>mage/adminhtml/variables.js</script></action>
|
27 |
+
<action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
|
28 |
+
<action method="addJs"><script>lib/flex.js</script></action>
|
29 |
+
<action method="addJs"><script>lib/FABridge.js</script></action>
|
30 |
+
<action method="addJs"><script>mage/adminhtml/flexuploader.js</script></action>
|
31 |
+
<action method="addJs"><script>mage/adminhtml/browser.js</script></action>
|
32 |
+
<action method="addJs"><script>prototype/window.js</script></action>
|
33 |
+
<action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
|
34 |
+
<action method="addItem"><type>js_css</type><name>prototype/windows/themes/commercelab/magento.css</name></action>
|
35 |
+
</reference>
|
36 |
+
</default>
|
37 |
+
</layout>
|
app/design/frontend/default/default/layout/clnews.xml
CHANGED
@@ -25,13 +25,17 @@
|
|
25 |
<action method="addItem"><type>skin_css</type><name>css/clnews/style.css</name></action>
|
26 |
<action method="addJs"><script>jquery/jquery-1.4.4.js</script></action>
|
27 |
<action method="addJs"><script>commercelab/noconflict.js</script></action>
|
|
|
|
|
|
|
|
|
28 |
</reference>
|
29 |
<reference name="root">
|
30 |
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
31 |
</reference>
|
32 |
<reference name="right">
|
33 |
<block type="clnews/news" name="right.clnews.menu" before="-">
|
34 |
-
<action method="setTemplate">
|
35 |
<template>clnews/menu.phtml</template>
|
36 |
</action>
|
37 |
</block>
|
@@ -43,7 +47,7 @@
|
|
43 |
</reference>
|
44 |
<reference name="left">
|
45 |
<block type="clnews/news" name="left.clnews.menu" before="-">
|
46 |
-
<action method="setTemplate">
|
47 |
<template>clnews/menu.phtml</template>
|
48 |
</action>
|
49 |
</block>
|
25 |
<action method="addItem"><type>skin_css</type><name>css/clnews/style.css</name></action>
|
26 |
<action method="addJs"><script>jquery/jquery-1.4.4.js</script></action>
|
27 |
<action method="addJs"><script>commercelab/noconflict.js</script></action>
|
28 |
+
<action method="addJs"><script>commercelab/treeview/jquery.treeview.pack.js</script></action>
|
29 |
+
<action method="addJs"><script>commercelab/category_tree.js</script></action>
|
30 |
+
|
31 |
+
<action method="addCss"><stylesheet>css/commercelab/treeview/jquery.treeview.css</stylesheet></action>
|
32 |
</reference>
|
33 |
<reference name="root">
|
34 |
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
35 |
</reference>
|
36 |
<reference name="right">
|
37 |
<block type="clnews/news" name="right.clnews.menu" before="-">
|
38 |
+
<action method="setTemplate" ifconfig="clnews/news/showrightblock">
|
39 |
<template>clnews/menu.phtml</template>
|
40 |
</action>
|
41 |
</block>
|
47 |
</reference>
|
48 |
<reference name="left">
|
49 |
<block type="clnews/news" name="left.clnews.menu" before="-">
|
50 |
+
<action method="setTemplate" ifconfig="clnews/news/showleftblock">
|
51 |
<template>clnews/menu.phtml</template>
|
52 |
</action>
|
53 |
</block>
|
app/design/frontend/default/default/template/clnews/list.phtml
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
<?php $items = $this->getNewsItems() ?>
|
12 |
<?php foreach ($items as $item): ?>
|
13 |
<div class="news-item">
|
14 |
-
<? if ($item->getImageShortContentShow() == 1): ?>
|
15 |
<?
|
16 |
$width_max = Mage::getStoreConfig('clnews/news/shortdescr_image_max_width');
|
17 |
$height_max = Mage::getStoreConfig('clnews/news/shortdescr_image_max_height');
|
11 |
<?php $items = $this->getNewsItems() ?>
|
12 |
<?php foreach ($items as $item): ?>
|
13 |
<div class="news-item">
|
14 |
+
<? if ($item->getImageShortContentShow() == 1 && $item->getImageShortContent()): ?>
|
15 |
<?
|
16 |
$width_max = Mage::getStoreConfig('clnews/news/shortdescr_image_max_width');
|
17 |
$height_max = Mage::getStoreConfig('clnews/news/shortdescr_image_max_height');
|
app/design/frontend/default/default/template/clnews/menu.phtml
CHANGED
@@ -5,14 +5,37 @@
|
|
5 |
<strong><span><?php echo $this->__(Mage::getStoreConfig('clnews/news/title'));?></span></strong>
|
6 |
</div>
|
7 |
<div class="block-content">
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
</div>
|
17 |
</div>
|
18 |
<?php endif ?>
|
5 |
<strong><span><?php echo $this->__(Mage::getStoreConfig('clnews/news/title'));?></span></strong>
|
6 |
</div>
|
7 |
<div class="block-content">
|
8 |
+
<div id="commercelab_categories_container" class="menu-categories">
|
9 |
+
<h5><?php echo $this->__('Categories');?></h5>
|
10 |
+
<ul id="commercelab_categories_div">
|
11 |
+
<?php $count = 0; ?>
|
12 |
+
<?php $level = 0; ?>
|
13 |
+
<?php $children = 0; ?>
|
14 |
+
<?php foreach ($categories as $category): ?>
|
15 |
+
<?php if ($count == 0 && $category->getLevel() == 0): ?>
|
16 |
+
<?php $level = $category->getLevel(); ?>
|
17 |
+
<li><a href="<?php echo $category->getLink(); ?>" ><?php echo $category->getTitle();?></a>
|
18 |
+
<?php elseif ($count > 0 && $category->getLevel() == $level): ?>
|
19 |
+
<?php $level = $category->getLevel(); ?>
|
20 |
+
</li><li><a href="<?php echo $category->getLink(); ?>" ><?php echo $category->getTitle();?></a>
|
21 |
+
<?php elseif ($count > 0 && $category->getLevel() != $level && $category->getLevel() > 0): ?>
|
22 |
+
<?php $children++; ?>
|
23 |
+
<?php $level = $category->getLevel(); ?>
|
24 |
+
<ul><li><a href="<?php echo $category->getLink(); ?>" ><?php echo $category->getTitle();?></a>
|
25 |
+
<?php elseif ($count > 0 && $category->getLevel() != $level && $category->getLevel() == 0): ?>
|
26 |
+
<?php for ($i = 0; $i < $children; $i++): ?>
|
27 |
+
</ul></li>
|
28 |
+
<?php endfor; ?>
|
29 |
+
<?php $children = 0; ?>
|
30 |
+
<?php $level = $category->getLevel(); ?>
|
31 |
+
</li><li><a href="<?php echo $category->getLink(); ?>" ><?php echo $category->getTitle();?></a>
|
32 |
+
<?php endif; ?>
|
33 |
+
<?php $count++; ?>
|
34 |
+
<?php endforeach; ?>
|
35 |
+
</li>
|
36 |
+
</ul>
|
37 |
+
</ul>
|
38 |
+
</div>
|
39 |
</div>
|
40 |
</div>
|
41 |
<?php endif ?>
|
app/design/frontend/default/default/template/clnews/newsitem.phtml
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
var js, fjs = d.getElementsByTagName(s)[0];
|
6 |
if (d.getElementById(id)) return;
|
7 |
js = d.createElement(s); js.id = id;
|
8 |
-
js.src = "//connect.facebook.net
|
9 |
fjs.parentNode.insertBefore(js, fjs);
|
10 |
}(document, 'script', 'facebook-jssdk'));</script>
|
11 |
<?php $session = Mage::getSingleton('core/session'); ?>
|
@@ -31,7 +31,7 @@
|
|
31 |
<?php if (Mage::helper('clnews')->getGoogleAccess()): ?><div class="google_button"><g:plusone></g:plusone></div><?php endif; ?><?php if (Mage::helper('clnews')->getFaceBookAccess()): ?><div class="fb-like" data-send="false" data-layout="button_count" data-width="110" data-show-faces="false"></div><?php endif; ?><?php if (Mage::helper('clnews')->getLinkedInAccess()): ?><script type="IN/Share" data-counter="right"></script><?php endif; ?><?php if (Mage::helper('clnews')->getTwitterAccess()): ?><a href="https://twitter.com/share" class="twitter-share-button">Tweet</a><?php endif; ?>
|
32 |
<a href="<?php echo $this->getUrl(Mage::helper('clnews')->getRoute() . '/newsitem/print/article/' . $item->getId()); ?>" class="print-btn"><?php echo $this->__('Print Version'); ?></a>
|
33 |
</div>
|
34 |
-
<?php if ($item->getImageFullContentShow() == 1): ?>
|
35 |
<div class="news_image">
|
36 |
<?php
|
37 |
$width_max = Mage::getStoreConfig('clnews/news/fulldescr_image_max_width');
|
@@ -212,7 +212,7 @@
|
|
212 |
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
213 |
po.src = 'https://apis.google.com/js/plusone.js';
|
214 |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
215 |
-
<?php if (count($comments)): ?>
|
216 |
AjaxSend(1, <?php echo $item->getID() ?>, false);
|
217 |
<?php endif ?>
|
218 |
})();
|
5 |
var js, fjs = d.getElementsByTagName(s)[0];
|
6 |
if (d.getElementById(id)) return;
|
7 |
js = d.createElement(s); js.id = id;
|
8 |
+
js.src = "//connect.facebook.net/<?php echo Mage::app()->getLocale()->getDefaultLocale() ?>/all.js#xfbml=1";
|
9 |
fjs.parentNode.insertBefore(js, fjs);
|
10 |
}(document, 'script', 'facebook-jssdk'));</script>
|
11 |
<?php $session = Mage::getSingleton('core/session'); ?>
|
31 |
<?php if (Mage::helper('clnews')->getGoogleAccess()): ?><div class="google_button"><g:plusone></g:plusone></div><?php endif; ?><?php if (Mage::helper('clnews')->getFaceBookAccess()): ?><div class="fb-like" data-send="false" data-layout="button_count" data-width="110" data-show-faces="false"></div><?php endif; ?><?php if (Mage::helper('clnews')->getLinkedInAccess()): ?><script type="IN/Share" data-counter="right"></script><?php endif; ?><?php if (Mage::helper('clnews')->getTwitterAccess()): ?><a href="https://twitter.com/share" class="twitter-share-button">Tweet</a><?php endif; ?>
|
32 |
<a href="<?php echo $this->getUrl(Mage::helper('clnews')->getRoute() . '/newsitem/print/article/' . $item->getId()); ?>" class="print-btn"><?php echo $this->__('Print Version'); ?></a>
|
33 |
</div>
|
34 |
+
<?php if ($item->getImageFullContentShow() == 1 && $item->getImageFullContent()): ?>
|
35 |
<div class="news_image">
|
36 |
<?php
|
37 |
$width_max = Mage::getStoreConfig('clnews/news/fulldescr_image_max_width');
|
212 |
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
213 |
po.src = 'https://apis.google.com/js/plusone.js';
|
214 |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
215 |
+
<?php if (isset($comments) && count($comments)): ?>
|
216 |
AjaxSend(1, <?php echo $item->getID() ?>, false);
|
217 |
<?php endif ?>
|
218 |
})();
|
app/locale/en_US/CommerceLab_News.csv
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
"News", "News"
|
js/commercelab/category_tree.js
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* @category CommerceLab
|
3 |
+
* @package CommerceLab_CategoryTree
|
4 |
+
* @author Uvarov Yurij <zim32@ukr.net>
|
5 |
+
*/
|
6 |
+
jQuery.noConflict();
|
7 |
+
|
8 |
+
jQuery(document).ready(function($){
|
9 |
+
|
10 |
+
$('#commercelab_categories_div').treeview(
|
11 |
+
{
|
12 |
+
collapsed: true
|
13 |
+
}
|
14 |
+
);
|
15 |
+
});
|
js/commercelab/treeview/jquery.treeview.pack.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Treeview 1.4 - jQuery plugin to hide and show branches of a tree
|
3 |
+
*
|
4 |
+
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
|
5 |
+
* http://docs.jquery.com/Plugins/Treeview
|
6 |
+
*
|
7 |
+
* Copyright (c) 2007 Jörn Zaefferer
|
8 |
+
*
|
9 |
+
* Dual licensed under the MIT and GPL licenses:
|
10 |
+
* http://www.opensource.org/licenses/mit-license.php
|
11 |
+
* http://www.gnu.org/licenses/gpl.html
|
12 |
+
*
|
13 |
+
* Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4($){$.1l($.F,{E:4(b,c){l a=3.n(\'.\'+b);3.n(\'.\'+c).o(c).m(b);a.o(b).m(c);8 3},s:4(a,b){8 3.n(\'.\'+a).o(a).m(b).P()},1n:4(a){a=a||"1j";8 3.1j(4(){$(3).m(a)},4(){$(3).o(a)})},1h:4(b,a){b?3.1g({1e:"p"},b,a):3.x(4(){T(3)[T(3).1a(":U")?"H":"D"]();7(a)a.A(3,O)})},12:4(b,a){7(b){3.1g({1e:"D"},b,a)}1L{3.D();7(a)3.x(a)}},11:4(a){7(!a.1k){3.n(":r-1H:G(9)").m(k.r);3.n((a.1F?"":"."+k.X)+":G(."+k.W+")").6(">9").D()}8 3.n(":y(>9)")},S:4(b,c){3.n(":y(>9):G(:y(>a))").6(">1z").C(4(a){c.A($(3).19())}).w($("a",3)).1n();7(!b.1k){3.n(":y(>9:U)").m(k.q).s(k.r,k.t);3.G(":y(>9:U)").m(k.u).s(k.r,k.v);3.1r("<J 14=\\""+k.5+"\\"/>").6("J."+k.5).x(4(){l a="";$.x($(3).B().1o("14").13(" "),4(){a+=3+"-5 "});$(3).m(a)})}3.6("J."+k.5).C(c)},z:4(g){g=$.1l({N:"z"},g);7(g.w){8 3.1K("w",[g.w])}7(g.p){l d=g.p;g.p=4(){8 d.A($(3).B()[0],O)}}4 1m(b,c){4 L(a){8 4(){K.A($("J."+k.5,b).n(4(){8 a?$(3).B("."+a).1i:1I}));8 1G}}$("a:10(0)",c).C(L(k.u));$("a:10(1)",c).C(L(k.q));$("a:10(2)",c).C(L())}4 K(){$(3).B().6(">.5").E(k.Z,k.Y).E(k.I,k.M).P().E(k.u,k.q).E(k.v,k.t).6(">9").1h(g.1f,g.p);7(g.1E){$(3).B().1D().6(">.5").s(k.Z,k.Y).s(k.I,k.M).P().s(k.u,k.q).s(k.v,k.t).6(">9").12(g.1f,g.p)}}4 1d(){4 1C(a){8 a?1:0}l b=[];j.x(4(i,e){b[i]=$(e).1a(":y(>9:1B)")?1:0});$.V(g.N,b.1A(""))}4 1c(){l b=$.V(g.N);7(b){l a=b.13("");j.x(4(i,e){$(e).6(">9")[1y(a[i])?"H":"D"]()})}}3.m("z");l j=3.6("Q").11(g);1x(g.1w){18"V":l h=g.p;g.p=4(){1d();7(h){h.A(3,O)}};1c();17;18"1b":l f=3.6("a").n(4(){8 3.16.15()==1b.16.15()});7(f.1i){f.m("1v").1u("9, Q").w(f.19()).H()}17}j.S(g,K);7(g.R){1m(3,g.R);$(g.R).H()}8 3.1t("w",4(a,b){$(b).1s().o(k.r).o(k.v).o(k.t).6(">.5").o(k.I).o(k.M);$(b).6("Q").1q().11(g).S(g,K)})}});l k=$.F.z.1J={W:"W",X:"X",q:"q",Y:"q-5",M:"t-5",u:"u",Z:"u-5",I:"v-5",v:"v",t:"t",r:"r",5:"5"};$.F.1p=$.F.z})(T);',62,110,'|||this|function|hitarea|find|if|return|ul||||||||||||var|addClass|filter|removeClass|toggle|expandable|last|replaceClass|lastExpandable|collapsable|lastCollapsable|add|each|has|treeview|apply|parent|click|hide|swapClass|fn|not|show|lastCollapsableHitarea|div|toggler|handler|lastExpandableHitarea|cookieId|arguments|end|li|control|applyClasses|jQuery|hidden|cookie|open|closed|expandableHitarea|collapsableHitarea|eq|prepareBranches|heightHide|split|class|toLowerCase|href|break|case|next|is|location|deserialize|serialize|height|animated|animate|heightToggle|length|hover|prerendered|extend|treeController|hoverClass|attr|Treeview|andSelf|prepend|prev|bind|parents|selected|persist|switch|parseInt|span|join|visible|binary|siblings|unique|collapsed|false|child|true|classes|trigger|else'.split('|'),0,{}))
|
js/prototype/windows/themes/commercelab/magento.css
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.dialog { border:1px solid #555; }
|
2 |
+
.dialog .bot { display:none !important; }
|
3 |
+
.overlay_magento { background-color:#000; filter:alpha(opacity=60); -moz-opacity:.6; opacity:.6; -webkit-opacity:.6; }
|
4 |
+
.top.table_window { border-bottom:1px solid #e6e6e6; background:#6a838b url(magento/top_bg.gif) 0 100% repeat-x; }
|
5 |
+
|
6 |
+
.magento_nw { width:6px; height:28px; }
|
7 |
+
.magento_n { height:28px; }
|
8 |
+
.magento_ne { width:6px; height:28px; }
|
9 |
+
|
10 |
+
.magento_w { width:6px; }
|
11 |
+
.magento_e { width:6px; }
|
12 |
+
.magento_w,
|
13 |
+
.magento_e,
|
14 |
+
.magento_content { background: #fafafa url(magento/content_bg.gif) 0 0 repeat-x; }
|
15 |
+
|
16 |
+
.magento_sw { background:#deebf0; width:5px; height:3px; }
|
17 |
+
.magento_s { background:#deebf0; height:3px; }
|
18 |
+
.magento_se,
|
19 |
+
|
20 |
+
.magento_sizer { background:#deebf0; width:5px; height:3px; }
|
21 |
+
.magento_sizer { cursor:se-resize; }
|
22 |
+
|
23 |
+
.magento_close { width:16px; height:16px; background:url(magento/window_close.png) no-repeat 0 0; position:absolute; top:5px; right:7px; cursor:pointer; z-index:1000; }
|
24 |
+
.magento_minimize { width:16px; height:16px; background:url(magento/window_minimize.png) 0 0 no-repeat; position:absolute; top:5px; right:28px; cursor:pointer; z-index:1000; }
|
25 |
+
.magento_maximize { width:16px; height:16px; background:url(magento/window_maximize.png)0 0 no-repeat; position:absolute; top:5px; right:49px; cursor:pointer; z-index:1000; }
|
26 |
+
|
27 |
+
.magento_title { float:left; width:100%; font:bold 12px/28px Arial, Helvetica, sans-serif; color:#fff; text-align:left; }
|
28 |
+
|
29 |
+
.magento_content { overflow:auto; font-size:12px; }
|
30 |
+
.magento_content,
|
31 |
+
.magento_content label { color:#333; font-family:Arial, sans-serif; }
|
32 |
+
|
33 |
+
.magento_buttons { padding:10px; text-align:right; }
|
34 |
+
.magento_buttons input.button { border-width:1px; border-style:solid; border-color:#ed6502 #a04300 #a04300 #ed6502; background:#ffac47 url(magento/btn_bg.gif) 0 100% repeat-x; padding:0 7px 1px 7px; font:bold 12px/18px Arial, Helvetica, sans-serif; color:#fff; cursor:pointer; text-align:center; white-space:nowrap; }
|
35 |
+
|
36 |
+
/* FOR IE */
|
37 |
+
* html .magento_close { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/magento/window_maximize.png", sizingMethod="crop"); }
|
38 |
+
* html .magento_minimize { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/magento/window_close.png", sizingMethod="crop");}
|
39 |
+
* html .magento_maximize { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/magento/window_minimize.png", sizingMethod="crop"); }
|
js/prototype/windows/themes/commercelab/magento/btn_bg.gif
ADDED
Binary file
|
js/prototype/windows/themes/commercelab/magento/content_bg.gif
ADDED
Binary file
|
js/prototype/windows/themes/commercelab/magento/top_bg.gif
ADDED
Binary file
|
js/prototype/windows/themes/commercelab/magento/window_close.png
ADDED
Binary file
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>CommerceLab_News</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -12,7 +12,7 @@
|
|
12 |
<p><strong>News Magento Extension Key Features</strong>:</p>
|
13 |
<br />
|
14 |
<ul class="ul-list">
|
15 |
-
<li>Create news categories</li>
|
16 |
<li>Bind each category to a particular store</li>
|
17 |
<li>Structural separation of news for a short and full description</li>
|
18 |
<li>Set a period of news publication (Publish From: Date, Hours, and Minutes; Publish until: Date, Hours and Minutes) </li>
|
@@ -27,6 +27,7 @@
|
|
27 |
<li>Print version for every news for easy opportunity to print it out</li>
|
28 |
<li>RSS-feed for each news category</li>
|
29 |
<li>Usage of Magento WYSYWIG-editor for simple news editing</li>
|
|
|
30 |
<li>Easy installation</li>
|
31 |
<li>Open source</li>
|
32 |
<li>Compatibility with the latest versions of Magento.</li>
|
@@ -34,13 +35,13 @@
|
|
34 |
<br />
|
35 |
<p><strong>CommerceLab – stay open for the world!</strong></p>
|
36 |
<br /></description>
|
37 |
-
<notes>Version number: 1.0.
|
38 |
Stability: Stable
|
39 |
Compatibility: 1.4, 1.5, 1.6, 1.7</notes>
|
40 |
<authors><author><name>CommerceLab</name><user>auto-converted</user><email>support@commerce-lab.com</email></author></authors>
|
41 |
-
<date>2012-
|
42 |
-
<time>
|
43 |
-
<contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="CommerceLab"><dir name="News"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="
|
44 |
<compatible/>
|
45 |
<dependencies/>
|
46 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>CommerceLab_News</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
12 |
<p><strong>News Magento Extension Key Features</strong>:</p>
|
13 |
<br />
|
14 |
<ul class="ul-list">
|
15 |
+
<li>Create news categories and their sub-categories</li>
|
16 |
<li>Bind each category to a particular store</li>
|
17 |
<li>Structural separation of news for a short and full description</li>
|
18 |
<li>Set a period of news publication (Publish From: Date, Hours, and Minutes; Publish until: Date, Hours and Minutes) </li>
|
27 |
<li>Print version for every news for easy opportunity to print it out</li>
|
28 |
<li>RSS-feed for each news category</li>
|
29 |
<li>Usage of Magento WYSYWIG-editor for simple news editing</li>
|
30 |
+
<li>The ability to to export News into CSV file</li>
|
31 |
<li>Easy installation</li>
|
32 |
<li>Open source</li>
|
33 |
<li>Compatibility with the latest versions of Magento.</li>
|
35 |
<br />
|
36 |
<p><strong>CommerceLab – stay open for the world!</strong></p>
|
37 |
<br /></description>
|
38 |
+
<notes>Version number: 1.0.2
|
39 |
Stability: Stable
|
40 |
Compatibility: 1.4, 1.5, 1.6, 1.7</notes>
|
41 |
<authors><author><name>CommerceLab</name><user>auto-converted</user><email>support@commerce-lab.com</email></author></authors>
|
42 |
+
<date>2012-07-19</date>
|
43 |
+
<time>13:55:56</time>
|
44 |
+
<contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="CommerceLab"><dir name="News"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="da553fda11187935780648d252c9e850"/></dir><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Action.php" hash="768aa10696beb070c5fc9eec9f0141c2"/><file name="SubCategories.php" hash="cc1eac066648cee1cabe3667625a5662"/></dir></dir></dir><file name="Edit.php" hash="32ae1eff8d827c5ccf46601dda906950"/><file name="Grid.php" hash="a9fd848b52d574801ecb07e6a965e216"/></dir><dir name="Comment"><dir name="Edit"><file name="Form.php" hash="a7b57128ebc8db11faeb12c19daf296b"/></dir><file name="Edit.php" hash="8de5a9f3de068243fbe0c4eddd58a715"/><file name="Grid.php" hash="d2ad38f3fc092a0ab9fcf1cbc56883db"/></dir><dir name="News"><dir name="Edit"><dir name="Tab"><file name="Additional.php" hash="5b0ab5180c2c6192f7a0e6c9a566c09d"/><file name="Info.php" hash="c2e91c7a505ee6ede52ef8ad52b4181c"/></dir><file name="Form.php" hash="9f087b81e9d08db22a719b70c8b504ba"/><file name="Tabs.php" hash="7cfa29c9c00b9e26a9114aef3f3a95e1"/></dir><file name="Edit.php" hash="b509c5c33e895f23d56ff19f085a6b02"/><file name="Grid.php" hash="6222ad2b270290a5c2218221afde6b73"/></dir><file name="Category.php" hash="79b3dde6b9fa76ae62213b7d6e2724b7"/><file name="Comment.php" hash="8be4d51b79855f471d28ebb8efa893cc"/><file name="News.php" hash="ebff7860ffe79041ace0badd257548fa"/></dir><file name="News.php" hash="20816483fb25f0b500706d3c1472ae2e"/><file name="Newsitem.php" hash="263e8591eabbfdf226cb111784eaea54"/><file name="Rss.php" hash="8011e243acfd1f2407ad69f271205315"/></dir><dir name="Controller"><file name="Router.php" hash="9defad284f4ba8ae6adbc1d1479fdb02"/></dir><dir name="Helper"><file name="Data.php" hash="54b3e5f59f408f77d0dc5402d4b89cee"/><file name="Versions.php" hash="47847c5ebcbb4afff5db50af3c358df5"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="bcd541e130b269eaa7c881998a1e1ec2"/></dir><dir name="Comment"><file name="Collection.php" hash="0a0735a6169c5b39d8d54a67c2bf181c"/></dir><dir name="News"><file name="Collection.php" hash="3a8d6de820d75ce0caca6319b8b7c780"/></dir><file name="Category.php" hash="09487b65a95b3f26924f3362b5dfc32e"/><file name="Comment.php" hash="50cd3b7a8a7b451723d6038fe0f402d3"/><file name="News.php" hash="7d4c3d7ba217fbe82f3b8c94ead8f9ec"/></dir><dir name="Wysiwyg"><file name="Config.php" hash="44527a7977ce854719b845dc37912548"/></dir><file name="Category.php" hash="e3d279a026d1613ecbd7d5a3b1b5f879"/><file name="Check.php" hash="8e3a9643ce8fa74650df280ff30877fc"/><file name="Comment.php" hash="e6ca88fe0a7ba12be87cc8b8ea8467ed"/><file name="News.php" hash="98c8bdfc76f61485437a9da60418395c"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategoryController.php" hash="55a5ce77722a8c066348063d2bd7bf8a"/><file name="CommentController.php" hash="bec1545e94875f64582f298ef8de977c"/><file name="NewsController.php" hash="0392ee055ff59db0aa188799f32e93ef"/></dir><file name="IndexController.php" hash="aed6c752e90fd1d5f363e056a262cf2f"/><file name="NewsitemController.php" hash="2ad107ffbcfff9f2655784f08195e457"/><file name="RssController.php" hash="53eeaf7b1f992ad4e018fa54cf08044a"/></dir><dir name="etc"><file name="config.xml" hash="cd2273926ab9f6be9d9474c888747680"/><file name="system.xml" hash="c10c9163b410c16d9c95f063e8f95171"/></dir><dir name="sql"><dir name="clnews_setup"><file name="mysql4-install-1.0.0.php" hash="1e262b10cef5e7b6392dfb4f68cc190b"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="072cb22e05bd386ae35d0f19ad1dedbc"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="clnews.xml" hash="56be957d1f4ef3073e648f17e2c93216"/></dir><dir name="template"><dir name="clnews"><file name="latest.phtml" hash="c469069d2d68a260fa95adf4b2dc0c92"/><file name="list.phtml" hash="027b849b1b34347a5e83b75f248cd357"/><file name="menu.phtml" hash="e940cc1614de26e74d0001b6711cc319"/><file name="news_print.phtml" hash="2805e2d08a368e74bfdbb234b92950f0"/><file name="newsitem.phtml" hash="2250255bd59a4b68753509af03530364"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="clnews.xml" hash="b3ee7933913985700b99efe8480f5fc8"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="CommerceLab_News.xml" hash="8da22cde4606bb3f8a30d40c4dbda6ee"/></dir></dir><dir name="locale"><dir name="en_US"><file name="CommerceLab_News.csv" hash="db70d4b3780e184eb262d9e29808c882"/></dir></dir></dir><dir name="js"><dir name="commercelab"><dir name="treeview"><file name="jquery.treeview.pack.js" hash="d1acfe09a5cb97d93ab167952c550a7d"/></dir><file name="noconflict.js" hash="8b266e71830972f1999c5af5638b5ff2"/><file name="category_tree.js" hash="2369a2d52e678de6f5fc0669492d2fda"/></dir><dir name="jquery"><file name="jquery-1.4.4.js" hash="1e2ef16563c5939f247626c6147045aa"/><file name="jquery-1.7.1-min.js" hash="de56dbfca517764d9d056e82068f8d39"/></dir><dir name="prototype"><dir name="windows"><dir name="themes"><dir name="commercelab"><dir name="magento"><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/><file name="content_bg.gif" hash="21278ea0da2d4256f4ced96b6080ba2e"/><file name="top_bg.gif" hash="26f28090de87d64f9b01bf624f89bfe2"/><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="magento.css" hash="a0b153cee7655dad31ee2923657cc08a"/></dir></dir></dir></dir></dir><dir name="skin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="clnews"><dir name="images"><file name="i-tags.gif" hash="d8acce70b98a2c5827ba8bd6ee166d6d"/><file name="i_attached.gif" hash="4e277173b6372b1a90b0f19e0388ad54"/><file name="i_print.gif" hash="0aed138181495642e9ab29e55d194d40"/><file name="rss.gif" hash="d17678b5dab15949ed62bea2b602090f"/></dir><file name="style.css" hash="02684062443683d8310010a2b73d1c92"/></dir><dir name="commercelab"><dir name="treeview"><dir name="images"><file name="file.gif" hash="9ab0e28d85d8ab5eb954fc28f6ac1e80"/><file name="folder-closed.gif" hash="262d69b7ca267be1994fca2aba46be32"/><file name="folder.gif" hash="9f41e1454905fd7416f89aa4380a65e1"/><file name="minus.gif" hash="e009322a00011359f76cf7ae59b4d33d"/><file name="plus.gif" hash="6c46b98e0c60e6dc2ef14f9d4a6607b8"/><file name="treeview-black-line.gif" hash="0cdd968bdb2f2852ec71e0264b3292cc"/><file name="treeview-black.gif" hash="a3ffb8abd978b0464f7b5b508fcfdef0"/><file name="treeview-default-line.gif" hash="5e3c0e0c48f48c23c45aef7b72c739c0"/><file name="treeview-default.gif" hash="46878a9b3ede269c4e234550c9c89cd0"/><file name="treeview-famfamfam-line.gif" hash="18b3e43abad26bdac6f4cea944777b62"/><file name="treeview-famfamfam.gif" hash="dc335e786863262f594737e26198009c"/><file name="treeview-gray-line.gif" hash="9c2613b4de53f939bc770983976f66cd"/><file name="treeview-gray.gif" hash="02b42894653cfd82e52aac669ad078ed"/><file name="treeview-red-line.gif" hash="feda280e7bffb057ca4c87491aab6943"/><file name="treeview-red.gif" hash="c94a07253c14c98fe69dffafb59228a5"/></dir><file name="jquery.treeview.css" hash="81ec9c30fb5b30b8811d8e182c065f16"/></dir></dir></dir><dir name="images"><dir name="clnews"><file name="ajax-loader.gif" hash="7b9776076d5fceef4993b55c9383dedd"/></dir></dir></dir></dir></dir></dir></target></contents>
|
45 |
<compatible/>
|
46 |
<dependencies/>
|
47 |
</package>
|
skin/frontend/default/default/css/commercelab/treeview/images/file.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/folder-closed.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/folder.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/minus.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/plus.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-black-line.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-black.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-default-line.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-default.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-famfamfam-line.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-famfamfam.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-gray-line.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-gray.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-red-line.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/images/treeview-red.gif
ADDED
Binary file
|
skin/frontend/default/default/css/commercelab/treeview/jquery.treeview.css
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#commercelab_categories_container
|
2 |
+
{
|
3 |
+
overflow-x: auto;
|
4 |
+
}
|
5 |
+
.treeview, .treeview ul {
|
6 |
+
padding: 0;
|
7 |
+
margin: 0;
|
8 |
+
list-style: none;
|
9 |
+
}
|
10 |
+
|
11 |
+
.treeview ul {
|
12 |
+
background-color: white;
|
13 |
+
margin-top: 4px;
|
14 |
+
}
|
15 |
+
|
16 |
+
.treeview .hitarea {
|
17 |
+
background: url(images/treeview-default.gif) -64px -25px no-repeat;
|
18 |
+
height: 16px;
|
19 |
+
width: 16px;
|
20 |
+
margin-left: -16px;
|
21 |
+
float: left;
|
22 |
+
cursor: pointer;
|
23 |
+
}
|
24 |
+
/* fix for IE6 */
|
25 |
+
* html .hitarea {
|
26 |
+
display: inline;
|
27 |
+
float:none;
|
28 |
+
}
|
29 |
+
|
30 |
+
.treeview li {
|
31 |
+
margin: 0;
|
32 |
+
padding: 3px 0pt 3px 16px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.treeview a.selected {
|
36 |
+
background-color: #eee;
|
37 |
+
}
|
38 |
+
|
39 |
+
#treecontrol { margin: 1em 0; display: none; }
|
40 |
+
|
41 |
+
.treeview .hover { color: red; cursor: pointer; }
|
42 |
+
|
43 |
+
.treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; }
|
44 |
+
.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
|
45 |
+
|
46 |
+
.treeview .expandable-hitarea { background-position: -80px -3px; }
|
47 |
+
|
48 |
+
.treeview li.last { background-position: 0 -1766px }
|
49 |
+
.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); }
|
50 |
+
.treeview li.lastCollapsable { background-position: 0 -111px }
|
51 |
+
.treeview li.lastExpandable { background-position: -32px -67px }
|
52 |
+
|
53 |
+
.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
|
54 |
+
|
55 |
+
.treeview-red li { background-image: url(images/treeview-red-line.gif); }
|
56 |
+
.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); }
|
57 |
+
|
58 |
+
.treeview-black li { background-image: url(images/treeview-black-line.gif); }
|
59 |
+
.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); }
|
60 |
+
|
61 |
+
.treeview-gray li { background-image: url(images/treeview-gray-line.gif); }
|
62 |
+
.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); }
|
63 |
+
|
64 |
+
.treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); }
|
65 |
+
.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); }
|
66 |
+
|
67 |
+
|
68 |
+
.filetree li { padding: 3px 0 2px 16px; }
|
69 |
+
.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
|
70 |
+
.filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; }
|
71 |
+
.filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; }
|
72 |
+
.filetree span.file { background: url(images/file.gif) 0 0 no-repeat; }
|