Version Notes
*fixes for umlaut-urls
Download this release
Release Info
Developer | Magento Core Team |
Extension | Kreativkonzentrat_Glossary |
Version | 0.5.7 |
Comparing to | |
See all releases |
Code changes from version 0.5.6 to 0.5.7
- app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit/Form.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit/Tab/Form.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit/Tabs.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Grid.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Block/Glossary.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Block/Glossary/Navigation.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Block/Glossary/Toolbar.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/Controller/Router.php +0 -3
- app/code/community/Kreativkonzentrat/Glossary/Helper/Data.php +42 -0
- app/code/community/Kreativkonzentrat/Glossary/Model/Glossary.php +4 -4
- app/code/community/Kreativkonzentrat/Glossary/Model/Mysql4/Glossary/Collection.php +6 -2
- app/code/community/Kreativkonzentrat/Glossary/controllers/Adminhtml/GlossaryController.php +2 -29
- app/code/community/Kreativkonzentrat/Glossary/controllers/IndexController.php +0 -1
- app/code/community/Kreativkonzentrat/Glossary/controllers/ViewController.php +0 -11
- app/code/community/Kreativkonzentrat/Glossary/etc/config.xml +1 -1
- app/code/community/Kreativkonzentrat/Glossary/sql/glossary_setup/mysql4-install-0.5.1.php +0 -1
- app/design/frontend/base/default/template/glossary/glossary_single.phtml +5 -1
- package.xml +5 -5
app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit.php
CHANGED
@@ -45,7 +45,6 @@ class Kreativkonzentrat_Glossary_Block_Adminhtml_Glossary_Edit extends Mage_Admi
|
|
45 |
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
46 |
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
47 |
}
|
48 |
-
|
49 |
return $return;
|
50 |
}
|
51 |
|
45 |
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
|
46 |
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
|
47 |
}
|
|
|
48 |
return $return;
|
49 |
}
|
50 |
|
app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit/Form.php
CHANGED
@@ -23,7 +23,6 @@ class Kreativkonzentrat_Glossary_Block_Adminhtml_Glossary_Edit_Form extends Mage
|
|
23 |
);
|
24 |
$form->setUseContainer(true);
|
25 |
$this->setForm($form);
|
26 |
-
|
27 |
return parent::_prepareForm();
|
28 |
}
|
29 |
|
23 |
);
|
24 |
$form->setUseContainer(true);
|
25 |
$this->setForm($form);
|
|
|
26 |
return parent::_prepareForm();
|
27 |
}
|
28 |
|
app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit/Tab/Form.php
CHANGED
@@ -81,7 +81,6 @@ class Kreativkonzentrat_Glossary_Block_Adminhtml_Glossary_Edit_Tab_Form extends
|
|
81 |
$form->setValues(Mage::registry('glossary_data')->getData());
|
82 |
$this->setForm($form);
|
83 |
}
|
84 |
-
|
85 |
return parent::_prepareForm();
|
86 |
}
|
87 |
|
81 |
$form->setValues(Mage::registry('glossary_data')->getData());
|
82 |
$this->setForm($form);
|
83 |
}
|
|
|
84 |
return parent::_prepareForm();
|
85 |
}
|
86 |
|
app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Edit/Tabs.php
CHANGED
@@ -29,7 +29,6 @@ class Kreativkonzentrat_Glossary_Block_Adminhtml_Glossary_Edit_Tabs extends Mage
|
|
29 |
'content' => $this->getLayout()->createBlock('glossary/adminhtml_glossary_edit_tab_form')->toHtml()
|
30 |
)
|
31 |
);
|
32 |
-
|
33 |
return parent::_beforeToHtml();
|
34 |
}
|
35 |
|
29 |
'content' => $this->getLayout()->createBlock('glossary/adminhtml_glossary_edit_tab_form')->toHtml()
|
30 |
)
|
31 |
);
|
|
|
32 |
return parent::_beforeToHtml();
|
33 |
}
|
34 |
|
app/code/community/Kreativkonzentrat/Glossary/Block/Adminhtml/Glossary/Grid.php
CHANGED
@@ -86,7 +86,6 @@ class Kreativkonzentrat_Glossary_Block_Adminhtml_Glossary_Grid extends Mage_Admi
|
|
86 |
));
|
87 |
$this->addExportType('*/*/exportCsv', Mage::helper('adminhtml')->__('CSV'));
|
88 |
$this->addExportType('*/*/exportXml', Mage::helper('adminhtml')->__('XML'));
|
89 |
-
|
90 |
return parent::_prepareColumns();
|
91 |
}
|
92 |
|
86 |
));
|
87 |
$this->addExportType('*/*/exportCsv', Mage::helper('adminhtml')->__('CSV'));
|
88 |
$this->addExportType('*/*/exportXml', Mage::helper('adminhtml')->__('XML'));
|
|
|
89 |
return parent::_prepareColumns();
|
90 |
}
|
91 |
|
app/code/community/Kreativkonzentrat/Glossary/Block/Glossary.php
CHANGED
@@ -36,7 +36,6 @@ class Kreativkonzentrat_Glossary_Block_Glossary extends Mage_Core_Block_Template
|
|
36 |
if ($glossary_id != null && $glossary_id != '') {
|
37 |
return Mage::getModel('glossary/glossary')->load($glossary_id)->getTitle();
|
38 |
}
|
39 |
-
|
40 |
return null;
|
41 |
}
|
42 |
|
36 |
if ($glossary_id != null && $glossary_id != '') {
|
37 |
return Mage::getModel('glossary/glossary')->load($glossary_id)->getTitle();
|
38 |
}
|
|
|
39 |
return null;
|
40 |
}
|
41 |
|
app/code/community/Kreativkonzentrat/Glossary/Block/Glossary/Navigation.php
CHANGED
@@ -53,7 +53,6 @@ class Kreativkonzentrat_Glossary_Block_Glossary_Navigation extends Mage_Core_Blo
|
|
53 |
") as $letter) {
|
54 |
$results[] = $letter['letter'];
|
55 |
}
|
56 |
-
|
57 |
return $results;
|
58 |
}
|
59 |
|
53 |
") as $letter) {
|
54 |
$results[] = $letter['letter'];
|
55 |
}
|
|
|
56 |
return $results;
|
57 |
}
|
58 |
|
app/code/community/Kreativkonzentrat/Glossary/Block/Glossary/Toolbar.php
CHANGED
@@ -26,7 +26,6 @@ class Kreativkonzentrat_Glossary_Block_Glossary_Toolbar extends Mage_Catalog_Blo
|
|
26 |
if ($this->getCurrentOrder()) {
|
27 |
$this->_collection->setOrder('title', $this->getCurrentDirection());
|
28 |
}
|
29 |
-
|
30 |
return $this;
|
31 |
}
|
32 |
}
|
26 |
if ($this->getCurrentOrder()) {
|
27 |
$this->_collection->setOrder('title', $this->getCurrentDirection());
|
28 |
}
|
|
|
29 |
return $this;
|
30 |
}
|
31 |
}
|
app/code/community/Kreativkonzentrat/Glossary/Controller/Router.php
CHANGED
@@ -41,9 +41,7 @@ class Kreativkonzentrat_Glossary_Controller_Router extends Mage_Core_Controller_
|
|
41 |
$glossary = Mage::getModel('glossary/glossary');
|
42 |
$itemId = $glossary->FindGlossaryEntry($kkg_param3);
|
43 |
$request->setModuleName('glossary')->setControllerName('view')->setActionName('popup')->setParam('id', $itemId);
|
44 |
-
|
45 |
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 'glossary/view/id?id=' . $itemId);
|
46 |
-
|
47 |
return true;
|
48 |
}
|
49 |
if (isset($kkg_param) && $kkg_param == 'glossary' && isset($kkg_param2) && $kkg_param2 == 'entry') {
|
@@ -51,7 +49,6 @@ class Kreativkonzentrat_Glossary_Controller_Router extends Mage_Core_Controller_
|
|
51 |
$itemId = $glossary->FindGlossaryEntry($kkg_param3);
|
52 |
$request->setModuleName('glossary')->setControllerName('view')->setActionName('id')->setParam('id', $itemId);
|
53 |
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 'glossary/view/id?id=' . $itemId);
|
54 |
-
|
55 |
return true;
|
56 |
} else {
|
57 |
return false;
|
41 |
$glossary = Mage::getModel('glossary/glossary');
|
42 |
$itemId = $glossary->FindGlossaryEntry($kkg_param3);
|
43 |
$request->setModuleName('glossary')->setControllerName('view')->setActionName('popup')->setParam('id', $itemId);
|
|
|
44 |
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 'glossary/view/id?id=' . $itemId);
|
|
|
45 |
return true;
|
46 |
}
|
47 |
if (isset($kkg_param) && $kkg_param == 'glossary' && isset($kkg_param2) && $kkg_param2 == 'entry') {
|
49 |
$itemId = $glossary->FindGlossaryEntry($kkg_param3);
|
50 |
$request->setModuleName('glossary')->setControllerName('view')->setActionName('id')->setParam('id', $itemId);
|
51 |
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 'glossary/view/id?id=' . $itemId);
|
|
|
52 |
return true;
|
53 |
} else {
|
54 |
return false;
|
app/code/community/Kreativkonzentrat/Glossary/Helper/Data.php
CHANGED
@@ -14,4 +14,46 @@ class Kreativkonzentrat_Glossary_Helper_Data extends Mage_Core_Helper_Abstract
|
|
14 |
public function getGlossaryIndexUrl () {
|
15 |
return $this->_getUrl('glossary');
|
16 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
}
|
14 |
public function getGlossaryIndexUrl () {
|
15 |
return $this->_getUrl('glossary');
|
16 |
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @param string $letter
|
20 |
+
*
|
21 |
+
* @return string
|
22 |
+
*/
|
23 |
+
public function asciiLetter ($letter) {
|
24 |
+
if (preg_match('/^[a-z]$/i', $letter)) {
|
25 |
+
return strtoupper($letter);
|
26 |
+
}
|
27 |
+
switch ($letter) {
|
28 |
+
case 'ä':
|
29 |
+
case 'Ä':
|
30 |
+
return 'A';
|
31 |
+
case 'ö':
|
32 |
+
case 'Ö':
|
33 |
+
return 'O';
|
34 |
+
case 'ü':
|
35 |
+
case 'Ü':
|
36 |
+
return 'U';
|
37 |
+
default:
|
38 |
+
return '123';
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @param string $string
|
44 |
+
* @return string
|
45 |
+
*/
|
46 |
+
public function convertUmlauts($string) {
|
47 |
+
$replace = array(
|
48 |
+
' ' => '_',
|
49 |
+
'Ä' => 'Ae',
|
50 |
+
'Ö' => 'Oe',
|
51 |
+
'Ü' => 'Ue',
|
52 |
+
'ä' => 'ae',
|
53 |
+
'ö' => 'oe',
|
54 |
+
'ü' => 'ue',
|
55 |
+
'ß' => 'ss'
|
56 |
+
);
|
57 |
+
return strtr($string, $replace);
|
58 |
+
}
|
59 |
}
|
app/code/community/Kreativkonzentrat/Glossary/Model/Glossary.php
CHANGED
@@ -25,12 +25,13 @@ class Kreativkonzentrat_Glossary_Model_Glossary extends Mage_Core_Model_Abstract
|
|
25 |
* @return bool
|
26 |
*/
|
27 |
public function FindGlossaryEntry ($request) {
|
|
|
28 |
$collection = Mage::getModel('glossary/glossary')->getCollection()->addFilter('status', 1)->addStoreFilter(Mage :: app()->getStore());
|
29 |
foreach ($collection as $item) {
|
30 |
-
if (strcasecmp(urlencode($item['title']), $request) == 0)
|
31 |
return $item->getID();
|
|
|
32 |
}
|
33 |
-
|
34 |
return false;
|
35 |
}
|
36 |
|
@@ -38,7 +39,7 @@ class Kreativkonzentrat_Glossary_Model_Glossary extends Mage_Core_Model_Abstract
|
|
38 |
* @return string
|
39 |
*/
|
40 |
public function getUrl () {
|
41 |
-
return Mage::app()->getStore()->getUrl('glossary/entry') . urlencode($this->getTitle());
|
42 |
}
|
43 |
|
44 |
/**
|
@@ -50,7 +51,6 @@ class Kreativkonzentrat_Glossary_Model_Glossary extends Mage_Core_Model_Abstract
|
|
50 |
foreach ($collection as $item) {
|
51 |
$titles[] = '/(?!(?:[^<]+>|[^>]+<\/a>))(' . htmlentities(str_replace('/', '', $item['title']), ENT_COMPAT, 'UTF-8') . ')/i';
|
52 |
}
|
53 |
-
|
54 |
return $titles;
|
55 |
}
|
56 |
|
25 |
* @return bool
|
26 |
*/
|
27 |
public function FindGlossaryEntry ($request) {
|
28 |
+
$helper = Mage::helper('glossary');
|
29 |
$collection = Mage::getModel('glossary/glossary')->getCollection()->addFilter('status', 1)->addStoreFilter(Mage :: app()->getStore());
|
30 |
foreach ($collection as $item) {
|
31 |
+
if (strcasecmp(urlencode($helper->convertUmlauts($item['title'])), $request) == 0) {
|
32 |
return $item->getID();
|
33 |
+
}
|
34 |
}
|
|
|
35 |
return false;
|
36 |
}
|
37 |
|
39 |
* @return string
|
40 |
*/
|
41 |
public function getUrl () {
|
42 |
+
return Mage::app()->getStore()->getUrl('glossary/entry') . urlencode(Mage::helper('glossary')->convertUmlauts($this->getTitle()));
|
43 |
}
|
44 |
|
45 |
/**
|
51 |
foreach ($collection as $item) {
|
52 |
$titles[] = '/(?!(?:[^<]+>|[^>]+<\/a>))(' . htmlentities(str_replace('/', '', $item['title']), ENT_COMPAT, 'UTF-8') . ')/i';
|
53 |
}
|
|
|
54 |
return $titles;
|
55 |
}
|
56 |
|
app/code/community/Kreativkonzentrat/Glossary/Model/Mysql4/Glossary/Collection.php
CHANGED
@@ -9,6 +9,9 @@
|
|
9 |
class Kreativkonzentrat_Glossary_Model_Mysql4_Glossary_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
10 |
{
|
11 |
|
|
|
|
|
|
|
12 |
public function _construct () {
|
13 |
parent::_construct();
|
14 |
$this->_init('glossary/glossary');
|
@@ -19,7 +22,6 @@ class Kreativkonzentrat_Glossary_Model_Mysql4_Glossary_Collection extends Mage_C
|
|
19 |
*/
|
20 |
public function setAlphabeticalOrder () {
|
21 |
$this->getSelect()->order('title ASC');
|
22 |
-
|
23 |
return $this;
|
24 |
}
|
25 |
|
@@ -33,11 +35,13 @@ class Kreativkonzentrat_Glossary_Model_Mysql4_Glossary_Collection extends Mage_C
|
|
33 |
$store = array($store->getId());
|
34 |
}
|
35 |
$stores = $this->getSelect()->join(array('store_table' => $this->getTable('glossary_store')), 'main_table.glossary_id = store_table.glossary_id', array())->where('store_table.store_id in (?)', array(0, $store));
|
36 |
-
|
37 |
//echo ($stores->__toString());
|
38 |
return $this;
|
39 |
}
|
40 |
|
|
|
|
|
|
|
41 |
protected function _afterLoad () {
|
42 |
$items = $this->getColumnValues('glossary_id');
|
43 |
if (count($items)) {
|
9 |
class Kreativkonzentrat_Glossary_Model_Mysql4_Glossary_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
10 |
{
|
11 |
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
*/
|
15 |
public function _construct () {
|
16 |
parent::_construct();
|
17 |
$this->_init('glossary/glossary');
|
22 |
*/
|
23 |
public function setAlphabeticalOrder () {
|
24 |
$this->getSelect()->order('title ASC');
|
|
|
25 |
return $this;
|
26 |
}
|
27 |
|
35 |
$store = array($store->getId());
|
36 |
}
|
37 |
$stores = $this->getSelect()->join(array('store_table' => $this->getTable('glossary_store')), 'main_table.glossary_id = store_table.glossary_id', array())->where('store_table.store_id in (?)', array(0, $store));
|
|
|
38 |
//echo ($stores->__toString());
|
39 |
return $this;
|
40 |
}
|
41 |
|
42 |
+
/**
|
43 |
+
*
|
44 |
+
*/
|
45 |
protected function _afterLoad () {
|
46 |
$items = $this->getColumnValues('glossary_id');
|
47 |
if (count($items)) {
|
app/code/community/Kreativkonzentrat/Glossary/controllers/Adminhtml/GlossaryController.php
CHANGED
@@ -31,7 +31,6 @@ class Kreativkonzentrat_Glossary_Adminhtml_GlossaryController extends Mage_Admin
|
|
31 |
public function editAction () {
|
32 |
$id = $this->getRequest()->getParam('id');
|
33 |
$model = Mage::getModel('glossary/glossary')->load($id);
|
34 |
-
|
35 |
if ($model->getId() || $id == 0) {
|
36 |
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
37 |
if (!empty($data)) {
|
@@ -58,37 +57,13 @@ class Kreativkonzentrat_Glossary_Adminhtml_GlossaryController extends Mage_Admin
|
|
58 |
$this->_forward('edit');
|
59 |
}
|
60 |
|
61 |
-
/**
|
62 |
-
* @param string $letter
|
63 |
-
*
|
64 |
-
* @return string
|
65 |
-
*/
|
66 |
-
private function asciiLetter ($letter) {
|
67 |
-
if (preg_match('/^[a-z]$/i', $letter)) {
|
68 |
-
return strtoupper($letter);
|
69 |
-
}
|
70 |
-
switch ($letter) {
|
71 |
-
case 'ä':
|
72 |
-
case 'Ä':
|
73 |
-
return 'A';
|
74 |
-
case 'ö':
|
75 |
-
case 'Ö':
|
76 |
-
return 'O';
|
77 |
-
case 'ü':
|
78 |
-
case 'Ü':
|
79 |
-
return 'U';
|
80 |
-
default:
|
81 |
-
return '123';
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
/**
|
86 |
*
|
87 |
*/
|
88 |
public function saveAction () {
|
89 |
if ($data = $this->getRequest()->getPost()) {
|
90 |
$stores = $this->getRequest()->getPost('stores', false);
|
91 |
-
//fix for "all
|
92 |
if ($stores[0] == '0') {
|
93 |
$data['stores'] = array('0');
|
94 |
}
|
@@ -102,13 +77,12 @@ class Kreativkonzentrat_Glossary_Adminhtml_GlossaryController extends Mage_Admin
|
|
102 |
}
|
103 |
$title = utf8_decode($data['title']);
|
104 |
$startingLetter = utf8_encode($title[0]);
|
105 |
-
$model->setLetter(
|
106 |
$model->save();
|
107 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('glossary')->__('Item was successfully saved'));
|
108 |
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
109 |
if ($this->getRequest()->getParam('back')) {
|
110 |
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
111 |
-
|
112 |
return;
|
113 |
}
|
114 |
$this->_redirect('*/*/');
|
@@ -119,7 +93,6 @@ class Kreativkonzentrat_Glossary_Adminhtml_GlossaryController extends Mage_Admin
|
|
119 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
120 |
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
121 |
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
122 |
-
|
123 |
return;
|
124 |
}
|
125 |
}
|
31 |
public function editAction () {
|
32 |
$id = $this->getRequest()->getParam('id');
|
33 |
$model = Mage::getModel('glossary/glossary')->load($id);
|
|
|
34 |
if ($model->getId() || $id == 0) {
|
35 |
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
36 |
if (!empty($data)) {
|
57 |
$this->_forward('edit');
|
58 |
}
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
/**
|
61 |
*
|
62 |
*/
|
63 |
public function saveAction () {
|
64 |
if ($data = $this->getRequest()->getPost()) {
|
65 |
$stores = $this->getRequest()->getPost('stores', false);
|
66 |
+
//fix for "all StoreViews"
|
67 |
if ($stores[0] == '0') {
|
68 |
$data['stores'] = array('0');
|
69 |
}
|
77 |
}
|
78 |
$title = utf8_decode($data['title']);
|
79 |
$startingLetter = utf8_encode($title[0]);
|
80 |
+
$model->setLetter(Mage::helper('glossary')->asciiLetter($startingLetter));
|
81 |
$model->save();
|
82 |
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('glossary')->__('Item was successfully saved'));
|
83 |
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
84 |
if ($this->getRequest()->getParam('back')) {
|
85 |
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
|
|
86 |
return;
|
87 |
}
|
88 |
$this->_redirect('*/*/');
|
93 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
94 |
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
95 |
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
|
|
96 |
return;
|
97 |
}
|
98 |
}
|
app/code/community/Kreativkonzentrat/Glossary/controllers/IndexController.php
CHANGED
@@ -20,7 +20,6 @@ class Kreativkonzentrat_Glossary_IndexController extends Mage_Core_Controller_Fr
|
|
20 |
} else {
|
21 |
$glossary = Mage::getModel('glossary/glossary')->getFilteredCollection();
|
22 |
$toolbar = $this->getLayout()->getBlock('glossary_toolbar');
|
23 |
-
|
24 |
$toolbar->addOrderToAvailableOrders('title', 'Title')
|
25 |
->setOrder('title')
|
26 |
->setDefaultOrder('title')
|
20 |
} else {
|
21 |
$glossary = Mage::getModel('glossary/glossary')->getFilteredCollection();
|
22 |
$toolbar = $this->getLayout()->getBlock('glossary_toolbar');
|
|
|
23 |
$toolbar->addOrderToAvailableOrders('title', 'Title')
|
24 |
->setOrder('title')
|
25 |
->setDefaultOrder('title')
|
app/code/community/Kreativkonzentrat/Glossary/controllers/ViewController.php
CHANGED
@@ -66,17 +66,6 @@ class Kreativkonzentrat_Glossary_ViewController extends Mage_Core_Controller_Fro
|
|
66 |
if ($params != null) {
|
67 |
//get only entries with corresponding letter
|
68 |
$collection = Mage::getModel('glossary/glossary')->getFilteredCollection()->addFieldToFilter('letter', $params[0])->setAlphabeticalOrder();
|
69 |
-
/*
|
70 |
-
* sql variant
|
71 |
-
|
72 |
-
//select only rows starting with letter param
|
73 |
-
$collection = Mage::getModel('glossary/glossary')->getCollection();
|
74 |
-
|
75 |
-
$collection->getSelect()->where("lower(left(title,1)='$params[0]')");
|
76 |
-
//debug query
|
77 |
-
|
78 |
-
*/
|
79 |
-
//echo ($collection->getSelect()->__toString());
|
80 |
} else {
|
81 |
$collection = Mage::getModel('glossary/glossary')->getFilteredCollection();
|
82 |
}
|
66 |
if ($params != null) {
|
67 |
//get only entries with corresponding letter
|
68 |
$collection = Mage::getModel('glossary/glossary')->getFilteredCollection()->addFieldToFilter('letter', $params[0])->setAlphabeticalOrder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
} else {
|
70 |
$collection = Mage::getModel('glossary/glossary')->getFilteredCollection();
|
71 |
}
|
app/code/community/Kreativkonzentrat/Glossary/etc/config.xml
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
</default>
|
20 |
<modules>
|
21 |
<Kreativkonzentrat_Glossary>
|
22 |
-
<version>0.5.
|
23 |
</Kreativkonzentrat_Glossary>
|
24 |
</modules>
|
25 |
<frontend>
|
19 |
</default>
|
20 |
<modules>
|
21 |
<Kreativkonzentrat_Glossary>
|
22 |
+
<version>0.5.7</version>
|
23 |
</Kreativkonzentrat_Glossary>
|
24 |
</modules>
|
25 |
<frontend>
|
app/code/community/Kreativkonzentrat/Glossary/sql/glossary_setup/mysql4-install-0.5.1.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
$installer = $this;
|
4 |
$installer->startSetup();
|
5 |
$installer->run("
|
1 |
<?php
|
|
|
2 |
$installer = $this;
|
3 |
$installer->startSetup();
|
4 |
$installer->run("
|
app/design/frontend/base/default/template/glossary/glossary_single.phtml
CHANGED
@@ -7,8 +7,12 @@
|
|
7 |
*/
|
8 |
?>
|
9 |
<?php $item = $this->getGlossary(); ?>
|
|
|
10 |
<h4><?php echo $item->getTitle(); ?></h4>
|
11 |
<div class="glossary_entry">
|
12 |
<h2><?php echo $item->getTitle(); ?></h2>
|
13 |
<p><?php echo $item->getGlossaryContent(); ?></p>
|
14 |
-
</div>
|
|
|
|
|
|
7 |
*/
|
8 |
?>
|
9 |
<?php $item = $this->getGlossary(); ?>
|
10 |
+
<?php if ($item) : ?>
|
11 |
<h4><?php echo $item->getTitle(); ?></h4>
|
12 |
<div class="glossary_entry">
|
13 |
<h2><?php echo $item->getTitle(); ?></h2>
|
14 |
<p><?php echo $item->getGlossaryContent(); ?></p>
|
15 |
+
</div>
|
16 |
+
<?php else : ?>
|
17 |
+
<h4><?php echo __('Glossary entry could not be found.');?></h4>
|
18 |
+
<?php endif; ?>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Kreativkonzentrat_Glossary</name>
|
4 |
-
<version>0.5.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Adds a glossary to your store</summary>
|
10 |
<description>The Glossary plugin for Magento allows you to easily add a glossary to your shop and links directly to glossary entries.</description>
|
11 |
-
<notes>*
|
12 |
<authors><author><name>Felix Moche</name><user>auto-converted</user><email>felix@kreativkonzentrat.de</email></author></authors>
|
13 |
-
<date>2013-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Kreativkonzentrat"><dir name="Glossary"><dir name="Block"><dir name="Adminhtml"><dir name="Glossary"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Kreativkonzentrat_Glossary</name>
|
4 |
+
<version>0.5.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Adds a glossary to your store</summary>
|
10 |
<description>The Glossary plugin for Magento allows you to easily add a glossary to your shop and links directly to glossary entries.</description>
|
11 |
+
<notes>*fixes for umlaut-urls</notes>
|
12 |
<authors><author><name>Felix Moche</name><user>auto-converted</user><email>felix@kreativkonzentrat.de</email></author></authors>
|
13 |
+
<date>2013-06-11</date>
|
14 |
+
<time>10:14:44</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Kreativkonzentrat"><dir name="Glossary"><dir name="Block"><dir name="Adminhtml"><dir name="Glossary"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="e6dbcb0812aeaa146a1e8a6d5a949756"/></dir><file name="Form.php" hash="77c30c9652308c13717e927165cb7619"/><file name="Tabs.php" hash="37ab965880f56fb4dd9b6b9954904746"/></dir><file name="Edit.php" hash="2ceacc23cccec82ce183d68433a8faca"/><file name="Grid.php" hash="4cf580a65ec7b2d47cba1f9be5aded95"/></dir><file name="Glossary.php" hash="e8b8611c1dd2b6666e208bee5bc0a06b"/></dir><dir name="Glossary"><file name="Navigation.php" hash="4e1483ea20babc180dd860687f395ed9"/><file name="Toolbar.php" hash="069b003f12f76deddbdfb5839b8a56d4"/></dir><file name="Glossary.php" hash="147d72a88e04fdf98065d3960c886b88"/></dir><dir name="Controller"><file name="Router.php" hash="2a9989eea1dc4dfeaa5c5d6951dab93f"/></dir><dir name="Helper"><file name="Data.php" hash="a96074c93474d374337de5a5af28d1b1"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Select.php" hash="21c76b12fee06db05aeedb7c71b0c5c8"/></dir><dir name="Mysql4"><dir name="Glossary"><file name="Collection.php" hash="b99eed98160453a229bbbe525df5bfaa"/></dir><file name="Glossary.php" hash="075d8c09d782f9bcfe30bf06628c7d7f"/></dir><file name="Glossary.php" hash="7e9f2cf01de7de4d27f7ead8ca8e26eb"/><file name="Page.php" hash="aadf769ae1f2d01fa2ff2aad3b3c21fc"/><file name="Product.php" hash="cf191326f968425fd1cfd34848910752"/><file name="Status.php" hash="c356d5d8cd0c4c2e29b72b6483199949"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="GlossaryController.php" hash="4bb0a2af5029dbc3bcf78505520aa022"/></dir><file name="IndexController.php" hash="c601268904a243100fc35de9475b115b"/><file name="ViewController.php" hash="1482a6a7a5caab7e0a666c3a974bdcc6"/></dir><dir name="etc"><file name="config.xml" hash="fd69e58754e301bfeaf683c633611dc0"/><file name="system.xml" hash="1d4e42aaccfd13d388056eb2938916a8"/></dir><dir name="sql"><dir name="glossary_setup"><file name="mysql4-install-0.5.1.php" hash="c896916cae355e538f600353ffe764e7"/><file name="mysql4-install-0.5.5.php" hash="1a23535af6a832f0412246b9c6888fe0"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="glossary.xml" hash="faf468990cd996b0ca09472122319370"/></dir><dir name="template"><dir name="glossary"><dir name="letter"><file name="view.phtml" hash="eb40266896912a17e2f53ec67a6f3a09"/></dir><file name="glossary.phtml" hash="f0c8072cbbdc1af7e02062f9c7f543e0"/><file name="glossary_letter.phtml" hash="018e520a7ac52bf9c9dc6737189b1729"/><file name="glossary_popup.phtml" hash="aa1cbf3c5f0b0eaa8561814486f2135b"/><file name="glossary_single.phtml" hash="589b107bd73c8588469e492b1e4de4f0"/><file name="pager.phtml" hash="0b4458298810fc5fbb6988ba5e338fbb"/><file name="toolbar.phtml" hash="4d152db96a576b6d19013fa1497fb2dc"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="glossary.xml" hash="8cbd849137916a3e184417d2d2b26536"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kreativkonzentrat_Glossary.xml" hash="ae9bb531254247fcd1d628ae582e8b17"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Kreativkonzentrat_Glossary.csv" hash="f3f9ef70ef94af8f133f7abf56e5c1df"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|