Mana_Filters - Version 14.06.13.09

Version Notes

Adds multiple selection features for attribute and price filters in Magento layered navigation.

Download this release

Release Info

Developer Magento Core Team
Extension Mana_Filters
Version 14.06.13.09
Comparing to
See all releases


Code changes from version 13.12.04.10 to 14.06.13.09

Files changed (90) hide show
  1. app/code/local/Mana/Core/Block/Js.php +36 -4
  2. app/code/local/Mana/Core/Exception/Validation.php +24 -0
  3. app/code/local/Mana/Core/Helper/Data.php +90 -7
  4. app/code/local/Mana/Core/Helper/Db.php +106 -0
  5. app/code/local/Mana/Core/Helper/Db/Aggregate.php +116 -0
  6. app/code/local/Mana/Core/Helper/Files.php +42 -2
  7. app/code/local/Mana/Core/Helper/Json.php +2 -2
  8. app/code/local/Mana/Core/Helper/Layout.php +19 -1
  9. app/code/local/Mana/Core/Helper/PageType.php +28 -0
  10. app/code/local/Mana/Core/Helper/PageType/Category.php +43 -0
  11. app/code/local/Mana/Core/Helper/PageType/CmsPage.php +35 -0
  12. app/code/local/Mana/Core/Helper/PageType/HomePage.php +8 -5
  13. app/code/local/Mana/Core/Helper/PageType/Search.php +20 -0
  14. app/code/local/Mana/Core/Helper/StringTemplate.php +56 -0
  15. app/code/local/Mana/Core/Model/Condition/Abstract.php +24 -0
  16. app/code/local/Mana/Core/Model/Condition/Combine.php +24 -0
  17. app/code/local/Mana/Core/Model/Source/Design.php +41 -0
  18. app/code/local/Mana/Core/Model/Source/Layout.php +20 -0
  19. app/code/local/Mana/Core/Model/Source/Status.php +28 -0
  20. app/code/local/Mana/Core/Profiler2.php +46 -0
  21. app/code/local/Mana/Core/etc/config.xml +10 -1
  22. app/code/local/Mana/Db/Helper/Data.php +1 -1
  23. app/code/local/Mana/Db/Model/Setup.php +1 -10
  24. app/code/local/Mana/Db/etc/config.xml +1 -7
  25. app/code/local/Mana/Filters/Block/Filter.php +18 -2
  26. app/code/local/Mana/Filters/Block/State.php +1 -1
  27. app/code/local/Mana/Filters/Block/View.php +35 -9
  28. app/code/local/Mana/Filters/Helper/Data.php +44 -11
  29. app/code/local/Mana/Filters/Helper/Item.php +120 -0
  30. app/code/local/Mana/Filters/Interface/Filter.php +2 -0
  31. app/code/local/Mana/Filters/Model/Filter/Attribute.php +64 -69
  32. app/code/local/Mana/Filters/Model/Filter/Category.php +19 -0
  33. app/code/local/Mana/Filters/Model/Filter/Decimal.php +21 -0
  34. app/code/local/Mana/Filters/Model/Filter/Price.php +33 -2
  35. app/code/local/Mana/Filters/Model/Filter2.php +16 -0
  36. app/code/local/Mana/Filters/Model/Filter2/Value.php +29 -0
  37. app/code/local/Mana/Filters/Model/Item.php +31 -1
  38. app/code/local/Mana/Filters/Model/Query.php +2 -62
  39. app/code/local/Mana/Filters/Model/Solr/Adapter/HttpStream.php +10 -0
  40. app/code/local/Mana/Filters/Model/Solr/Adapter/PhpExtension.php +11 -0
  41. app/code/local/Mana/Filters/Model/Solr/Price.php +1 -1
  42. app/code/local/Mana/Filters/Resource/Filter/Attribute.php +7 -2
  43. app/code/local/Mana/Filters/Resource/Filter/Decimal.php +2 -1
  44. app/code/local/Mana/Filters/Resource/Filter2.php +30 -0
  45. app/code/local/Mana/Filters/Resource/Filter2/Store.php +43 -0
  46. app/code/local/Mana/Filters/Resource/Filter2/Store/Collection.php +24 -0
  47. app/code/local/Mana/Filters/Resource/Filter2/Value.php +17 -0
  48. app/code/local/Mana/Filters/Resource/Item.php +84 -0
  49. app/code/local/Mana/Filters/Resource/ItemAdditionalInfo.php +35 -0
  50. app/code/local/Mana/Filters/etc/config.xml +1 -1
  51. app/design/adminhtml/default/default/layout/mana_core.xml +5 -0
  52. app/design/adminhtml/default/default/template/mana/core/popup.phtml +12 -0
  53. app/design/frontend/base/default/layout/mana_filters.xml +13 -0
  54. app/design/frontend/base/default/template/mana/filters/items/list.phtml +1 -0
  55. app/design/frontend/base/default/template/mana/filters/items/list_popup.phtml +5 -11
  56. app/design/frontend/base/default/template/mana/filters/items/standard.phtml +1 -0
  57. app/design/frontend/base/default/template/mana/filters/items/standard_popup.phtml +6 -12
  58. app/design/frontend/rwd/default/layout/mana_filters.xml +75 -0
  59. app/design/frontend/rwd/default/template/mana/filters/items/list.phtml +47 -0
  60. app/design/frontend/rwd/default/template/mana/filters/items/standard.phtml +47 -0
  61. app/etc/modules/Mana_Filters.xml +5 -0
  62. app/locale/en_US/Mana_Core.csv +10 -0
  63. js/jquery/jquery.js +1 -1
  64. js/mana/core.js +240 -25
  65. js/mana/core.js.map +27 -0
  66. js/mana/core.min.js +7 -0
  67. js/src/Mana/Core/Ajax.js +297 -0
  68. js/src/Mana/Core/Base64.js +126 -0
  69. js/src/Mana/Core/Block.js +225 -0
  70. js/src/Mana/Core/Config.js +28 -0
  71. js/src/Mana/Core/Core.js +48 -0
  72. js/src/Mana/Core/Json.js +24 -0
  73. js/src/Mana/Core/Layout.js +301 -0
  74. js/src/Mana/Core/Mana.js +134 -0
  75. js/src/Mana/Core/Object.js +75 -0
  76. js/src/Mana/Core/PageBlock.js +81 -0
  77. js/src/Mana/Core/PopupBlock.js +14 -0
  78. js/src/Mana/Core/StringTemplate.js +23 -0
  79. js/src/Mana/Core/UrlTemplate.js +15 -0
  80. js/src/Mana/Core/Utf8.js +47 -0
  81. js/src/Mana/Core/header.js +9 -0
  82. js/src/Mana/Core/init.js +10 -0
  83. js/src/Mana/Core/obsolete.js +334 -0
  84. js/src/Mana/Core/rwd.js +24 -0
  85. package.xml +4 -4
  86. skin/adminhtml/default/default/css/mana_core.css +31 -1
  87. skin/frontend/base/default/css/mana_core.css +8 -2
  88. skin/frontend/rwd/default/css/mana_core.css +60 -0
  89. skin/frontend/rwd/default/css/mana_filters.css +22 -0
  90. skin/frontend/rwd/default/images/mana_core/m-wait.gif +0 -0
app/code/local/Mana/Core/Block/Js.php CHANGED
@@ -12,7 +12,13 @@
12
  *
13
  */
14
  class Mana_Core_Block_Js extends Mage_Core_Block_Template {
15
- protected $_config = array();
 
 
 
 
 
 
16
 
17
  public function setConfig($key, $value) {
18
  $this->_config[$key] = $value;
@@ -60,12 +66,23 @@ class Mana_Core_Block_Js extends Mage_Core_Block_Template {
60
  $this->_options[$selector] = $options;
61
  }
62
  else {
63
- foreach ($options as $key => $value) {
64
- $this->_options[$selector][$key] = $value;
65
- }
66
  }
67
  return $this;
68
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * Returns all the translations registered to be passed to client-side scripts
71
  * @return array | null
@@ -78,9 +95,24 @@ class Mana_Core_Block_Js extends Mage_Core_Block_Template {
78
  public function getOptions() { return $this->_options; }
79
 
80
  protected function _prepareLayout() {
 
 
 
81
  $this
82
  ->setConfig('url.base', Mage::getUrl('', array('_nosid' => true)))
83
  ->setConfig('url.secureBase', Mage::getUrl('', array('_secure' => true, '_nosid' => true)));
 
 
 
 
 
 
 
 
 
 
 
 
84
  return $this;
85
  }
86
  }
12
  *
13
  */
14
  class Mana_Core_Block_Js extends Mage_Core_Block_Template {
15
+ protected $_config;
16
+
17
+ protected function _construct() {
18
+ $this->_config = array(
19
+ 'debug' => Mage::app()->getStore()->isAdmin() || Mage::getStoreConfigFlag('mana/ajax/debug'),
20
+ );
21
+ }
22
 
23
  public function setConfig($key, $value) {
24
  $this->_config[$key] = $value;
66
  $this->_options[$selector] = $options;
67
  }
68
  else {
69
+ $this->_mergeArrayRecursive($this->_options[$selector], $options);
 
 
70
  }
71
  return $this;
72
  }
73
+
74
+ protected function _mergeArrayRecursive(&$target, $source) {
75
+ foreach ($source as $key => $value) {
76
+ if (isset($target[$key]) && is_array($target[$key]) && is_array($value)) {
77
+ $this->_mergeArrayRecursive($target[$key], $value);
78
+ }
79
+ else {
80
+ $target[$key] = $value;
81
+ }
82
+ }
83
+
84
+ }
85
+
86
  /**
87
  * Returns all the translations registered to be passed to client-side scripts
88
  * @return array | null
95
  public function getOptions() { return $this->_options; }
96
 
97
  protected function _prepareLayout() {
98
+ /* @var $core Mana_Core_Helper_Data */
99
+ $core = Mage::helper('mana_core');
100
+
101
  $this
102
  ->setConfig('url.base', Mage::getUrl('', array('_nosid' => true)))
103
  ->setConfig('url.secureBase', Mage::getUrl('', array('_secure' => true, '_nosid' => true)));
104
+ $this
105
+ ->setConfig('ajax.currentRoute', $core->getRoutePath() . $core->getRouteParams());
106
+
107
+ if ($value = Mage::getStoreConfig('mana/ajax/google_analytics_account')) {
108
+ $this->setConfig('ga.account', $value);
109
+ }
110
+ elseif ($value = Mage::getStoreConfig('google/analytics/account')) {
111
+ $this->setConfig('ga.account', $value);
112
+ }
113
+ elseif ($value = Mage::getStoreConfig('aromicon_gua/general/account_id')) {
114
+ $this->setConfig('ga.account', $value);
115
+ }
116
  return $this;
117
  }
118
  }
app/code/local/Mana/Core/Exception/Validation.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Db
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Exception_Validation extends Exception {
13
+ protected $_errors;
14
+ public function __construct($errors) {
15
+ $this->_errors = $errors;
16
+ }
17
+
18
+ /**
19
+ * @return array
20
+ */
21
+ public function getErrors() {
22
+ return $this->_errors;
23
+ }
24
+ }
app/code/local/Mana/Core/Helper/Data.php CHANGED
@@ -347,19 +347,34 @@ class Mana_Core_Helper_Data extends Mage_Core_Helper_Abstract {
347
  }
348
  return $val;
349
  }
350
- public function jsonForceObjectAndEncode($data) {
351
- return json_encode($this->_forceObjectRecursively($data));
352
  }
353
- protected function _forceObjectRecursively($data) {
 
 
 
 
 
354
  if (is_array($data)) {
 
355
  foreach ($data as $key => $value) {
356
- $data[$key] = $this->_forceObjectRecursively($value);
 
 
 
 
 
 
357
  }
358
- return (object)$data;
359
  }
360
  elseif(is_object($data)) {
361
  foreach ($data as $key => $value) {
362
- $data->$key = $this->_forceObjectRecursively($value);
 
 
 
363
  }
364
  return $data;
365
  }
@@ -405,6 +420,7 @@ class Mana_Core_Helper_Data extends Mage_Core_Helper_Abstract {
405
  return $request->getRouteName() . '/' . $request->getControllerName() . '/' . $request->getActionName();
406
  }
407
  }
 
408
  public function getRouteParams() {
409
  $request = Mage::app()->getRequest();
410
 
@@ -638,7 +654,7 @@ class Mana_Core_Helper_Data extends Mage_Core_Helper_Abstract {
638
  public function getAttributeTable($attribute) {
639
  return $attribute['backend_table'] ?
640
  $attribute['backend_table'] :
641
- 'catalog_category_entity_' . $attribute['backend_type'];
642
  }
643
 
644
  /**
@@ -705,6 +721,19 @@ class Mana_Core_Helper_Data extends Mage_Core_Helper_Abstract {
705
  return $pageTypes[$type];
706
  }
707
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
  public function isManadevLayeredNavigationInstalled() {
709
  return $this->isModuleEnabled('Mana_Filters');
710
  }
@@ -713,6 +742,10 @@ class Mana_Core_Helper_Data extends Mage_Core_Helper_Abstract {
713
  return $this->isModuleEnabled('ManaPro_FilterSeoLinks');
714
  }
715
 
 
 
 
 
716
  public function isManadevAttributePageInstalled() {
717
  return $this->isModuleEnabled('Mana_AttributePage');
718
  }
@@ -726,6 +759,11 @@ class Mana_Core_Helper_Data extends Mage_Core_Helper_Abstract {
726
  return $this->isModuleEnabled('ManaPro_FilterColors');
727
  }
728
 
 
 
 
 
 
729
  public function isEnterpriseUrlRewriteInstalled() {
730
  return $this->isModuleEnabled('Enterprise_UrlRewrite');
731
  }
@@ -809,4 +847,49 @@ class Mana_Core_Helper_Data extends Mage_Core_Helper_Abstract {
809
 
810
  return $html;
811
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  }
347
  }
348
  return $val;
349
  }
350
+ public function jsonForceObjectAndEncode($data, $options = array()) {
351
+ return json_encode($this->_forceObjectRecursively($data, $options));
352
  }
353
+ protected function _forceObjectRecursively($data, $options = array()) {
354
+ $forceObject = false;
355
+ if (isset($options['force_object'])) {
356
+ $forceObject = $options['force_object'];
357
+ unset($options['force_object']);
358
+ }
359
  if (is_array($data)) {
360
+ $convert = false;
361
  foreach ($data as $key => $value) {
362
+ if (!is_numeric($key)) {
363
+ $convert = true;
364
+ }
365
+ $data[$key] = $this->_forceObjectRecursively($value,
366
+ $forceObject !== false && isset($forceObject[$key])
367
+ ? array_merge(array('force_object' => $forceObject[$key]), $options)
368
+ : $options);
369
  }
370
+ return $forceObject === true || $convert ? (object)$data : $data;
371
  }
372
  elseif(is_object($data)) {
373
  foreach ($data as $key => $value) {
374
+ $data->$key = $this->_forceObjectRecursively($value,
375
+ $forceObject !== false && isset($forceObject[$key])
376
+ ? array_merge(array('force_object' => $forceObject[$key]), $options)
377
+ : $options);
378
  }
379
  return $data;
380
  }
420
  return $request->getRouteName() . '/' . $request->getControllerName() . '/' . $request->getActionName();
421
  }
422
  }
423
+
424
  public function getRouteParams() {
425
  $request = Mage::app()->getRequest();
426
 
654
  public function getAttributeTable($attribute) {
655
  return $attribute['backend_table'] ?
656
  $attribute['backend_table'] :
657
+ Mage::getSingleton('core/resource')->getTableName('catalog_category_entity_' . $attribute['backend_type']);
658
  }
659
 
660
  /**
721
  return $pageTypes[$type];
722
  }
723
 
724
+ /**
725
+ * @param string $helper
726
+ * @return Mana_Core_Helper_PageType|null
727
+ */
728
+ public function getPageTypeByRoutePath($routePath = null, $helper = 'helper') {
729
+ foreach ($this->getPageTypes($helper) as $pageType) {
730
+ if ($pageType->getRoutePath() == $this->getRoutePath($routePath)) {
731
+ return $pageType;
732
+ }
733
+ }
734
+ return null;
735
+ }
736
+
737
  public function isManadevLayeredNavigationInstalled() {
738
  return $this->isModuleEnabled('Mana_Filters');
739
  }
742
  return $this->isModuleEnabled('ManaPro_FilterSeoLinks');
743
  }
744
 
745
+ public function isManadevSeoInstalled() {
746
+ return $this->isModuleEnabled('Mana_Seo');
747
+ }
748
+
749
  public function isManadevAttributePageInstalled() {
750
  return $this->isModuleEnabled('Mana_AttributePage');
751
  }
759
  return $this->isModuleEnabled('ManaPro_FilterColors');
760
  }
761
 
762
+ public function isManadevDependentFilterInstalled()
763
+ {
764
+ return $this->isModuleEnabled('ManaPro_FilterDependent');
765
+ }
766
+
767
  public function isEnterpriseUrlRewriteInstalled() {
768
  return $this->isModuleEnabled('Enterprise_UrlRewrite');
769
  }
847
 
848
  return $html;
849
  }
850
+ public function getOptionArray($allOptions)
851
+ {
852
+ $_options = array();
853
+ foreach ($allOptions as $option) {
854
+ $_options[$option['value']] = $option['label'];
855
+ }
856
+ return $_options;
857
+ }
858
+
859
+ /**
860
+ * @return string[]
861
+ */
862
+ public function getProductToolbarParameters() {
863
+ $result = array();
864
+ $request = Mage::app()->getRequest();
865
+ foreach (array('p', 'mode', 'order', 'dir', 'limit') as $key) {
866
+ if ($value = $request->getParam($key)) {
867
+ $result[$key] = $value;
868
+ }
869
+ }
870
+ return $result;
871
+ }
872
+
873
+ public function initLayoutMessages($messagesStorage) {
874
+ if (!is_array($messagesStorage)) {
875
+ $messagesStorage = array($messagesStorage);
876
+ }
877
+ $layout = Mage::getSingleton('core/layout');
878
+ foreach ($messagesStorage as $storageName) {
879
+ $storage = Mage::getSingleton($storageName);
880
+ if ($storage) {
881
+ $block = $layout->getMessagesBlock();
882
+ $block->addMessages($storage->getMessages(true));
883
+ $block->setEscapeMessageFlag($storage->getEscapeMessages(true));
884
+ $block->addStorageType($storageName);
885
+ } else {
886
+ Mage::throwException(
887
+ Mage::helper('core')->__('Invalid messages storage "%s" for layout messages initialization', (string)$storageName)
888
+ );
889
+ }
890
+ }
891
+
892
+ return $this;
893
+ }
894
+
895
  }
app/code/local/Mana/Core/Helper/Db.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Helper_Db extends Mage_Core_Helper_Abstract {
13
+ protected static $_seoSymbols = array(
14
+ array('symbol' => '\\', 'substitute' => ''),
15
+ array('symbol' => '_', 'substitute' => '-'),
16
+ array('symbol' => '\'', 'substitute' => ''),
17
+ array('symbol' => ':', 'substitute' => '-'),
18
+ array('symbol' => '%', 'substitute' => ''),
19
+ array('symbol' => '#', 'substitute' => ''),
20
+ array('symbol' => '?', 'substitute' => ''),
21
+ array('symbol' => '&', 'substitute' => '+'),
22
+ array('symbol' => ' ', 'substitute' => '-'),
23
+ );
24
+
25
+ public function getMaskIndex($bit) {
26
+ return ((int)floor($bit / 32));
27
+ }
28
+
29
+ public function getMask($bit) {
30
+ return 1 << ($bit % 32);
31
+ }
32
+
33
+ public function getModelFieldBitNo($model, $field) {
34
+ return @constant(get_class($model).'::DM_'.strtoupper($field));
35
+ }
36
+
37
+ /**
38
+ * @param Varien_Object $model
39
+ * @param int|string $bitNo
40
+ * @param null $value
41
+ * @return bool
42
+ */
43
+ public function isModelContainsCustomSetting($model, $bitNo, $value = null) {
44
+ if (is_string($bitNo)) {
45
+ $bitNo = $this->getModelFieldBitNo($model, $bitNo);
46
+ if (is_null($bitNo)) {
47
+ return is_null($value) ? true : $value;
48
+ }
49
+ }
50
+ $maskField = "default_mask{$this->getMaskIndex($bitNo)}";
51
+ $mask = $model->getData($maskField);
52
+ if (is_null($mask)) {
53
+ $mask = 0;
54
+ }
55
+ $bit = $this->getMask($bitNo);
56
+ if (is_null($value)) {
57
+ return ($mask & $bit) == $bit;
58
+ }
59
+ else {
60
+ $model->setData($maskField, $value ? $mask | $bit : $mask & ~$bit);
61
+ return $value;
62
+ }
63
+ }
64
+
65
+
66
+ public function isCustom($tableAlias, $bit) {
67
+ return "`{$tableAlias}`.`default_mask{$this->getMaskIndex($bit)}` ".
68
+ "& {$this->getMask($bit)} = {$this->getMask($bit)}";
69
+ }
70
+
71
+ public function wrapIntoZendDbExpr($fields) {
72
+ $result = array();
73
+ foreach ($fields as $key => $value) {
74
+ $result[$key] = new Zend_Db_Expr($value);
75
+ }
76
+ return $result;
77
+ }
78
+
79
+ public function seoifyExpr($expr) {
80
+ $res = Mage::getSingleton('core/resource');
81
+ $db = $res->getConnection('read');
82
+
83
+ $expr = "LOWER($expr)";
84
+ foreach ($this->getSeoSymbols() as $symbol) {
85
+ $expr = "REPLACE($expr, {$db->quote($symbol['symbol'])}, {$db->quote($symbol['substitute'])})";
86
+ }
87
+
88
+ return $expr;
89
+ }
90
+
91
+ public function getSeoSymbols() {
92
+ return self::$_seoSymbols;
93
+ }
94
+
95
+ public function scheduleReindexing($code) {
96
+ if ($reindex = Mage::registry('m_reindex')) {
97
+ Mage::unregister('m_reindex');
98
+ } else {
99
+ $reindex = array();
100
+ }
101
+ $reindex[$code] = $code;
102
+ Mage::register('m_reindex', $reindex);
103
+
104
+ return $this;
105
+ }
106
+ }
app/code/local/Mana/Core/Helper/Db/Aggregate.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Helper_Db_Aggregate extends Mage_Core_Helper_Abstract {
13
+ public function expr($expr, $count) {
14
+ $result = array();
15
+ for ($i = 0; $i < $count; $i++) {
16
+ $result[] = str_replace('X`', "$i`", $expr);
17
+ }
18
+ return $result;
19
+ }
20
+
21
+ public function glue($exprArray, $separator, $lastSeparator = false) {
22
+ $result = '';
23
+ $separator = "'$separator'";
24
+ if ($lastSeparator !== false) {
25
+ $lastSeparator = "'$lastSeparator'";
26
+ }
27
+ foreach ($exprArray as $index => $expr) {
28
+ $nextField = isset($exprArray[$index + 1]) ? $exprArray[$index + 1] : '';
29
+ if (!$result) {
30
+ $result = $expr;
31
+ }
32
+ else {
33
+ if ($lastSeparator !== false) {
34
+ if ($nextField) {
35
+ $result .= ", IF ($expr IS NULL, '', CONCAT(IF ($nextField IS NULL, $lastSeparator, $separator), $expr))";
36
+ } else {
37
+ $result .= ", IF ($expr IS NULL, '', CONCAT($lastSeparator, $expr))";
38
+ }
39
+ } else {
40
+ $result .= ", IF ($expr IS NULL, '', CONCAT($separator, $expr))";
41
+ }
42
+ }
43
+ }
44
+ return "CONCAT($result)";
45
+ }
46
+
47
+ public function sum($exprArray) {
48
+ $result = '';
49
+ foreach ($exprArray as $expr) {
50
+ if ($result) {
51
+ $result .= " + ";
52
+ }
53
+ $result .= $expr;
54
+ }
55
+ return $result;
56
+ }
57
+
58
+ public function wrap($pattern, $exprArray) {
59
+ $result = array();
60
+ foreach ($exprArray as $expr) {
61
+ $result[] = str_replace('`X`', $expr, $pattern);
62
+ }
63
+
64
+ return $result;
65
+ }
66
+
67
+ public function concat() {
68
+ $args = func_get_args();
69
+ $count = 0;
70
+ foreach ($args as $arg) {
71
+ if (is_array($arg)) {
72
+ $count = count($arg);
73
+ }
74
+ }
75
+ if ($count) {
76
+ $result = array();
77
+ for ($i = 0; $i < $count; $i++) {
78
+ $params = array();
79
+ foreach ($args as $arg) {
80
+ $params[] = is_array($arg) ? $arg[$i] : $arg;
81
+ }
82
+ $result[] = 'CONCAT(' . implode(', ', $params) . ')';
83
+ }
84
+ return $result;
85
+ }
86
+ else {
87
+ return 'CONCAT('.implode(', ', $args).')';
88
+ }
89
+ }
90
+
91
+ /**
92
+ * @param Varien_Db_Select $select
93
+ * @param string $tableAlias
94
+ * @param string $tableName
95
+ * @param string $joinCondition
96
+ * @param int $count
97
+ * @return $this
98
+ */
99
+ public function joinLeft($select, $tableAlias, $tableName, $joinCondition, $count) {
100
+ for ($i = 0; $i < $count; $i++) {
101
+ $select->joinLeft(array(str_replace('X', $i, $tableAlias) => $tableName),
102
+ str_replace('X`', "$i`", $joinCondition), null);
103
+ }
104
+ return $this;
105
+ }
106
+
107
+ #region Dependencies
108
+
109
+ /**
110
+ * @return Mana_Core_Helper_Db
111
+ */
112
+ public function dbHelper() {
113
+ return Mage::helper('mana_core/db');
114
+ }
115
+ #endregion
116
+ }
app/code/local/Mana/Core/Helper/Files.php CHANGED
@@ -66,18 +66,31 @@ class Mana_Core_Helper_Files extends Mage_Core_Helper_Abstract {
66
  $second = substr($hash, strlen($hash) - 1);
67
  $resultTemplate = "$first/$second/{$fileinfo['filename']}%s.{$fileinfo['extension']}";
68
  $checkTemplate = $this->getFileName($resultTemplate, $type, true);
69
- if (!file_exists(sprintf($checkTemplate, ''))) {
70
  return sprintf($resultTemplate, '');
71
  }
72
  $i = 1;
73
  while (true) {
74
- if (!file_exists(sprintf($checkTemplate, '-'.$i))) {
75
  return sprintf($resultTemplate, '-'.$i);
76
  }
77
  $i++;
78
  }
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  public function walkRecursively($dir, $callback) {
82
  if (file_exists($dir)) {
83
  $this->_walkRecursively($dir, $callback);
@@ -102,4 +115,31 @@ class Mana_Core_Helper_Files extends Mage_Core_Helper_Abstract {
102
  }
103
  }
104
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  }
66
  $second = substr($hash, strlen($hash) - 1);
67
  $resultTemplate = "$first/$second/{$fileinfo['filename']}%s.{$fileinfo['extension']}";
68
  $checkTemplate = $this->getFileName($resultTemplate, $type, true);
69
+ if (!$this->_fileExists(sprintf($checkTemplate, ''))) {
70
  return sprintf($resultTemplate, '');
71
  }
72
  $i = 1;
73
  while (true) {
74
+ if (!$this->_fileExists(sprintf($checkTemplate, '-'.$i))) {
75
  return sprintf($resultTemplate, '-'.$i);
76
  }
77
  $i++;
78
  }
79
  }
80
 
81
+ protected function _fileExists($filename) {
82
+ $filename = str_replace('\\', '/', $filename);
83
+ if (file_exists($filename)) {
84
+ return true;
85
+ }
86
+ if (($pos = strpos($filename, '/m-temp/')) !== false) {
87
+ $filename = substr($filename, 0, $pos) . '/m-' . substr($filename, $pos + strlen('/m-temp/'));
88
+ return file_exists($filename);
89
+ }
90
+ else {
91
+ return false;
92
+ }
93
+ }
94
  public function walkRecursively($dir, $callback) {
95
  if (file_exists($dir)) {
96
  $this->_walkRecursively($dir, $callback);
115
  }
116
  }
117
  }
118
+
119
+ public function shouldRenderImage($relativeUrl) {
120
+ return $this->getFilename($relativeUrl, 'image') !== false;
121
+ }
122
+ public function renderImageAttributes($relativeUrl, $width = null, $height = null) {
123
+ if ($filename = $this->getFilename($relativeUrl, 'image')) {
124
+ if ($width || $height) {
125
+ $processor = new Varien_Image($filename);
126
+ $newRelativeUrl = 'w'.($width ? $width : 'x').'h'.($height ? $height : 'x').'/'.$relativeUrl;
127
+ if (!$width) {
128
+ $width = $processor->getOriginalWidth();
129
+ }
130
+ if (!$height) {
131
+ $height = $processor->getOriginalHeight();
132
+ }
133
+ $processor->keepAspectRatio(true);
134
+ $processor->resize($width, $height);
135
+ $processor->save($this->getFilename($newRelativeUrl, 'image', true));
136
+ return "src=\"{$this->getUrl($newRelativeUrl, 'image')}\" ".
137
+ "width=\"{$processor->getOriginalWidth()}\" ".
138
+ "height=\"{$processor->getOriginalHeight()}\"";
139
+ }
140
+ else {
141
+ return "src=\"{$this->getUrl($relativeUrl, 'image')}\"";
142
+ }
143
+ }
144
+ }
145
  }
app/code/local/Mana/Core/Helper/Json.php CHANGED
@@ -10,11 +10,11 @@
10
  *
11
  */
12
  class Mana_Core_Helper_Json extends Mage_Core_Helper_Abstract {
13
- public function encodeAttribute($data) {
14
  /* @var $core Mana_Core_Helper_Data */
15
  $core = Mage::helper('mana_core');
16
 
17
- $result = $core->jsonForceObjectAndEncode($data);
18
  $result = implode("\"", str_replace("\"", "'", explode("'", $result)));
19
  $result = $this->escapeHtml($result);
20
  return $result;
10
  *
11
  */
12
  class Mana_Core_Helper_Json extends Mage_Core_Helper_Abstract {
13
+ public function encodeAttribute($data, $options = array()) {
14
  /* @var $core Mana_Core_Helper_Data */
15
  $core = Mage::helper('mana_core');
16
 
17
+ $result = $core->jsonForceObjectAndEncode($data, $options);
18
  $result = implode("\"", str_replace("\"", "'", explode("'", $result)));
19
  $result = $this->escapeHtml($result);
20
  return $result;
app/code/local/Mana/Core/Helper/Layout.php CHANGED
@@ -10,12 +10,14 @@
10
  *
11
  */
12
  class Mana_Core_Helper_Layout extends Mage_Core_Helper_Abstract {
 
 
13
  protected $_delayPrepareLayoutBlocks = array();
14
  /**
15
  * @param Mage_Core_Block_Abstract $block
16
  */
17
  public function delayPrepareLayout($block, $sortOrder = 0) {
18
- if (Mage::registry('m_page_is_being_rendered')) {
19
  $block->delayedPrepareLayout();
20
  }
21
  else {
@@ -23,6 +25,7 @@ class Mana_Core_Helper_Layout extends Mage_Core_Helper_Abstract {
23
  }
24
  }
25
  public function prepareDelayedLayoutBlocks() {
 
26
  uasort($this->_delayPrepareLayoutBlocks, array($this, '_compareBlocks'));
27
  foreach ($this->_delayPrepareLayoutBlocks as $block) {
28
  $block['block']->delayedPrepareLayout();
@@ -48,4 +51,19 @@ class Mana_Core_Helper_Layout extends Mage_Core_Helper_Abstract {
48
  return '';
49
  }
50
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
10
  *
11
  */
12
  class Mana_Core_Helper_Layout extends Mage_Core_Helper_Abstract {
13
+ protected $_delayedLayoutIsBeingProcessed;
14
+
15
  protected $_delayPrepareLayoutBlocks = array();
16
  /**
17
  * @param Mage_Core_Block_Abstract $block
18
  */
19
  public function delayPrepareLayout($block, $sortOrder = 0) {
20
+ if ($this->_delayedLayoutIsBeingProcessed || Mage::registry('m_page_is_being_rendered')) {
21
  $block->delayedPrepareLayout();
22
  }
23
  else {
25
  }
26
  }
27
  public function prepareDelayedLayoutBlocks() {
28
+ $this->_delayedLayoutIsBeingProcessed = true;
29
  uasort($this->_delayPrepareLayoutBlocks, array($this, '_compareBlocks'));
30
  foreach ($this->_delayPrepareLayoutBlocks as $block) {
31
  $block['block']->delayedPrepareLayout();
51
  return '';
52
  }
53
  }
54
+
55
+ public function addRecursiveLayoutUpdates($layoutXml) {
56
+ if ($layoutXml) {
57
+ $layoutUpdate = '<' . '?xml version="1.0"?' . '><layout>' . $layoutXml . '</layout>';
58
+ if ($xml = simplexml_load_string($layoutUpdate, Mage::getConfig()->getModelClassName('core/layout_element'))) {
59
+ foreach ($xml->children() as $child) {
60
+ if (strtolower($child->getName()) == 'update' && isset($child['handle'])) {
61
+ Mage::getSingleton('core/layout')->getUpdate()->addHandle((string)$child['handle']);
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ }
68
+
69
  }
app/code/local/Mana/Core/Helper/PageType.php CHANGED
@@ -10,6 +10,7 @@ abstract class Mana_Core_Helper_PageType extends Mage_Core_Helper_Abstract {
10
 
11
  abstract public function getRoutePath();
12
  abstract public function getCurrentSuffix();
 
13
  public function setCode($code) {
14
  $this->_code = $code;
15
  return $this;
@@ -21,4 +22,31 @@ abstract class Mana_Core_Helper_PageType extends Mage_Core_Helper_Abstract {
21
  public function matchRoute($route) {
22
  return $route == $this->getRoutePath();
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
10
 
11
  abstract public function getRoutePath();
12
  abstract public function getCurrentSuffix();
13
+
14
  public function setCode($code) {
15
  $this->_code = $code;
16
  return $this;
22
  public function matchRoute($route) {
23
  return $route == $this->getRoutePath();
24
  }
25
+
26
+ public function isProductListVisible() {
27
+ return true;
28
+ }
29
+
30
+ /**
31
+ * @return bool|string
32
+ */
33
+ public function getConditionLabel() {
34
+ return false;
35
+ }
36
+
37
+ public function getPageContent() {
38
+ return array(
39
+ 'page_type' => $this->getPageTypeId(),
40
+ 'meta_title' => Mage::getStoreConfig('design/head/default_title'),
41
+ 'meta_keywords' => Mage::getStoreConfig('design/head/default_keywords'),
42
+ 'meta_description' => Mage::getStoreConfig('design/head/default_description'),
43
+ 'meta_robots' => Mage::getStoreConfig('design/head/default_robots'),
44
+ 'title' => '',
45
+ 'description' => '',
46
+ );
47
+ }
48
+
49
+ public function getPageTypeId() {
50
+ return '';
51
+ }
52
  }
app/code/local/Mana/Core/Helper/PageType/Category.php CHANGED
@@ -21,4 +21,47 @@ class Mana_Core_Helper_PageType_Category extends Mana_Core_Helper_PageType {
21
  public function getRoutePath() {
22
  return 'catalog/category/view';
23
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
21
  public function getRoutePath() {
22
  return 'catalog/category/view';
23
  }
24
+
25
+ public function isProductListVisible() {
26
+ if ($category = Mage::registry('current_category')) {
27
+ return $category->getData('display_mode') != 'PAGE';
28
+ }
29
+ return true;
30
+ }
31
+
32
+
33
+ /**
34
+ * @return bool|string
35
+ */
36
+ public function getConditionLabel() {
37
+ return $this->__('Category Page');
38
+ }
39
+
40
+ public function getPageContent() {
41
+ if ($category = Mage::registry('current_category')) {
42
+ $result = array(
43
+ 'meta_title' => $category->getData('meta_title') ? $category->getData('meta_title') : $category->getName(),
44
+ 'title' => $category->getName(),
45
+ 'description' => $category->getData('description'),
46
+ );
47
+
48
+ if ($description = $category->getData('meta_description')) {
49
+ $result['meta_description'] = $description;
50
+ }
51
+ if ($keywords = $category->getData('meta_keywords')) {
52
+ $result['meta_keywords'] = $keywords;
53
+ }
54
+ return array_merge(parent::getPageContent(), $result);
55
+ }
56
+ return parent::getPageContent();
57
+ }
58
+
59
+ public function getPageTypeId() {
60
+ if ($category = Mage::registry('current_category')) {
61
+ return 'category:' . $category->getId();
62
+ }
63
+ else {
64
+ return '';
65
+ }
66
+ }
67
  }
app/code/local/Mana/Core/Helper/PageType/CmsPage.php CHANGED
@@ -17,4 +17,39 @@ class Mana_Core_Helper_PageType_CmsPage extends Mana_Core_Helper_PageType {
17
  public function getRoutePath() {
18
  return 'cms/page/view';
19
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
17
  public function getRoutePath() {
18
  return 'cms/page/view';
19
  }
20
+
21
+ public function isProductListVisible() {
22
+ if ($block = Mage::getSingleton('core/layout')->getBlock('cms.products')) {
23
+ return ($block->hasData('hide_when_no_filters_applied')
24
+ ? $block->getData('hide_when_no_filters_applied')
25
+ : Mage::getStoreConfigFlag('mana_filters/display/hide_cms_product_list'));
26
+ }
27
+
28
+ return true;
29
+ }
30
+
31
+ /**
32
+ * @return bool|string
33
+ */
34
+ public function getConditionLabel() {
35
+ return $this->__('CMS Page');
36
+ }
37
+
38
+ public function getPageContent() {
39
+ $page = Mage::getSingleton('cms/page');
40
+
41
+ $result = array(
42
+ 'meta_title' => $page->getData('title'),
43
+ 'meta_description' => $page->getData('meta_description'),
44
+ 'meta_keywords' => $page->getData('meta_keywords'),
45
+ 'title' => $page->getData('title'),
46
+ 'description' => $page->getData('content'),
47
+ );
48
+ return array_merge(parent::getPageContent(), $result);
49
+ }
50
+
51
+
52
+ public function getPageTypeId() {
53
+ return 'cms:' . Mage::getSingleton('cms/page')->getId();
54
+ }
55
  }
app/code/local/Mana/Core/Helper/PageType/HomePage.php CHANGED
@@ -9,12 +9,15 @@
9
  * @author Mana Team
10
  *
11
  */
12
- class Mana_Core_Helper_PageType_HomePage extends Mana_Core_Helper_PageType {
13
- public function getCurrentSuffix() {
14
- return Mage::getStoreConfig('mana/seo/home_page_suffix');
15
- }
16
-
17
  public function getRoutePath() {
18
  return 'cms/index/index';
19
  }
 
 
 
 
 
 
 
20
  }
9
  * @author Mana Team
10
  *
11
  */
12
+ class Mana_Core_Helper_PageType_HomePage extends Mana_Core_Helper_PageType_CmsPage {
 
 
 
 
13
  public function getRoutePath() {
14
  return 'cms/index/index';
15
  }
16
+
17
+ /**
18
+ * @return bool|string
19
+ */
20
+ public function getConditionLabel() {
21
+ return $this->__('CMS Home Page');
22
+ }
23
  }
app/code/local/Mana/Core/Helper/PageType/Search.php CHANGED
@@ -17,4 +17,24 @@ class Mana_Core_Helper_PageType_Search extends Mana_Core_Helper_PageType {
17
  public function getRoutePath() {
18
  return 'catalogsearch/result/index';
19
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
17
  public function getRoutePath() {
18
  return 'catalogsearch/result/index';
19
  }
20
+ /**
21
+ * @return bool|string
22
+ */
23
+ public function getConditionLabel() {
24
+ return $this->__('Quick Search Page');
25
+ }
26
+
27
+ public function getPageContent() {
28
+ $result = array(
29
+ 'meta_title' => Mage::helper('catalogsearch')->__("Search results for: '%s'",
30
+ Mage::helper('catalogsearch')->getEscapedQueryText()),
31
+ 'title' => Mage::helper('catalogsearch')->__("Search results for: '%s'",
32
+ Mage::helper('catalogsearch')->getQueryText()),
33
+ );
34
+ return array_merge(parent::getPageContent(), $result);
35
+ }
36
+
37
+ public function getPageTypeId() {
38
+ return 'search';
39
+ }
40
  }
app/code/local/Mana/Core/Helper/StringTemplate.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Helper_StringTemplate extends Mage_Core_Helper_Abstract {
13
+ public function parse($template) {
14
+ $result = array();
15
+ if (preg_match_all('/{{.*}}/', $template, $matches, PREG_OFFSET_CAPTURE)) {
16
+ $lastOffset = 0;
17
+ foreach ($matches[0] as $match) {
18
+ list($var, $offset) = $match;
19
+ if ($offset > $lastOffset) {
20
+ $result[] = array('string', substr($template, $lastOffset, $offset - $lastOffset));
21
+ }
22
+ $result[] = array('var', substr($var, 2, strlen($var) - 4));
23
+ $lastOffset = $offset + strlen($var);
24
+ }
25
+ $offset = strlen($template);
26
+ if ($offset > $lastOffset) {
27
+ $result[] = array('string', substr($template, $lastOffset, $offset - $lastOffset));
28
+ }
29
+ }
30
+ else {
31
+ $result[] = array('string', $template);
32
+ }
33
+ return $result;
34
+ }
35
+
36
+ public function dbConcat($parsedTemplate, $vars) {
37
+ $result = array();
38
+ foreach ($parsedTemplate as $token) {
39
+ list($type, $text) = $token;
40
+ if ($type == 'string') {
41
+ $result[] = "'$text'";
42
+ }
43
+ elseif ($type == 'var') {
44
+ if (isset($vars[$text])) {
45
+ $result[] = $vars[$text];
46
+ }
47
+ else {
48
+ $result[] = "'".'{{$text}}'."'";
49
+ }
50
+ }
51
+ }
52
+ return count($result) > 1
53
+ ? 'CONCAT('.implode(', ', $result).')'
54
+ : (count($result) ? $result[0] : "''");
55
+ }
56
+ }
app/code/local/Mana/Core/Model/Condition/Abstract.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Model_Condition_Abstract extends Mage_Rule_Model_Condition_Abstract {
13
+ protected $_initialData;
14
+ public function __construct($data = array())
15
+ {
16
+ $this->_initialData = $data;
17
+ parent::__construct();
18
+ }
19
+
20
+ protected function _construct() {
21
+ $this->_data = $this->_initialData;
22
+ $this->_initialData = null;
23
+ }
24
+ }
app/code/local/Mana/Core/Model/Condition/Combine.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Model_Condition_Combine extends Mage_Rule_Model_Condition_Combine {
13
+ protected $_initialData;
14
+ public function __construct($data = array())
15
+ {
16
+ $this->_initialData = $data;
17
+ parent::__construct();
18
+ }
19
+
20
+ protected function _construct() {
21
+ $this->_data = $this->_initialData;
22
+ $this->_initialData = null;
23
+ }
24
+ }
app/code/local/Mana/Core/Model/Source/Design.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Model_Source_Design extends Mana_Core_Model_Source_Abstract
13
+ {
14
+ public function getIsFullLabel() {
15
+ return false;
16
+ }
17
+
18
+ protected function _getAllOptions()
19
+ {
20
+ $design = Mage::getModel('core/design_package')->getThemeList();
21
+ $options = array();
22
+ foreach ($design as $package => $themes){
23
+ $packageOption = array('label' => $package);
24
+ $themeOptions = array();
25
+ foreach ($themes as $theme) {
26
+ $themeOptions[] = array(
27
+ 'label' => ($this->getIsFullLabel() ? $package . ' / ' : '') . $theme,
28
+ 'value' => $package . '/' . $theme
29
+ );
30
+ }
31
+ $packageOption['value'] = $themeOptions;
32
+ $options[] = $packageOption;
33
+ }
34
+ array_unshift($options, array(
35
+ 'value'=>'',
36
+ 'label'=>Mage::helper('core')->__('-- Please Select --'))
37
+ );
38
+
39
+ return $options;
40
+ }
41
+ }
app/code/local/Mana/Core/Model/Source/Layout.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Model_Source_Layout extends Mana_Core_Model_Source_Abstract
13
+ {
14
+ protected function _getAllOptions()
15
+ {
16
+ $result = Mage::getSingleton('page/source_layout')->toOptionArray();
17
+ array_unshift($result, array('value'=>'', 'label'=>Mage::helper('catalog')->__('No layout updates')));
18
+ return $result;
19
+ }
20
+ }
app/code/local/Mana/Core/Model/Source/Status.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Core_Model_Source_Status extends Mana_Core_Model_Source_Abstract {
13
+ protected function _getAllOptions() {
14
+ return array(
15
+ array('value' => 1, 'label' => $this->helper()->__('Enabled')),
16
+ array('value' => 0, 'label' => $this->helper()->__('Disabled')),
17
+ );
18
+ }
19
+
20
+ #region Dependencies
21
+ /**
22
+ * @return Mana_AttributePage_Helper_Data
23
+ */
24
+ public function helper() {
25
+ return Mage::helper('mana_core');
26
+ }
27
+ #endregion
28
+ }
app/code/local/Mana/Core/Profiler2.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ /**
10
+ * Enter description here ...
11
+ * @author Mana Team
12
+ *
13
+ */
14
+ class Mana_Core_Profiler2 {
15
+ static protected $_stack = array();
16
+ public static function enabled() {
17
+ return defined('MANA_PROFILER');
18
+ }
19
+ public static function start($name, $logQueries = false) {
20
+ if (self::enabled()) {
21
+ array_push(self::$_stack, compact('name', 'logQueries'));
22
+ if ($logQueries) {
23
+ self::logQueries(true);
24
+ }
25
+ Varien_Profiler::start($name);
26
+ }
27
+ }
28
+ public static function stop() {
29
+ if (self::enabled()) {
30
+ /* @var $name string */
31
+ /* @var $logQueries bool */
32
+ extract(array_pop(self::$_stack));
33
+ Varien_Profiler::stop($name);
34
+ if ($logQueries) {
35
+ self::logQueries(false);
36
+ }
37
+ }
38
+ }
39
+
40
+ public static function logQueries($flag) {
41
+ $db = Mage::getSingleton('core/resource')->getConnection('read');
42
+ if (method_exists($db, 'debug')) {
43
+ $db->debug($flag);
44
+ }
45
+ }
46
+ }
app/code/local/Mana/Core/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  <Mana_Core>
13
  <!-- This version number identifies version of database tables specific to this extension. It is written to
14
  core_resource table. -->
15
- <version>13.10.22.17</version>
16
  </Mana_Core>
17
  </modules>
18
  <!-- This section contains module settings which are merged into global configuration during each page load,
@@ -210,6 +210,15 @@
210
  <!-- BASED ON SNIPPET: Static Visuals/Frontend section (config.xml) -->
211
  <!-- This section enables static visual changes in store frontend. -->
212
  <frontend>
 
 
 
 
 
 
 
 
 
213
  <!-- BASED ON SNIPPET: Static Visuals/Layout file support (config.xml) -->
214
  <!-- This section registers additional layout XML file with our module-specific layout changes to be loaded
215
  and executes during page rendering. -->
12
  <Mana_Core>
13
  <!-- This version number identifies version of database tables specific to this extension. It is written to
14
  core_resource table. -->
15
+ <version>14.06.13.09</version>
16
  </Mana_Core>
17
  </modules>
18
  <!-- This section contains module settings which are merged into global configuration during each page load,
210
  <!-- BASED ON SNIPPET: Static Visuals/Frontend section (config.xml) -->
211
  <!-- This section enables static visual changes in store frontend. -->
212
  <frontend>
213
+ <routers>
214
+ <mana>
215
+ <use>standard</use>
216
+ <args>
217
+ <module>Mana_Core</module>
218
+ <frontName>mana</frontName>
219
+ </args>
220
+ </mana>
221
+ </routers>
222
  <!-- BASED ON SNIPPET: Static Visuals/Layout file support (config.xml) -->
223
  <!-- This section registers additional layout XML file with our module-specific layout changes to be loaded
224
  and executes during page rendering. -->
app/code/local/Mana/Db/Helper/Data.php CHANGED
@@ -571,7 +571,7 @@ class Mana_Db_Helper_Data extends Mage_Core_Helper_Abstract {
571
  }
572
  $classFile .= '.php';
573
  foreach (explode(PS, get_include_path()) as $path) {
574
- if (file_exists($path.DS.$classFile)) {
575
  return true;
576
  }
577
  }
571
  }
572
  $classFile .= '.php';
573
  foreach (explode(PS, get_include_path()) as $path) {
574
+ if (@file_exists($path.DS.$classFile)) {
575
  return true;
576
  }
577
  }
app/code/local/Mana/Db/Model/Setup.php CHANGED
@@ -70,15 +70,6 @@ class Mana_Db_Model_Setup extends Varien_Object {
70
  }
71
 
72
  public function scheduleReindexing($code) {
73
- if ($reindex = Mage::registry('m_reindex')) {
74
- Mage::unregister('m_reindex');
75
- }
76
- else {
77
- $reindex = array();
78
- }
79
- $reindex[$code] = $code;
80
- Mage::register('m_reindex', $reindex);
81
-
82
- return $this;
83
  }
84
  }
70
  }
71
 
72
  public function scheduleReindexing($code) {
73
+ Mage::helper('mana_core/db')->scheduleReindexing($code);
 
 
 
 
 
 
 
 
 
74
  }
75
  }
app/code/local/Mana/Db/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  <Mana_Db>
13
  <!-- This version number identifies version of database tables specific to this extension. It is written to
14
  core_resource table. -->
15
- <version>13.10.26.19</version>
16
  </Mana_Db>
17
  </modules>
18
  <!-- This section contains module settings which are merged into global configuration during each page load,
@@ -72,12 +72,6 @@
72
  <mana_db_replicator>
73
  <model>mana_db/indexer</model>
74
  </mana_db_replicator>
75
- <mana_db translate="name description" module="mana_db">
76
- <model>mana_db/entity_indexer</model>
77
- <name>Entity Flat Data (MANAdev)</name>
78
- <description>Reorganizes entity data to flat structure</description>
79
- <targets/>
80
- </mana_db>
81
  </indexer>
82
  </index>
83
  <!-- BASED ON SNIPPET: New Models/Event support (config.xml) -->
12
  <Mana_Db>
13
  <!-- This version number identifies version of database tables specific to this extension. It is written to
14
  core_resource table. -->
15
+ <version>14.03.20.15</version>
16
  </Mana_Db>
17
  </modules>
18
  <!-- This section contains module settings which are merged into global configuration during each page load,
72
  <mana_db_replicator>
73
  <model>mana_db/indexer</model>
74
  </mana_db_replicator>
 
 
 
 
 
 
75
  </indexer>
76
  </index>
77
  <!-- BASED ON SNIPPET: New Models/Event support (config.xml) -->
app/code/local/Mana/Filters/Block/Filter.php CHANGED
@@ -72,7 +72,7 @@ class Mana_Filters_Block_Filter extends Mage_Catalog_Block_Layer_Filter_Abstract
72
  }
73
  }
74
 
75
- return $this->jsonHelper()->encodeAttribute($result);
76
  }
77
 
78
  public function getPopupBlockName() {
@@ -81,7 +81,23 @@ class Mana_Filters_Block_Filter extends Mage_Catalog_Block_Layer_Filter_Abstract
81
  }
82
  public function getItemsCount() {
83
  $this->_prepareFilterBlockOnce();
84
- return $this->getHidden() ? 0 : $this->_filter->getItemsCount();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
 
87
  public function getMultipleValueSeparator() {
72
  }
73
  }
74
 
75
+ return $this->jsonHelper()->encodeAttribute($result, array('force_object' => true));
76
  }
77
 
78
  public function getPopupBlockName() {
81
  }
82
  public function getItemsCount() {
83
  $this->_prepareFilterBlockOnce();
84
+ if ($this->getHidden()) {
85
+ return 0;
86
+ }
87
+ else {
88
+ $count = $this->_filter->getItemsCount();
89
+ $selected = $this->_filter->getMSelectedValues();
90
+ if ($count == 1 &&
91
+ empty($selected) &&
92
+ $this->getFilterOptions()->getCode() != 'category' &&
93
+ Mage::getStoreConfigFlag('mana_filters/display/hide_filters_with_single_visible_item'))
94
+ {
95
+ return 0;
96
+ }
97
+ else {
98
+ return $count;
99
+ }
100
+ }
101
  }
102
 
103
  public function getMultipleValueSeparator() {
app/code/local/Mana/Filters/Block/State.php CHANGED
@@ -13,7 +13,7 @@
13
  class Mana_Filters_Block_State extends Mage_Catalog_Block_Layer_State {
14
  public function getClearUrl() {
15
  if ($this->getMode() == 'this') {
16
- $query = array();
17
  foreach ($this->getActiveFilters() as $item) {
18
  $query[$item->getFilter()->getRequestVar()] = $item->getFilter()->getResetValue();
19
  }
13
  class Mana_Filters_Block_State extends Mage_Catalog_Block_Layer_State {
14
  public function getClearUrl() {
15
  if ($this->getMode() == 'this') {
16
+ $query = array('p' => null);
17
  foreach ($this->getActiveFilters() as $item) {
18
  $query[$item->getFilter()->getRequestVar()] = $item->getFilter()->getResetValue();
19
  }
app/code/local/Mana/Filters/Block/View.php CHANGED
@@ -111,21 +111,27 @@ class Mana_Filters_Block_View extends Mage_Catalog_Block_Layer_View {
111
  * @return Mana_Filters_Block_Filter[]
112
  */
113
  public function getFilters() {
114
- /* @var $helper Mana_Filters_Helper_Data */
115
- $helper = Mage::helper(strtolower('Mana_Filters'));
 
116
 
117
- $filters = array();
118
- foreach ($helper->getFilterOptionsCollection() as $filterOptions) {
119
- /* @var $filterOptions Mana_Filters_Model_Filter2_Store */
 
120
 
121
 
122
- if ($helper->isFilterEnabled($filterOptions)) {
123
- if ($helper->canShowFilterInBlock($this, $filterOptions)) {
 
 
 
124
  $filters[] = $this->getChild($filterOptions->getCode() . '_filter');
125
  }
126
- }
 
127
  }
128
- return $filters;
129
  }
130
  public function getClearUrl() {
131
  /* @var $helper Mana_Filters_Helper_Data */
@@ -196,10 +202,30 @@ class Mana_Filters_Block_View extends Mage_Catalog_Block_Layer_View {
196
  }
197
  return true;
198
  }
 
 
 
199
  /**
200
  * @return Mana_Filters_Helper_Data
201
  */
202
  public function layerHelper() {
203
  return Mage::helper('mana_filters');
204
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  }
111
  * @return Mana_Filters_Block_Filter[]
112
  */
113
  public function getFilters() {
114
+ if (!$this->hasData('filters')) {
115
+ /* @var $helper Mana_Filters_Helper_Data */
116
+ $helper = Mage::helper(strtolower('Mana_Filters'));
117
 
118
+ $filters = array();
119
+ $collection = $helper->getFilterOptionsCollection();
120
+ foreach ($collection as $filterOptions) {
121
+ /* @var $filterOptions Mana_Filters_Model_Filter2_Store */
122
 
123
 
124
+ if ($helper->isFilterEnabled($filterOptions) &&
125
+ (!$this->coreHelper()->isManadevDependentFilterInstalled()
126
+ || !$this->dependentHelper()->hide($filterOptions, $collection)) &&
127
+ $helper->canShowFilterInBlock($this, $filterOptions))
128
+ {
129
  $filters[] = $this->getChild($filterOptions->getCode() . '_filter');
130
  }
131
+ }
132
+ $this->setData('filters', $filters);
133
  }
134
+ return $this->_getData('filters');
135
  }
136
  public function getClearUrl() {
137
  /* @var $helper Mana_Filters_Helper_Data */
202
  }
203
  return true;
204
  }
205
+
206
+ #region Dependencies
207
+
208
  /**
209
  * @return Mana_Filters_Helper_Data
210
  */
211
  public function layerHelper() {
212
  return Mage::helper('mana_filters');
213
  }
214
+
215
+ /**
216
+ * @return Mana_Core_Helper_Data
217
+ */
218
+ public function coreHelper() {
219
+ return Mage::helper('mana_core');
220
+ }
221
+ /**
222
+ * @return ManaPro_FilterDependent_Helper_Data
223
+ */
224
+ public function dependentHelper() {
225
+ return Mage::helper('manapro_filterdependent');
226
+ }
227
+
228
+ #endregion
229
+
230
+
231
  }
app/code/local/Mana/Filters/Helper/Data.php CHANGED
@@ -53,36 +53,49 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
53
  $request->getModuleName() == 'manapro_filterajax' && $request->getControllerName() == 'search' && $request->getActionName() == 'index')
54
  {
55
  if (!$this->_filterSearchOptionsCollection) {
 
56
  $this->_filterSearchOptionsCollection = Mage::getResourceModel('mana_filters/filter2_store_collection')
57
  ->addColumnToSelect('*')
58
  ->addStoreFilter(Mage::app()->getStore())
59
  ->setOrder('position', 'ASC');
 
 
 
 
 
60
  }
61
- Mage::dispatchEvent('m_before_load_filter_collection', array('collection' => $this->_filterSearchOptionsCollection));
62
  return $this->_filterSearchOptionsCollection;
63
  }
64
- if ($allCategories) {
65
- if (!$this->_filterAllOptionsCollection) {
66
- $this->_filterAllOptionsCollection = Mage::getResourceModel('mana_filters/filter2_store_collection')
 
67
  ->addColumnToSelect('*')
68
  ->addStoreFilter(Mage::app()->getStore())
69
  ->setOrder('position', 'ASC');
70
- }
71
- Mage::dispatchEvent('m_before_load_filter_collection', array('collection' => $this->_filterAllOptionsCollection));
 
 
 
 
72
  return $this->_filterAllOptionsCollection;
73
  }
74
  else {
75
  if (!$this->_filterOptionsCollection) {
76
- Mana_Core_Profiler::start('mln' . '::' . __CLASS__ . '::' . __METHOD__ . '::' . '$productCollection->getSetIds()');
77
  $setIds = Mage::getSingleton('catalog/layer')->getProductCollection()->getSetIds();
78
- Mana_Core_Profiler::stop('mln' . '::' . __CLASS__ . '::' . __METHOD__ . '::' . '$productCollection->getSetIds()');
79
  $this->_filterOptionsCollection = Mage::getResourceModel('mana_filters/filter2_store_collection')
80
  ->addFieldToSelect('*')
81
  ->addCodeFilter($this->_getAttributeCodes($setIds))
82
  ->addStoreFilter(Mage::app()->getStore())
83
  ->setOrder('position', 'ASC');
84
- }
85
- Mage::dispatchEvent('m_before_load_filter_collection', array('collection' => $this->_filterOptionsCollection));
 
 
 
 
86
  return $this->_filterOptionsCollection;
87
  }
88
  }
@@ -116,7 +129,7 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
116
  return $url;
117
  }
118
  public function getClearUrl($markUrl = true, $clearListParams = false, $nosid = false, $clearAllParams = false) {
119
- $filterState = array();
120
  foreach ($this->getLayer()->getState()->getFilters() as $item) {
121
  $filterState[$item->getFilter()->getRequestVar()] = $item->getFilter()->getCleanValue();
122
  }
@@ -202,6 +215,7 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
202
  throw new Exception('Not implemented');
203
  }
204
  }
 
205
  public function canShowFilterInBlock($block, $filter) {
206
  if ($block->getData('show_'.$filter->getCode())) {
207
  return true;
@@ -256,7 +270,14 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
256
  }
257
  }
258
 
 
 
 
 
 
 
259
  public function addCountToCategories($productCollection, $categoryCollection, $inCurrentCategory = false) {
 
260
  $isAnchor = array();
261
  $isNotAnchor = array();
262
  foreach ($categoryCollection as $category) {
@@ -293,6 +314,7 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
293
  $anchorStmt = clone $select;
294
  $anchorStmt->limit(); //reset limits
295
  $anchorStmt->where('count_table.category_id IN (?)', $isAnchor);
 
296
  $productCounts += $productCollection->getConnection()->fetchPairs($anchorStmt);
297
  $anchorStmt = null;
298
  }
@@ -316,6 +338,8 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
316
  $category->setProductCount($_count);
317
  }
318
 
 
 
319
  return $this;
320
  }
321
  public function renderHtml($block, $part, $data = array()) {
@@ -422,6 +446,14 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
422
  return false;
423
  }
424
 
 
 
 
 
 
 
 
 
425
  #region Dependencies
426
 
427
  /**
@@ -430,5 +462,6 @@ class Mana_Filters_Helper_Data extends Mana_Core_Helper_Layer {
430
  public function coreHelper() {
431
  return Mage::helper('mana_core');
432
  }
 
433
  #endregion
434
  }
53
  $request->getModuleName() == 'manapro_filterajax' && $request->getControllerName() == 'search' && $request->getActionName() == 'index')
54
  {
55
  if (!$this->_filterSearchOptionsCollection) {
56
+ Mana_Core_Profiler2::start(__METHOD__ . "::search");
57
  $this->_filterSearchOptionsCollection = Mage::getResourceModel('mana_filters/filter2_store_collection')
58
  ->addColumnToSelect('*')
59
  ->addStoreFilter(Mage::app()->getStore())
60
  ->setOrder('position', 'ASC');
61
+ Mage::dispatchEvent('m_before_load_filter_collection', array('collection' => $this->_filterSearchOptionsCollection));
62
+ if (Mana_Core_Profiler2::enabled()) {
63
+ $this->_filterSearchOptionsCollection->load();
64
+ Mana_Core_Profiler2::stop();
65
+ }
66
  }
 
67
  return $this->_filterSearchOptionsCollection;
68
  }
69
+ elseif ($allCategories) {
70
+ if (!$this->_filterAllOptionsCollection) {
71
+ Mana_Core_Profiler2::start(__METHOD__ . "::all");
72
+ $this->_filterAllOptionsCollection = Mage::getResourceModel('mana_filters/filter2_store_collection')
73
  ->addColumnToSelect('*')
74
  ->addStoreFilter(Mage::app()->getStore())
75
  ->setOrder('position', 'ASC');
76
+ Mage::dispatchEvent('m_before_load_filter_collection', array('collection' => $this->_filterAllOptionsCollection));
77
+ if (Mana_Core_Profiler2::enabled()) {
78
+ $this->_filterAllOptionsCollection->load();
79
+ Mana_Core_Profiler2::stop();
80
+ }
81
+ }
82
  return $this->_filterAllOptionsCollection;
83
  }
84
  else {
85
  if (!$this->_filterOptionsCollection) {
86
+ Mana_Core_Profiler2::start(__METHOD__ . "::category");
87
  $setIds = Mage::getSingleton('catalog/layer')->getProductCollection()->getSetIds();
 
88
  $this->_filterOptionsCollection = Mage::getResourceModel('mana_filters/filter2_store_collection')
89
  ->addFieldToSelect('*')
90
  ->addCodeFilter($this->_getAttributeCodes($setIds))
91
  ->addStoreFilter(Mage::app()->getStore())
92
  ->setOrder('position', 'ASC');
93
+ Mage::dispatchEvent('m_before_load_filter_collection', array('collection' => $this->_filterOptionsCollection));
94
+ if (Mana_Core_Profiler2::enabled()) {
95
+ $this->_filterOptionsCollection->load();
96
+ Mana_Core_Profiler2::stop();
97
+ }
98
+ }
99
  return $this->_filterOptionsCollection;
100
  }
101
  }
129
  return $url;
130
  }
131
  public function getClearUrl($markUrl = true, $clearListParams = false, $nosid = false, $clearAllParams = false) {
132
+ $filterState = array('p' => null);
133
  foreach ($this->getLayer()->getState()->getFilters() as $item) {
134
  $filterState[$item->getFilter()->getRequestVar()] = $item->getFilter()->getCleanValue();
135
  }
215
  throw new Exception('Not implemented');
216
  }
217
  }
218
+
219
  public function canShowFilterInBlock($block, $filter) {
220
  if ($block->getData('show_'.$filter->getCode())) {
221
  return true;
270
  }
271
  }
272
 
273
+ /**
274
+ * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection
275
+ * @param $categoryCollection
276
+ * @param bool $inCurrentCategory
277
+ * @return $this
278
+ */
279
  public function addCountToCategories($productCollection, $categoryCollection, $inCurrentCategory = false) {
280
+ Mana_Core_Profiler2::start(__METHOD__);
281
  $isAnchor = array();
282
  $isNotAnchor = array();
283
  foreach ($categoryCollection as $category) {
314
  $anchorStmt = clone $select;
315
  $anchorStmt->limit(); //reset limits
316
  $anchorStmt->where('count_table.category_id IN (?)', $isAnchor);
317
+ $sql = $anchorStmt->__toString();
318
  $productCounts += $productCollection->getConnection()->fetchPairs($anchorStmt);
319
  $anchorStmt = null;
320
  }
338
  $category->setProductCount($_count);
339
  }
340
 
341
+ Mana_Core_Profiler2::stop();
342
+
343
  return $this;
344
  }
345
  public function renderHtml($block, $part, $data = array()) {
446
  return false;
447
  }
448
 
449
+ public function getPageContent() {
450
+ return array(
451
+ 'filters' => $this->getActiveFilters(),
452
+ 'page' => Mage::app()->getRequest()->getParam('p'),
453
+ );
454
+ }
455
+
456
+
457
  #region Dependencies
458
 
459
  /**
462
  public function coreHelper() {
463
  return Mage::helper('mana_core');
464
  }
465
+
466
  #endregion
467
  }
app/code/local/Mana/Filters/Helper/Item.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Filters
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Filters_Helper_Item extends Mana_Core_Helper_Layer {
13
+ protected $_allItems = array();
14
+ protected $_attributeItems = array();
15
+ protected $_resources;
16
+
17
+ public function isEnabled() {
18
+ return (bool)(string)Mage::getConfig()->getNode('mana_filters/item_repository/is_active');
19
+ }
20
+
21
+ /**
22
+ * @return Mana_Filters_Resource_ItemAdditionalInfo[]
23
+ * @throws Exception
24
+ */
25
+ public function getResources() {
26
+ if (!$this->_resources) {
27
+ $this->_resources = array();
28
+ foreach ($this->coreHelper()->getSortedXmlChildren(Mage::getConfig()->getNode('mana_filters/item_repository'),
29
+ 'resources') as $key => $xml)
30
+ {
31
+ $this->_resources[$key] = Mage::getResourceSingleton((string)$xml->resource);
32
+ if (!($this->_resources[$key] instanceof Mana_Filters_Resource_ItemAdditionalInfo)) {
33
+ throw new Exception(sprintf('%1 must be instance of %2', get_class($this->_resources[$key]),
34
+ 'Mana_Filters_Resource_ItemAdditionalInfo'));
35
+
36
+ }
37
+ }
38
+ }
39
+ return $this->_resources;
40
+ }
41
+
42
+ /**
43
+ * @param Mana_Filters_Model_Filter_Attribute $filter
44
+ * @param Mana_Filters_Model_Item[] $items
45
+ */
46
+ public function registerItems($filter, $items) {
47
+ if ($this->isEnabled()) {
48
+ $this->_attributeItems[$filter->getAttributeModel()->getId()] = $items;
49
+ $this->_allItems += $items;
50
+ }
51
+ }
52
+
53
+ /**
54
+ * @param Mana_Filters_Model_Filter_Attribute $filter
55
+ * @return array|null
56
+ */
57
+ public function selectItems($filter) {
58
+ if ($this->isEnabled()) {
59
+ $select = $this->getResource()->selectItems($filter);
60
+ foreach ($this->getResources() as $resource) {
61
+ $resource->selectItems($select, $filter);
62
+ }
63
+ return $this->getResource()->fetch($select);
64
+ }
65
+ else {
66
+ return null;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * @param Mana_Filters_Model_Filter_Attribute $filter
72
+ * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
73
+ * @return array|null
74
+ */
75
+ public function countItems($filter, $collection) {
76
+ if ($this->isEnabled()) {
77
+ $select = $this->getResource()->countItems($filter, $collection);
78
+ foreach ($this->getResources() as $resource) {
79
+ $resource->countItems($select, $filter, $collection);
80
+ }
81
+ return $this->getResource()->fetch($select);
82
+ }
83
+ else {
84
+ return null;
85
+ }
86
+ }
87
+
88
+ /**
89
+ * @param int $attributeId
90
+ * @return array|bool
91
+ */
92
+ public function getAttributeItems($attributeId) {
93
+ return isset($this->_attributeItems[$attributeId]) ? $this->_attributeItems[$attributeId] : false;
94
+ }
95
+
96
+ /**
97
+ * @param int $optionId
98
+ * @return Mana_Filters_Model_Item|bool
99
+ */
100
+ public function get($optionId) {
101
+ return isset($this->_allItems[$optionId]) ? $this->_allItems[$optionId] : false;
102
+ }
103
+
104
+ #region Dependencies
105
+
106
+ /**
107
+ * @return Mana_Filters_Resource_Item
108
+ */
109
+ public function getResource() {
110
+ return Mage::getResourceSingleton('mana_filters/item');
111
+ }
112
+
113
+ /**
114
+ * @return Mana_Core_Helper_Data
115
+ */
116
+ public function coreHelper() {
117
+ return Mage::helper('mana_core');
118
+ }
119
+ #endregion
120
+ }
app/code/local/Mana/Filters/Interface/Filter.php CHANGED
@@ -77,4 +77,6 @@ interface Mana_Filters_Interface_Filter
77
  * @return void
78
  */
79
  public function addToState();
 
 
80
  }
77
  * @return void
78
  */
79
  public function addToState();
80
+
81
+
82
  }
app/code/local/Mana/Filters/Model/Filter/Attribute.php CHANGED
@@ -66,96 +66,61 @@ class Mana_Filters_Model_Filter_Attribute
66
  $key = $this->getLayer()->getStateKey() . '_' . $this->_requestVar;
67
  $data = $this->getLayer()->getAggregator()->getCacheData($key);
68
 
69
- if ($data === null) {
 
 
 
70
  }
71
-
72
  if ($data === null) {
73
- if ($query->isOptimizedAttributeFilter($this)) {
74
- $optionsCount = $query->getAllOptimizedAttributeFilterCounts();
75
- $data = array();
76
- $onlyWithResults = $this->_getIsFilterableAttribute($attribute) == self::OPTIONS_ONLY_WITH_RESULTS;
77
- $attributeId = $attribute->getId();
78
- $isReverse = $this->getFilterOptions()->getIsReverse();
79
- foreach ($optionsCount as $option) {
80
- if ($option['attribute_id'] != $attributeId) {
81
- continue;
82
- }
83
 
84
- $hasResults = !empty($option['count']);
85
- $isSelected = !empty($option['value']) && in_array($option['value'], $selectedOptionIds);
 
 
 
 
86
  // Check filter type
87
- if ($onlyWithResults) {
88
- if ($hasResults || $isSelected) {
89
  $data[] = array(
90
  'label' => $option['label'],
91
  'value' => $option['value'],
92
- 'count' => $option['count'],
93
  'm_selected' => $isSelected,
94
- 'm_show_selected' => $isReverse ? !$isSelected : $isSelected,
 
95
  );
96
  }
97
- }
98
- else {
99
  $data[] = array(
100
  'label' => $option['label'],
101
  'value' => $option['value'],
102
- 'count' => $option['count'],
103
  'm_selected' => $isSelected,
104
- 'm_show_selected' => $isReverse ? !$isSelected : $isSelected,
105
  );
106
  }
107
  }
108
  }
109
- else {
110
- $options = $attribute->getFrontend()->getSelectOptions();
111
- $optionsCount = $query->getFilterCounts($this->getFilterOptions()->getCode());
112
- $data = array();
113
-
114
- foreach ($options as $option) {
115
- if (!$option || is_array($option['value'])) {
116
- continue;
117
- }
118
- if (Mage::helper('core/string')->strlen($option['value'])) {
119
- $isSelected = in_array($option['value'], $selectedOptionIds);
120
- // Check filter type
121
- if ($this->_getIsFilterableAttribute($attribute) == self::OPTIONS_ONLY_WITH_RESULTS) {
122
- if (!empty($optionsCount[$option['value']]) || in_array($option['value'], $selectedOptionIds)) {
123
- $data[] = array(
124
- 'label' => $option['label'],
125
- 'value' => $option['value'],
126
- 'count' => isset($optionsCount[$option['value']]) ? $optionsCount[$option['value']] : 0,
127
- 'm_selected' => $isSelected,
128
- 'm_show_selected' => $this->getFilterOptions()->getIsReverse(
129
- ) ? !$isSelected : $isSelected,
130
- );
131
- }
132
- } else {
133
- $data[] = array(
134
- 'label' => $option['label'],
135
- 'value' => $option['value'],
136
- 'count' => isset($optionsCount[$option['value']]) ? $optionsCount[$option['value']] : 0,
137
- 'm_selected' => $isSelected,
138
- 'm_show_selected' => $this->getFilterOptions()->getIsReverse() ? !$isSelected : $isSelected,
139
- );
140
- }
141
- }
142
- }
143
- }
144
 
145
- $tags = array(
146
- Mage_Eav_Model_Entity_Attribute::CACHE_TAG . ':' . $attribute->getId()
147
- );
148
 
149
- $tags = $this->getLayer()->getStateTags($tags);
 
 
150
 
151
- $sortMethod = $this->getFilterOptions()->getSortMethod() ? $this->getFilterOptions()->getSortMethod() : 'byPosition';
152
- foreach ($data as $position => &$item) {
153
- $item['position'] = $position;
154
- }
155
- usort($data, array(Mage::getSingleton('mana_filters/sort'), $sortMethod));
156
 
157
- $this->getLayer()->getAggregator()->saveCacheData($data, $key, $tags);
 
 
158
  }
 
 
 
159
 
160
  return $data;
161
  }
@@ -222,7 +187,9 @@ class Mana_Filters_Model_Filter_Attribute
222
  */
223
  public function countOnCollection($collection)
224
  {
225
- return $this->_getResource()->countOnCollection($collection, $this);
 
 
226
  }
227
 
228
  public function optimizedCountOnCollection($collection, $attributeIds) {
@@ -290,9 +257,10 @@ class Mana_Filters_Model_Filter_Attribute
290
  $data = $this->_getItemsData();
291
  $items = array();
292
  foreach ($data as $itemData) {
293
- $items[] = $this->_createItemEx($itemData);
294
  }
295
  $items = $ext->processFilterItems($this, $items);
 
296
  $this->_items = $items;
297
 
298
  return $this;
@@ -332,6 +300,10 @@ class Mana_Filters_Model_Filter_Attribute
332
  public function getRemoveUrl()
333
  {
334
  $query = array($this->getRequestVar() => $this->getResetValue());
 
 
 
 
335
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
336
  $params['_current'] = true;
337
  $params['_use_rewrite'] = true;
@@ -367,4 +339,27 @@ class Mana_Filters_Model_Filter_Attribute
367
  return $values ? array_filter(explode('_', $values)) : array();
368
  }
369
  #endregion
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  }
66
  $key = $this->getLayer()->getStateKey() . '_' . $this->_requestVar;
67
  $data = $this->getLayer()->getAggregator()->getCacheData($key);
68
 
69
+ if ($data === null && $this->itemHelper()->isEnabled() &&
70
+ $this->_getIsFilterable() == self::OPTIONS_ONLY_WITH_RESULTS)
71
+ {
72
+ $data = $query->getFilterCounts($this->getFilterOptions()->getCode());
73
  }
 
74
  if ($data === null) {
75
+ $options = $attribute->getFrontend()->getSelectOptions();
76
+ $optionsCount = $query->getFilterCounts($this->getFilterOptions()->getCode());
77
+ $data = array();
 
 
 
 
 
 
 
78
 
79
+ foreach ($options as $option) {
80
+ if (!$option || is_array($option['value'])) {
81
+ continue;
82
+ }
83
+ if (Mage::helper('core/string')->strlen($option['value'])) {
84
+ $isSelected = in_array($option['value'], $selectedOptionIds);
85
  // Check filter type
86
+ if ($this->_getIsFilterableAttribute($attribute) == self::OPTIONS_ONLY_WITH_RESULTS) {
87
+ if (!empty($optionsCount[$option['value']]) || in_array($option['value'], $selectedOptionIds)) {
88
  $data[] = array(
89
  'label' => $option['label'],
90
  'value' => $option['value'],
91
+ 'count' => isset($optionsCount[$option['value']]) ? $optionsCount[$option['value']] : 0,
92
  'm_selected' => $isSelected,
93
+ 'm_show_selected' => $this->getFilterOptions()->getIsReverse(
94
+ ) ? !$isSelected : $isSelected,
95
  );
96
  }
97
+ } else {
 
98
  $data[] = array(
99
  'label' => $option['label'],
100
  'value' => $option['value'],
101
+ 'count' => isset($optionsCount[$option['value']]) ? $optionsCount[$option['value']] : 0,
102
  'm_selected' => $isSelected,
103
+ 'm_show_selected' => $this->getFilterOptions()->getIsReverse() ? !$isSelected : $isSelected,
104
  );
105
  }
106
  }
107
  }
108
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
 
 
 
110
 
111
+ $tags = array(
112
+ Mage_Eav_Model_Entity_Attribute::CACHE_TAG . ':' . $attribute->getId()
113
+ );
114
 
115
+ $tags = $this->getLayer()->getStateTags($tags);
 
 
 
 
116
 
117
+ $sortMethod = $this->getFilterOptions()->getSortMethod() ? $this->getFilterOptions()->getSortMethod() : 'byPosition';
118
+ foreach (array_keys($data) as $position => $key) {
119
+ $data[$key]['position'] = $position;
120
  }
121
+ usort($data, array(Mage::getSingleton('mana_filters/sort'), $sortMethod));
122
+
123
+ $this->getLayer()->getAggregator()->saveCacheData($data, $key, $tags);
124
 
125
  return $data;
126
  }
187
  */
188
  public function countOnCollection($collection)
189
  {
190
+ return $this->itemHelper()->isEnabled() && $this->_getIsFilterable() == self::OPTIONS_ONLY_WITH_RESULTS
191
+ ? $this->itemHelper()->countItems($this, $collection)
192
+ : $this->_getResource()->countOnCollection($collection, $this);
193
  }
194
 
195
  public function optimizedCountOnCollection($collection, $attributeIds) {
257
  $data = $this->_getItemsData();
258
  $items = array();
259
  foreach ($data as $itemData) {
260
+ $items[$itemData['value']] = $this->_createItemEx($itemData);
261
  }
262
  $items = $ext->processFilterItems($this, $items);
263
+ $this->itemHelper()->registerItems($this, $items);
264
  $this->_items = $items;
265
 
266
  return $this;
300
  public function getRemoveUrl()
301
  {
302
  $query = array($this->getRequestVar() => $this->getResetValue());
303
+ if ($this->coreHelper()->isManadevDependentFilterInstalled()) {
304
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getRequestVar());
305
+ }
306
+
307
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
308
  $params['_current'] = true;
309
  $params['_use_rewrite'] = true;
339
  return $values ? array_filter(explode('_', $values)) : array();
340
  }
341
  #endregion
342
+ #region Dependencies
343
+
344
+ /**
345
+ * @return Mana_Core_Helper_Data
346
+ */
347
+ public function coreHelper() {
348
+ return Mage::helper('mana_core');
349
+ }
350
+
351
+ /**
352
+ * @return ManaPro_FilterDependent_Helper_Data
353
+ */
354
+ public function dependentHelper() {
355
+ return Mage::helper('manapro_filterdependent');
356
+ }
357
+
358
+ /**
359
+ * @return Mana_Filters_Helper_Item
360
+ */
361
+ public function itemHelper() {
362
+ return Mage::helper('mana_filters/item');
363
+ }
364
+ #endregion
365
  }
app/code/local/Mana/Filters/Model/Filter/Category.php CHANGED
@@ -280,6 +280,10 @@ class Mana_Filters_Model_Filter_Category
280
  public function getRemoveUrl()
281
  {
282
  $query = array($this->getRequestVar() => $this->getResetValue());
 
 
 
 
283
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
284
  $params['_current'] = true;
285
  $params['_use_rewrite'] = true;
@@ -340,5 +344,20 @@ class Mana_Filters_Model_Filter_Category
340
  public function filterHelper() {
341
  return Mage::helper('mana_filters');
342
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  #endregion
344
  }
280
  public function getRemoveUrl()
281
  {
282
  $query = array($this->getRequestVar() => $this->getResetValue());
283
+ if ($this->coreHelper()->isManadevDependentFilterInstalled()) {
284
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getRequestVar());
285
+ }
286
+
287
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
288
  $params['_current'] = true;
289
  $params['_use_rewrite'] = true;
344
  public function filterHelper() {
345
  return Mage::helper('mana_filters');
346
  }
347
+
348
+ /**
349
+ * @return Mana_Core_Helper_Data
350
+ */
351
+ public function coreHelper() {
352
+ return Mage::helper('mana_core');
353
+ }
354
+
355
+ /**
356
+ * @return ManaPro_FilterDependent_Helper_Data
357
+ */
358
+ public function dependentHelper() {
359
+ return Mage::helper('manapro_filterdependent');
360
+ }
361
+
362
  #endregion
363
  }
app/code/local/Mana/Filters/Model/Filter/Decimal.php CHANGED
@@ -251,6 +251,10 @@ class Mana_Filters_Model_Filter_Decimal
251
  public function getRemoveUrl()
252
  {
253
  $query = array($this->getRequestVar() => $this->getResetValue());
 
 
 
 
254
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
255
  $params['_current'] = true;
256
  $params['_use_rewrite'] = true;
@@ -450,4 +454,21 @@ class Mana_Filters_Model_Filter_Decimal
450
  return $this->_getResource()->isUpperBoundInclusive();
451
  }
452
  #endregion
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  }
251
  public function getRemoveUrl()
252
  {
253
  $query = array($this->getRequestVar() => $this->getResetValue());
254
+ if ($this->coreHelper()->isManadevDependentFilterInstalled()) {
255
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getRequestVar());
256
+ }
257
+
258
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
259
  $params['_current'] = true;
260
  $params['_use_rewrite'] = true;
454
  return $this->_getResource()->isUpperBoundInclusive();
455
  }
456
  #endregion
457
+ #region Dependencies
458
+
459
+ /**
460
+ * @return Mana_Core_Helper_Data
461
+ */
462
+ public function coreHelper() {
463
+ return Mage::helper('mana_core');
464
+ }
465
+
466
+ /**
467
+ * @return ManaPro_FilterDependent_Helper_Data
468
+ */
469
+ public function dependentHelper() {
470
+ return Mage::helper('manapro_filterdependent');
471
+ }
472
+
473
+ #endregion
474
  }
app/code/local/Mana/Filters/Model/Filter/Price.php CHANGED
@@ -89,7 +89,7 @@ class Mana_Filters_Model_Filter_Price
89
 
90
  public function getHighestPossibleValue()
91
  {
92
- return (int)ceil($this->getMaxPriceInt());
93
  }
94
 
95
  protected $_hasNoResults = false;
@@ -179,11 +179,15 @@ class Mana_Filters_Model_Filter_Price
179
  {
180
  $min = 0;
181
  $max = $this->_getResource()->getMaxPriceOnCollection($this, $collection);
182
- $max = ceil($max);
183
  $this->setData('max_price_int', $max);
184
  return compact('min', 'max');
185
  }
186
 
 
 
 
 
187
  /**
188
  * Returns option id/count pairs for option lists or min/max pair for slider. Typically, this method just returns
189
  * $counts. However, in some cases (like not applied Solr facets) this method gets a collection object with Solr
@@ -272,6 +276,10 @@ class Mana_Filters_Model_Filter_Price
272
  public function getRemoveUrl()
273
  {
274
  $query = array($this->getRequestVar() => $this->getResetValue());
 
 
 
 
275
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
276
  $params['_current'] = true;
277
  $params['_use_rewrite'] = true;
@@ -335,9 +343,15 @@ class Mana_Filters_Model_Filter_Price
335
  }
336
  if (!$range) {
337
  $currentCategory = Mage::registry('current_category_filter');
 
 
 
338
  if ($currentCategory) {
339
  $range = $currentCategory->getFilterPriceRange();
340
  }
 
 
 
341
  else {
342
  $range = $this->getLayer()->getCurrentCategory()->getFilterPriceRange();
343
  }
@@ -424,4 +438,21 @@ class Mana_Filters_Model_Filter_Price
424
  }
425
  #endregion
426
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
427
  }
89
 
90
  public function getHighestPossibleValue()
91
  {
92
+ return $this->getMaxPriceInt();
93
  }
94
 
95
  protected $_hasNoResults = false;
179
  {
180
  $min = 0;
181
  $max = $this->_getResource()->getMaxPriceOnCollection($this, $collection);
182
+ $max = $this->_ceil($max);
183
  $this->setData('max_price_int', $max);
184
  return compact('min', 'max');
185
  }
186
 
187
+ protected function _ceil($value) {
188
+ return ceil($value);
189
+ }
190
+
191
  /**
192
  * Returns option id/count pairs for option lists or min/max pair for slider. Typically, this method just returns
193
  * $counts. However, in some cases (like not applied Solr facets) this method gets a collection object with Solr
276
  public function getRemoveUrl()
277
  {
278
  $query = array($this->getRequestVar() => $this->getResetValue());
279
+ if ($this->coreHelper()->isManadevDependentFilterInstalled()) {
280
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getRequestVar());
281
+ }
282
+
283
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
284
  $params['_current'] = true;
285
  $params['_use_rewrite'] = true;
343
  }
344
  if (!$range) {
345
  $currentCategory = Mage::registry('current_category_filter');
346
+ /* @var $currentOptionPage Mana_AttributePage_Model_OptionPage_Store */
347
+ $currentOptionPage = Mage::registry('current_option_page');
348
+
349
  if ($currentCategory) {
350
  $range = $currentCategory->getFilterPriceRange();
351
  }
352
+ elseif ($currentOptionPage && $currentOptionPage->getData('price_step')) {
353
+ $range = $currentOptionPage->getData('price_step');
354
+ }
355
  else {
356
  $range = $this->getLayer()->getCurrentCategory()->getFilterPriceRange();
357
  }
438
  }
439
  #endregion
440
 
441
+ #region Dependencies
442
+
443
+ /**
444
+ * @return Mana_Core_Helper_Data
445
+ */
446
+ public function coreHelper() {
447
+ return Mage::helper('mana_core');
448
+ }
449
+
450
+ /**
451
+ * @return ManaPro_FilterDependent_Helper_Data
452
+ */
453
+ public function dependentHelper() {
454
+ return Mage::helper('manapro_filterdependent');
455
+ }
456
+
457
+ #endregion
458
  }
app/code/local/Mana/Filters/Model/Filter2.php CHANGED
@@ -57,6 +57,22 @@ class Mana_Filters_Model_Filter2 extends Mana_Db_Model_Object {
57
  $result->addError($t->__('Please fill in %s field', $t->__('Position')));
58
  }
59
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  public function getCode() {
61
  return isset($this->_data['code']) ? $this->_data['code'] : null;
62
  }
57
  $result->addError($t->__('Please fill in %s field', $t->__('Position')));
58
  }
59
  }
60
+
61
+ public function validateDetails() {
62
+ if ($edit = $this->getValueData()) {
63
+ foreach ($edit['saved'] as $id => $editId) {
64
+ if ($id > 0) {
65
+ $editModel = Mage::helper('mana_admin')->loadModel('mana_filters/filter2_value', $editId);
66
+ $editModel->validate();
67
+ }
68
+ else {
69
+ // inserts
70
+ throw new Exception('Not implemented!');
71
+ }
72
+ }
73
+ }
74
+ }
75
+
76
  public function getCode() {
77
  return isset($this->_data['code']) ? $this->_data['code'] : null;
78
  }
app/code/local/Mana/Filters/Model/Filter2/Value.php CHANGED
@@ -13,6 +13,35 @@
13
  */
14
  class Mana_Filters_Model_Filter2_Value extends Mana_Db_Model_Object {
15
  protected $_eventPrefix = 'mana_filter_value';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  /**
17
  * Invoked during model creation process, this method associates this model with resource and resource
18
  * collection classes
13
  */
14
  class Mana_Filters_Model_Filter2_Value extends Mana_Db_Model_Object {
15
  protected $_eventPrefix = 'mana_filter_value';
16
+
17
+ #region bit indexes for default_mask field(s)
18
+ const DM_NAME = Mana_Filters_Resource_Filter2_Value::DM_NAME;
19
+ const DM_POSITION = Mana_Filters_Resource_Filter2_Value::DM_POSITION;
20
+ const DM_COLOR = Mana_Filters_Resource_Filter2_Value::DM_COLOR;
21
+ const DM_NORMAL_IMAGE = Mana_Filters_Resource_Filter2_Value::DM_NORMAL_IMAGE;
22
+ const DM_SELECTED_IMAGE = Mana_Filters_Resource_Filter2_Value::DM_SELECTED_IMAGE;
23
+ const DM_NORMAL_HOVERED_IMAGE = Mana_Filters_Resource_Filter2_Value::DM_NORMAL_HOVERED_IMAGE;
24
+ const DM_SELECTED_HOVERED_IMAGE = Mana_Filters_Resource_Filter2_Value::DM_SELECTED_HOVERED_IMAGE;
25
+ const DM_STATE_IMAGE = Mana_Filters_Resource_Filter2_Value::DM_STATE_IMAGE;
26
+
27
+ const DM_CONTENT_IS_ACTIVE = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_IS_ACTIVE;
28
+ const DM_CONTENT_IS_INITIALIZED = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_IS_INITIALIZED;
29
+ const DM_CONTENT_STOP_FURTHER_PROCESSING = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_STOP_FURTHER_PROCESSING;
30
+ const DM_CONTENT_META_TITLE = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_META_TITLE;
31
+ const DM_CONTENT_META_KEYWORDS = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_META_KEYWORDS;
32
+ const DM_CONTENT_META_DESCRIPTION = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_META_DESCRIPTION;
33
+ const DM_CONTENT_META_ROBOTS = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_META_ROBOTS;
34
+ const DM_CONTENT_TITLE = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_TITLE;
35
+ const DM_CONTENT_SUBTITLE = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_SUBTITLE;
36
+ const DM_CONTENT_DESCRIPTION = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_DESCRIPTION;
37
+ const DM_CONTENT_ADDITIONAL_DESCRIPTION = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_ADDITIONAL_DESCRIPTION;
38
+ const DM_CONTENT_LAYOUT_XML = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_LAYOUT_XML;
39
+ const DM_CONTENT_WIDGET_LAYOUT_XML = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_WIDGET_LAYOUT_XML;
40
+ const DM_CONTENT_PRIORITY = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_PRIORITY;
41
+ const DM_CONTENT_COMMON_DIRECTIVES = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_COMMON_DIRECTIVES;
42
+ const DM_CONTENT_BACKGROUND_IMAGE = Mana_Filters_Resource_Filter2_Value::DM_CONTENT_BACKGROUND_IMAGE;
43
+
44
+ #endregion
45
  /**
46
  * Invoked during model creation process, this method associates this model with resource and resource
47
  * collection classes
app/code/local/Mana/Filters/Model/Item.php CHANGED
@@ -37,6 +37,9 @@ class Mana_Filters_Model_Item extends Mage_Catalog_Model_Layer_Filter_Item {
37
  // MANA_END
38
  Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
39
  );
 
 
 
40
  $params = array('_current'=>true, '_m_escape' => '', '_use_rewrite'=>true, '_query'=>$query, '_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
41
  return Mage::helper('mana_filters')->markLayeredNavigationUrl(Mage::getUrl('*/*/*', $params), '*/*/*', $params);
42
  }
@@ -61,6 +64,9 @@ class Mana_Filters_Model_Item extends Mage_Catalog_Model_Layer_Filter_Item {
61
  // MANA_END
62
  Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
63
  );
 
 
 
64
  $params = array('_current'=>true, '_m_escape' => '', '_use_rewrite'=>true, '_query'=>$query, '_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
65
  return Mage::helper('mana_filters')->markLayeredNavigationUrl(Mage::getUrl('*/*/*', $params), '*/*/*', $params);
66
  }
@@ -86,9 +92,15 @@ class Mana_Filters_Model_Item extends Mage_Catalog_Model_Layer_Filter_Item {
86
  $this->getFilter()->getRequestVar()=>implode('_', $values),
87
  Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
88
  );
 
 
 
89
  }
90
  else {
91
  $query = array($this->getFilter()->getRequestVar()=>$this->getFilter()->getResetValue());
 
 
 
92
  }
93
  // MANA END
94
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
@@ -134,7 +146,7 @@ class Mana_Filters_Model_Item extends Mage_Catalog_Model_Layer_Filter_Item {
134
  'url' => $this->getValue(),
135
  'prefix' => '',
136
  'position' => 0,
137
- 'id' => 0,
138
  );
139
  }
140
  }
@@ -150,4 +162,22 @@ class Mana_Filters_Model_Item extends Mage_Catalog_Model_Layer_Filter_Item {
150
  return Mage::helper('core')->escapeHtml($this->getLabel());
151
  }
152
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
37
  // MANA_END
38
  Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
39
  );
40
+ if ($this->coreHelper()->isManadevDependentFilterInstalled() && $this->dependentHelper()->areDependentFiltersClearedOnParentFilterChange()) {
41
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getFilter()->getRequestVar());
42
+ }
43
  $params = array('_current'=>true, '_m_escape' => '', '_use_rewrite'=>true, '_query'=>$query, '_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
44
  return Mage::helper('mana_filters')->markLayeredNavigationUrl(Mage::getUrl('*/*/*', $params), '*/*/*', $params);
45
  }
64
  // MANA_END
65
  Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
66
  );
67
+ if ($this->coreHelper()->isManadevDependentFilterInstalled() && $this->dependentHelper()->areDependentFiltersClearedOnParentFilterChange()) {
68
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getFilter()->getRequestVar());
69
+ }
70
  $params = array('_current'=>true, '_m_escape' => '', '_use_rewrite'=>true, '_query'=>$query, '_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
71
  return Mage::helper('mana_filters')->markLayeredNavigationUrl(Mage::getUrl('*/*/*', $params), '*/*/*', $params);
72
  }
92
  $this->getFilter()->getRequestVar()=>implode('_', $values),
93
  Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
94
  );
95
+ if ($this->coreHelper()->isManadevDependentFilterInstalled() && $this->dependentHelper()->areDependentFiltersClearedOnParentFilterChange()) {
96
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getFilter()->getRequestVar());
97
+ }
98
  }
99
  else {
100
  $query = array($this->getFilter()->getRequestVar()=>$this->getFilter()->getResetValue());
101
+ if ($this->coreHelper()->isManadevDependentFilterInstalled()) {
102
+ $query = $this->dependentHelper()->removeDependentFiltersFromUrl($query, $this->getFilter()->getRequestVar());
103
+ }
104
  }
105
  // MANA END
106
  $params = array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure());
146
  'url' => $this->getValue(),
147
  'prefix' => '',
148
  'position' => 0,
149
+ 'id' => $this->getValue(),
150
  );
151
  }
152
  }
162
  return Mage::helper('core')->escapeHtml($this->getLabel());
163
  }
164
  }
165
+
166
+ #region Dependencies
167
+
168
+ /**
169
+ * @return Mana_Core_Helper_Data
170
+ */
171
+ public function coreHelper() {
172
+ return Mage::helper('mana_core');
173
+ }
174
+
175
+ /**
176
+ * @return ManaPro_FilterDependent_Helper_Data
177
+ */
178
+ public function dependentHelper() {
179
+ return Mage::helper('manapro_filterdependent');
180
+ }
181
+
182
+ #endregion
183
  }
app/code/local/Mana/Filters/Model/Query.php CHANGED
@@ -91,6 +91,7 @@ class Mana_Filters_Model_Query extends Varien_Object
91
  }
92
  return $this;
93
  }
 
94
  protected function _apply() {
95
  }
96
 
@@ -158,6 +159,7 @@ class Mana_Filters_Model_Query extends Varien_Object
158
  $mainSelect = clone $this->_productCollection->getSelect();
159
 
160
  $collection = $this->createProductCollection();
 
161
  foreach ($this->_filters as $filter) {
162
  /* @var $filterModel Mana_Filters_Interface_Filter */
163
  $filterModel = $filter['model'];
@@ -179,68 +181,6 @@ class Mana_Filters_Model_Query extends Varien_Object
179
  return $currentFilter['processedCounts'];
180
  }
181
 
182
- protected $_allOptimizedAttributeFilterCounts;
183
-
184
- public function getAllOptimizedAttributeFilterCounts() {
185
- if (!$this->_allOptimizedAttributeFilterCounts) {
186
- $attributeIds = array();
187
- $firstModel = null;
188
- /* @var $firstModel Mana_Filters_Model_Filter_Attribute */
189
-
190
- foreach ($this->_filters as $filter) {
191
- $model = $filter['model'];
192
-
193
- if ($this->isOptimizedAttributeFilter($model)) {
194
- if (!$firstModel) {
195
- $firstModel = $model;
196
- }
197
-
198
- /* @var $model Mana_Filters_Model_Filter_Attribute */
199
- $id = $model->getAttributeModel()->getId();
200
- $attributeIds[$id] = $id;
201
- }
202
- }
203
-
204
- $mainSelect = clone $this->_productCollection->getSelect();
205
-
206
- $collection = $this->createProductCollection();
207
-
208
- foreach ($this->_filters as $filter) {
209
- if ($filter['isApplied']) {
210
- /* @var $filterModel Mana_Filters_Interface_Filter */
211
- $filterModel = $filter['model'];
212
-
213
- $applyFilter = true;
214
- foreach ($this->_filters as $optimizedFilter) {
215
- /* @var $model Mana_Filters_Model_Filter_Attribute */
216
- $model = $optimizedFilter['model'];
217
- if ($this->isOptimizedAttributeFilter($model) && !$model->isFilterAppliedWhenCounting($filterModel)) {
218
- $applyFilter = false;
219
- break;
220
- }
221
- }
222
-
223
- if ($applyFilter) {
224
- $filterModel->applyToCollection($collection);
225
- }
226
- }
227
- }
228
-
229
- $this->_allOptimizedAttributeFilterCounts = $firstModel
230
- ? $firstModel->optimizedCountOnCollection($collection, $attributeIds)
231
- : array();
232
- $this->_copyParts($this->_productCollection->getSelect(), $mainSelect);
233
-
234
- }
235
- return $this->_allOptimizedAttributeFilterCounts;
236
- }
237
-
238
- public function isOptimizedAttributeFilter($model) {
239
- return !$this->filtersHelper()->useSolr() &&
240
- $model instanceof Mana_Filters_Model_Filter_Attribute &&
241
- !$model->isApplied();
242
- }
243
-
244
  #region Dependencies
245
 
246
  /**
91
  }
92
  return $this;
93
  }
94
+
95
  protected function _apply() {
96
  }
97
 
159
  $mainSelect = clone $this->_productCollection->getSelect();
160
 
161
  $collection = $this->createProductCollection();
162
+ //$sql = $collection->getSelect()->__toString();
163
  foreach ($this->_filters as $filter) {
164
  /* @var $filterModel Mana_Filters_Interface_Filter */
165
  $filterModel = $filter['model'];
181
  return $currentFilter['processedCounts'];
182
  }
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  #region Dependencies
185
 
186
  /**
app/code/local/Mana/Filters/Model/Solr/Adapter/HttpStream.php CHANGED
@@ -141,6 +141,16 @@ class Mana_Filters_Model_Solr_Adapter_HttpStream extends Enterprise_Search_Model
141
  return $this->_prepareFieldCondition($field, $part);
142
  }
143
 
 
 
 
 
 
 
 
 
 
 
144
  #region Dependencies
145
 
146
  /**
141
  return $this->_prepareFieldCondition($field, $part);
142
  }
143
 
144
+ protected function _prepareFacetConditions($facetFields) {
145
+ $result = parent::_prepareFacetConditions($facetFields);
146
+ if (isset($result['facet']) && $result['facet'] == 'on' &&
147
+ ($limit = Mage::getStoreConfig('mana_filters/general/solr_limit')) &&
148
+ is_numeric($limit))
149
+ {
150
+ $result['facet.limit'] = (int)$limit;
151
+ }
152
+ return $result;
153
+ }
154
  #region Dependencies
155
 
156
  /**
app/code/local/Mana/Filters/Model/Solr/Adapter/PhpExtension.php CHANGED
@@ -72,4 +72,15 @@ class Mana_Filters_Model_Solr_Adapter_PhpExtension extends Enterprise_Search_Mod
72
 
73
  return $result;
74
  }
 
 
 
 
 
 
 
 
 
 
 
75
  }
72
 
73
  return $result;
74
  }
75
+
76
+ protected function _prepareFacetConditions($facetFields) {
77
+ $result = parent::_prepareFacetConditions($facetFields);
78
+ if (isset($result['facet']) && $result['facet'] == 'on' &&
79
+ ($limit = Mage::getStoreConfig('mana_filters/general/solr_limit')) &&
80
+ is_numeric($limit))
81
+ {
82
+ $result['facet.limit'] = (int)$limit;
83
+ }
84
+ return $result;
85
+ }
86
  }
app/code/local/Mana/Filters/Model/Solr/Price.php CHANGED
@@ -285,7 +285,7 @@ class Mana_Filters_Model_Solr_Price extends Mana_Filters_Model_Filter_Price
285
  if (!is_numeric($max)) {
286
  return parent::getRangeOnCollection($collection);
287
  } else {
288
- $max = floor($max * $this->getCurrencyRate());
289
  }
290
 
291
  return compact('min', 'max');
285
  if (!is_numeric($max)) {
286
  return parent::getRangeOnCollection($collection);
287
  } else {
288
+ $max = $this->_ceil($max * $this->getCurrencyRate());
289
  }
290
 
291
  return compact('min', 'max');
app/code/local/Mana/Filters/Resource/Filter/Attribute.php CHANGED
@@ -20,6 +20,7 @@ class Mana_Filters_Resource_Filter_Attribute
20
  * @return mixed
21
  */
22
  public function countOnCollection($collection, $model) {
 
23
  $select = $collection->getSelect();
24
  // reset columns, order and limitation conditions
25
  $select->reset(Zend_Db_Select::COLUMNS);
@@ -46,7 +47,9 @@ class Mana_Filters_Resource_Filter_Attribute
46
  )
47
  ->group("{$tableAlias}.value");
48
 
49
- return $connection->fetchPairs($select);
 
 
50
  }
51
 
52
  /**
@@ -72,6 +75,7 @@ class Mana_Filters_Resource_Filter_Attribute
72
  'attribute_id' => new Zend_Db_Expr("`_oc_o`.`attribute_id`"),
73
  'label' => new Zend_Db_Expr("COALESCE(`_oc_ls`.`value`, `_oc_lg`.`value`)"),
74
  'value' => new Zend_Db_Expr("`_oc_o`.`option_id`"),
 
75
  'count' => new Zend_Db_Expr("COUNT(DISTINCT `_oc_idx`.`entity_id`)"),
76
  );
77
  $select
@@ -87,7 +91,8 @@ class Mana_Filters_Resource_Filter_Attribute
87
  $db->quoteInto("`_oc_idx`.`store_id` = ?", $storeId), null)
88
  ->where("`_oc_o`.`attribute_id` IN ($attributeIds)")
89
  ->columns($columns)
90
- ->group(array('attribute_id', 'label', 'value'));
 
91
 
92
  $sql = $select->__toString();
93
  return $db->fetchAll($select);
20
  * @return mixed
21
  */
22
  public function countOnCollection($collection, $model) {
23
+ //Mana_Core_Profiler2::logQueries(true);
24
  $select = $collection->getSelect();
25
  // reset columns, order and limitation conditions
26
  $select->reset(Zend_Db_Select::COLUMNS);
47
  )
48
  ->group("{$tableAlias}.value");
49
 
50
+ $result = $connection->fetchPairs($select);
51
+ //Mana_Core_Profiler2::logQueries(false);
52
+ return $result;
53
  }
54
 
55
  /**
75
  'attribute_id' => new Zend_Db_Expr("`_oc_o`.`attribute_id`"),
76
  'label' => new Zend_Db_Expr("COALESCE(`_oc_ls`.`value`, `_oc_lg`.`value`)"),
77
  'value' => new Zend_Db_Expr("`_oc_o`.`option_id`"),
78
+ 'sort_order' => new Zend_Db_Expr("`_oc_o`.`sort_order`"),
79
  'count' => new Zend_Db_Expr("COUNT(DISTINCT `_oc_idx`.`entity_id`)"),
80
  );
81
  $select
91
  $db->quoteInto("`_oc_idx`.`store_id` = ?", $storeId), null)
92
  ->where("`_oc_o`.`attribute_id` IN ($attributeIds)")
93
  ->columns($columns)
94
+ ->group(array('attribute_id', 'label', 'value', 'sort_order'))
95
+ ->order("sort_order ASC");
96
 
97
  $sql = $select->__toString();
98
  return $db->fetchAll($select);
app/code/local/Mana/Filters/Resource/Filter/Decimal.php CHANGED
@@ -37,11 +37,12 @@ class Mana_Filters_Resource_Filter_Decimal extends Mage_Catalog_Model_Resource_E
37
 
38
  $adapter = $this->_getReadAdapter();
39
 
40
- $countExpr = new Zend_Db_Expr("COUNT(*)");
41
  $rangeExpr = new Zend_Db_Expr("FLOOR(decimal_index.value / {$model->getRange()}) + 1");
42
 
43
  $select->columns(array('range' => $rangeExpr, 'count' => $countExpr));
44
  $select->group('range');
 
45
 
46
  return $adapter->fetchPairs($select);
47
  }
37
 
38
  $adapter = $this->_getReadAdapter();
39
 
40
+ $countExpr = new Zend_Db_Expr("COUNT(DISTINCT e.entity_id)");
41
  $rangeExpr = new Zend_Db_Expr("FLOOR(decimal_index.value / {$model->getRange()}) + 1");
42
 
43
  $select->columns(array('range' => $rangeExpr, 'count' => $countExpr));
44
  $select->group('range');
45
+ //$sql = $select->__toString();
46
 
47
  return $adapter->fetchPairs($select);
48
  }
app/code/local/Mana/Filters/Resource/Filter2.php CHANGED
@@ -62,6 +62,9 @@ class Mana_Filters_Resource_Filter2 extends Mana_Db_Resource_Object {
62
  const DM_COLOR_STATE_DISPLAY = 39;
63
  const DM_MIN_SLIDER_CODE = 40;
64
 
 
 
 
65
  #endregion
66
 
67
  /**
@@ -337,4 +340,31 @@ class Mana_Filters_Resource_Filter2 extends Mana_Db_Resource_Object {
337
  $object->setHadValueData(true);
338
  return parent::_afterSave($object);
339
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  }
62
  const DM_COLOR_STATE_DISPLAY = 39;
63
  const DM_MIN_SLIDER_CODE = 40;
64
 
65
+ const DM_SHOW_OPTION_SEARCH = 41;
66
+ const DM_INCLUDE_IN_CANONICAL_URL = 42;
67
+
68
  #endregion
69
 
70
  /**
340
  $object->setHadValueData(true);
341
  return parent::_afterSave($object);
342
  }
343
+
344
+ /**
345
+ * @param Mana_Filters_Model_Filter2 $filter
346
+ * @return bool|int
347
+ */
348
+ public function getAttributeId($filter) {
349
+ $db = $this->_getReadAdapter();
350
+
351
+ if ($filter->getType() != 'category') {
352
+ return $db->fetchOne($db->select()
353
+ ->from(array('a' => $this->getTable('eav/attribute')), 'attribute_id')
354
+ ->joinInner(
355
+ array('t' => $this->getTable('eav/entity_type')),
356
+ "`t`.`entity_type_id` = `a`.`entity_type_id` AND `t`.`entity_type_code` = 'catalog_product'",
357
+ null
358
+ )
359
+ ->joinInner(
360
+ array('ca' => $this->getTable('catalog/eav_attribute')),
361
+ "`ca`.`attribute_id` = `a`.`attribute_id`",
362
+ null
363
+ )
364
+ ->where('a.attribute_code = ?', $filter->getCode()));
365
+ }
366
+ else {
367
+ return false;
368
+ }
369
+ }
370
  }
app/code/local/Mana/Filters/Resource/Filter2/Store.php CHANGED
@@ -212,5 +212,48 @@ class Mana_Filters_Resource_Filter2_Store extends Mana_Filters_Resource_Filter2
212
  $select->columns("global.type AS type");
213
  $result->addColumn('type');
214
  }
 
 
 
 
215
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  }
212
  $select->columns("global.type AS type");
213
  $result->addColumn('type');
214
  }
215
+
216
+ if ($this->coreHelper()->isManadevDependentFilterInstalled()) {
217
+ $this->getDependentFilterVirtualColumnsResource()->addToModel($this, $select, $result, $columns, $globalEntityName);
218
+ }
219
  }
220
+ /**
221
+ * @param Mana_Filters_Model_Filter2_Store $filter
222
+ * @return bool|int
223
+ */
224
+ public function getAttributeId($filter) {
225
+ $db = $this->_getReadAdapter();
226
+
227
+ return $db->fetchOne($db->select()
228
+ ->from(array('a' => $this->getTable('eav/attribute')), 'attribute_id')
229
+ ->joinInner(array('f' => $this->getTable('mana_filters/filter2')), "a.attribute_code = f.code", null)
230
+ ->joinInner(
231
+ array('t' => $this->getTable('eav/entity_type')),
232
+ "`t`.`entity_type_id` = `a`.`entity_type_id` AND `t`.`entity_type_code` = 'catalog_product'",
233
+ null
234
+ )
235
+ ->joinInner(
236
+ array('ca' => $this->getTable('catalog/eav_attribute')),
237
+ "`ca`.`attribute_id` = `a`.`attribute_id`",
238
+ null
239
+ )
240
+ ->where('f.id = ?', $filter->getGlobalId()));
241
+ }
242
+
243
+ #region Dependencies
244
+
245
+ /**
246
+ * @return Mana_Core_Helper_Data
247
+ */
248
+ public function coreHelper() {
249
+ return Mage::helper('mana_core');
250
+ }
251
+
252
+ /**
253
+ * @return ManaPro_FilterDependent_Resource_VirtualColumns
254
+ */
255
+ public function getDependentFilterVirtualColumnsResource() {
256
+ return Mage::getResourceSingleton('manapro_filterdependent/virtualColumns');
257
+ }
258
+ #endregion
259
  }
app/code/local/Mana/Filters/Resource/Filter2/Store/Collection.php CHANGED
@@ -13,6 +13,9 @@
13
  * @author Mana Team
14
  */
15
  class Mana_Filters_Resource_Filter2_Store_Collection extends Mana_Filters_Resource_Filter2_Collection {
 
 
 
16
  /**
17
  * Invoked during resource collection model creation process, this method associates this
18
  * resource collection model with model class and with resource model class
@@ -43,6 +46,10 @@ class Mana_Filters_Resource_Filter2_Store_Collection extends Mana_Filters_Resour
43
  $select->columns("global.type AS type");
44
  $result->addColumn('type');
45
  }
 
 
 
 
46
  }
47
  public function addGlobalFields($fields) {
48
  $select = $this->_select;
@@ -56,4 +63,21 @@ class Mana_Filters_Resource_Filter2_Store_Collection extends Mana_Filters_Resour
56
  }
57
  return $this;
58
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
13
  * @author Mana Team
14
  */
15
  class Mana_Filters_Resource_Filter2_Store_Collection extends Mana_Filters_Resource_Filter2_Collection {
16
+ protected $_eventPrefix = 'mana_filter_store_collection';
17
+ protected $_eventObject = 'collection';
18
+
19
  /**
20
  * Invoked during resource collection model creation process, this method associates this
21
  * resource collection model with model class and with resource model class
46
  $select->columns("global.type AS type");
47
  $result->addColumn('type');
48
  }
49
+
50
+ if ($this->coreHelper()->isManadevDependentFilterInstalled()) {
51
+ $this->getDependentFilterVirtualColumnsResource()->addToCollection($select, $result, $columns, $globalEntityName);
52
+ }
53
  }
54
  public function addGlobalFields($fields) {
55
  $select = $this->_select;
63
  }
64
  return $this;
65
  }
66
+
67
+ #region Dependencies
68
+
69
+ /**
70
+ * @return Mana_Core_Helper_Data
71
+ */
72
+ public function coreHelper() {
73
+ return Mage::helper('mana_core');
74
+ }
75
+
76
+ /**
77
+ * @return ManaPro_FilterDependent_Resource_VirtualColumns
78
+ */
79
+ public function getDependentFilterVirtualColumnsResource() {
80
+ return Mage::getResourceSingleton('manapro_filterdependent/virtualColumns');
81
+ }
82
+ #endregion
83
  }
app/code/local/Mana/Filters/Resource/Filter2/Value.php CHANGED
@@ -23,6 +23,23 @@ class Mana_Filters_Resource_Filter2_Value extends Mana_Db_Resource_Object {
23
  const DM_SELECTED_HOVERED_IMAGE = 6;
24
  const DM_STATE_IMAGE = 7;
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  #endregion
27
 
28
  public function loadByFilterPosition($object, $filterId, $position)
23
  const DM_SELECTED_HOVERED_IMAGE = 6;
24
  const DM_STATE_IMAGE = 7;
25
 
26
+ const DM_CONTENT_IS_ACTIVE = 8;
27
+ const DM_CONTENT_IS_INITIALIZED = 9;
28
+ const DM_CONTENT_STOP_FURTHER_PROCESSING = 10;
29
+ const DM_CONTENT_META_TITLE = 11;
30
+ const DM_CONTENT_META_KEYWORDS = 12;
31
+ const DM_CONTENT_META_DESCRIPTION = 13;
32
+ const DM_CONTENT_META_ROBOTS = 14;
33
+ const DM_CONTENT_TITLE = 15;
34
+ const DM_CONTENT_SUBTITLE = 16;
35
+ const DM_CONTENT_DESCRIPTION = 17;
36
+ const DM_CONTENT_ADDITIONAL_DESCRIPTION = 18;
37
+ const DM_CONTENT_LAYOUT_XML = 19;
38
+ const DM_CONTENT_WIDGET_LAYOUT_XML = 20;
39
+ const DM_CONTENT_PRIORITY = 21;
40
+ const DM_CONTENT_COMMON_DIRECTIVES = 22;
41
+ const DM_CONTENT_BACKGROUND_IMAGE = 23;
42
+
43
  #endregion
44
 
45
  public function loadByFilterPosition($object, $filterId, $position)
app/code/local/Mana/Filters/Resource/Item.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Filters
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ class Mana_Filters_Resource_Item extends Mage_Core_Model_Mysql4_Abstract {
13
+ /**
14
+ * @param Mana_Filters_Model_Filter_Attribute $filter
15
+ * @return Varien_Db_Select
16
+ */
17
+ public function selectItems($filter) {
18
+ }
19
+
20
+ /**
21
+ * @param Mana_Filters_Model_Filter_Attribute $filter
22
+ * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
23
+ * @return Varien_Db_Select
24
+ */
25
+ public function countItems($filter, $collection) {
26
+ $select = $collection->getSelect();
27
+ $select->reset(Zend_Db_Select::COLUMNS);
28
+ $select->reset(Zend_Db_Select::ORDER);
29
+ $select->reset(Zend_Db_Select::GROUP);
30
+ $select->reset(Zend_Db_Select::LIMIT_COUNT);
31
+ $select->reset(Zend_Db_Select::LIMIT_OFFSET);
32
+
33
+ $db = $this->_getReadAdapter();
34
+ $attribute = $filter->getAttributeModel();
35
+
36
+ $selectedOptionIds = $filter->getMSelectedValues();
37
+ $isSelectedExpr = count($selectedOptionIds) ? "`eav`.`value` IN (" . implode(', ', $selectedOptionIds). ")" : "NULL";
38
+
39
+ $fields = array(
40
+ 'sort_order' => new Zend_Db_Expr("`o`.`sort_order`"),
41
+ 'value' => new Zend_Db_Expr("`eav`.`value`"),
42
+ 'label' => new Zend_Db_Expr("COALESCE(`vs`.`value`, `vg`.`value`)"),
43
+ 'm_selected' => new Zend_Db_Expr($isSelectedExpr),
44
+ 'm_show_selected' => new Zend_Db_Expr($filter->getFilterOptions()->getIsReverse()
45
+ ? "NOT ($isSelectedExpr)"
46
+ : $isSelectedExpr),
47
+ );
48
+ $select
49
+ ->joinInner(array('eav' => $this->getTable('catalog/product_index_eav')),
50
+ "`eav`.`entity_id` = `e`.`entity_id` AND
51
+ {$db->quoteInto("`eav`.`attribute_id` = ?", $attribute->getAttributeId())} AND
52
+ {$db->quoteInto("`eav`.`store_id` = ?", $filter->getStoreId())}",
53
+ array('count' => "COUNT(DISTINCT `eav`.`entity_id`)")
54
+ )
55
+ ->joinInner(array('o' => $this->getTable('eav/attribute_option')),
56
+ "`o`.`option_id` = `eav`.`value`", null)
57
+ ->joinInner(array('vg' => $this->getTable('eav/attribute_option_value')),
58
+ $db->quoteInto("`vg`.`option_id` = `eav`.`value` AND `vg`.`store_id` = ?", 0), null)
59
+ ->joinLeft(array('vs' => $this->getTable('eav/attribute_option_value')),
60
+ $db->quoteInto("`vs`.`option_id` = `eav`.`value` AND `vs`.`store_id` = ?", $filter->getStoreId()), null)
61
+ ->columns($fields)
62
+ ->group($fields);
63
+
64
+ //$sql = $select->__toString();
65
+ return $select;
66
+
67
+ }
68
+
69
+ /**
70
+ * @param Varien_Db_Select $select
71
+ * @return array
72
+ */
73
+ public function fetch($select) {
74
+ $db = $this->_getReadAdapter();
75
+ return $db->fetchAll($select);
76
+ }
77
+
78
+ /**
79
+ * Resource initialization
80
+ */
81
+ protected function _construct() {
82
+ $this->_setResource('catalog');
83
+ }
84
+ }
app/code/local/Mana/Filters/Resource/ItemAdditionalInfo.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Filters
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://www.manadev.com/license Proprietary License
7
+ */
8
+ /**
9
+ * @author Mana Team
10
+ *
11
+ */
12
+ abstract class Mana_Filters_Resource_ItemAdditionalInfo extends Mage_Core_Model_Mysql4_Abstract
13
+ {
14
+ /**
15
+ * @param Varien_Db_Select $select
16
+ * @param Mana_Filters_Model_Filter_Attribute $filter
17
+ * @return mixed
18
+ */
19
+ abstract public function selectItems($select, $filter);
20
+
21
+ /**
22
+ * @param Varien_Db_Select $select
23
+ * @param Mana_Filters_Model_Filter_Attribute $filter
24
+ * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
25
+ * @return mixed
26
+ */
27
+ abstract public function countItems($select, $filter, $collection);
28
+
29
+ /**
30
+ * Resource initialization
31
+ */
32
+ protected function _construct() {
33
+ $this->_setResource('catalog');
34
+ }
35
+ }
app/code/local/Mana/Filters/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  <Mana_Filters>
13
  <!-- This version number identifies version of database tables specific to this extension. It is written to
14
  core_resource table. -->
15
- <version>13.12.03.10</version>
16
  </Mana_Filters>
17
  </modules>
18
 
12
  <Mana_Filters>
13
  <!-- This version number identifies version of database tables specific to this extension. It is written to
14
  core_resource table. -->
15
+ <version>14.06.13.09</version>
16
  </Mana_Filters>
17
  </modules>
18
 
app/design/adminhtml/default/default/layout/mana_core.xml CHANGED
@@ -46,6 +46,11 @@ examples on what kind of actions can be applied to referenced blocks.
46
  <name>m_wait</name>
47
  <template>mana/core/wait.phtml</template>
48
  </action>
 
 
 
 
 
49
  </reference>
50
  </jquery_core>
51
  <jquery_basic_effects>
46
  <name>m_wait</name>
47
  <template>mana/core/wait.phtml</template>
48
  </action>
49
+ <action method="addSingletonBlock">
50
+ <type>core/template</type>
51
+ <name>m_popup</name>
52
+ <template>mana/core/popup.phtml</template>
53
+ </action>
54
  </reference>
55
  </jquery_core>
56
  <jquery_basic_effects>
app/design/adminhtml/default/default/template/mana/core/popup.phtml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Core
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ /* @var $this Mage_Core_Block_Template */
9
+ ?>
10
+ <div id="m-popup" class="m-popup" style="display:none;">
11
+ </div>
12
+
app/design/frontend/base/default/layout/mana_filters.xml CHANGED
@@ -59,4 +59,17 @@ examples on what kind of actions can be applied to referenced blocks.
59
  <block type="core/template" name="cms.products" template="mana/filters/cms.phtml" />
60
  </reference>
61
  </cms_page_layered>
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  </layout>
59
  <block type="core/template" name="cms.products" template="mana/filters/cms.phtml" />
60
  </reference>
61
  </cms_page_layered>
62
+ <mana_optionpage_view> <!-- find all category pages with layered navigation -->
63
+ <reference name="left"> <!-- find left column block -->
64
+ <remove name="catalog.leftnav"/> <!-- remove standard layered navigation -->
65
+ <remove name="enterprisecatalog.leftnav"/> <!-- remove enterprise layered navigation -->
66
+ <block type="mana_filters/view" name="mana.catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
67
+ </reference>
68
+ <reference name="head">
69
+ <action method="addCss"><stylesheet>css/mana_filters.css</stylesheet></action>
70
+ </reference>
71
+ <reference name="mana.catalog.leftnav">
72
+ <action method="setTemplate" ifconfig="mana_filters/advanced/enabled"><template>manapro/filteradvanced/view.phtml</template></action>
73
+ </reference>
74
+ </mana_optionpage_view>
75
  </layout>
app/design/frontend/base/default/template/mana/filters/items/list.phtml CHANGED
@@ -14,6 +14,7 @@
14
  */
15
  /* @var $this Mana_Filters_Block_Filter_Attribute */
16
  ?>
 
17
  <ol class="m-filter-item-list <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>">
18
  <?php foreach ($this->getItems() as $_item): ?>
19
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
14
  */
15
  /* @var $this Mana_Filters_Block_Filter_Attribute */
16
  ?>
17
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'before_items', array('block' => $this)) ?>
18
  <ol class="m-filter-item-list <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>">
19
  <?php foreach ($this->getItems() as $_item): ?>
20
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
app/design/frontend/base/default/template/mana/filters/items/list_popup.phtml CHANGED
@@ -13,24 +13,19 @@
13
  /* @var $showmore ManaPro_FilterShowMore_Helper_Data */ $showmore = Mage::helper(strtolower('ManaPro_FilterShowMore'));
14
  /* @var $jsonHelper Mana_Core_Helper_Json */
15
  $jsonHelper = Mage::helper('mana_core/json');
16
- $MAX_ROW_COUNT = $showmore->getMaxRowCount(); // 20
17
- $MAX_COLUMN_COUNT = $showmore->getMaxColumnCount(); // 4
18
- $items = $this->getItems();
19
- list($rowCount, $columnCount) = $showmore->getPopupDimensions($items, $MAX_ROW_COUNT, $MAX_COLUMN_COUNT);
20
  ?>
21
  <div class="m-filter-popup">
22
- <ol class="m-rows" data-max-rows="<?php echo $MAX_ROW_COUNT ?>">
23
- <?php for($rowIndex = 0; $rowIndex < $rowCount; $rowIndex++) : ?>
24
  <li>
25
  <ol class="m-columns">
26
- <?php for ($columnIndex = 0; $columnIndex < $columnCount; $columnIndex++) : if ($columnIndex * $rowCount + $rowIndex < count($items)) : ?>
27
- <?php $_item = $items[$columnIndex * $rowCount + $rowIndex]; ?>
28
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
29
  <?php //if ($_item->getCount() > 0): ?>
30
  <a href="#" title="<?php echo $this->escapeHtml($_item->getLabel()) ?>"
31
  data-item="<?php echo $jsonHelper->encodeAttribute($_item->getSeoData()) ?>"
32
  data-is-reverse="<?php echo $this->getFilterOptions()->getIsReverse() ?>"
33
- data-index="<?php echo $columnIndex * $rowCount + $rowIndex ?>">
34
  <span <?php if ($_item->getMShowSelected()): ?>class="m-selected-filter-item"<?php endif; ?> ><?php echo $this->escapeHtml($_item->getLabel()) ?></span>
35
  </a>
36
  <?php //else: echo $this->escapeHtml($_item->getLabel()); ?>
@@ -39,10 +34,9 @@ list($rowCount, $columnCount) = $showmore->getPopupDimensions($items, $MAX_ROW_C
39
  (<?php echo $_item->getCount() ?>)
40
  <?php endif; ?>
41
  </li>
42
- <?php endif; endfor; ?>
43
  </ol>
44
  </li>
45
- <?php endfor; ?>
46
  </ol>
47
  <div class="buttons-set">
48
  <button type="button" title="<?php echo $this->__('Close') ?>" class="button m-close">
13
  /* @var $showmore ManaPro_FilterShowMore_Helper_Data */ $showmore = Mage::helper(strtolower('ManaPro_FilterShowMore'));
14
  /* @var $jsonHelper Mana_Core_Helper_Json */
15
  $jsonHelper = Mage::helper('mana_core/json');
 
 
 
 
16
  ?>
17
  <div class="m-filter-popup">
18
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'before_popup_items', array('block' => $this)) ?>
19
+ <ol class="m-rows">
20
  <li>
21
  <ol class="m-columns">
22
+ <?php foreach ($this->getItems() as $_index => $_item) : /*@var $_item Mana_Filters_Model_Item */ ?>
 
23
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
24
  <?php //if ($_item->getCount() > 0): ?>
25
  <a href="#" title="<?php echo $this->escapeHtml($_item->getLabel()) ?>"
26
  data-item="<?php echo $jsonHelper->encodeAttribute($_item->getSeoData()) ?>"
27
  data-is-reverse="<?php echo $this->getFilterOptions()->getIsReverse() ?>"
28
+ data-index="<?php echo $_index ?>">
29
  <span <?php if ($_item->getMShowSelected()): ?>class="m-selected-filter-item"<?php endif; ?> ><?php echo $this->escapeHtml($_item->getLabel()) ?></span>
30
  </a>
31
  <?php //else: echo $this->escapeHtml($_item->getLabel()); ?>
34
  (<?php echo $_item->getCount() ?>)
35
  <?php endif; ?>
36
  </li>
37
+ <?php endforeach; ?>
38
  </ol>
39
  </li>
 
40
  </ol>
41
  <div class="buttons-set">
42
  <button type="button" title="<?php echo $this->__('Close') ?>" class="button m-close">
app/design/frontend/base/default/template/mana/filters/items/standard.phtml CHANGED
@@ -14,6 +14,7 @@
14
  */
15
  /* @var $this Mana_Filters_Block_Filter_Attribute */
16
  ?>
 
17
  <ol class="m-filter-item-list <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>">
18
  <?php foreach ($this->getItems() as $_item): ?>
19
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
14
  */
15
  /* @var $this Mana_Filters_Block_Filter_Attribute */
16
  ?>
17
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'before_items', array('block' => $this)) ?>
18
  <ol class="m-filter-item-list <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>">
19
  <?php foreach ($this->getItems() as $_item): ?>
20
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
app/design/frontend/base/default/template/mana/filters/items/standard_popup.phtml CHANGED
@@ -8,23 +8,18 @@
8
  /**
9
  * @author Mana Team
10
  */
11
- /* @var $this Mana_Filters_Block_Filter_Attribute */
12
  /* @var $filters Mana_Filters_Helper_Data */ $filters = Mage::helper(strtolower('Mana_Filters'));
13
  /* @var $showmore ManaPro_FilterShowMore_Helper_Data */ $showmore = Mage::helper(strtolower('ManaPro_FilterShowMore'));
14
  /* @var $jsonHelper Mana_Core_Helper_Json */
15
  $jsonHelper = Mage::helper('mana_core/json');
16
- $MAX_ROW_COUNT = $showmore->getMaxRowCount(); // 20
17
- $MAX_COLUMN_COUNT = $showmore->getMaxColumnCount(); // 4
18
- $items = $this->getItems();
19
- list($rowCount, $columnCount) = $showmore->getPopupDimensions($items, $MAX_ROW_COUNT, $MAX_COLUMN_COUNT);
20
  ?>
21
  <div class="m-filter-popup">
22
- <ol class="m-rows" data-max-rows="<?php echo $MAX_ROW_COUNT ?>">
23
- <?php for($rowIndex = 0; $rowIndex < $rowCount; $rowIndex++) : ?>
24
  <li>
25
  <ol class="m-columns">
26
- <?php for ($columnIndex = 0; $columnIndex < $columnCount; $columnIndex++) : if ($columnIndex * $rowCount + $rowIndex < count($items)) : ?>
27
- <?php $_item = $items[$columnIndex * $rowCount + $rowIndex]; ?>
28
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
29
  <?php if ($_item->getMSelected()): ?>
30
  <span class="m-selected-filter-item"><?php echo $this->escapeHtml($_item->getLabel()) ?></span>
@@ -33,7 +28,7 @@ list($rowCount, $columnCount) = $showmore->getPopupDimensions($items, $MAX_ROW_C
33
  <a href="#" title="<?php echo $this->escapeHtml($_item->getLabel()) ?>"
34
  data-item="<?php echo $jsonHelper->encodeAttribute($_item->getSeoData()) ?>"
35
  data-is-reverse="<?php echo $this->getFilterOptions()->getIsReverse() ?>"
36
- data-index="<?php echo $columnIndex * $rowCount + $rowIndex ?>">
37
  <?php echo $this->escapeHtml($_item->getLabel()) ?></a>
38
  <?php else: echo $this->escapeHtml($_item->getLabel()) ?>
39
  <?php endif; ?>
@@ -42,9 +37,8 @@ list($rowCount, $columnCount) = $showmore->getPopupDimensions($items, $MAX_ROW_C
42
  (<?php echo $_item->getCount() ?>)
43
  <?php endif; ?>
44
  </li>
45
- <?php endif; endfor; ?>
46
  </ol>
47
  </li>
48
- <?php endfor; ?>
49
  </ol>
50
  </div>
8
  /**
9
  * @author Mana Team
10
  */
11
+ /* @var $this Mana_Filters_Block_Filter */
12
  /* @var $filters Mana_Filters_Helper_Data */ $filters = Mage::helper(strtolower('Mana_Filters'));
13
  /* @var $showmore ManaPro_FilterShowMore_Helper_Data */ $showmore = Mage::helper(strtolower('ManaPro_FilterShowMore'));
14
  /* @var $jsonHelper Mana_Core_Helper_Json */
15
  $jsonHelper = Mage::helper('mana_core/json');
 
 
 
 
16
  ?>
17
  <div class="m-filter-popup">
18
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'before_popup_items', array('block' => $this)) ?>
19
+ <ol class="m-rows">
20
  <li>
21
  <ol class="m-columns">
22
+ <?php foreach ($this->getItems() as $_index => $_item) : /*@var $_item Mana_Filters_Model_Item */ ?>
 
23
  <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
24
  <?php if ($_item->getMSelected()): ?>
25
  <span class="m-selected-filter-item"><?php echo $this->escapeHtml($_item->getLabel()) ?></span>
28
  <a href="#" title="<?php echo $this->escapeHtml($_item->getLabel()) ?>"
29
  data-item="<?php echo $jsonHelper->encodeAttribute($_item->getSeoData()) ?>"
30
  data-is-reverse="<?php echo $this->getFilterOptions()->getIsReverse() ?>"
31
+ data-index="<?php echo $_index ?>">
32
  <?php echo $this->escapeHtml($_item->getLabel()) ?></a>
33
  <?php else: echo $this->escapeHtml($_item->getLabel()) ?>
34
  <?php endif; ?>
37
  (<?php echo $_item->getCount() ?>)
38
  <?php endif; ?>
39
  </li>
40
+ <?php endforeach; ?>
41
  </ol>
42
  </li>
 
43
  </ol>
44
  </div>
app/design/frontend/rwd/default/layout/mana_filters.xml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ @category Mana
4
+ @package Mana_Filters
5
+ @copyright Copyright (c) http://www.manadev.com
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ -->
8
+ <!-- BASED ON SNIPPET: Static Visuals/Empty layout file -->
9
+ <!-- This file defines the rules which should be applied when module mana_filters is installed and active. Typically,
10
+ rules consists of the following parts:
11
+ 1. You say on which types of pages you would like your changes to be applied (in Magento wording, you need to
12
+ specify layout handle), for example, layout handle "catalog_category_layered" selects all pages where
13
+ specific category products are shown and where layered navigation is enabled. Layout handle "default" selects
14
+ every each page rendered by Magento.
15
+ 2. You say in which blocks you would like to make the changes (in Magento wording you reference parent block).
16
+ 3. You say what changes you would like to apply to that block (you could specify to remove child blocks, to add
17
+ your own blocks, to invoke methods on referenced block).
18
+ Review standard Magento layout XML's for full list of available layout handles, blocks to be referenced, and for
19
+ examples on what kind of actions can be applied to referenced blocks.
20
+ -->
21
+ <layout version="0.1.0">
22
+ <catalog_category_layered> <!-- find all category pages with layered navigation -->
23
+ <reference name="left_first"> <!-- find left column block -->
24
+ <remove name="catalog.leftnav"/> <!-- remove standard layered navigation -->
25
+ <remove name="enterprisecatalog.leftnav"/> <!-- remove enterprise layered navigation -->
26
+ <block type="mana_filters/view" name="mana.catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
27
+ </reference>
28
+ <reference name="head">
29
+ <action method="addCss"><stylesheet>css/mana_filters.css</stylesheet></action>
30
+ </reference>
31
+ <reference name="mana.catalog.leftnav">
32
+ <action method="setTemplate" ifconfig="mana_filters/advanced/enabled"><template>manapro/filteradvanced/view.phtml</template></action>
33
+ </reference>
34
+ </catalog_category_layered>
35
+ <catalogsearch_result_index> <!-- find all catalog search result page -->
36
+ <reference name="left_first"> <!-- find left column block -->
37
+ <remove name="catalogsearch.leftnav"/> <!-- remove standard layered navigation -->
38
+ <remove name="enterprisesearch.leftnav"/> <!-- remove enterprise layered navigation -->
39
+ <block type="mana_filters/search" name="mana.catalogsearch.leftnav" before="-" template="catalog/layer/view.phtml"/>
40
+ </reference>
41
+ <reference name="head">
42
+ <action method="addCss"><stylesheet>css/mana_filters.css</stylesheet></action>
43
+ </reference>
44
+ <reference name="mana.catalogsearch.leftnav">
45
+ <action method="setTemplate" ifconfig="mana_filters/advanced/enabled"><template>manapro/filteradvanced/view.phtml</template></action>
46
+ </reference>
47
+ </catalogsearch_result_index>
48
+ <cms_page_layered>
49
+ <reference name="left_first"> <!-- find left column block -->
50
+ <block type="mana_filters/view" name="mana.catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
51
+ </reference>
52
+ <reference name="head">
53
+ <action method="addCss"><stylesheet>css/mana_filters.css</stylesheet></action>
54
+ </reference>
55
+ <reference name="mana.catalog.leftnav">
56
+ <action method="setTemplate" ifconfig="mana_filters/advanced/enabled"><template>manapro/filteradvanced/view.phtml</template></action>
57
+ </reference>
58
+ <reference name="content">
59
+ <block type="core/template" name="cms.products" template="mana/filters/cms.phtml" />
60
+ </reference>
61
+ </cms_page_layered>
62
+ <mana_optionpage_view> <!-- find all category pages with layered navigation -->
63
+ <reference name="left_first"> <!-- find left column block -->
64
+ <remove name="catalog.leftnav"/> <!-- remove standard layered navigation -->
65
+ <remove name="enterprisecatalog.leftnav"/> <!-- remove enterprise layered navigation -->
66
+ <block type="mana_filters/view" name="mana.catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
67
+ </reference>
68
+ <reference name="head">
69
+ <action method="addCss"><stylesheet>css/mana_filters.css</stylesheet></action>
70
+ </reference>
71
+ <reference name="mana.catalog.leftnav">
72
+ <action method="setTemplate" ifconfig="mana_filters/advanced/enabled"><template>manapro/filteradvanced/view.phtml</template></action>
73
+ </reference>
74
+ </mana_optionpage_view>
75
+ </layout>
app/design/frontend/rwd/default/template/mana/filters/items/list.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Filters
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ /**
9
+ * Template for showing options for filter as a HTML list
10
+ * @author Mana Team
11
+ * Injected instead of standard catalog/layer/filter.phtml in Mana_Filters_Block_Filter_Attribute constructor.
12
+ * This template is overridden by copying (template body was pasted from catalog/layer/filter.phtml
13
+ * and modified as needed). All changes are marked with comments.
14
+ */
15
+ /* @var $this Mana_Filters_Block_Filter_Attribute */
16
+ ?>
17
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'before_items', array('block' => $this)) ?>
18
+ <ol class="m-filter-item-list <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>">
19
+ <?php foreach ($this->getItems() as $_item): ?>
20
+ <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
21
+ <?php // MANA BEGIN ?>
22
+ <?php if ($_item->getMSelected()): ?>
23
+ <span class="m-selected-filter-item"><?php echo $this->escapeHtml($_item->getLabel()) ?>
24
+ <?php else : ?>
25
+ <?php if (!$this->getFilterOptions()->getDisableNoResultOptions() || $_item->getCount() > 0 || $_item->getMSelected()): ?>
26
+ <a href="<?php echo $this->urlEscape($_item->getUrl()) ?>" title="<?php echo $this->escapeHtml($_item->getLabel()) ?>"><?php echo $this->escapeHtml($_item->getLabel()) ?>
27
+ <?php else: ?>
28
+ <span><?php echo $this->escapeHtml($_item->getLabel()) ?>
29
+ <?php endif; ?>
30
+ <?php endif; ?>
31
+ <?php // MANA END ?>
32
+ <?php if (Mage::getStoreConfigFlag('mana_filters/display/count')) : ?>
33
+ <span class="count">(<?php echo $_item->getCount() ?>)</span>
34
+ <?php endif; ?>
35
+ <?php if ($_item->getMSelected()): ?>
36
+ </span>
37
+ <?php else : ?>
38
+ <?php if (!$this->getFilterOptions()->getDisableNoResultOptions() || $_item->getCount() > 0 || $_item->getMSelected()): ?>
39
+ </a>
40
+ <?php else: ?>
41
+ </span>
42
+ <?php endif; ?>
43
+ <?php endif; ?>
44
+ </li>
45
+ <?php endforeach ?>
46
+ </ol>
47
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'after_items', array('block' => $this)) ?>
app/design/frontend/rwd/default/template/mana/filters/items/standard.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Mana
4
+ * @package Mana_Filters
5
+ * @copyright Copyright (c) http://www.manadev.com
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ /**
9
+ * Template for showing options for filter as a HTML list
10
+ * @author Mana Team
11
+ * Injected instead of standard catalog/layer/filter.phtml in Mana_Filters_Block_Filter_Attribute constructor.
12
+ * This template is overridden by copying (template body was pasted from catalog/layer/filter.phtml
13
+ * and modified as needed). All changes are marked with comments.
14
+ */
15
+ /* @var $this Mana_Filters_Block_Filter_Attribute */
16
+ ?>
17
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'before_items', array('block' => $this)) ?>
18
+ <ol class="m-filter-item-list <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>">
19
+ <?php foreach ($this->getItems() as $_item): ?>
20
+ <li <?php if ($_item->getMShowSelected()): ?>class="m-selected-ln-item"<?php endif; ?>>
21
+ <?php // MANA BEGIN ?>
22
+ <?php if ($_item->getMSelected()): ?>
23
+ <span class="m-selected-filter-item"><?php echo $this->escapeHtml($_item->getLabel()) ?>
24
+ <?php else : ?>
25
+ <?php if (!$this->getFilterOptions()->getDisableNoResultOptions() || $_item->getCount() > 0 || $_item->getMSelected()): ?>
26
+ <a href="<?php echo $this->urlEscape($_item->getReplaceUrl()) ?>" title="<?php echo $this->escapeHtml($_item->getLabel()) ?>"><?php echo $this->escapeHtml($_item->getLabel()) ?>
27
+ <?php else: ?>
28
+ <span><?php echo $this->escapeHtml($_item->getLabel()) ?>
29
+ <?php endif; ?>
30
+ <?php endif; ?>
31
+ <?php // MANA END ?>
32
+ <?php if (Mage::getStoreConfigFlag('mana_filters/display/count')) : ?>
33
+ <span class="count">(<?php echo $_item->getCount() ?>)</span>
34
+ <?php endif; ?>
35
+ <?php if ($_item->getMSelected()): ?>
36
+ </span>
37
+ <?php else : ?>
38
+ <?php if (!$this->getFilterOptions()->getDisableNoResultOptions() || $_item->getCount() > 0 || $_item->getMSelected()): ?>
39
+ </a>
40
+ <?php else: ?>
41
+ </span>
42
+ <?php endif; ?>
43
+ <?php endif; ?>
44
+ </li>
45
+ <?php endforeach ?>
46
+ </ol>
47
+ <?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'after_items', array('block' => $this)) ?>
app/etc/modules/Mana_Filters.xml CHANGED
@@ -24,5 +24,10 @@
24
  <Mana_Db />
25
  </depends>
26
  </Mana_Filters>
 
 
 
 
 
27
  </modules>
28
  </config>
24
  <Mana_Db />
25
  </depends>
26
  </Mana_Filters>
27
+ <Mana_InfiniteScrolling>
28
+ <depends>
29
+ <Mana_Filters />
30
+ </depends>
31
+ </Mana_InfiniteScrolling>
32
  </modules>
33
  </config>
app/locale/en_US/Mana_Core.csv CHANGED
@@ -32,3 +32,13 @@
32
  "Use Default","Use Default"
33
  "Advices, Warnings and Messages","Advices, Warnings and Messages"
34
  "Global Configuration","Global Configuration"
 
 
 
 
 
 
 
 
 
 
32
  "Use Default","Use Default"
33
  "Advices, Warnings and Messages","Advices, Warnings and Messages"
34
  "Global Configuration","Global Configuration"
35
+ "You must call setData('store_id', ...) before calling load() on %s objects.","You must call setData('store_id', ...) before calling load() on %s objects."
36
+ "Quick Search Page","Quick Search Page"
37
+ "CMS Home Page","CMS Home Page"
38
+ "CMS Page","CMS Page"
39
+ "Category Page","Category Page"
40
+ "Enabled","Enabled"
41
+ "Disabled","Disabled"
42
+ "",""
43
+ "",""
44
+ "",""
js/jquery/jquery.js CHANGED
@@ -353,7 +353,7 @@ jQuery.extend = jQuery.fn.extend = function() {
353
  };
354
 
355
  jQuery.extend({
356
- noConflict: function( deep ) {
357
  if ( window.$ === jQuery ) {
358
  window.$ = _$;
359
  }
353
  };
354
 
355
  jQuery.extend({
356
+ noConflict: function( deep ) {
357
  if ( window.$ === jQuery ) {
358
  window.$ = _$;
359
  }
js/mana/core.js CHANGED
@@ -7,14 +7,16 @@
7
 
8
  ; // make JS merging easier
9
 
 
 
10
  var Mana = Mana || {};
11
 
12
- (function($, undefined) {
13
 
14
 
15
  $.extend(Mana, {
16
  _singletons: {},
17
- _defines: { jquery: $ },
18
 
19
  /**
20
  * Defines JavaScript class/module
@@ -50,6 +52,9 @@ var Mana = Mana || {};
50
  return result;
51
  },
52
  _resolveDefine: function(name) {
 
 
 
53
  return Mana._defines[name];
54
  },
55
 
@@ -136,7 +141,9 @@ var Mana = Mana || {};
136
  }
137
 
138
  });
139
- })(jQuery);
 
 
140
 
141
  /* Simple JavaScript Inheritance
142
  * By John Resig http://ejohn.org/
@@ -214,6 +221,7 @@ var Mana = Mana || {};
214
  };
215
  })();
216
 
 
217
  Mana.define('Mana/Core', ['jquery'], function ($) {
218
  return Mana.Object.extend('Mana/Core', {
219
  getClasses: function(element) {
@@ -262,11 +270,13 @@ Mana.define('Mana/Core', ['jquery'], function ($) {
262
  }
263
  });
264
  });
 
 
265
  Mana.define('Mana/Core/Config', ['jquery'], function ($) {
266
  return Mana.Object.extend('Mana/Core/Config', {
267
  _init: function () {
268
  this._data = {
269
- debug: true,
270
  showOverlay: true,
271
  showWait: true
272
  };
@@ -281,9 +291,17 @@ Mana.define('Mana/Core/Config', ['jquery'], function ($) {
281
  set: function (data) {
282
  $.extend(this._data, data);
283
  return this;
284
- }
 
 
 
 
 
 
285
  });
286
  });
 
 
287
  Mana.define('Mana/Core/Json', ['jquery', 'singleton:Mana/Core'], function ($, core) {
288
  return Mana.Object.extend('Mana/Core/Json', {
289
  parse: function (what) {
@@ -308,6 +326,8 @@ Mana.define('Mana/Core/Json', ['jquery', 'singleton:Mana/Core'], function ($, co
308
  }
309
  });
310
  });
 
 
311
  Mana.define('Mana/Core/Utf8', [], function () {
312
  return Mana.Object.extend('Mana/Core/Utf8', {
313
  decode: function (str_data) {
@@ -355,6 +375,8 @@ Mana.define('Mana/Core/Utf8', [], function () {
355
  }
356
  });
357
  });
 
 
358
  Mana.define('Mana/Core/Base64', ['singleton:Mana/Core/Utf8'], function (utf8) {
359
  return Mana.Object.extend('Mana/Core/Base64', {
360
  encode: function (what) {
@@ -481,6 +503,8 @@ Mana.define('Mana/Core/Base64', ['singleton:Mana/Core/Utf8'], function (utf8) {
481
  }
482
  });
483
  });
 
 
484
  Mana.define('Mana/Core/UrlTemplate', ['singleton:Mana/Core/Base64', 'singleton:Mana/Core/Config'], function (base64, config) {
485
  return Mana.Object.extend('Mana/Core/UrlTemplate', {
486
  decodeAttribute: function (data) {
@@ -490,9 +514,39 @@ Mana.define('Mana/Core/UrlTemplate', ['singleton:Mana/Core/Base64', 'singleton:M
490
  else {
491
  return base64.decode(data.replace(/-/g, '+').replace(/_/g, '/').replace(/,/g, '='));
492
  }
 
 
 
493
  }
494
  });
495
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($, core, undefined) {
497
  return Mana.Object.extend('Mana/Core/Layout', {
498
  _init: function () {
@@ -504,6 +558,10 @@ Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($,
504
  getBlock: function (blockName) {
505
  return this._getBlockRecursively(this.getPageBlock(), blockName);
506
  },
 
 
 
 
507
  _getBlockRecursively: function (block, blockName) {
508
  if (block.getId() == blockName) {
509
  return block;
@@ -633,13 +691,25 @@ Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($,
633
  exists = true;
634
  delete namedBlocks[blockInfo.id];
635
  }
636
- else if (type) {
637
- block = new type();
 
 
 
 
 
 
 
 
638
  }
639
- block.setId(blockInfo.id);
640
  }
641
- else if (type) {
642
- block = new type();
 
 
 
 
 
643
  }
644
  if (block) {
645
  block.setElement(element);
@@ -656,9 +726,51 @@ Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($,
656
  return null;
657
  }
658
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
  showPopup: function (options) {
660
- var self = this;
661
 
 
662
  Mana.requireOptional([options.popup.blockName], function (PopupBlockClass) {
663
  var fadeoutCallback = options.fadeout.callback;
664
  options.fadeout.callback = function () {
@@ -669,20 +781,17 @@ Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($,
669
  });
670
  };
671
  var overlay = self.getPageBlock().showOverlay('m-popup-overlay', options.fadeout);
672
- var $popup = $('#m-popup');
673
  overlay.animate({ opacity: options.overlay.opacity }, options.fadein.overlayTime, function () {
674
- $popup
675
- .css({"width": "auto", "height": "auto"})
676
- .html(options.content);
677
-
678
- if (options.popup['class']) {
679
- $popup.addClass(options.popup['class']);
680
- }
681
  $popup.show();
682
 
683
  var popupBlock = new PopupBlockClass();
684
  popupBlock.setElement($popup[0]);
685
- popupBlock.prepare(options.popupBlock);
 
 
 
 
686
 
687
  $('.m-popup-overlay').on('click', function () {
688
  self.hidePopup();
@@ -739,6 +848,8 @@ Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($,
739
  }
740
  });
741
  });
 
 
742
  Mana.define('Mana/Core/Ajax', ['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Json',
743
  'singleton:Mana/Core', 'singleton:Mana/Core/Config'],
744
  function ($, layout, json, core, config, undefined)
@@ -751,10 +862,45 @@ function ($, layout, json, core, config, undefined)
751
  this._oldSetLocation = undefined;
752
  this._preventClicks = 0;
753
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
  get:function (url, callback, options) {
755
- var self = this;
756
  options = this._before(options, url);
757
- $.get(window.encodeURI(url))
758
  .done(function (response) { self._done(response, callback, options, url); })
759
  .fail(function (error) { self._fail(error, options, url)})
760
  .complete(function () { self._complete(options, url); });
@@ -951,6 +1097,7 @@ function ($, layout, json, core, config, undefined)
951
  _internalCallInterceptionCallback: function(url, element) {
952
  var interceptor = this._findMatchingInterceptor(url, element);
953
  if (interceptor) {
 
954
  interceptor.intercept(url, element);
955
  return false; // prevent default link click behavior
956
  }
@@ -989,10 +1136,22 @@ function ($, layout, json, core, config, undefined)
989
  this._matchedInterceptorCache[url] = interceptor;
990
  }
991
  return this._matchedInterceptorCache[url];
 
 
 
 
 
 
 
 
992
  }
993
  });
994
  });
995
- Mana.define('Mana/Core/Block', ['jquery', 'singleton:Mana/Core', 'singleton:Mana/Core/Layout'], function($, core, layout, undefined) {
 
 
 
 
996
  return Mana.Object.extend('Mana/Core/Block', {
997
  _init: function() {
998
  this._id = '';
@@ -1007,6 +1166,7 @@ Mana.define('Mana/Core/Block', ['jquery', 'singleton:Mana/Core', 'singleton:Mana
1007
  this._subscribeToHtmlEvents()._subscribeToBlockEvents();
1008
  },
1009
  _subscribeToHtmlEvents: function() {
 
1010
  return this;
1011
  },
1012
  _subscribeToBlockEvents:function () {
@@ -1205,9 +1365,33 @@ Mana.define('Mana/Core/Block', ['jquery', 'singleton:Mana/Core', 'singleton:Mana
1205
  this._text[key] = this.$().data(key + '-text');
1206
  }
1207
  return this._text[key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1208
  }
1209
  });
1210
  });
 
 
1211
  Mana.define('Mana/Core/PageBlock', ['jquery', 'Mana/Core/Block', 'singleton:Mana/Core/Config'],
1212
  function ($, Block, config)
1213
  {
@@ -1233,9 +1417,11 @@ function ($, Block, config)
1233
  return this
1234
  ._super()
1235
  .on('bind', this, function() {
 
1236
  $(window).on('resize', _raiseResize);
1237
  })
1238
  .on('unbind', this, function() {
 
1239
  $(window).off('resize', _raiseResize);
1240
  });
1241
 
@@ -1287,6 +1473,8 @@ function ($, Block, config)
1287
  }
1288
  });
1289
  });
 
 
1290
  Mana.require(['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Ajax'], function($, layout, ajax) {
1291
  function _generateBlocks() {
1292
  var vars = layout.beginGeneratingBlocks();
@@ -1296,10 +1484,35 @@ Mana.require(['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Ajax'
1296
  _generateBlocks();
1297
  ajax.startIntercepting();
1298
  });
1299
- //$(document).bind('m-ajax-after', _generateBlocks);
 
1300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1301
  });
1302
 
 
1303
  //region (Obsolete) additional jQuery functions used in MANAdev extensions
1304
  (function($) {
1305
  // this variables are private to this code block
@@ -1633,4 +1846,6 @@ Mana.require(['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Ajax'
1633
  };
1634
 
1635
  })(jQuery);
1636
- //endregion/
 
 
7
 
8
  ; // make JS merging easier
9
 
10
+
11
+
12
  var Mana = Mana || {};
13
 
14
+ (function($, $p, undefined) {
15
 
16
 
17
  $.extend(Mana, {
18
  _singletons: {},
19
+ _defines: { jquery: $, prototype: $p },
20
 
21
  /**
22
  * Defines JavaScript class/module
52
  return result;
53
  },
54
  _resolveDefine: function(name) {
55
+ if (Mana._defines[name] === undefined) {
56
+ console.warn("'" + name + "' is not defined");
57
+ }
58
  return Mana._defines[name];
59
  },
60
 
141
  }
142
 
143
  });
144
+ })(jQuery, $);
145
+
146
+
147
 
148
  /* Simple JavaScript Inheritance
149
  * By John Resig http://ejohn.org/
221
  };
222
  })();
223
 
224
+
225
  Mana.define('Mana/Core', ['jquery'], function ($) {
226
  return Mana.Object.extend('Mana/Core', {
227
  getClasses: function(element) {
270
  }
271
  });
272
  });
273
+
274
+
275
  Mana.define('Mana/Core/Config', ['jquery'], function ($) {
276
  return Mana.Object.extend('Mana/Core/Config', {
277
  _init: function () {
278
  this._data = {
279
+ debug: false,
280
  showOverlay: true,
281
  showWait: true
282
  };
291
  set: function (data) {
292
  $.extend(this._data, data);
293
  return this;
294
+ },
295
+ getBaseUrl: function (url) {
296
+ return url.indexOf(this.getData('url.base')) == 0
297
+ ? this.getData('url.base')
298
+ : this.getData('url.secureBase');
299
+ },
300
+
301
  });
302
  });
303
+
304
+
305
  Mana.define('Mana/Core/Json', ['jquery', 'singleton:Mana/Core'], function ($, core) {
306
  return Mana.Object.extend('Mana/Core/Json', {
307
  parse: function (what) {
326
  }
327
  });
328
  });
329
+
330
+
331
  Mana.define('Mana/Core/Utf8', [], function () {
332
  return Mana.Object.extend('Mana/Core/Utf8', {
333
  decode: function (str_data) {
375
  }
376
  });
377
  });
378
+
379
+
380
  Mana.define('Mana/Core/Base64', ['singleton:Mana/Core/Utf8'], function (utf8) {
381
  return Mana.Object.extend('Mana/Core/Base64', {
382
  encode: function (what) {
503
  }
504
  });
505
  });
506
+
507
+
508
  Mana.define('Mana/Core/UrlTemplate', ['singleton:Mana/Core/Base64', 'singleton:Mana/Core/Config'], function (base64, config) {
509
  return Mana.Object.extend('Mana/Core/UrlTemplate', {
510
  decodeAttribute: function (data) {
514
  else {
515
  return base64.decode(data.replace(/-/g, '+').replace(/_/g, '/').replace(/,/g, '='));
516
  }
517
+ },
518
+ encodeAttribute: function(data) {
519
+ return base64.encode(data).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ',');
520
  }
521
  });
522
  });
523
+
524
+
525
+ Mana.define('Mana/Core/StringTemplate', ['jquery'], function ($, undefined) {
526
+ return Mana.Object.extend('Mana/Core/StringTemplate', {
527
+ concat: function(parsedTemplate, vars) {
528
+ var result = '';
529
+ $.each(parsedTemplate, function(i, token) {
530
+ var type = token[0];
531
+ var text = token[1];
532
+ if (type == 'string') {
533
+ result += text;
534
+ }
535
+ else if (type == 'var') {
536
+ if (vars[text] !== undefined) {
537
+ result += vars[text];
538
+ }
539
+ else {
540
+ result += '{{' + text + '}}';
541
+ }
542
+ }
543
+ });
544
+ return result;
545
+ }
546
+ });
547
+ });
548
+
549
+
550
  Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($, core, undefined) {
551
  return Mana.Object.extend('Mana/Core/Layout', {
552
  _init: function () {
558
  getBlock: function (blockName) {
559
  return this._getBlockRecursively(this.getPageBlock(), blockName);
560
  },
561
+ getBlockForElement: function(el) {
562
+ var blockInfo = this._getElementBlockInfo(el);
563
+ return blockInfo ? this.getBlock(blockInfo.id) : null;
564
+ },
565
  _getBlockRecursively: function (block, blockName) {
566
  if (block.getId() == blockName) {
567
  return block;
691
  exists = true;
692
  delete namedBlocks[blockInfo.id];
693
  }
694
+ else {
695
+ if (type) {
696
+ block = new type();
697
+ }
698
+ else {
699
+ console.error("Block '" + blockInfo.typeName + "' is not defined");
700
+ }
701
+ }
702
+ if (block) {
703
+ block.setId(blockInfo.id);
704
  }
 
705
  }
706
+ else {
707
+ if (type) {
708
+ block = new type();
709
+ }
710
+ else {
711
+ console.error("Block '" + blockInfo.typeName + "' is not defined");
712
+ }
713
  }
714
  if (block) {
715
  block.setElement(element);
726
  return null;
727
  }
728
  },
729
+ preparePopup: function(options) {
730
+ options = this._preparePopupOptions(options);
731
+ if (options.$popup === undefined) {
732
+ var $popup = $('#m-popup');
733
+ $popup.css({"width": "auto", "height": "auto"});
734
+ if (core.isString(options.content)) {
735
+ $popup.html(options.content);
736
+ }
737
+ else {
738
+ $popup.html($(options.content).html());
739
+ }
740
+
741
+ if (options.popup['class']) {
742
+ $popup.addClass(options.popup['class']);
743
+ }
744
+
745
+ options.$popup = $popup;
746
+ }
747
+ return options.$popup;
748
+ },
749
+ _preparePopupOptions: function(options) {
750
+ var result = {
751
+ overlay: {
752
+ opacity: 0.2
753
+ },
754
+ popup: {
755
+ blockName: 'Mana/Core/PopupBlock'
756
+ },
757
+ popupBlock: {},
758
+ fadein: {
759
+ overlayTime: 0,
760
+ popupTime: 300
761
+ },
762
+ fadeout: {
763
+ overlayTime: 0,
764
+ popupTime: 500
765
+ }
766
+ };
767
+ $.extend(true, result, options);
768
+ return result;
769
+ },
770
  showPopup: function (options) {
771
+ options = this._preparePopupOptions(options);
772
 
773
+ var self = this;
774
  Mana.requireOptional([options.popup.blockName], function (PopupBlockClass) {
775
  var fadeoutCallback = options.fadeout.callback;
776
  options.fadeout.callback = function () {
781
  });
782
  };
783
  var overlay = self.getPageBlock().showOverlay('m-popup-overlay', options.fadeout);
784
+ var $popup = self.preparePopup(options);
785
  overlay.animate({ opacity: options.overlay.opacity }, options.fadein.overlayTime, function () {
 
 
 
 
 
 
 
786
  $popup.show();
787
 
788
  var popupBlock = new PopupBlockClass();
789
  popupBlock.setElement($popup[0]);
790
+ var vars = self.beginGeneratingBlocks(popupBlock);
791
+ self.endGeneratingBlocks(vars);
792
+ if (popupBlock.prepare) {
793
+ popupBlock.prepare(options.popupBlock);
794
+ }
795
 
796
  $('.m-popup-overlay').on('click', function () {
797
  self.hidePopup();
848
  }
849
  });
850
  });
851
+
852
+
853
  Mana.define('Mana/Core/Ajax', ['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Json',
854
  'singleton:Mana/Core', 'singleton:Mana/Core/Config'],
855
  function ($, layout, json, core, config, undefined)
862
  this._oldSetLocation = undefined;
863
  this._preventClicks = 0;
864
  },
865
+ _encodeUrl: function(url, options) {
866
+ if (options.encode) {
867
+ if (options.encode.offset !== undefined) {
868
+ if (options.encode.length === undefined) {
869
+ if (options.encode.offset === 0) {
870
+ return window.encodeURI(url.substr(options.encode.offset));
871
+ }
872
+ else {
873
+ return url.substr(0, options.encode.offset) +
874
+ window.encodeURI(url.substr(options.encode.offset));
875
+ }
876
+ }
877
+ else if (options.encode.length === 0) {
878
+ return url;
879
+ }
880
+ else {
881
+ if (options.encode.offset === 0) {
882
+ return window.encodeURI(url.substr(options.encode.offset, options.encode.length))
883
+ + url.substr(options.encode.offset + options.encode.length);
884
+ }
885
+ else {
886
+ return url.substr(0, options.encode.offset) +
887
+ window.encodeURI(url.substr(options.encode.offset, options.encode.length)) +
888
+ url.substr(options.encode.offset + options.encode.length);
889
+ }
890
+ }
891
+ }
892
+ else {
893
+ return url;
894
+ }
895
+ }
896
+ else {
897
+ return window.encodeURI(url);
898
+ }
899
+ },
900
  get:function (url, callback, options) {
901
+ var self = this, encodedUrl;
902
  options = this._before(options, url);
903
+ $.get(this._encodeUrl(url, options))
904
  .done(function (response) { self._done(response, callback, options, url); })
905
  .fail(function (error) { self._fail(error, options, url)})
906
  .complete(function () { self._complete(options, url); });
1097
  _internalCallInterceptionCallback: function(url, element) {
1098
  var interceptor = this._findMatchingInterceptor(url, element);
1099
  if (interceptor) {
1100
+ this.lastUrl = url;
1101
  interceptor.intercept(url, element);
1102
  return false; // prevent default link click behavior
1103
  }
1136
  this._matchedInterceptorCache[url] = interceptor;
1137
  }
1138
  return this._matchedInterceptorCache[url];
1139
+ },
1140
+ getDocumentUrl: function() {
1141
+ if (this.lastUrl) {
1142
+ return this.lastUrl;
1143
+ }
1144
+ else {
1145
+ return document.URL;
1146
+ }
1147
  }
1148
  });
1149
  });
1150
+
1151
+
1152
+ Mana.define('Mana/Core/Block', ['jquery', 'singleton:Mana/Core', 'singleton:Mana/Core/Layout',
1153
+ 'singleton:Mana/Core/Json'],
1154
+ function($, core, layout, json, undefined) {
1155
  return Mana.Object.extend('Mana/Core/Block', {
1156
  _init: function() {
1157
  this._id = '';
1166
  this._subscribeToHtmlEvents()._subscribeToBlockEvents();
1167
  },
1168
  _subscribeToHtmlEvents: function() {
1169
+ this._json = {};
1170
  return this;
1171
  },
1172
  _subscribeToBlockEvents:function () {
1365
  this._text[key] = this.$().data(key + '-text');
1366
  }
1367
  return this._text[key];
1368
+ },
1369
+ getJsonData: function(attributeName, fieldName) {
1370
+ if (this._json[attributeName] === undefined) {
1371
+ this._json[attributeName] = json.decodeAttribute(this.$().data(attributeName));
1372
+ }
1373
+ return fieldName === undefined ? this._json[attributeName] : this._json[attributeName][fieldName];
1374
+ }
1375
+ });
1376
+ });
1377
+
1378
+
1379
+ Mana.define('Mana/Core/PopupBlock', ['jquery', 'Mana/Core/Block', 'singleton:Mana/Core/Layout'], function ($, Block, layout) {
1380
+ return Block.extend('Mana/Core/PopupBlock', {
1381
+ prepare: function(options) {
1382
+ var self = this;
1383
+ this._host = options.host;
1384
+
1385
+ this.$().find('.btn-close').on('click', function() { return self._close(); });
1386
+ },
1387
+ _close: function() {
1388
+ layout.hidePopup();
1389
+ return false;
1390
  }
1391
  });
1392
  });
1393
+
1394
+
1395
  Mana.define('Mana/Core/PageBlock', ['jquery', 'Mana/Core/Block', 'singleton:Mana/Core/Config'],
1396
  function ($, Block, config)
1397
  {
1417
  return this
1418
  ._super()
1419
  .on('bind', this, function() {
1420
+ $(window).on('load', _raiseResize);
1421
  $(window).on('resize', _raiseResize);
1422
  })
1423
  .on('unbind', this, function() {
1424
+ $(window).off('load', _raiseResize);
1425
  $(window).off('resize', _raiseResize);
1426
  });
1427
 
1473
  }
1474
  });
1475
  });
1476
+
1477
+
1478
  Mana.require(['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Ajax'], function($, layout, ajax) {
1479
  function _generateBlocks() {
1480
  var vars = layout.beginGeneratingBlocks();
1484
  _generateBlocks();
1485
  ajax.startIntercepting();
1486
  });
1487
+ });
1488
+
1489
 
1490
+ Mana.require(['jquery'], function($) {
1491
+ var bp = {
1492
+ xsmall: 479,
1493
+ small: 599,
1494
+ medium: 770,
1495
+ large: 979,
1496
+ xlarge: 1199
1497
+ };
1498
+ Mana.rwdIsMobile = false;
1499
+ $(function() {
1500
+ if (window.enquire) {
1501
+ enquire.register('screen and (max-width: ' + bp.medium + 'px)', {
1502
+ match: function () {
1503
+ Mana.rwdIsMobile = true;
1504
+ $(document).trigger('m-rwd-mobile');
1505
+ },
1506
+ unmatch: function () {
1507
+ Mana.rwdIsMobile = false;
1508
+ $(document).trigger('m-rwd-wide');
1509
+ }
1510
+ });
1511
+ }
1512
+ });
1513
  });
1514
 
1515
+
1516
  //region (Obsolete) additional jQuery functions used in MANAdev extensions
1517
  (function($) {
1518
  // this variables are private to this code block
1846
  };
1847
 
1848
  })(jQuery);
1849
+ //endregion
1850
+
1851
+ //# sourceMappingURL=core.js.map
js/mana/core.js.map ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 3,
3
+ "file": "core.js",
4
+ "sources": [
5
+ "src/Mana/Core/header.js",
6
+ "src/Mana/Core/Mana.js",
7
+ "src/Mana/Core/Object.js",
8
+ "src/Mana/Core/Core.js",
9
+ "src/Mana/Core/Config.js",
10
+ "src/Mana/Core/Json.js",
11
+ "src/Mana/Core/Utf8.js",
12
+ "src/Mana/Core/Base64.js",
13
+ "src/Mana/Core/UrlTemplate.js",
14
+ "src/Mana/Core/StringTemplate.js",
15
+ "src/Mana/Core/Layout.js",
16
+ "src/Mana/Core/Ajax.js",
17
+ "src/Mana/Core/Block.js",
18
+ "src/Mana/Core/PopupBlock.js",
19
+ "src/Mana/Core/PageBlock.js",
20
+ "src/Mana/Core/init.js",
21
+ "src/Mana/Core/rwd.js",
22
+ "src/Mana/Core/obsolete.js"
23
+ ],
24
+ "names": [],
25
+ "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA,EACA;CCTA;AACA,EACA;AACA,EACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;CCtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA,C;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,C;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA,C;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA,C;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACzSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACjOA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACxBA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EACA;AACA",
26
+ "sourceRoot": "../"
27
+ }
js/mana/core.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /**
2
+ * @category Mana
3
+ * @package Mana_Core
4
+ * @copyright Copyright (c) http://www.manadev.com
5
+ * @license http://www.manadev.com/license Proprietary License
6
+ */
7
+ var Mana=Mana||{};!function(e,t,n){e.extend(Mana,{_singletons:{},_defines:{jquery:e,prototype:t},define:function(e,t,n){var o=Mana._resolveDependencyNames(t);return Mana._define(e,o.names,function(){return n.apply(this,Mana._resolveDependencies(arguments,o.deps))})},require:function(e,t){var n=Mana._resolveDependencyNames(e);return Mana._define(null,n.names,function(){return t.apply(this,Mana._resolveDependencies(arguments,n.deps))})},_define:function(t,n,o){var i=[];e.each(n,function(e,t){i.push(Mana._resolveDefine(t))});var r=o.apply(this,i);return t&&(Mana._defines[t]=r),r},_resolveDefine:function(e){return Mana._defines[e]===n&&console.warn("'"+e+"' is not defined"),Mana._defines[e]},requireOptional:function(e,t){var n=Mana._resolveDependencyNames(e);return Mana._define(null,n.names,function(){return t.apply(this,Mana._resolveDependencies(arguments,n.deps))})},_resolveDependencyNames:function(t){var n=[],o=[];return e.each(t,function(e,t){var i=t.indexOf(":"),r={name:t,resolver:""};-1!=i&&(r={name:t.substr(i+1),resolver:t.substr(0,i)}),Mana._resolveDependencyName(r),n.push(r.name),o.push(r)}),{names:n,deps:o}},_resolveDependencies:function(t,n){return e.each(t,function(e,o){t[e]=Mana._resolveDependency(n[e],o)}),t},_resolveDependencyName:function(){},_resolveDependency:function(e,t){if(t!==n)switch(e.resolver){case"singleton":return Mana._singletons[e.name]===n&&(Mana._singletons[e.name]=new t),Mana._singletons[e.name]}return t}})}(jQuery,$),function(undefined){var initializing=!1,fnTest=/xyz/.test(function(){})?/\b_super\b/:/.*/;Mana.Object=function(){},Mana.Object.extend=function(className,prop){prop===undefined&&(prop=className,className=undefined);var _super=this.prototype;initializing=!0;var prototype=new this;initializing=!1;for(var name in prop)prototype[name]="function"==typeof prop[name]&&"function"==typeof _super[name]&&fnTest.test(prop[name])?function(e,t){return function(){var n=this._super;this._super=_super[e];var o=t.apply(this,arguments);return this._super=n,o}}(name,prop[name]):prop[name];var Object;return className===undefined?Object=function(){!initializing&&this._init&&this._init.apply(this,arguments)}:eval("Object = function "+className.replace(/\//g,"_")+"() { if (!initializing && this._init) this._init.apply(this, arguments); };"),Object.prototype=prototype,Object.prototype.constructor=Object,Object.extend=arguments.callee,Object}}(),Mana.define("Mana/Core",["jquery"],function(e){return Mana.Object.extend("Mana/Core",{getClasses:function(e){return e.className.split(/\s+/)},getPrefixedClass:function(t,n){var o="";return e.each(this.getClasses(t),function(e,t){return 0==t.indexOf(n)?(o=t.substr(n.length),!1):void 0}),o},arrayRemove:function(e,t,n){var o=e.slice((n||t)+1||e.length);return e.length=0>t?e.length+t:t,e.push.apply(e,o)},getBlockAlias:function(e,t){var n;return 0===(n=t.indexOf(e+"-"))?t.substr((e+"-").length):t},count:function(t){var n=0;return e.each(t,function(){n++}),n},isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},isString:function(e){return"[object String]"==Object.prototype.toString.call(e)}})}),Mana.define("Mana/Core/Config",["jquery"],function(e){return Mana.Object.extend("Mana/Core/Config",{_init:function(){this._data={debug:!1,showOverlay:!0,showWait:!0}},getData:function(e){return this._data[e]},setData:function(e,t){return this._data[e]=t,this},set:function(t){return e.extend(this._data,t),this},getBaseUrl:function(e){return this.getData(0==e.indexOf(this.getData("url.base"))?"url.base":"url.secureBase")}})}),Mana.define("Mana/Core/Json",["jquery","singleton:Mana/Core"],function(e,t){return Mana.Object.extend("Mana/Core/Json",{parse:function(t){return e.parseJSON(t)},stringify:function(e){return Object.toJSON(e)},decodeAttribute:function(n){if(t.isString(n)){var o=n.split('"'),i=[];e.each(o,function(e,t){i.push(t.replace(/'/g,'"'))});var r=i.join("'");return this.parse(r)}return n}})}),Mana.define("Mana/Core/Utf8",[],function(){return Mana.Object.extend("Mana/Core/Utf8",{decode:function(e){var t=[],n=0,o=0,i=0,r=0,a=0;for(e+="";n<e.length;)i=e.charCodeAt(n),128>i?(t[o++]=String.fromCharCode(i),n++):i>191&&224>i?(r=e.charCodeAt(n+1),t[o++]=String.fromCharCode((31&i)<<6|63&r),n+=2):(r=e.charCodeAt(n+1),a=e.charCodeAt(n+2),t[o++]=String.fromCharCode((15&i)<<12|(63&r)<<6|63&a),n+=3);return t.join("")}})}),Mana.define("Mana/Core/Base64",["singleton:Mana/Core/Utf8"],function(e){return Mana.Object.extend("Mana/Core/Base64",{encode:function(e){for(var t,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="",r=e.length,a=0;r-->0;){if(t=e.charCodeAt(a++),i+=o.charAt(t>>2&63),r--<=0){i+=o.charAt(t<<4&63),i+="==";break}if(n=e.charCodeAt(a++),i+=o.charAt(63&(t<<4|n>>4&15)),r--<=0){i+=o.charAt(n<<2&63),i+="=";break}t=e.charCodeAt(a++),i+=o.charAt(63&(n<<2|t>>6&3)),i+=o.charAt(63&t)}return i},decode:function(t){var n,o,i,r,a,c,s,u,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,h=0,p="",f=[];if(!t)return t;t+="";do r=l.indexOf(t.charAt(d++)),a=l.indexOf(t.charAt(d++)),c=l.indexOf(t.charAt(d++)),s=l.indexOf(t.charAt(d++)),u=r<<18|a<<12|c<<6|s,n=u>>16&255,o=u>>8&255,i=255&u,f[h++]=64==c?String.fromCharCode(n):64==s?String.fromCharCode(n,o):String.fromCharCode(n,o,i);while(d<t.length);return p=f.join(""),p=e.decode(p)}})}),Mana.define("Mana/Core/UrlTemplate",["singleton:Mana/Core/Base64","singleton:Mana/Core/Config"],function(e,t){return Mana.Object.extend("Mana/Core/UrlTemplate",{decodeAttribute:function(n){return t.getData("debug")?n:e.decode(n.replace(/-/g,"+").replace(/_/g,"/").replace(/,/g,"="))},encodeAttribute:function(t){return e.encode(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,",")}})}),Mana.define("Mana/Core/StringTemplate",["jquery"],function(e,t){return Mana.Object.extend("Mana/Core/StringTemplate",{concat:function(n,o){var i="";return e.each(n,function(e,n){var r=n[0],a=n[1];"string"==r?i+=a:"var"==r&&(i+=o[a]!==t?o[a]:"{{"+a+"}}")}),i}})}),Mana.define("Mana/Core/Layout",["jquery","singleton:Mana/Core"],function(e,t,n){return Mana.Object.extend("Mana/Core/Layout",{_init:function(){this._pageBlock=null},getPageBlock:function(){return this._pageBlock},getBlock:function(e){return this._getBlockRecursively(this.getPageBlock(),e)},getBlockForElement:function(e){var t=this._getElementBlockInfo(e);return t?this.getBlock(t.id):null},_getBlockRecursively:function(t,n){if(t.getId()==n)return t;var o=this,i=null;return e.each(t.getChildren(),function(e,t){return i=o._getBlockRecursively(t,n),i?!1:!0}),i},beginGeneratingBlocks:function(e){var t={parentBlock:e,namedBlocks:{}};return e&&(e.trigger("unload",{},!1,!0),e.trigger("unbind",{},!1,!0),t.namedBlocks=this._removeAnonymousBlocks(e)),t},endGeneratingBlocks:function(t){var o=t.parentBlock,i=t.namedBlocks,r=this;this._collectBlockTypes(o?o.getElement():document,function(t){if(!r._pageBlock){var a=document.body,c=e(a),s=c.attr("data-m-block"),u=s?t[s]:t["Mana/Core/PageBlock"];r._pageBlock=(new u).setElement(e("body")[0]).setId("page")}var l=o===n;l&&(o=r.getPageBlock()),r._generateBlocksInElement(o.getElement(),o,t,i),e.each(i,function(e,t){t.parent.removeChild(t.child)}),o.trigger("bind",{},!1,!0),o.trigger("load",{},!1,!0)})},_collectBlockTypes:function(t,n){var o=["Mana/Core/PageBlock"];this._collectBlockTypesInElement(t,o),Mana.requireOptional(o,function(){var t=arguments,i={};e.each(o,function(e,n){i[n]=t[e]}),n(i)})},_collectBlockTypesInElement:function(t,n){var o=this;e(t).children().each(function(){var e=o._getElementBlockInfo(this);e&&-1==n.indexOf(e.typeName)&&n.push(e.typeName),o._collectBlockTypesInElement(this,n)})},_removeAnonymousBlocks:function(t){var n=this,o={};return e.each(t.getChildren().slice(0),function(e,i){i.getId()?(o[i.getId()]={parent:t,child:i},n._removeAnonymousBlocks(i)):t.removeChild(i)}),o},_getElementBlockInfo:function(n){var o,i,r=e(n);return(o=t.getPrefixedClass(n,"mb-"))||(i=r.attr("data-m-block"))||r.hasClass("m-block")?{id:o||n.id,typeName:i||r.attr("data-m-block")||"Mana/Core/Block"}:null},_generateBlocksInElement:function(t,n,o,i){var r=this;e(t).children().each(function(){var e=r._createBlockFromElement(this,n,o,i);r._generateBlocksInElement(this,e||n,o,i)})},_createBlockFromElement:function(e,n,o,i){var r=this._getElementBlockInfo(e);if(r){var a,c=o[r.typeName],s=!1;return r.id?(a=n.getChild(t.getBlockAlias(n.getId(),r.id)),a?(s=!0,delete i[r.id]):c?a=new c:console.error("Block '"+r.typeName+"' is not defined"),a&&a.setId(r.id)):c?a=new c:console.error("Block '"+r.typeName+"' is not defined"),a?(a.setElement(e),s||n.addChild(a),a):null}return null},preparePopup:function(o){if(o=this._preparePopupOptions(o),o.$popup===n){var i=e("#m-popup");i.css({width:"auto",height:"auto"}),i.html(t.isString(o.content)?o.content:e(o.content).html()),o.popup["class"]&&i.addClass(o.popup["class"]),o.$popup=i}return o.$popup},_preparePopupOptions:function(t){var n={overlay:{opacity:.2},popup:{blockName:"Mana/Core/PopupBlock"},popupBlock:{},fadein:{overlayTime:0,popupTime:300},fadeout:{overlayTime:0,popupTime:500}};return e.extend(!0,n,t),n},showPopup:function(t){t=this._preparePopupOptions(t);var n=this;Mana.requireOptional([t.popup.blockName],function(o){var i=t.fadeout.callback;t.fadeout.callback=function(){e("#m-popup").fadeOut(t.fadeout.popupTime,function(){i&&i()})};var r=n.getPageBlock().showOverlay("m-popup-overlay",t.fadeout),a=n.preparePopup(t);r.animate({opacity:t.overlay.opacity},t.fadein.overlayTime,function(){a.show();var i=new o;i.setElement(a[0]);var r=n.beginGeneratingBlocks(i);n.endGeneratingBlocks(r),i.prepare&&i.prepare(t.popupBlock),e(".m-popup-overlay").on("click",function(){return n.hidePopup(),!1}),n._popupEscListenerInitialized||(n._popupEscListenerInitialized=!0,e(document).keydown(function(t){return e(".m-popup-overlay").length&&27==t.keyCode?(n.hidePopup(),!1):!0})),a.css("top",(e(window).height()-a.outerHeight())/2+e(window).scrollTop()+"px").css("left",(e(window).width()-a.outerWidth())/2+e(window).scrollLeft()+"px");a.height();a.hide().css({height:"auto"});var c={left:a.css("left"),top:a.css("top"),width:a.width()+"px",height:a.height()+"px"};a.children().each(function(){e(this).css({width:a.width()+e(this).width()-e(this).outerWidth()+"px",height:a.height()+e(this).height()-e(this).outerHeight()+"px"})}),a.css({top:e(window).height()/2+e(window).scrollTop()+"px",left:e(window).width()/2+e(window).scrollLeft()+"px",width:"0px",height:"0px"}).show(),a.animate(c,t.fadein.popupTime,t.fadein.callback)})})},hidePopup:function(){this.getPageBlock().hideOverlay()}})}),Mana.define("Mana/Core/Ajax",["jquery","singleton:Mana/Core/Layout","singleton:Mana/Core/Json","singleton:Mana/Core","singleton:Mana/Core/Config"],function(e,t,n,o,i,r){return Mana.Object.extend("Mana/Core/Ajax",{_init:function(){this._interceptors=[],this._matchedInterceptorCache={},this._lastAjaxActionSource=r,this._oldSetLocation=r,this._preventClicks=0},_encodeUrl:function(e,t){return t.encode?t.encode.offset!==r?t.encode.length===r?0===t.encode.offset?window.encodeURI(e.substr(t.encode.offset)):e.substr(0,t.encode.offset)+window.encodeURI(e.substr(t.encode.offset)):0===t.encode.length?e:0===t.encode.offset?window.encodeURI(e.substr(t.encode.offset,t.encode.length))+e.substr(t.encode.offset+t.encode.length):e.substr(0,t.encode.offset)+window.encodeURI(e.substr(t.encode.offset,t.encode.length))+e.substr(t.encode.offset+t.encode.length):e:window.encodeURI(e)},get:function(t,n,o){var i=this;o=this._before(o,t),e.get(this._encodeUrl(t,o)).done(function(e){i._done(e,n,o,t)}).fail(function(e){i._fail(e,o,t)}).complete(function(){i._complete(o,t)})},post:function(t,n,o,i){var a=this;n===r&&(n=[]),o===r&&(o=function(){}),i=this._before(i,t,n),e.post(window.encodeURI(t),n).done(function(e){a._done(e,o,i,t,n)}).fail(function(e){a._fail(e,i,t,n)}).complete(function(){a._complete(i,t,n)})},update:function(n){n.updates&&e.each(n.updates,function(t,n){e(t).html(n)}),n.blocks&&e.each(n.blocks,function(e,o){var i=t.getBlock(e);i&&i.setContent(n.sections[o])}),n.config&&i.set(n.config),n.script&&e.globalEval(n.script),n.title&&(document.title=n.title.replace(/&amp;/g,"&"))},getSectionSeparator:function(){return"\n91b5970cd70e2353d866806f8003c1cd56646961\n"},_before:function(n,o){var i=t.getPageBlock();return n=e.extend({showOverlay:i.getShowOverlay(),showWait:i.getShowWait(),showDebugMessages:i.getShowDebugMessages()},n),n.showOverlay&&i.showOverlay(),n.showWait&&i.showWait(),n.preventClicks&&this._preventClicks++,e(document).trigger("m-ajax-before",[[],o,"",n]),n},_done:function(e,o,i,r,a){var c=t.getPageBlock();i.showOverlay&&c.hideOverlay(),i.showWait&&c.hideWait();try{var s=e;try{var u=e.split(this.getSectionSeparator());e=u.shift(),e=n.parse(e),e.sections=u}catch(l){return void o(s,{url:r})}e?e.error&&!e.customErrorDisplay?i.showDebugMessages&&alert(e.message||e.error):o(e,{url:r,data:a}):i.showDebugMessages&&alert("No response.")}catch(d){if(i.showDebugMessages){var h="";"string"==typeof d?h+=d:(h+=d.message,d.fileName&&(h+="\n in "+d.fileName+" ("+d.lineNumber+")")),e&&(h+="\n\n",h+="string"==typeof e?e:n.stringify(e)),alert(h)}}},_fail:function(e,n){var o=t.getPageBlock();n.showOverlay&&o.hideOverlay(),n.showWait&&o.hideWait(),n.showDebugMessages&&alert(e.status+(e.responseText?": "+e.responseText:""))},_complete:function(t,n){t.preventClicks&&this._preventClicks--,e(document).trigger("m-ajax-after",[[],n,"",t])},addInterceptor:function(e){this._interceptors.push(e)},removeInterceptor:function(e){var t=this._interceptors.indexOf(e);-1!=t&&this._interceptors.splice(t,1)},startIntercepting:function(){var t=this;window.History&&window.History.enabled&&e(window).on("statechange",t._onStateChange=function(){var e=window.History.getState(),n=e.url;t._findMatchingInterceptor(n,t._lastAjaxActionSource)?t._internalCallInterceptionCallback(n,t._lastAjaxActionSource):t._oldSetLocation(n,t._lastAjaxActionSource)}),window.setLocation&&(this._oldSetLocation=window.setLocation,window.setLocation=function(e,n){t._callInterceptionCallback(e,n)}),e(document).on("click","a",t._onClick=function(){var e=this.href;return t._preventClicks&&e==location.href+"#"?!1:t._findMatchingInterceptor(e,this)?t._callInterceptionCallback(e,this):!0})},stopIntercepting:function(){window.History&&window.History.enabled&&(e(window).off("statechange",self._onStateChange),self._onStateChange=null),e(document).off("click","a",self._onClick),self._onClick=null},_internalCallInterceptionCallback:function(e,t){var n=this._findMatchingInterceptor(e,t);return n?(this.lastUrl=e,n.intercept(e,t),!1):!0},_callInterceptionCallback:function(e,t){return this._findMatchingInterceptor(e,t)?(this._lastAjaxActionSource=t,window.History&&window.History.enabled?window.History.pushState(null,window.title,e):this._internalCallInterceptionCallback(e,t)):this._oldSetLocation(e,t),!1},_findMatchingInterceptor:function(t,n){if(this._matchedInterceptorCache[t]===r){var o=!1;i.getData("ajax.enabled")&&e.each(this._interceptors,function(e,i){return i.match(t,n)?(o=i,!1):!0}),this._matchedInterceptorCache[t]=o}return this._matchedInterceptorCache[t]},getDocumentUrl:function(){return this.lastUrl?this.lastUrl:document.URL}})}),Mana.define("Mana/Core/Block",["jquery","singleton:Mana/Core","singleton:Mana/Core/Layout","singleton:Mana/Core/Json"],function(e,t,n,o,i){return Mana.Object.extend("Mana/Core/Block",{_init:function(){this._id="",this._element=null,this._parent=null,this._children=[],this._namedChildren={},this._isSelfContained=!1,this._eventHandlers={},this._data={},this._text={},this._subscribeToHtmlEvents()._subscribeToBlockEvents()},_subscribeToHtmlEvents:function(){return this._json={},this},_subscribeToBlockEvents:function(){return this},getElement:function(){return this._element},$:function(){return e(this.getElement())},setElement:function(e){return this._element=e,this},addChild:function(e){return this._children.push(e),e.getId()&&(this._namedChildren[t.getBlockAlias(this.getId(),e.getId())]=e),e._parent=this,this},removeChild:function(n){var o=e.inArray(n,this._children);return-1!=o&&(t.arrayRemove(this._children,o),n.getId()&&delete this._namedChildren[t.getBlockAlias(this.getId(),n.getId())]),n._parent=null,this},getIsSelfContained:function(){return this._isSelfContained},setIsSelfContained:function(e){return this._isSelfContained=e,this},getId:function(){return this._id||this.getElement().id},setId:function(e){return this._id=e,this},getParent:function(){return this._parent},getChild:function(n){if(t.isFunction(n)){var o=null;return e.each(this._children,function(e,t){return n(e,t)?(o=t,!1):!0}),o}return this._namedChildren[n]},getChildren:function(t){if(t===i)return this._children.slice(0);var n=[];return e.each(this._children,function(e,o){t(e,o)&&n.push(o)}),n},getAlias:function(){var t=i,n=this;return e.each(this._parent._namedChildren,function(e,o){return o===n?(t=e,!1):!0}),t},_trigger:function(t,n){return n.stopped||this._eventHandlers[t]===i||e.each(this._eventHandlers[t],function(e,t){var o=t.callback.call(t.target,n);return o===!1&&(n.stopped=!0),o}),n.result},trigger:function(t,n,o,r){return n===i&&(n={}),n.target===i&&(n.target=this),r===i&&(r=!1),o===i&&(o=!0),this._trigger(t,n),r&&e.each(this.getChildren(),function(e,o){o.trigger(t,n,!1,r)}),o&&this.getParent()&&this.getParent().trigger(t,n,o,!1),n.result},on:function(e,t,n,o){return this._eventHandlers[e]===i&&(this._eventHandlers[e]=[]),o===i&&(o=0),this._eventHandlers[e].push({target:t,callback:n,sortOrder:o}),this._eventHandlers[e].sort(function(e,t){return e.sortOrder<t.sortOrder?-1:e.sortOrder>t.sortOrder?1:0}),this},off:function(n,o,r){this._eventHandlers[n]===i&&(this._eventHandlers[n]=[]);var a=-1;e.each(this._eventHandlers[n],function(e,t){return t.target==o&&t.callback==r?(a=e,!1):!0}),-1!=a&&t.arrayRemove(this._eventHandlers[n],a)},setContent:function(t){if("string"!=e.type(t)){if(!(t.content&&this.getId()&&t.content[this.getId()]))return this;t=t.content[this.getId()]}var o=n.beginGeneratingBlocks(this);return t=e(t),e(this.getElement()).replaceWith(t),this.setElement(t[0]),n.endGeneratingBlocks(o),this},getData:function(e){return this._data[e]},setData:function(e,t){return this._data[e]=t,this},getText:function(e){return this._text[e]===i&&(this._text[e]=this.$().data(e+"-text")),this._text[e]},getJsonData:function(e,t){return this._json[e]===i&&(this._json[e]=o.decodeAttribute(this.$().data(e))),t===i?this._json[e]:this._json[e][t]}})}),Mana.define("Mana/Core/PopupBlock",["jquery","Mana/Core/Block","singleton:Mana/Core/Layout"],function(e,t,n){return t.extend("Mana/Core/PopupBlock",{prepare:function(e){var t=this;this._host=e.host,this.$().find(".btn-close").on("click",function(){return t._close()})},_close:function(){return n.hidePopup(),!1}})}),Mana.define("Mana/Core/PageBlock",["jquery","Mana/Core/Block","singleton:Mana/Core/Config"],function(e,t,n){return t.extend("Mana/Core/PageBlock",{_init:function(){this._defaultOverlayFadeout={overlayTime:0,popupTime:0,callback:null},this._overlayFadeout=this._defaultOverlayFadeout,this._super()},_subscribeToHtmlEvents:function(){function t(){o||(o=!0,n.resize(),o=!1)}var n=this,o=!1;return this._super().on("bind",this,function(){e(window).on("load",t),e(window).on("resize",t)}).on("unbind",this,function(){e(window).off("load",t),e(window).off("resize",t)})},_subscribeToBlockEvents:function(){return this._super().on("load",this,function(){this.resize()})},resize:function(){this.trigger("resize",{},!1,!0)},showOverlay:function(t,n){this._overlayFadeout=n||this._defaultOverlayFadeout;var o=e(t?'<div class="m-overlay '+t+'"></div>':'<div class="m-overlay"></div>');return o.appendTo(this.getElement()),o.css({left:0,top:0}).width(e(document).width()).height(e(document).height()),o},hideOverlay:function(){var t=this;return e(".m-overlay").fadeOut(this._overlayFadeout.overlayTime,function(){e(".m-overlay").remove(),t._overlayFadeout.callback&&t._overlayFadeout.callback(),t._overlayFadeout=t._defaultOverlayFadeout}),this},showWait:function(){return e("#m-wait").show(),this},hideWait:function(){return e("#m-wait").hide(),this},getShowDebugMessages:function(){return n.getData("debug")},getShowOverlay:function(){return n.getData("showOverlay")},getShowWait:function(){return n.getData("showWait")}})}),Mana.require(["jquery","singleton:Mana/Core/Layout","singleton:Mana/Core/Ajax"],function(e,t,n){function o(){var e=t.beginGeneratingBlocks();t.endGeneratingBlocks(e)}e(function(){o(),n.startIntercepting()})}),Mana.require(["jquery"],function(e){var t={xsmall:479,small:599,medium:770,large:979,xlarge:1199};Mana.rwdIsMobile=!1,e(function(){window.enquire&&enquire.register("screen and (max-width: "+t.medium+"px)",{match:function(){Mana.rwdIsMobile=!0,e(document).trigger("m-rwd-mobile")},unmatch:function(){Mana.rwdIsMobile=!1,e(document).trigger("m-rwd-wide")}})})}),function(e){var t={},n={};e.__=function(n){if("string"==typeof n){var o=arguments;return o[0]=t[n]?t[n]:n,e.vsprintf(o)}t=e.extend(t,n)},e.options=function(t){return"string"==typeof t?n[t]:(n=e.extend(!0,n,t),void e(document).trigger("m-options-changed"))},e.dynamicUpdate=function(t){t&&e.each(t,function(t,n){e(n.selector).html(n.html)})},e.dynamicReplace=function(t,n,o){t&&e.each(t,function(t,i){var r=e(t);if(r.length){var a=e(r[0]);r.length>1&&r.slice(1).remove(),a.replaceWith(o?e.utf8_decode(i):i)}else if(n)throw"There is no content to replace."})},e.errorUpdate=function(t,n){t||(t="#messages");var o=e(t);o.length?o.html('<ul class="messages"><li class="error-msg"><ul><li>'+n+"</li></ul></li></ul>"):alert(n)},e.arrayRemove=function(e,t,n){var o=e.slice((n||t)+1||e.length);return e.length=0>t?e.length+t:t,e.push.apply(e,o)},e.mViewport=function(){var e="CSS1Compat"==document.compatMode;return{l:window.pageXOffset||(e?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(e?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(e?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(e?document.documentElement.clientHeight:document.body.clientHeight)}},e.mStickTo=function(t,n){var o=e(t).offset(),i=e.mViewport(),r=o.top+t.offsetHeight,a=o.left+(t.offsetWidth-n.outerWidth())/2;r+n.outerHeight()>i.t+i.h&&(r=o.top-n.outerHeight()),a+n.outerWidth()>i.l+i.w&&(a=o.left+t.offsetWidth-n.outerWidth()),n.css({left:a+"px",top:r+"px"})},e.fn.mMarkAttr=function(e,t){return t?this.attr(e,e):this.removeAttr(e),this},e(function(){try{window.mainNav&&window.mainNav("nav",{show_delay:"100",hide_delay:"100"})}catch(e){}}),e.base64_decode=function(t){var n,o,i,r,a,c,s,u,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,h=0,p="",f=[];if(!t)return t;t+="";do r=l.indexOf(t.charAt(d++)),a=l.indexOf(t.charAt(d++)),c=l.indexOf(t.charAt(d++)),s=l.indexOf(t.charAt(d++)),u=r<<18|a<<12|c<<6|s,n=u>>16&255,o=u>>8&255,i=255&u,f[h++]=64==c?String.fromCharCode(n):64==s?String.fromCharCode(n,o):String.fromCharCode(n,o,i);while(d<t.length);return p=f.join(""),p=e.utf8_decode(p)},e.utf8_decode=function(e){var t=[],n=0,o=0,i=0,r=0,a=0;for(e+="";n<e.length;)i=e.charCodeAt(n),128>i?(t[o++]=String.fromCharCode(i),n++):i>191&&224>i?(r=e.charCodeAt(n+1),t[o++]=String.fromCharCode((31&i)<<6|63&r),n+=2):(r=e.charCodeAt(n+1),a=e.charCodeAt(n+2),t[o++]=String.fromCharCode((15&i)<<12|(63&r)<<6|63&a),n+=3);return t.join("")};var o={overlayTime:500,popupTime:1e3,callback:null};e.mSetPopupFadeoutOptions=function(e){o=e},e.fn.extend({mPopup:function(t,n){var o=e.extend({fadeOut:{overlayTime:0,popupTime:500,callback:null},fadeIn:{overlayTime:0,popupTime:500,callback:null},overlay:{opacity:.2},popup:{contentSelector:"."+t+"-text",containerClass:"m-"+t+"-popup-container",top:100}},n);e(this).live("click",function(){if(e.mPopupClosing())return!1;var t=e(o.popup.contentSelector).html();e.mSetPopupFadeoutOptions(o.fadeOut);var n=e('<div class="m-popup-overlay"> </div>');return n.appendTo(document.body),n.css({left:0,top:0}).width(e(document).width()).height(e(document).height()),n.animate({opacity:o.overlay.opacity},o.fadeIn.overlayTime,function(){e("#m-popup").css({width:"auto",height:"auto"}).html(t).addClass(o.popup.containerClass).css("top",(e(window).height()-e("#m-popup").outerHeight())/2-o.popup.top+e(window).scrollTop()+"px").css("left",(e(window).width()-e("#m-popup").outerWidth())/2+e(window).scrollLeft()+"px");e("#m-popup").height();e("#m-popup").show().height(0),e("#m-popup").hide().css({height:"auto"});var n={left:e("#m-popup").css("left"),top:e("#m-popup").css("top"),width:e("#m-popup").width()+"px",height:e("#m-popup").height()+"px"};e("#m-popup").children().each(function(){e(this).css({width:e("#m-popup").width()+e(this).width()-e(this).outerWidth()+"px",height:e("#m-popup").height()+e(this).height()-e(this).outerHeight()+"px"})}),e("#m-popup").css({top:e(window).height()/2-o.popup.top+e(window).scrollTop()+"px",left:e(window).width()/2+e(window).scrollLeft()+"px",width:"0px",height:"0px"}).show(),e("#m-popup").animate(n,o.fadeIn.popupTime,function(){o.fadeIn.callback&&o.fadeIn.callback()})}),!1})}});var i=!1;e.mPopupClosing=function(e){return void 0!==e&&(i=e),i},e.mClosePopup=function(){return e.mPopupClosing(!0),e(".m-popup-overlay").fadeOut(o.overlayTime,function(){e(".m-popup-overlay").remove(),e("#m-popup").fadeOut(o.popupTime,function(){o.callback&&o.callback(),e.mPopupClosing(!1)})}),!1}}(jQuery);
js/src/Mana/Core/Ajax.js ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/Ajax', ['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Json',
2
+ 'singleton:Mana/Core', 'singleton:Mana/Core/Config'],
3
+ function ($, layout, json, core, config, undefined)
4
+ {
5
+ return Mana.Object.extend('Mana/Core/Ajax', {
6
+ _init: function() {
7
+ this._interceptors = [];
8
+ this._matchedInterceptorCache = {};
9
+ this._lastAjaxActionSource = undefined;
10
+ this._oldSetLocation = undefined;
11
+ this._preventClicks = 0;
12
+ },
13
+ _encodeUrl: function(url, options) {
14
+ if (options.encode) {
15
+ if (options.encode.offset !== undefined) {
16
+ if (options.encode.length === undefined) {
17
+ if (options.encode.offset === 0) {
18
+ return window.encodeURI(url.substr(options.encode.offset));
19
+ }
20
+ else {
21
+ return url.substr(0, options.encode.offset) +
22
+ window.encodeURI(url.substr(options.encode.offset));
23
+ }
24
+ }
25
+ else if (options.encode.length === 0) {
26
+ return url;
27
+ }
28
+ else {
29
+ if (options.encode.offset === 0) {
30
+ return window.encodeURI(url.substr(options.encode.offset, options.encode.length))
31
+ + url.substr(options.encode.offset + options.encode.length);
32
+ }
33
+ else {
34
+ return url.substr(0, options.encode.offset) +
35
+ window.encodeURI(url.substr(options.encode.offset, options.encode.length)) +
36
+ url.substr(options.encode.offset + options.encode.length);
37
+ }
38
+ }
39
+ }
40
+ else {
41
+ return url;
42
+ }
43
+ }
44
+ else {
45
+ return window.encodeURI(url);
46
+ }
47
+ },
48
+ get:function (url, callback, options) {
49
+ var self = this, encodedUrl;
50
+ options = this._before(options, url);
51
+ $.get(this._encodeUrl(url, options))
52
+ .done(function (response) { self._done(response, callback, options, url); })
53
+ .fail(function (error) { self._fail(error, options, url)})
54
+ .complete(function () { self._complete(options, url); });
55
+ },
56
+ post:function (url, data, callback, options) {
57
+ var self = this;
58
+ if (data === undefined) {
59
+ data = [];
60
+ }
61
+ if (callback === undefined) {
62
+ callback = function() {};
63
+ }
64
+ options = this._before(options, url, data);
65
+ $.post(window.encodeURI(url), data)
66
+ .done(function (response) { self._done(response, callback, options, url, data); })
67
+ .fail(function (error) { self._fail(error, options, url, data)})
68
+ .complete(function () { self._complete(options, url, data); });
69
+ },
70
+ update: function(response) {
71
+ if (response.updates) {
72
+ $.each(response.updates, function (selector, html) {
73
+ $(selector).html(html);
74
+ });
75
+ }
76
+ if (response.blocks) {
77
+ $.each(response.blocks, function (blockName, sectionIndex) {
78
+ var block = layout.getBlock(blockName);
79
+ if (block) {
80
+ block.setContent(response.sections[sectionIndex]);
81
+ }
82
+ });
83
+ }
84
+ if (response.config) {
85
+ config.set(response.config);
86
+ }
87
+ if (response.script) {
88
+ $.globalEval(response.script);
89
+ }
90
+ if (response.title) {
91
+ document.title = response.title.replace(/&amp;/g, '&');
92
+ }
93
+ },
94
+ getSectionSeparator: function() {
95
+ return "\n91b5970cd70e2353d866806f8003c1cd56646961\n";
96
+ },
97
+ _before: function(options, url, data) {
98
+ var page = layout.getPageBlock();
99
+ options = $.extend({
100
+ showOverlay:page.getShowOverlay(),
101
+ showWait:page.getShowWait(),
102
+ showDebugMessages:page.getShowDebugMessages()
103
+ }, options);
104
+
105
+ if (options.showOverlay) {
106
+ page.showOverlay();
107
+ }
108
+ if (options.showWait) {
109
+ page.showWait();
110
+ }
111
+ if (options.preventClicks) {
112
+ this._preventClicks++;
113
+ }
114
+ $(document).trigger('m-ajax-before', [[], url, '', options]);
115
+ return options;
116
+ },
117
+ _done:function (response, callback, options, url, data) {
118
+ var page = layout.getPageBlock();
119
+ if (options.showOverlay) {
120
+ page.hideOverlay();
121
+ }
122
+ if (options.showWait) {
123
+ page.hideWait();
124
+ }
125
+ try {
126
+ var content = response;
127
+ try {
128
+ var sections = response.split(this.getSectionSeparator());
129
+ response = sections.shift();
130
+ response = json.parse(response);
131
+ response.sections = sections;
132
+ }
133
+ catch (e) {
134
+ callback(content, { url:url});
135
+ return;
136
+ }
137
+ if (!response) {
138
+ if (options.showDebugMessages) {
139
+ alert('No response.');
140
+ }
141
+ }
142
+ else if (response.error && !response.customErrorDisplay) {
143
+ if (options.showDebugMessages) {
144
+ alert(response.message || response.error);
145
+ }
146
+ }
147
+ else {
148
+ callback(response, { url:url, data: data});
149
+ }
150
+ }
151
+ catch (error) {
152
+ if (options.showDebugMessages) {
153
+ var s = '';
154
+ if (typeof(error) == 'string') {
155
+ s += error;
156
+ }
157
+ else {
158
+ s += error.message;
159
+ if (error.fileName) {
160
+ s += "\n in " + error.fileName + " (" + error.lineNumber + ")";
161
+ }
162
+ }
163
+ if (response) {
164
+ s += "\n\n";
165
+ s += typeof(response) == 'string' ? response : json.stringify(response);
166
+ }
167
+ alert(s);
168
+ }
169
+ }
170
+ },
171
+ _fail:function (error, options, url, data) {
172
+ var page = layout.getPageBlock();
173
+ if (options.showOverlay) {
174
+ page.hideOverlay();
175
+ }
176
+ if (options.showWait) {
177
+ page.hideWait();
178
+ }
179
+ if (options.showDebugMessages) {
180
+ alert(error.status + (error.responseText ? ': ' + error.responseText : ''));
181
+ }
182
+ },
183
+ _complete:function (options, url, data) {
184
+ if (options.preventClicks) {
185
+ this._preventClicks--;
186
+ }
187
+ $(document).trigger('m-ajax-after', [[], url, '', options]);
188
+ },
189
+ addInterceptor: function (interceptor) {
190
+ this._interceptors.push(interceptor);
191
+ },
192
+ removeInterceptor: function (interceptor) {
193
+ var index = this._interceptors.indexOf(interceptor);
194
+ if (index != -1) {
195
+ this._interceptors.splice(index, 1);
196
+ }
197
+ },
198
+ startIntercepting: function() {
199
+ var self = this;
200
+
201
+ // intercept browser history changes (Back button clicks, pushing new URL in _callInterceptionCallback() method)
202
+ if (window.History && window.History.enabled) {
203
+ $(window).on('statechange', self._onStateChange = function () {
204
+ var State = window.History.getState();
205
+ var url = State.url; // URL encoded
206
+ if (self._findMatchingInterceptor(url, self._lastAjaxActionSource)) {
207
+ self._internalCallInterceptionCallback(url, self._lastAjaxActionSource);
208
+ }
209
+ else {
210
+ self._oldSetLocation(url, self._lastAjaxActionSource);
211
+ }
212
+ });
213
+ }
214
+
215
+ // intercept Magento setLocation() calls
216
+ if (window.setLocation) {
217
+ this._oldSetLocation = window.setLocation;
218
+ window.setLocation = function (url, element) {
219
+ self._callInterceptionCallback(url, element);
220
+ };
221
+ }
222
+
223
+ // intercept all link clicks
224
+ $(document).on('click', 'a', self._onClick = function () {
225
+ var url = this.href; // URL encoded
226
+ if (self._preventClicks && url == location.href + '#') {
227
+ return false;
228
+ }
229
+ if (self._findMatchingInterceptor(url, this)) {
230
+ return self._callInterceptionCallback(url, this);
231
+ }
232
+ else {
233
+ return true;
234
+ }
235
+ });
236
+ },
237
+ stopIntercepting: function() {
238
+ if (window.History && window.History.enabled) {
239
+ $(window).off('statechange', self._onStateChange);
240
+ self._onStateChange = null;
241
+ }
242
+ $(document).off('click', 'a', self._onClick);
243
+ self._onClick = null;
244
+ },
245
+ _internalCallInterceptionCallback: function(url, element) {
246
+ var interceptor = this._findMatchingInterceptor(url, element);
247
+ if (interceptor) {
248
+ this.lastUrl = url;
249
+ interceptor.intercept(url, element);
250
+ return false; // prevent default link click behavior
251
+ }
252
+ return true;
253
+ },
254
+ _callInterceptionCallback: function(url, element) {
255
+ if (this._findMatchingInterceptor(url, element)) {
256
+ this._lastAjaxActionSource = element;
257
+ if (window.History && window.History.enabled) {
258
+ //noinspection JSUnresolvedVariable
259
+ window.History.pushState(null, window.title, url);
260
+ }
261
+ else {
262
+ this._internalCallInterceptionCallback(url, element);
263
+ }
264
+ }
265
+ else {
266
+ this._oldSetLocation(url, element);
267
+ }
268
+ return false;
269
+ },
270
+ _findMatchingInterceptor: function(url, element) {
271
+ if (this._matchedInterceptorCache[url] === undefined) {
272
+ var interceptor = false;
273
+ if (config.getData('ajax.enabled')) {
274
+ $.each(this._interceptors, function(index, candidateInterceptor) {
275
+ if (candidateInterceptor.match(url, element)) {
276
+ interceptor = candidateInterceptor;
277
+ return false;
278
+ }
279
+ else {
280
+ return true;
281
+ }
282
+ });
283
+ }
284
+ this._matchedInterceptorCache[url] = interceptor;
285
+ }
286
+ return this._matchedInterceptorCache[url];
287
+ },
288
+ getDocumentUrl: function() {
289
+ if (this.lastUrl) {
290
+ return this.lastUrl;
291
+ }
292
+ else {
293
+ return document.URL;
294
+ }
295
+ }
296
+ });
297
+ });
js/src/Mana/Core/Base64.js ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/Base64', ['singleton:Mana/Core/Utf8'], function (utf8) {
2
+ return Mana.Object.extend('Mana/Core/Base64', {
3
+ encode: function (what) {
4
+ /*
5
+ * Caudium - An extensible World Wide Web server
6
+ * Copyright C 2002 The Caudium Group
7
+ *
8
+ * This program is free software; you can redistribute it and/or
9
+ * modify it under the terms of the GNU General Public License as
10
+ * published by the Free Software Foundation; either version 2 of the
11
+ * License, or (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful, but
14
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ * General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program; if not, write to the Free Software
20
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ *
22
+ */
23
+
24
+ /*
25
+ * base64.js - a JavaScript implementation of the base64 algorithm,
26
+ * (mostly) as defined in RFC 2045.
27
+ *
28
+ * This is a direct JavaScript reimplementation of the original C code
29
+ * as found in the Exim mail transport agent, by Philip Hazel.
30
+ *
31
+ */
32
+ var base64_encodetable = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
33
+ var result = "";
34
+ var len = what.length;
35
+ var x, y;
36
+ var ptr = 0;
37
+
38
+ while (len-- > 0) {
39
+ x = what.charCodeAt(ptr++);
40
+ result += base64_encodetable.charAt(( x >> 2 ) & 63);
41
+
42
+ if (len-- <= 0) {
43
+ result += base64_encodetable.charAt(( x << 4 ) & 63);
44
+ result += "==";
45
+ break;
46
+ }
47
+
48
+ y = what.charCodeAt(ptr++);
49
+ result += base64_encodetable.charAt(( ( x << 4 ) | ( ( y >> 4 ) & 15 ) ) & 63);
50
+
51
+ if (len-- <= 0) {
52
+ result += base64_encodetable.charAt(( y << 2 ) & 63);
53
+ result += "=";
54
+ break;
55
+ }
56
+
57
+ x = what.charCodeAt(ptr++);
58
+ result += base64_encodetable.charAt(( ( y << 2 ) | ( ( x >> 6 ) & 3 ) ) & 63);
59
+ result += base64_encodetable.charAt(x & 63);
60
+
61
+ }
62
+
63
+ return result;
64
+ },
65
+ decode: function (data) {
66
+ // Decodes string using MIME base64 algorithm
67
+ //
68
+ // version: 1109.2015
69
+ // discuss at: http://phpjs.org/functions/base64_decode
70
+ // + original by: Tyler Akins (http://rumkin.com)
71
+ // + improved by: Thunder.m
72
+ // + input by: Aman Gupta
73
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
74
+ // + bugfixed by: Onno Marsman
75
+ // + bugfixed by: Pellentesque Malesuada
76
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
77
+ // + input by: Brett Zamir (http://brett-zamir.me)
78
+ // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
79
+ // - depends on: utf8_decode
80
+ // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
81
+ // * returns 1: 'Kevin van Zonneveld'
82
+ // mozilla has this native
83
+ // - but breaks in 2.0.0.12!
84
+ //if (typeof this.window['btoa'] == 'function') {
85
+ // return btoa(data);
86
+ //}
87
+ var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
88
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
89
+ ac = 0,
90
+ dec = "",
91
+ tmp_arr = [];
92
+
93
+ if (!data) {
94
+ return data;
95
+ }
96
+
97
+ data += '';
98
+
99
+ do { // unpack four hexets into three octets using index points in b64
100
+ h1 = b64.indexOf(data.charAt(i++));
101
+ h2 = b64.indexOf(data.charAt(i++));
102
+ h3 = b64.indexOf(data.charAt(i++));
103
+ h4 = b64.indexOf(data.charAt(i++));
104
+
105
+ bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
106
+
107
+ o1 = bits >> 16 & 0xff;
108
+ o2 = bits >> 8 & 0xff;
109
+ o3 = bits & 0xff;
110
+
111
+ if (h3 == 64) {
112
+ tmp_arr[ac++] = String.fromCharCode(o1);
113
+ } else if (h4 == 64) {
114
+ tmp_arr[ac++] = String.fromCharCode(o1, o2);
115
+ } else {
116
+ tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
117
+ }
118
+ } while (i < data.length);
119
+
120
+ dec = tmp_arr.join('');
121
+ dec = utf8.decode(dec);
122
+
123
+ return dec;
124
+ }
125
+ });
126
+ });
js/src/Mana/Core/Block.js ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/Block', ['jquery', 'singleton:Mana/Core', 'singleton:Mana/Core/Layout',
2
+ 'singleton:Mana/Core/Json'],
3
+ function($, core, layout, json, undefined) {
4
+ return Mana.Object.extend('Mana/Core/Block', {
5
+ _init: function() {
6
+ this._id = '';
7
+ this._element = null;
8
+ this._parent = null;
9
+ this._children = [];
10
+ this._namedChildren = {};
11
+ this._isSelfContained = false;
12
+ this._eventHandlers = {};
13
+ this._data = {};
14
+ this._text = {};
15
+ this._subscribeToHtmlEvents()._subscribeToBlockEvents();
16
+ },
17
+ _subscribeToHtmlEvents: function() {
18
+ this._json = {};
19
+ return this;
20
+ },
21
+ _subscribeToBlockEvents:function () {
22
+ return this;
23
+ },
24
+ getElement:function() {
25
+ return this._element;
26
+ },
27
+ $: function() {
28
+ return $(this.getElement());
29
+ },
30
+ setElement:function (value) {
31
+ this._element = value;
32
+ return this;
33
+ },
34
+ addChild:function (child) {
35
+ this._children.push(child);
36
+ if (child.getId()) {
37
+ this._namedChildren[core.getBlockAlias(this.getId(), child.getId())] = child;
38
+ }
39
+ child._parent = this;
40
+ return this;
41
+ },
42
+ removeChild: function(child) {
43
+ var index = $.inArray(child, this._children);
44
+ if (index != -1) {
45
+ core.arrayRemove(this._children, index);
46
+ if (child.getId()) {
47
+ delete this._namedChildren[core.getBlockAlias(this.getId(), child.getId())];
48
+ }
49
+ }
50
+ child._parent = null;
51
+ return this;
52
+ },
53
+ getIsSelfContained: function() {
54
+ return this._isSelfContained;
55
+ },
56
+ setIsSelfContained: function(value) {
57
+ this._isSelfContained = value;
58
+ return this;
59
+ },
60
+ getId:function () {
61
+ return this._id || this.getElement().id;
62
+ },
63
+ setId:function (value) {
64
+ this._id = value;
65
+ return this;
66
+ },
67
+ getParent: function() {
68
+ return this._parent;
69
+ },
70
+ getChild: function(name, index) {
71
+ if (core.isFunction(name)) {
72
+ var result = null;
73
+ $.each(this._children, function (i, child) {
74
+ if (name(i, child)) {
75
+ result = child;
76
+ return false;
77
+ }
78
+ else {
79
+ return true;
80
+ }
81
+ });
82
+ return result;
83
+ }
84
+ else {
85
+ return this._namedChildren[name];
86
+ }
87
+ },
88
+ getChildren: function(condition) {
89
+ if (condition === undefined) {
90
+ return this._children.slice(0);
91
+ }
92
+ else {
93
+ var result = [];
94
+ $.each(this._children, function (index, child) {
95
+ if (condition(index, child)) {
96
+ result.push(child);
97
+ }
98
+ });
99
+ return result;
100
+ }
101
+ },
102
+ getAlias: function() {
103
+ var result = undefined;
104
+ var self = this;
105
+ $.each(this._parent._namedChildren, function(name, child) {
106
+ if (child === self) {
107
+ result = name;
108
+ return false;
109
+ }
110
+ else {
111
+ return true;
112
+ }
113
+ });
114
+
115
+ return result;
116
+ },
117
+ _trigger: function(name, e) {
118
+ if (!e.stopped && this._eventHandlers[name] !== undefined) {
119
+ $.each(this._eventHandlers[name], function(key, value) {
120
+ var result = value.callback.call(value.target, e);
121
+ if (result === false) {
122
+ e.stopped = true;
123
+ }
124
+ return result;
125
+ });
126
+ }
127
+ return e.result;
128
+ },
129
+ trigger: function(name, e, bubble, propagate) {
130
+ if (e === undefined) {
131
+ e = {};
132
+ }
133
+ if (e.target === undefined) {
134
+ e.target = this;
135
+ }
136
+ if (propagate === undefined) {
137
+ propagate = false;
138
+ }
139
+ if (bubble === undefined) {
140
+ bubble = true;
141
+ }
142
+ this._trigger(name, e);
143
+ if (propagate) {
144
+ $.each(this.getChildren(), function (index, child) {
145
+ child.trigger(name, e, false, propagate);
146
+ });
147
+ }
148
+ if (bubble && this.getParent()) {
149
+ this.getParent().trigger(name, e, bubble, false);
150
+ }
151
+ return e.result;
152
+ },
153
+ on: function(name, target, callback, sortOrder) {
154
+ if (this._eventHandlers[name] === undefined) {
155
+ this._eventHandlers[name] = [];
156
+ }
157
+ if (sortOrder === undefined) {
158
+ sortOrder = 0;
159
+ }
160
+ this._eventHandlers[name].push({target: target, callback: callback, sortOrder: sortOrder});
161
+ this._eventHandlers[name].sort(function(a, b) {
162
+ if (a.sortOrder < b.sortOrder) return -1;
163
+ if (a.sortOrder > b.sortOrder) return 1;
164
+ return 0;
165
+ });
166
+ return this;
167
+ },
168
+ off:function (name, target, callback) {
169
+ if (this._eventHandlers[name] === undefined) {
170
+ this._eventHandlers[name] = [];
171
+ }
172
+ var found = -1;
173
+ $.each(this._eventHandlers[name], function(index, handler) {
174
+ if (handler.target == target && handler.callback == callback) {
175
+ found = index;
176
+ return false;
177
+ }
178
+ else {
179
+ return true;
180
+ }
181
+ });
182
+
183
+ if (found != -1) {
184
+ core.arrayRemove(this._eventHandlers[name], found);
185
+ }
186
+ },
187
+ setContent: function(content) {
188
+ if ($.type(content) != 'string') {
189
+ if (content.content && this.getId() && content.content[this.getId()]) {
190
+ content = content.content[this.getId()];
191
+ }
192
+ else {
193
+ return this;
194
+ }
195
+ }
196
+
197
+ var vars = layout.beginGeneratingBlocks(this);
198
+ content = $(content);
199
+ $(this.getElement()).replaceWith(content);
200
+ this.setElement(content[0]);
201
+ layout.endGeneratingBlocks(vars);
202
+
203
+ return this;
204
+ },
205
+ getData: function(key) {
206
+ return this._data[key];
207
+ },
208
+ setData: function(key, value) {
209
+ this._data[key] = value;
210
+ return this;
211
+ },
212
+ getText: function (key) {
213
+ if (this._text[key] === undefined) {
214
+ this._text[key] = this.$().data(key + '-text');
215
+ }
216
+ return this._text[key];
217
+ },
218
+ getJsonData: function(attributeName, fieldName) {
219
+ if (this._json[attributeName] === undefined) {
220
+ this._json[attributeName] = json.decodeAttribute(this.$().data(attributeName));
221
+ }
222
+ return fieldName === undefined ? this._json[attributeName] : this._json[attributeName][fieldName];
223
+ }
224
+ });
225
+ });
js/src/Mana/Core/Config.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/Config', ['jquery'], function ($) {
2
+ return Mana.Object.extend('Mana/Core/Config', {
3
+ _init: function () {
4
+ this._data = {
5
+ debug: false,
6
+ showOverlay: true,
7
+ showWait: true
8
+ };
9
+ },
10
+ getData: function (key) {
11
+ return this._data[key];
12
+ },
13
+ setData: function (key, value) {
14
+ this._data[key] = value;
15
+ return this;
16
+ },
17
+ set: function (data) {
18
+ $.extend(this._data, data);
19
+ return this;
20
+ },
21
+ getBaseUrl: function (url) {
22
+ return url.indexOf(this.getData('url.base')) == 0
23
+ ? this.getData('url.base')
24
+ : this.getData('url.secureBase');
25
+ },
26
+
27
+ });
28
+ });
js/src/Mana/Core/Core.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core', ['jquery'], function ($) {
2
+ return Mana.Object.extend('Mana/Core', {
3
+ getClasses: function(element) {
4
+ return element.className.split(/\s+/);
5
+ },
6
+ getPrefixedClass: function(element, prefix) {
7
+ var result = '';
8
+ //noinspection FunctionWithInconsistentReturnsJS
9
+ $.each(this.getClasses(element), function(key, value) {
10
+ if (value.indexOf(prefix) == 0) {
11
+ result = value.substr(prefix.length);
12
+ return false;
13
+ }
14
+ });
15
+
16
+ return result;
17
+ },
18
+ // Array Remove - By John Resig (MIT Licensed)
19
+ arrayRemove:function (array, from, to) {
20
+ var rest = array.slice((to || from) + 1 || array.length);
21
+ array.length = from < 0 ? array.length + from : from;
22
+ return array.push.apply(array, rest);
23
+ },
24
+ getBlockAlias: function(parentId, childId) {
25
+ var pos;
26
+ if ((pos = childId.indexOf(parentId + '-')) === 0) {
27
+ return childId.substr((parentId + '-').length);
28
+ }
29
+ else {
30
+ return childId;
31
+ }
32
+ },
33
+ count: function(obj) {
34
+ var result = 0;
35
+ $.each(obj, function() {
36
+ result++;
37
+ });
38
+ return result;
39
+ },
40
+ // from underscore.js
41
+ isFunction: function(obj) {
42
+ return !!(obj && obj.constructor && obj.call && obj.apply);
43
+ },
44
+ isString: function (obj) {
45
+ return Object.prototype.toString.call(obj) == '[object String]';
46
+ }
47
+ });
48
+ });
js/src/Mana/Core/Json.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/Json', ['jquery', 'singleton:Mana/Core'], function ($, core) {
2
+ return Mana.Object.extend('Mana/Core/Json', {
3
+ parse: function (what) {
4
+ return $.parseJSON(what);
5
+ },
6
+ stringify: function (what) {
7
+ return Object.toJSON(what);
8
+ },
9
+ decodeAttribute: function (what) {
10
+ if (core.isString(what)) {
11
+ var encoded = what.split("\"");
12
+ var decoded = [];
13
+ $.each(encoded, function (key, value) {
14
+ decoded.push(value.replace(/'/g, "\""));
15
+ });
16
+ var result = decoded.join("'");
17
+ return this.parse(result);
18
+ }
19
+ else {
20
+ return what;
21
+ }
22
+ }
23
+ });
24
+ });
js/src/Mana/Core/Layout.js ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/Layout', ['jquery', 'singleton:Mana/Core'], function ($, core, undefined) {
2
+ return Mana.Object.extend('Mana/Core/Layout', {
3
+ _init: function () {
4
+ this._pageBlock = null;
5
+ },
6
+ getPageBlock: function () {
7
+ return this._pageBlock;
8
+ },
9
+ getBlock: function (blockName) {
10
+ return this._getBlockRecursively(this.getPageBlock(), blockName);
11
+ },
12
+ getBlockForElement: function(el) {
13
+ var blockInfo = this._getElementBlockInfo(el);
14
+ return blockInfo ? this.getBlock(blockInfo.id) : null;
15
+ },
16
+ _getBlockRecursively: function (block, blockName) {
17
+ if (block.getId() == blockName) {
18
+ return block;
19
+ }
20
+
21
+ var self = this, result = null;
22
+ $.each(block.getChildren(), function (index, child) {
23
+ result = self._getBlockRecursively(child, blockName);
24
+ return result ? false : true;
25
+ });
26
+ return result;
27
+ },
28
+ beginGeneratingBlocks: function (parentBlock) {
29
+ var vars = {
30
+ parentBlock: parentBlock,
31
+ namedBlocks: {}
32
+ };
33
+ if (parentBlock) {
34
+ parentBlock.trigger('unload', {}, false, true);
35
+ parentBlock.trigger('unbind', {}, false, true);
36
+ vars.namedBlocks = this._removeAnonymousBlocks(parentBlock);
37
+ }
38
+ return vars;
39
+ },
40
+ endGeneratingBlocks: function (vars) {
41
+ var parentBlock = vars.parentBlock, namedBlocks = vars.namedBlocks;
42
+ var self = this;
43
+ this._collectBlockTypes(parentBlock ? parentBlock.getElement() : document, function (blockTypes) {
44
+ if (!self._pageBlock) {
45
+ var body = document.body, $body = $(body);
46
+ var typeName = $body.attr('data-m-block');
47
+ var PageBlock = typeName ? blockTypes[typeName] : blockTypes['Mana/Core/PageBlock'];
48
+ self._pageBlock = new PageBlock()
49
+ .setElement($('body')[0])
50
+ .setId('page');
51
+ }
52
+ var initialPageLoad = (parentBlock === undefined);
53
+ if (initialPageLoad) {
54
+ parentBlock = self.getPageBlock();
55
+ }
56
+
57
+ self._generateBlocksInElement(parentBlock.getElement(), parentBlock, blockTypes, namedBlocks);
58
+ $.each(namedBlocks, function (id, namedBlock) {
59
+ namedBlock.parent.removeChild(namedBlock.child);
60
+ });
61
+ parentBlock.trigger('bind', {}, false, true);
62
+ parentBlock.trigger('load', {}, false, true);
63
+
64
+ // BREAKPOINT: all generated client side blocks
65
+ var a = 1;
66
+ });
67
+ },
68
+ _collectBlockTypes: function (element, callback) {
69
+ var blockTypeNames = ['Mana/Core/PageBlock'];
70
+ this._collectBlockTypesInElement(element, blockTypeNames);
71
+ Mana.requireOptional(blockTypeNames, function () {
72
+ var blockTypeValues = arguments;
73
+ ;
74
+ var blockTypes = {};
75
+ $.each(blockTypeNames, function (key, value) {
76
+ blockTypes[value] = blockTypeValues[key];
77
+ // if (blockTypeValues[key]) {
78
+ // blockTypes[value] = blockTypeValues[key];
79
+ // }
80
+ // else {
81
+ // throw "Block type '" + value + "' is not defined.";
82
+ // }
83
+ });
84
+ callback(blockTypes);
85
+ });
86
+ },
87
+ _collectBlockTypesInElement: function (element, blockTypeNames) {
88
+ var layout = this;
89
+ $(element).children().each(function () {
90
+ var blockInfo = layout._getElementBlockInfo(this);
91
+ if (blockInfo) {
92
+ if (blockTypeNames.indexOf(blockInfo.typeName) == -1) {
93
+ blockTypeNames.push(blockInfo.typeName);
94
+ }
95
+ }
96
+ layout._collectBlockTypesInElement(this, blockTypeNames);
97
+ });
98
+ },
99
+ _removeAnonymousBlocks: function (parentBlock) {
100
+ var self = this, result = {};
101
+ $.each(parentBlock.getChildren().slice(0), function (key, block) {
102
+ if (block.getId()) {
103
+ result[block.getId()] = { parent: parentBlock, child: block};
104
+ self._removeAnonymousBlocks(block);
105
+ }
106
+ else {
107
+ parentBlock.removeChild(block);
108
+ }
109
+ });
110
+ return result;
111
+ },
112
+ _getElementBlockInfo: function (element) {
113
+ var $element = $(element);
114
+ var id, typeName;
115
+
116
+ if ((id = core.getPrefixedClass(element, 'mb-'))
117
+ || (typeName = $element.attr('data-m-block'))
118
+ || $element.hasClass('m-block')) {
119
+ return {
120
+ id: id || element.id,
121
+ typeName: typeName || $element.attr('data-m-block') || 'Mana/Core/Block'
122
+ };
123
+ }
124
+
125
+ return null;
126
+ },
127
+ _generateBlocksInElement: function (element, block, blockTypes, namedBlocks) {
128
+ var layout = this;
129
+ $(element).children().each(function () {
130
+ var childBlock = layout._createBlockFromElement(this, block, blockTypes, namedBlocks);
131
+ layout._generateBlocksInElement(this, childBlock || block, blockTypes, namedBlocks);
132
+ });
133
+ },
134
+ _createBlockFromElement: function (element, parent, blockTypes, namedBlocks) {
135
+ var blockInfo = this._getElementBlockInfo(element);
136
+
137
+ if (blockInfo) {
138
+ var type = blockTypes[blockInfo.typeName], block, exists = false;
139
+ if (blockInfo.id) {
140
+ block = parent.getChild(core.getBlockAlias(parent.getId(), blockInfo.id));
141
+ if (block) {
142
+ exists = true;
143
+ delete namedBlocks[blockInfo.id];
144
+ }
145
+ else {
146
+ if (type) {
147
+ block = new type();
148
+ }
149
+ else {
150
+ console.error("Block '" + blockInfo.typeName + "' is not defined");
151
+ }
152
+ }
153
+ if (block) {
154
+ block.setId(blockInfo.id);
155
+ }
156
+ }
157
+ else {
158
+ if (type) {
159
+ block = new type();
160
+ }
161
+ else {
162
+ console.error("Block '" + blockInfo.typeName + "' is not defined");
163
+ }
164
+ }
165
+ if (block) {
166
+ block.setElement(element);
167
+ if (!exists) {
168
+ parent.addChild(block);
169
+ }
170
+ return block;
171
+ }
172
+ else {
173
+ return null;
174
+ }
175
+ }
176
+ else {
177
+ return null;
178
+ }
179
+ },
180
+ preparePopup: function(options) {
181
+ options = this._preparePopupOptions(options);
182
+ if (options.$popup === undefined) {
183
+ var $popup = $('#m-popup');
184
+ $popup.css({"width": "auto", "height": "auto"});
185
+ if (core.isString(options.content)) {
186
+ $popup.html(options.content);
187
+ }
188
+ else {
189
+ $popup.html($(options.content).html());
190
+ }
191
+
192
+ if (options.popup['class']) {
193
+ $popup.addClass(options.popup['class']);
194
+ }
195
+
196
+ options.$popup = $popup;
197
+ }
198
+ return options.$popup;
199
+ },
200
+ _preparePopupOptions: function(options) {
201
+ var result = {
202
+ overlay: {
203
+ opacity: 0.2
204
+ },
205
+ popup: {
206
+ blockName: 'Mana/Core/PopupBlock'
207
+ },
208
+ popupBlock: {},
209
+ fadein: {
210
+ overlayTime: 0,
211
+ popupTime: 300
212
+ },
213
+ fadeout: {
214
+ overlayTime: 0,
215
+ popupTime: 500
216
+ }
217
+ };
218
+ $.extend(true, result, options);
219
+ return result;
220
+ },
221
+ showPopup: function (options) {
222
+ options = this._preparePopupOptions(options);
223
+
224
+ var self = this;
225
+ Mana.requireOptional([options.popup.blockName], function (PopupBlockClass) {
226
+ var fadeoutCallback = options.fadeout.callback;
227
+ options.fadeout.callback = function () {
228
+ $('#m-popup').fadeOut(options.fadeout.popupTime, function () {
229
+ if (fadeoutCallback) {
230
+ fadeoutCallback();
231
+ }
232
+ });
233
+ };
234
+ var overlay = self.getPageBlock().showOverlay('m-popup-overlay', options.fadeout);
235
+ var $popup = self.preparePopup(options);
236
+ overlay.animate({ opacity: options.overlay.opacity }, options.fadein.overlayTime, function () {
237
+ $popup.show();
238
+
239
+ var popupBlock = new PopupBlockClass();
240
+ popupBlock.setElement($popup[0]);
241
+ var vars = self.beginGeneratingBlocks(popupBlock);
242
+ self.endGeneratingBlocks(vars);
243
+ if (popupBlock.prepare) {
244
+ popupBlock.prepare(options.popupBlock);
245
+ }
246
+
247
+ $('.m-popup-overlay').on('click', function () {
248
+ self.hidePopup();
249
+ return false;
250
+ });
251
+ if (!self._popupEscListenerInitialized) {
252
+ self._popupEscListenerInitialized = true;
253
+ $(document).keydown(function (e) {
254
+ if ($('.m-popup-overlay').length) {
255
+ if (e.keyCode == 27) {
256
+ self.hidePopup();
257
+ return false;
258
+ }
259
+ }
260
+ return true;
261
+ });
262
+ }
263
+
264
+ $popup
265
+ .css("top", (($(window).height() - $popup.outerHeight()) / 2) + $(window).scrollTop() + "px")
266
+ .css("left", (($(window).width() - $popup.outerWidth()) / 2) + $(window).scrollLeft() + "px");
267
+
268
+ var popupHeight = $popup.height();
269
+ $popup.hide().css({"height": "auto"});
270
+
271
+ var css = {
272
+ left: $popup.css('left'),
273
+ top: $popup.css('top'),
274
+ width: $popup.width() + "px",
275
+ height: $popup.height() + "px"
276
+ };
277
+
278
+ $popup.children().each(function () {
279
+ $(this).css({
280
+ width: ($popup.width() + $(this).width() - $(this).outerWidth()) + "px",
281
+ height: ($popup.height() + $(this).height() - $(this).outerHeight()) + "px"
282
+ });
283
+ });
284
+ $popup
285
+ .css({
286
+ top: ($(window).height() / 2) + $(window).scrollTop() + "px",
287
+ left: ($(window).width() / 2) + $(window).scrollLeft() + "px",
288
+ width: 0 + "px",
289
+ height: 0 + "px"
290
+ })
291
+ .show();
292
+
293
+ $popup.animate(css, options.fadein.popupTime, options.fadein.callback);
294
+ });
295
+ });
296
+ },
297
+ hidePopup: function () {
298
+ this.getPageBlock().hideOverlay();
299
+ }
300
+ });
301
+ });
js/src/Mana/Core/Mana.js ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var Mana = Mana || {};
2
+
3
+ (function($, $p, undefined) {
4
+
5
+
6
+ $.extend(Mana, {
7
+ _singletons: {},
8
+ _defines: { jquery: $, prototype: $p },
9
+
10
+ /**
11
+ * Defines JavaScript class/module
12
+ * @param name class/module name
13
+ * @param dependencies
14
+ * @param callback
15
+ */
16
+ define:function (name, dependencies, callback) {
17
+ var resolved = Mana._resolveDependencyNames(dependencies);
18
+ return Mana._define(name, resolved.names, function() {
19
+ return callback.apply(this, Mana._resolveDependencies(arguments, resolved.deps));
20
+ });
21
+ },
22
+
23
+ require:function(dependencies, callback) {
24
+ var resolved = Mana._resolveDependencyNames(dependencies);
25
+ return Mana._define(null, resolved.names, function () {
26
+ return callback.apply(this, Mana._resolveDependencies(arguments, resolved.deps));
27
+ });
28
+ },
29
+
30
+ _define: function(name, deps, callback) {
31
+ var args = [];
32
+ $.each(deps, function(index, dep) {
33
+ args.push(Mana._resolveDefine(dep));
34
+ });
35
+
36
+ var result = callback.apply(this, args);
37
+ if (name) {
38
+ Mana._defines[name] = result;
39
+ }
40
+
41
+ return result;
42
+ },
43
+ _resolveDefine: function(name) {
44
+ if (Mana._defines[name] === undefined) {
45
+ console.warn("'" + name + "' is not defined");
46
+ }
47
+ return Mana._defines[name];
48
+ },
49
+
50
+ requireOptional: function (dependencies, callback) {
51
+ var resolved = Mana._resolveDependencyNames(dependencies);
52
+ return Mana._define(null, resolved.names, function () {
53
+ return callback.apply(this, Mana._resolveDependencies(arguments, resolved.deps));
54
+ });
55
+ // var resolved = Mana._resolveDependencyNames(dependencies);
56
+ // var args = [];
57
+ // var argResolved = [];
58
+ // function _finishRequire() {
59
+ // var allResolved = true;
60
+ // $.each(argResolved, function(index, isResolved) {
61
+ // if (!isResolved) {
62
+ // allResolved = false;
63
+ // return false;
64
+ // }
65
+ // else {
66
+ // return true;
67
+ // }
68
+ // });
69
+ // if (allResolved) {
70
+ // return callback.apply(this, Mana._resolveDependencies(args, resolved.deps));
71
+ // }
72
+ // }
73
+ // $.each(resolved.names, function () {
74
+ // args.push(undefined);
75
+ // argResolved.push(false);
76
+ // });
77
+ // $.each(resolved.names, function(index, name) {
78
+ // require([name], function(arg) {
79
+ // args[index] = arg;
80
+ // argResolved[index] = true;
81
+ // return _finishRequire.apply(this);
82
+ // }, function() {
83
+ // argResolved[index] = true;
84
+ // return _finishRequire.apply(this);
85
+ // });
86
+ // });
87
+ },
88
+
89
+ _resolveDependencyNames: function(dependencies) {
90
+ var depNames = [];
91
+ var deps = [];
92
+ $.each(dependencies, function (index, dependency) {
93
+ var pos = dependency.indexOf(':');
94
+ var dep = { name:dependency, resolver:'' };
95
+ if (pos != -1) {
96
+ dep = { name:dependency.substr(pos + 1), resolver:dependency.substr(0, pos) };
97
+ }
98
+
99
+ Mana._resolveDependencyName(dep);
100
+
101
+ depNames.push(dep.name);
102
+ deps.push(dep);
103
+ });
104
+
105
+ return { names: depNames, deps: deps};
106
+ },
107
+
108
+ _resolveDependencies:function (args, deps) {
109
+ $.each(args, function (index, arg) {
110
+ args[index] = Mana._resolveDependency(deps[index], arg);
111
+ });
112
+
113
+ return args;
114
+ },
115
+
116
+ _resolveDependencyName: function(dep) {
117
+ },
118
+
119
+ _resolveDependency:function (dep, value) {
120
+ if (value !== undefined) {
121
+ switch (dep.resolver) {
122
+ case 'singleton':
123
+ if (Mana._singletons[dep.name] === undefined) {
124
+ Mana._singletons[dep.name] = new value();
125
+ }
126
+ return Mana._singletons[dep.name];
127
+ }
128
+ }
129
+ return value;
130
+ }
131
+
132
+ });
133
+ })(jQuery, $);
134
+
js/src/Mana/Core/Object.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Simple JavaScript Inheritance
2
+ * By John Resig http://ejohn.org/
3
+ * MIT Licensed.
4
+ */
5
+ // Inspired by base2 and Prototype
6
+ (function (undefined) {
7
+ var initializing = false, fnTest = /xyz/.test(function () { xyz;}) ? /\b_super\b/ : /.*/;
8
+
9
+ // The base Class implementation (does nothing)
10
+ Mana.Object = function () {
11
+ };
12
+
13
+ // Create a new Class that inherits from this class
14
+ Mana.Object.extend = function (className, prop) {
15
+ if (prop === undefined) {
16
+ prop = className;
17
+ className = undefined;
18
+ }
19
+ var _super = this.prototype;
20
+
21
+ // Instantiate a base class (but only create the instance,
22
+ // don't run the init constructor)
23
+ initializing = true;
24
+ var prototype = new this();
25
+ initializing = false;
26
+
27
+ // Copy the properties over onto the new prototype
28
+ for (var name in prop) {
29
+ // Check if we're overwriting an existing function
30
+ //noinspection JSUnfilteredForInLoop
31
+ prototype[name] = typeof prop[name] == "function" &&
32
+ typeof _super[name] == "function" && fnTest.test(prop[name]) ?
33
+ (function (name, fn) {
34
+ return function () {
35
+ var tmp = this._super;
36
+
37
+ // Add a new ._super() method that is the same method
38
+ // but on the super-class
39
+ //noinspection JSUnfilteredForInLoop
40
+ this._super = _super[name];
41
+
42
+ // The method only need to be bound temporarily, so we
43
+ // remove it when we're done executing
44
+ var ret = fn.apply(this, arguments);
45
+ this._super = tmp;
46
+
47
+ return ret;
48
+ };
49
+ })(name, prop[name]) :
50
+ prop[name];
51
+ }
52
+
53
+ // The dummy class constructor
54
+ var Object;
55
+ if (className === undefined) {
56
+ // All construction is actually done in the init method
57
+ Object = function Object() { if (!initializing && this._init) this._init.apply(this, arguments); };
58
+ }
59
+ else {
60
+ // give constructor a meaningful name for easier debugging
61
+ eval("Object = function " + className.replace(/\//g, '_') + "() { if (!initializing && this._init) this._init.apply(this, arguments); };");
62
+ }
63
+
64
+ // Populate our constructed prototype object
65
+ Object.prototype = prototype;
66
+
67
+ // Enforce the constructor to be what we expect
68
+ Object.prototype.constructor = Object;
69
+
70
+ // And make this class extendable
71
+ Object.extend = arguments.callee;
72
+
73
+ return Object;
74
+ };
75
+ })();
js/src/Mana/Core/PageBlock.js ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/PageBlock', ['jquery', 'Mana/Core/Block', 'singleton:Mana/Core/Config'],
2
+ function ($, Block, config)
3
+ {
4
+ return Block.extend('Mana/Core/PageBlock', {
5
+ _init: function () {
6
+ this._defaultOverlayFadeout = { overlayTime: 0, popupTime: 0, callback: null };
7
+ this._overlayFadeout = this._defaultOverlayFadeout;
8
+ this._super();
9
+ },
10
+ _subscribeToHtmlEvents: function() {
11
+ var self = this;
12
+ var inResize = false;
13
+ function _raiseResize() {
14
+ if (inResize) {
15
+ return;
16
+ }
17
+ inResize = true;
18
+ self.resize();
19
+ inResize = false;
20
+ }
21
+
22
+
23
+ return this
24
+ ._super()
25
+ .on('bind', this, function() {
26
+ $(window).on('load', _raiseResize);
27
+ $(window).on('resize', _raiseResize);
28
+ })
29
+ .on('unbind', this, function() {
30
+ $(window).off('load', _raiseResize);
31
+ $(window).off('resize', _raiseResize);
32
+ });
33
+
34
+ },
35
+ _subscribeToBlockEvents: function() {
36
+ return this
37
+ ._super()
38
+ .on('load', this, function () {
39
+ this.resize();
40
+ });
41
+ },
42
+ resize: function () {
43
+ this.trigger('resize', {}, false, true);
44
+ },
45
+ showOverlay: function(overlayClass, fadeout) {
46
+ this._overlayFadeout = fadeout || this._defaultOverlayFadeout;
47
+ var overlay = overlayClass ? $('<div class="m-overlay ' + overlayClass + '"></div>') : $('<div class="m-overlay"></div>');
48
+ overlay.appendTo(this.getElement());
49
+ overlay.css({left:0, top:0}).width($(document).width()).height($(document).height());
50
+ return overlay;
51
+ },
52
+ hideOverlay: function() {
53
+ var self = this;
54
+ $('.m-overlay').fadeOut(this._overlayFadeout.overlayTime, function () {
55
+ $('.m-overlay').remove();
56
+ if (self._overlayFadeout.callback) {
57
+ self._overlayFadeout.callback();
58
+ }
59
+ self._overlayFadeout = self._defaultOverlayFadeout;
60
+ })
61
+ return this;
62
+ },
63
+ showWait: function() {
64
+ $('#m-wait').show();
65
+ return this;
66
+ },
67
+ hideWait: function() {
68
+ $('#m-wait').hide();
69
+ return this;
70
+ },
71
+ getShowDebugMessages: function() {
72
+ return config.getData('debug');
73
+ },
74
+ getShowOverlay:function () {
75
+ return config.getData('showOverlay');
76
+ },
77
+ getShowWait:function () {
78
+ return config.getData('showWait');
79
+ }
80
+ });
81
+ });
js/src/Mana/Core/PopupBlock.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/PopupBlock', ['jquery', 'Mana/Core/Block', 'singleton:Mana/Core/Layout'], function ($, Block, layout) {
2
+ return Block.extend('Mana/Core/PopupBlock', {
3
+ prepare: function(options) {
4
+ var self = this;
5
+ this._host = options.host;
6
+
7
+ this.$().find('.btn-close').on('click', function() { return self._close(); });
8
+ },
9
+ _close: function() {
10
+ layout.hidePopup();
11
+ return false;
12
+ }
13
+ });
14
+ });
js/src/Mana/Core/StringTemplate.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/StringTemplate', ['jquery'], function ($, undefined) {
2
+ return Mana.Object.extend('Mana/Core/StringTemplate', {
3
+ concat: function(parsedTemplate, vars) {
4
+ var result = '';
5
+ $.each(parsedTemplate, function(i, token) {
6
+ var type = token[0];
7
+ var text = token[1];
8
+ if (type == 'string') {
9
+ result += text;
10
+ }
11
+ else if (type == 'var') {
12
+ if (vars[text] !== undefined) {
13
+ result += vars[text];
14
+ }
15
+ else {
16
+ result += '{{' + text + '}}';
17
+ }
18
+ }
19
+ });
20
+ return result;
21
+ }
22
+ });
23
+ });
js/src/Mana/Core/UrlTemplate.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/UrlTemplate', ['singleton:Mana/Core/Base64', 'singleton:Mana/Core/Config'], function (base64, config) {
2
+ return Mana.Object.extend('Mana/Core/UrlTemplate', {
3
+ decodeAttribute: function (data) {
4
+ if (config.getData('debug')) {
5
+ return data;
6
+ }
7
+ else {
8
+ return base64.decode(data.replace(/-/g, '+').replace(/_/g, '/').replace(/,/g, '='));
9
+ }
10
+ },
11
+ encodeAttribute: function(data) {
12
+ return base64.encode(data).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ',');
13
+ }
14
+ });
15
+ });
js/src/Mana/Core/Utf8.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.define('Mana/Core/Utf8', [], function () {
2
+ return Mana.Object.extend('Mana/Core/Utf8', {
3
+ decode: function (str_data) {
4
+ // Converts a UTF-8 encoded string to ISO-8859-1
5
+ //
6
+ // version: 1109.2015
7
+ // discuss at: http://phpjs.org/functions/utf8_decode
8
+ // + original by: Webtoolkit.info (http://www.webtoolkit.info/)
9
+ // + input by: Aman Gupta
10
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
11
+ // + improved by: Norman "zEh" Fuchs
12
+ // + bugfixed by: hitwork
13
+ // + bugfixed by: Onno Marsman
14
+ // + input by: Brett Zamir (http://brett-zamir.me)
15
+ // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
16
+ // * example 1: utf8_decode('Kevin van Zonneveld');
17
+ // * returns 1: 'Kevin van Zonneveld'
18
+ var tmp_arr = [],
19
+ i = 0,
20
+ ac = 0,
21
+ c1 = 0,
22
+ c2 = 0,
23
+ c3 = 0;
24
+
25
+ str_data += '';
26
+
27
+ while (i < str_data.length) {
28
+ c1 = str_data.charCodeAt(i);
29
+ if (c1 < 128) {
30
+ tmp_arr[ac++] = String.fromCharCode(c1);
31
+ i++;
32
+ } else if (c1 > 191 && c1 < 224) {
33
+ c2 = str_data.charCodeAt(i + 1);
34
+ tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
35
+ i += 2;
36
+ } else {
37
+ c2 = str_data.charCodeAt(i + 1);
38
+ c3 = str_data.charCodeAt(i + 2);
39
+ tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
40
+ i += 3;
41
+ }
42
+ }
43
+
44
+ return tmp_arr.join('');
45
+ }
46
+ });
47
+ });
js/src/Mana/Core/header.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @category Mana
3
+ * @package Mana_Core
4
+ * @copyright Copyright (c) http://www.manadev.com
5
+ * @license http://www.manadev.com/license Proprietary License
6
+ */
7
+
8
+ ; // make JS merging easier
9
+
js/src/Mana/Core/init.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ Mana.require(['jquery', 'singleton:Mana/Core/Layout', 'singleton:Mana/Core/Ajax'], function($, layout, ajax) {
2
+ function _generateBlocks() {
3
+ var vars = layout.beginGeneratingBlocks();
4
+ layout.endGeneratingBlocks(vars);
5
+ }
6
+ $(function() {
7
+ _generateBlocks();
8
+ ajax.startIntercepting();
9
+ });
10
+ });
js/src/Mana/Core/obsolete.js ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //region (Obsolete) additional jQuery functions used in MANAdev extensions
2
+ (function($) {
3
+ // this variables are private to this code block
4
+ var _translations = {};
5
+ var _options = {};
6
+
7
+ // Default usage of this function is to pass a string in original language and get translated string as a
8
+ // result. This same function is also used to register original and translated string pairs - in this case
9
+ // plain object with mappings is passed as the only parameter. Anyway, we expect the only parameter to be
10
+ // passed
11
+ $.__ = function(key) {
12
+ if (typeof key === "string") { // do translation
13
+ var args = arguments;
14
+ args[0] = _translations[key] ? _translations[key] : key;
15
+ return $.vsprintf(args);
16
+ }
17
+ else { // register translation pairs
18
+ _translations = $.extend(_translations, key);
19
+ }
20
+ };
21
+ // Default usage of this function is to pass a CSS selector and get plain object of associated options as
22
+ // a result. This same function is used to register selector-object pairs in this case plain object with
23
+ // with mappings is passed as the only parameter. Anyway, we expect the only parameter to be passed
24
+ $.options = function (selector) {
25
+ if (typeof selector === "string") { // return associated options
26
+ return _options[selector];
27
+ }
28
+ else { // register selector-options pairs
29
+ _options = $.extend(true, _options, selector);
30
+ }
31
+ $(document).trigger('m-options-changed');
32
+ };
33
+
34
+ $.dynamicUpdate = function (update) {
35
+ if (update) {
36
+ $.each(update, function(index, update) {
37
+ $(update.selector).html(update.html);
38
+ });
39
+ }
40
+ }
41
+ $.dynamicReplace = function (update, loud, decode) {
42
+ if (update) {
43
+ $.each(update, function(selector, html) {
44
+ var selected = $(selector);
45
+ if (selected.length) {
46
+ var first = $(selected[0]);
47
+ if (selected.length > 1) {
48
+ selected.slice(1).remove();
49
+ }
50
+ first.replaceWith(decode ? $.utf8_decode(html) : html);
51
+ }
52
+ else {
53
+ if (loud) {
54
+ throw 'There is no content to replace.';
55
+ }
56
+ }
57
+ //console.log('Selector: ' + selector);
58
+ //console.log('HTML: ' + html);
59
+ });
60
+ }
61
+ }
62
+
63
+ $.errorUpdate = function(selector, error) {
64
+ if (!selector) {
65
+ selector = '#messages';
66
+ }
67
+ var messages = $(selector);
68
+ if (messages.length) {
69
+ messages.html('<ul class="messages"><li class="error-msg"><ul><li>' + error + '</li></ul></li></ul>');
70
+ }
71
+ else {
72
+ alert(error);
73
+ }
74
+ }
75
+
76
+ // Array Remove - By John Resig (MIT Licensed)
77
+ $.arrayRemove = function(array, from, to) {
78
+ var rest = array.slice((to || from) + 1 || array.length);
79
+ array.length = from < 0 ? array.length + from : from;
80
+ return array.push.apply(array, rest);
81
+ };
82
+ $.mViewport = function() {
83
+ var m = document.compatMode == 'CSS1Compat';
84
+ return {
85
+ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
86
+ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
87
+ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
88
+ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
89
+ };
90
+ }
91
+ $.mStickTo = function(el, what) {
92
+ var pos = $(el).offset();
93
+ var viewport = $.mViewport();
94
+ var top = pos.top + el.offsetHeight;
95
+ var left = pos.left + (el.offsetWidth - what.outerWidth()) / 2;
96
+ if (top + what.outerHeight() > viewport.t + viewport.h) {
97
+ top = pos.top - what.outerHeight();
98
+ }
99
+ if (left + what.outerWidth() > viewport.l + viewport.w) {
100
+ left = pos.left + el.offsetWidth - what.outerWidth();
101
+ }
102
+ what.css({left: left + 'px', top: top + 'px'});
103
+ }
104
+
105
+ $.fn.mMarkAttr = function (attr, condition) {
106
+ if (condition) {
107
+ this.attr(attr, attr);
108
+ }
109
+ else {
110
+ this.removeAttr(attr);
111
+ }
112
+ return this;
113
+ };
114
+ // the following function is executed when DOM ir ready. If not use this wrapper, code inside could fail if
115
+ // executed when referenced DOM elements are still being loaded.
116
+ $(function() {
117
+ // fix for IE 7 and IE 8 where dom:loaded may fire too early
118
+ try {
119
+ if (window.mainNav) {
120
+ window.mainNav("nav", {"show_delay":"100", "hide_delay":"100"});
121
+ }
122
+ }
123
+ catch (e) {
124
+
125
+ }
126
+ });
127
+
128
+ $.base64_decode = function (data) {
129
+ // Decodes string using MIME base64 algorithm
130
+ //
131
+ // version: 1109.2015
132
+ // discuss at: http://phpjs.org/functions/base64_decode
133
+ // + original by: Tyler Akins (http://rumkin.com)
134
+ // + improved by: Thunder.m
135
+ // + input by: Aman Gupta
136
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
137
+ // + bugfixed by: Onno Marsman
138
+ // + bugfixed by: Pellentesque Malesuada
139
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
140
+ // + input by: Brett Zamir (http://brett-zamir.me)
141
+ // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
142
+ // - depends on: utf8_decode
143
+ // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
144
+ // * returns 1: 'Kevin van Zonneveld'
145
+ // mozilla has this native
146
+ // - but breaks in 2.0.0.12!
147
+ //if (typeof this.window['btoa'] == 'function') {
148
+ // return btoa(data);
149
+ //}
150
+ var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
151
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
152
+ ac = 0,
153
+ dec = "",
154
+ tmp_arr = [];
155
+
156
+ if (!data) {
157
+ return data;
158
+ }
159
+
160
+ data += '';
161
+
162
+ do { // unpack four hexets into three octets using index points in b64
163
+ h1 = b64.indexOf(data.charAt(i++));
164
+ h2 = b64.indexOf(data.charAt(i++));
165
+ h3 = b64.indexOf(data.charAt(i++));
166
+ h4 = b64.indexOf(data.charAt(i++));
167
+
168
+ bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
169
+
170
+ o1 = bits >> 16 & 0xff;
171
+ o2 = bits >> 8 & 0xff;
172
+ o3 = bits & 0xff;
173
+
174
+ if (h3 == 64) {
175
+ tmp_arr[ac++] = String.fromCharCode(o1);
176
+ } else if (h4 == 64) {
177
+ tmp_arr[ac++] = String.fromCharCode(o1, o2);
178
+ } else {
179
+ tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
180
+ }
181
+ } while (i < data.length);
182
+
183
+ dec = tmp_arr.join('');
184
+ dec = $.utf8_decode(dec);
185
+
186
+ return dec;
187
+ };
188
+ $.utf8_decode = function (str_data) {
189
+ // Converts a UTF-8 encoded string to ISO-8859-1
190
+ //
191
+ // version: 1109.2015
192
+ // discuss at: http://phpjs.org/functions/utf8_decode
193
+ // + original by: Webtoolkit.info (http://www.webtoolkit.info/)
194
+ // + input by: Aman Gupta
195
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
196
+ // + improved by: Norman "zEh" Fuchs
197
+ // + bugfixed by: hitwork
198
+ // + bugfixed by: Onno Marsman
199
+ // + input by: Brett Zamir (http://brett-zamir.me)
200
+ // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
201
+ // * example 1: utf8_decode('Kevin van Zonneveld');
202
+ // * returns 1: 'Kevin van Zonneveld'
203
+ var tmp_arr = [],
204
+ i = 0,
205
+ ac = 0,
206
+ c1 = 0,
207
+ c2 = 0,
208
+ c3 = 0;
209
+
210
+ str_data += '';
211
+
212
+ while (i < str_data.length) {
213
+ c1 = str_data.charCodeAt(i);
214
+ if (c1 < 128) {
215
+ tmp_arr[ac++] = String.fromCharCode(c1);
216
+ i++;
217
+ } else if (c1 > 191 && c1 < 224) {
218
+ c2 = str_data.charCodeAt(i + 1);
219
+ tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
220
+ i += 2;
221
+ } else {
222
+ c2 = str_data.charCodeAt(i + 1);
223
+ c3 = str_data.charCodeAt(i + 2);
224
+ tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
225
+ i += 3;
226
+ }
227
+ }
228
+
229
+ return tmp_arr.join('');
230
+ };
231
+
232
+ var _popupFadeoutOptions = { overlayTime: 500, popupTime: 1000, callback: null };
233
+ $.mSetPopupFadeoutOptions = function(options) {
234
+ _popupFadeoutOptions = options;
235
+ }
236
+ $.fn.extend({
237
+ mPopup: function(name, options) {
238
+ var o = $.extend({
239
+ fadeOut: { overlayTime: 0, popupTime:500, callback:null },
240
+ fadeIn: { overlayTime: 0, popupTime:500, callback: null },
241
+ overlay: { opacity: 0.2},
242
+ popup: { contentSelector:'.' + name + '-text', containerClass:'m-' + name + '-popup-container', top:100 }
243
+
244
+ }, options);
245
+ $(this).live('click', function() {
246
+ if ($.mPopupClosing()) {
247
+ return false;
248
+ }
249
+ // preparations
250
+ var html = $(o.popup.contentSelector).html();
251
+ $.mSetPopupFadeoutOptions(o.fadeOut);
252
+
253
+ // put overlay to prevent interaction with the page and to catch 'cancel' mouse clicks
254
+ var overlay = $('<div class="m-popup-overlay"> </div>');
255
+ overlay.appendTo(document.body);
256
+ overlay.css({left:0, top:0}).width($(document).width()).height($(document).height());
257
+ overlay.animate({ opacity:o.overlay.opacity }, o.fadeIn.overlayTime, function () {
258
+ // all this code is called when overlay animation is over
259
+
260
+ // fill popup with content
261
+ $('#m-popup')
262
+ .css({"width":"auto", "height":"auto"})
263
+ .html(html)
264
+ .addClass(o.popup.containerClass)
265
+ .css("top", (($(window).height() - $('#m-popup').outerHeight()) / 2) - o.popup.top + $(window).scrollTop() + "px")
266
+ .css("left", (($(window).width() - $('#m-popup').outerWidth()) / 2) + $(window).scrollLeft() + "px")
267
+
268
+ // get intended height and set initial height to 0
269
+ var popupHeight = $('#m-popup').height();
270
+ $('#m-popup').show().height(0);
271
+ $('#m-popup').hide().css({"height":"auto"});
272
+
273
+ // calculate intended popup position
274
+ var css = {
275
+ left:$('#m-popup').css('left'),
276
+ top:$('#m-popup').css('top'),
277
+ width:$('#m-popup').width() + "px",
278
+ height:$('#m-popup').height() + "px"
279
+ };
280
+
281
+ // adjust (the only) child of popup container element
282
+ $('#m-popup').children().each(function () {
283
+ $(this).css({
284
+ width:($('#m-popup').width() + $(this).width() - $(this).outerWidth()) + "px",
285
+ height:($('#m-popup').height() + $(this).height() - $(this).outerHeight()) + "px"
286
+ });
287
+ });
288
+
289
+ // make popup a point
290
+ $('#m-popup')
291
+ .css({
292
+ top:($(window).height() / 2) - o.popup.top + $(window).scrollTop() + "px",
293
+ left:($(window).width() / 2) + $(window).scrollLeft() + "px",
294
+ width:0 + "px",
295
+ height:0 + "px"
296
+ })
297
+ .show();
298
+
299
+ // explode popup to intended size
300
+ $('#m-popup').animate(css, o.fadeIn.popupTime, function () {
301
+ if (o.fadeIn.callback) {
302
+ o.fadeIn.callback();
303
+ }
304
+ });
305
+ });
306
+
307
+ // prevent following to target link of <a> tag
308
+ return false;
309
+ });
310
+ }
311
+ });
312
+ var _popupClosing = false;
313
+ $.mPopupClosing = function (value) {
314
+ if (value !== undefined) {
315
+ _popupClosing = value;
316
+ }
317
+ return _popupClosing;
318
+ };
319
+ $.mClosePopup = function () {
320
+ $.mPopupClosing(true);
321
+ $('.m-popup-overlay').fadeOut(_popupFadeoutOptions.overlayTime, function() {
322
+ $('.m-popup-overlay').remove();
323
+ $('#m-popup').fadeOut(_popupFadeoutOptions.popupTime, function() {
324
+ if (_popupFadeoutOptions.callback) {
325
+ _popupFadeoutOptions.callback();
326
+ }
327
+ $.mPopupClosing(false);
328
+ });
329
+ })
330
+ return false;
331
+ };
332
+
333
+ })(jQuery);
334
+ //endregion
js/src/Mana/Core/rwd.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mana.require(['jquery'], function($) {
2
+ var bp = {
3
+ xsmall: 479,
4
+ small: 599,
5
+ medium: 770,
6
+ large: 979,
7
+ xlarge: 1199
8
+ };
9
+ Mana.rwdIsMobile = false;
10
+ $(function() {
11
+ if (window.enquire) {
12
+ enquire.register('screen and (max-width: ' + bp.medium + 'px)', {
13
+ match: function () {
14
+ Mana.rwdIsMobile = true;
15
+ $(document).trigger('m-rwd-mobile');
16
+ },
17
+ unmatch: function () {
18
+ Mana.rwdIsMobile = false;
19
+ $(document).trigger('m-rwd-wide');
20
+ }
21
+ });
22
+ }
23
+ });
24
+ });
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mana_Filters</name>
4
- <version>13.12.04.10</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Add multiple selection features for attribute and price filters in Magento layered navigation</description>
11
  <notes>Adds multiple selection features for attribute and price filters in Magento layered navigation.</notes>
12
  <authors><author><name>Mana Team</name><user>auto-converted</user><email>team@manadev.com</email></author></authors>
13
- <date>2013-12-04</date>
14
- <time>11:03:27</time>
15
- <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="mana_core.css" hash="146f6612e4af69b09c8dabdd04034956"/></dir><dir name="images"><dir name="mana_core"><file name="m-wait.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="jquery"><file name="ui.css" hash="4ab351feeb25bfbcb84f61e722545525"/><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="95f9cceeb9d742dd3e917ec16ed754f8"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="f040b255ca13e693da34ab33c7d6b554"/><file name="ui-bg_flat_0_aaaaaa_40x100.png" hash="2a44fbdb7360c60122bcf6dcef0387d8"/><file name="ui-bg_flat_10_000000_40x100.png" hash="c18cd01623c7fed23c80d53e2f5e7c78"/><file name="ui-bg_flat_75_ffffff_40x100.png" hash="8692e6efddf882acbff144c38ea7dfdf"/><file name="ui-bg_glass_55_fbf9ee_1x400.png" hash="f8f4558e0b92ff2cd6136781533902ec"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="e5a8f32e28fd5c27bf0fed33c8a8b9b5"/><file name="ui-bg_glass_75_dadada_1x400.png" hash="c12c6510dad3ebfa64c8a30e959a2469"/><file name="ui-bg_glass_75_e6e6e6_1x400.png" hash="f4254356c2a8c9a383205ef2c4de22c4"/><file name="ui-bg_glass_95_fef1ec_1x400.png" hash="5a3be2d8fff8324d59aec3df7b0a0c83"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="5f1847175ba18c41322cb9cb0581e0fb"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="d386adb3d23db4588a3271526a530f51"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="34c616d227cbdaefd8a81534d6ca7813"/><file name="ui-bg_highlight-soft_75_cccccc_1x100.png" hash="72c593d16e998952cd8d798fee33c6f3"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="b806658954cb4d16ade8977af737f486"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="384c3f17709ba0f809b023b6e7b10b84"/><file name="ui-icons_2e83ff_256x240.png" hash="25162bf857a8eb83ea932a58436e1049"/><file name="ui-icons_228ef1_256x240.png" hash="79f41c0765e9ec18562b20b0801d748b"/><file name="ui-icons_222222_256x240.png" hash="9129e086dc488d8bcaf808510bc646ba"/><file name="ui-icons_454545_256x240.png" hash="771099482bdc1571ece41073b1752596"/><file name="ui-icons_888888_256x240.png" hash="faf6f5dc44e713178784c1fb053990aa"/><file name="ui-icons_cd0a0a_256x240.png" hash="5d8808d43cefca6f6781a5316d176632"/><file name="ui-icons_ef8c08_256x240.png" hash="380c866362e1e42896f973ea92f67013"/><file name="ui-icons_ffd27a_256x240.png" hash="2a20f483ddcbc84e6469ce5bbd280699"/><file name="ui-icons_ffffff_256x240.png" hash="342bc03f6264c75d3f1d7f99e34295b9"/></dir></dir><file name="mana_core.css" hash="bc5b7191ba25e69b8fee72188536aaf6"/><file name="mana_filters.css" hash="1d9769421d9cd76993bb033107363821"/></dir><dir name="images"><dir name="mana_core"><file name="m-wait.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mana_core.xml" hash="b5dd1c5ec1a7d527463d70e4320a7ea8"/></dir><dir name="template"><dir name="mana"><dir name="core"><file name="js.phtml" hash="53a4035fe21537c0cd7fde286ed4a611"/><file name="require.phtml" hash="b85203a9ecf3808b5cdde85fcb03ec6e"/><file name="wait.phtml" hash="7c0ffe76e7b3aca2163d9ecc5145e81b"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mana_core.xml" hash="67573b93ead87e30c31eedf5f39af2a2"/><file name="mana_filters.xml" hash="0437a11880f49cd42d32626d64b22e48"/></dir><dir name="template"><dir name="mana"><dir name="core"><file name="js.phtml" hash="1aa41c842f1984142a864f667f99d33b"/><file name="popup.phtml" hash="e2823a07a8eefcad23f1ea416e95f84c"/><file name="require.phtml" hash="b85203a9ecf3808b5cdde85fcb03ec6e"/><file name="wait.phtml" hash="2fdb82f90c1aa8705fa76f500b967fef"/></dir><dir name="filters"><file name="cms.phtml" hash="b4c954289a496a8e79bddac6f89abbbe"/><file name="state.phtml" hash="d39975d6dc1fba2cec9679b023dfb667"/><dir name="items"><file name="list.phtml" hash="59d6b292fad30b666fbd1aae563505b0"/><file name="list_popup.phtml" hash="4034da62447f67ea524e16bf61f0a232"/><file name="standard.phtml" hash="c84f5b423a10a37bfeeae74945102592"/><file name="standard_popup.phtml" hash="a49c8f07082be26fbae6d6e5af99c014"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mana_Core.csv" hash="5c2c5da766214b0c18a7a1212655194d"/><file name="Mana_Db.csv" hash="754c3b5f318886cb1eae04af5e841ada"/><file name="Mana_Filters.csv" hash="7a4c41f5f3d3a4f4389db3ba7cac53e4"/></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="advListRotator.js" hash="6629920522d9fd8364469abe1ae705c9"/><file name="fileuploader.js" hash="164c23d4b94b5424c8e1c00057d45ce4"/><file name="froogaloop.js" hash="aefc485211db6c55726e13759063d312"/><file name="froogaloop.min.js" hash="d39fd09571c0cae46b8c35d75cffeb77"/><file name="history.adapter.jquery.js" hash="8e34662937b6021c290077b353800702"/><file name="history.js" hash="89898d2f67eecb9f819588dcad2c8717"/><file name="jquery-ui.js" hash="6ac9f97eaab22d1a1f91572a20ef516b"/><file name="jquery-ui.min.js" hash="c1e83e4d225186ec057ea9eb18742dea"/><file name="jquery.easing.js" hash="cc674e02a06874bb5888ede6e0b1c977"/><file name="jquery.flexslider-min.js" hash="c236f33e84d73c1a873ec63cc25d7bd1"/><file name="jquery.js" hash="67dfa0103ec3677a14bed88a757351d7"/><file name="jquery.min.js" hash="f8a9d24fe8df43991da1c0dd0dd9d1af"/><file name="jquery.noconflict.js" hash="0da09155d7323809b48494da0846bf34"/><file name="jquery.printf.js" hash="71e34de7c90b12d738ca6b912fef04da"/><file name="require.js" hash="a7afdceabeb04107653fdc7d274a00d1"/><file name="require.min.js" hash="215507e3b7eb905c61e436921c5736bd"/><dir name="validate"><file name="jquery.validate.js" hash="0bb7a2f5eea19acc7bb65f6c82ec15fb"/><dir name="localization"><file name="messages_ar.js" hash="a42cc9c91da7c4f6d2f48492dda14273"/><file name="messages_bg.js" hash="bc4ebf054b6a399abf518ef28bbad839"/><file name="messages_cn.js" hash="886e45b3ffd60a683ecc8e6ea644e519"/><file name="messages_cs.js" hash="6b794f90ab955c17fe02b6553876050c"/><file name="messages_da.js" hash="cc862df2998db2cc18c8276aa7bfe0f0"/><file name="messages_de.js" hash="70a9eb9abfc4365f36718b06b38f6725"/><file name="messages_el.js" hash="bd18b65d9f876e12997281e09d2a8bf3"/><file name="messages_es.js" hash="2f3a18c6d0377bc4658839a070853ed7"/><file name="messages_fa.js" hash="e32dd026bd9d2f626b7371bf025eb5c1"/><file name="messages_fi.js" hash="d8810a4f5b025594129f32957e521210"/><file name="messages_fr.js" hash="3081f76c1368d03d2e1a84a7ed9748e2"/><file name="messages_he.js" hash="028af705c2c07e946ce6de5e63223611"/><file name="messages_hu.js" hash="7612f6525fd5922f970d40b5929c88bb"/><file name="messages_it.js" hash="824964b0dcf1ea4904d18a125ff10b09"/><file name="messages_kk.js" hash="28c0dac0417ec5e0ec9271bfd11b7129"/><file name="messages_lt.js" hash="ef0a5dea6d4bfe7965ff9c719238f2b0"/><file name="messages_lv.js" hash="6d1d834333de4f018259481658d79e85"/><file name="messages_nl.js" hash="9f8aad8e3d769b0a636a02c672044232"/><file name="messages_no.js" hash="1a00dddbef393a2b8bc2e78934243566"/><file name="messages_pl.js" hash="28cea41b05ff80cc721b6896a2f658ba"/><file name="messages_ptbr.js" hash="194f1a4cbe9483dea4363400e046b923"/><file name="messages_ptpt.js" hash="3a9a7730cc461866e37f2cd8b0507f3a"/><file name="messages_ro.js" hash="eaf4c868e8fde6f5dee2f0a3ee0cbe12"/><file name="messages_ru.js" hash="e3d6e8809230c758b95438de4c783474"/><file name="messages_se.js" hash="b80035c9f1fdfba7c7f523838ec6510b"/><file name="messages_sk.js" hash="9e1b0a7378aff7add6100dc3c3e8d80c"/><file name="messages_tr.js" hash="7ecf31a65c2eefd8c7da62f65ccf33a7"/><file name="messages_tw.js" hash="b660609f8ddf6b17d71b72aa43512f1f"/><file name="messages_ua.js" hash="80e565078f016c8ea1cffc6c8cdd5a93"/><file name="methods_de.js" hash="a9d8792f8e46298165daaf4e9a5d98ad"/><file name="methods_nl.js" hash="8505eec534134eac849adca1cf8f2f9d"/><file name="methods_pt.js" hash="09b350c9c069b5a82d5811339ac15ab6"/></dir></dir></dir><dir name="mana"><file name="core.js" hash="47c214e55d09bb46dc9422679617c2c3"/></dir></dir></target><target name="magelocal"><dir name="Mana"><dir name="Core"><file name="Profiler.php" hash="750f9a6490534be89ef5a55ddf62db21"/><dir name="Block"><file name="Js.php" hash="f4f5da9060891521b275fcf5e6f9ebf5"/><file name="List.php" hash="8a54149b3d24b8f1447ee77dc7c691ed"/><file name="Require.php" hash="39764e20e72f331223f1ad85a21c15a3"/><file name="Singleton.php" hash="74e1cb457680fb2f999af95fa3af26c2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6245429c5bc31a6b9667afe2e714cdb9"/><file name="config.xml" hash="1602d5ba888c673c71fd32a1c563c043"/><file name="system.xml" hash="107f9fc56e6b83ceb92fa20bfcc93705"/></dir><dir name="Helper"><file name="Data.php" hash="18a6687ae2ef22d90aea3ed29159b15f"/><file name="Debug.php" hash="6fd3859ac2e817d36aadd8ba6c47405a"/><file name="Files.php" hash="1a6d3869c8f7b752057299a4f6562694"/><file name="Image.php" hash="75ade04d12f104d05314f2d9343ec539"/><file name="Js.php" hash="a9866a72f35c584a0c4684d4b2a371dd"/><file name="Json.php" hash="308275754075cc319f85527a3cba74d3"/><file name="Layer.php" hash="30a33c43ac0b4fdcd8cb4e20968ea664"/><file name="Layout.php" hash="ed9e70f7a133bd0ddb94cd5cae15d451"/><file name="Lock.php" hash="7567ccb21cef8c90dac0e9bbac321801"/><file name="Logger.php" hash="6fc13c5afbd795a4d0ecfe9c576baaac"/><file name="Mbstring.php" hash="1702040a0138b88445a36bdd23d44566"/><file name="PageType.php" hash="231df1f506545b008ce7f2d997b28ce7"/><file name="Router.php" hash="9713a66ad89d22b0d0a5c6d5a5937ae6"/><file name="Seo.php" hash="b8aafbf9d4ec1d796e83c9ff2f7fac0b"/><file name="UrlTemplate.php" hash="2e04649154b3c1a80e40df17cc1846a6"/><file name="Utils.php" hash="611650a169c7747bbc8177dcd31ee2a4"/><dir name="PageType"><file name="Category.php" hash="db7b627f3cd7a61622f8a0eb30bcfb1e"/><file name="CmsPage.php" hash="4fe9e843b5bd9122691fca8c1f260cf1"/><file name="HomePage.php" hash="46a9b90008a40394957fa372de87f974"/><file name="Search.php" hash="eff6acc97b37192af0e9e6d98ad939d8"/></dir></dir><dir name="Model"><file name="Callback.php" hash="2e8955cf399ea302e8b19c6ccb999cc5"/><file name="Closure.php" hash="f1456fc3e6aa04906339198be3a0a544"/><file name="Eav.php" hash="ed4adbb339497fefe1db29a59c2ed110"/><file name="Indexer.php" hash="3fcaafc332c5fe3dca0cdef383228603"/><file name="Object.php" hash="dcb759ec94621a28c4e531715813513c"/><file name="Observer.php" hash="ca5d42b0d4bef6a312575f07df964d2d"/><dir name="Attribute"><file name="Scope.php" hash="7277aac766688c59886cff561b8c44a3"/></dir><dir name="Config"><file name="Default.php" hash="b69bd384a59f38f214f565d21af1ca3a"/></dir><dir name="Html"><file name="Filter.php" hash="ca77f8b76bd39d00001d6dfb12ff6929"/><file name="Parser.php" hash="5f4c098e69b582025f909ddeeab6e630"/><file name="Reader.php" hash="41a66c26ce51f3803eba50cea5b95d96"/><file name="State.php" hash="5952deebd020273729594ace8a2cae9b"/><file name="Token.php" hash="5c7a4ef3150a35b8a6bf9e296e53e739"/></dir><dir name="Source"><file name="Abstract.php" hash="bb05e3ce9f5e01ef2843a5a558a86fd8"/><file name="Config.php" hash="59b1d6927157e4b34bde55794a7a86be"/><file name="Country.php" hash="cd5c9dd00c4456db2e6b4f6316303a8c"/><file name="Js.php" hash="71852d9a46c5fca27d4b0403e9ee19d9"/><file name="Yesno.php" hash="3082e75e81e111aed0ac9f1cc17e579e"/><file name="YesNoDefault.php" hash="4a13c8de30d7f27b71dac16bbf1e18ae"/></dir></dir><dir name="Resource"><file name="Eav.php" hash="2ada400977d3a8b0883a03998e1a4e47"/><file name="Indexer.php" hash="6ced1a9ad6696345071a189c8c3e657d"/><dir name="Attribute"><file name="Collection.php" hash="7f01d6480b5110a431a5b50571a9ec62"/></dir><dir name="Eav"><file name="Collection.php" hash="5153a97a4021aebced2b0a538d10b4e7"/><file name="Setup.php" hash="13360360cbfada91713159a38c82e6b2"/><dir name="Collection"><file name="Derived.php" hash="03a87d87a781c8256b6414fb132ed30e"/></dir></dir><dir name="Virtual"><file name="Collection.php" hash="ac2d11980e9dc015ed0cfbe12fbf3fc7"/></dir></dir><dir name="Rewrite"><dir name="PageCache"><file name="Processor.php" hash="d5175e3a150d92ec32016654c8a7988a"/></dir></dir><dir name="sql"><dir name="mana_core_setup"><file name="mysql4-install-1.1.1.php" hash="a169406e2cc37282d001e9415eda219a"/></dir></dir></dir><dir name="Db"><dir name="etc"><file name="config.xml" hash="9f0a1149061142957f57b0962d5cf2e4"/><file name="m_db.xml" hash="7fb95c96ed440dfc5efb8d3ed598dd20"/></dir><dir name="Exception"><file name="Formula.php" hash="f791f3d718241b9b004ae1719dd8fca8"/><file name="Validation.php" hash="7238432db3b3a24615dc186e60afc546"/></dir><dir name="Helper"><file name="Config.php" hash="947e93e74329de11cffe102dad3b5002"/><file name="Data.php" hash="e5edeab32a90b2a15584ccc6b7244e2b"/><file name="Formula.php" hash="c5761ee937e3490d1508a3ed0cfac805"/><dir name="Formula"><file name="Abstract.php" hash="88283737316ebd8cafddce5e42ac2bd8"/><file name="DependencyFinder.php" hash="480e4097ef5e9b21c527f5c61dbd3987"/><file name="Entity.php" hash="e5f500a86b18b37dd43fc8ab151fd204"/><file name="Evaluator.php" hash="8dc9cf1b9ddf8cefd053909ba841d985"/><file name="Function.php" hash="db3fb341c32f9c285d37df84a36fb82c"/><file name="Parser.php" hash="7828e59f31c03e31da92a889b4e8b52f"/><file name="Processor.php" hash="4bf7bfa8a2cdcfbecaede6ab3aa67f04"/><file name="Selector.php" hash="91bee56da8ee75aa06edacb19cb925b9"/><dir name="Entity"><file name="Aggregate.php" hash="fab53a31e480228474de7015100d6498"/><file name="Foreign.php" hash="6d4159dcb6ff3f7e5a958b6e891057c1"/><file name="Frontend.php" hash="4bef999e0ca552c3fa8b518c36b6e239"/><file name="Normal.php" hash="6a91af1bd600ca9b8be40ee5be5c4fa5"/><dir name="Aggregate"><file name="Field.php" hash="682fc6e82caf400025ba22f6b1c40156"/></dir></dir><dir name="Function"><file name="Count.php" hash="62d463301d3eac82f9f8c2952cc23ed4"/><file name="Glue.php" hash="00abff0970bc94ef46ebdb91d773ab02"/><file name="If.php" hash="215287632f25bd541fe29051cc11fba4"/><file name="Lower.php" hash="7e91d1e618e66d262b0967f0a053adfd"/><file name="Seo.php" hash="70ce3da277c48fc84363c58baba3dd37"/><file name="SkinUrl.php" hash="059ac4b6d44bf7714886c023c30a1490"/></dir><dir name="Processor"><file name="Eav.php" hash="722b0888661d38b399f74eaf9ec4247e"/><file name="Entity.php" hash="b3d6e11b78cf782c9eae78ce1eefd155"/><file name="System.php" hash="c7a3c7bf6194b041dd17dc2b3a605f6f"/><file name="Table.php" hash="771155e0a194fcf7a821e51172100138"/></dir></dir></dir><dir name="Model"><file name="Entity.php" hash="88e63ed2ebdeb129757d7acbd6f4d805"/><file name="Indexer.php" hash="8596a12b7ee26e686937cef3d2985685"/><file name="Object.php" hash="91dac5c80f75dcb81c1aadaa8984b466"/><file name="Observer.php" hash="d52dc7c597890e130a6d0ee92846fa89"/><file name="Setup.php" hash="f3793eb6b2aa2a898a1ffb16cb83da8c"/><file name="Validation.php" hash="f2dd026c3d73f3fd345e1b7abde51e7d"/><dir name="Entity"><file name="Indexer.php" hash="c807d323f91e2c38344332ae8e9654b3"/></dir><dir name="Formula"><file name="Alias.php" hash="d14575f9f0477021a2e53ff1fd9c5501"/><file name="Closure.php" hash="d773c0f5ed1f593acb5458bfb3187a7b"/><file name="Context.php" hash="5fd16cf22bc1bac09856606ee0d0a141"/><file name="Entity.php" hash="c0eb7a9362996c104bde5cd2c469db10"/><file name="Expr.php" hash="b739ab589ea0e3378e32c12a69ba78cc"/><file name="Field.php" hash="d00b8c25724e34f6cad819edf1497ede"/><file name="Node.php" hash="e28d2d8d0af762abbe3b9677937103fe"/><dir name="Alias"><file name="Array.php" hash="6719df8e4123c881980f5a2b6ef93a8f"/><file name="Empty.php" hash="93e05898f60e111f12b5febb119305dd"/><file name="Single.php" hash="8603f08d6415110c8c0f04a805055fab"/></dir><dir name="Closure"><file name="AggregateFieldJoin.php" hash="f1d19cb54eaf620d038508b7ad31fc60"/><file name="ForeignJoin.php" hash="b07167a5ef2a7caf479266269f232edf"/><file name="ForeignJoinEnd.php" hash="6b9000298615ce69eadc04e707fbe17f"/><file name="Join.php" hash="b8d368c1042754f18d027027acccb27a"/></dir><dir name="Node"><file name="Add.php" hash="22f6ec02b3226ce2c9313f713d1b03fb"/><file name="Field.php" hash="93c6bf27b93091ebe7672500e7e94e48"/><file name="FormulaExpr.php" hash="b6a36a818533775fa778c6dc66ec40f7"/><file name="FunctionCall.php" hash="bac31778c670aca74c9db49dcb40007a"/><file name="Identifier.php" hash="a38aa478e6485ef9ea95fb0758c2ea49"/><file name="Multiply.php" hash="292881a092500642e4d98aeb33aa2f75"/><file name="NullValue.php" hash="2ddeb334ac3e12cdec1b413904e02210"/><file name="NumberConstant.php" hash="fd2524859dc3ed2a3fb46468b8352f72"/><file name="StringConstant.php" hash="04cdb7baa502e001dfb35af748efde30"/></dir></dir><dir name="Replication"><file name="Target.php" hash="b918ef992096a72080a743352385b64b"/></dir><dir name="Setup"><file name="Abstract.php" hash="d8e84857de7b1cdb6ba6c03e5f4aa867"/><file name="V13012122.php" hash="a2ca004389d5145d819ff791f965ef9e"/></dir><dir name="Virtual"><file name="Result.php" hash="33f35c946b2285e62a5a1c08c1bb3ec8"/></dir></dir><dir name="Resource"><file name="Entity.php" hash="c5f9ee0f1475f2d4a2075b5cead6199d"/><file name="Formula.php" hash="53b21b55b710d119fc91bbcf841caea2"/><file name="Object.php" hash="9106bec7565a3bedaf2de81b18569157"/><file name="Replicate.php" hash="e4c75872344dde3ed8a04744110faace"/><dir name="Edit"><file name="Session.php" hash="07474c4d34f6ec1cd91ade3e871ec096"/></dir><dir name="Entity"><file name="Collection.php" hash="291cbdeef792ab848175c0ae9bb65fad"/><file name="Indexer.php" hash="9e102278a3cf4e69ead0a34b12d3c91c"/><file name="JsonCollection.php" hash="bf1f5a893a33affb7c1b182f803d600a"/></dir><dir name="Object"><file name="Collection.php" hash="6f7f393abef136226ed22eb8f45d2fdd"/></dir></dir><dir name="sql"><dir name="mana_db_setup"><file name="mysql4-install-11.09.28.09.php" hash="0d8c0873cbbabb1db406e1c0b709b4de"/><file name="mysql4-upgrade-11.09.28.09-11.09.28.10.php" hash="04ccee17b3b04906e8fed2b1ac9214a3"/><file name="mysql4-upgrade-11.10.08.23-11.10.20.22.php" hash="847b24ea006e99af80cc8980ff7ff021"/></dir></dir></dir><dir name="Filters"><dir name="Block"><file name="Filter.php" hash="7460ab6dc2a4787be60e5cb18e55eca7"/><file name="Layer.php" hash="0f8fac9a9277fb6e204a8ed32b164902"/><file name="Search.php" hash="e7c5d74b36406fb181ba149588070f95"/><file name="State.php" hash="c9a00b949def21806686fa144a997bcb"/><file name="View.php" hash="f1babbe3af7e4c300bc647da7203fea7"/></dir><dir name="etc"><file name="config.xml" hash="4f808b05293fc7c9ca96c6207f317140"/></dir><dir name="Helper"><file name="Data.php" hash="9b1d03fc6f97dfa944bfe81d654fec2c"/><file name="Extended.php" hash="5b065cc2be0a8b96dc4db32bc8279304"/></dir><dir name="Interface"><file name="Filter.php" hash="883a29e42087529428e73b4ae785609a"/></dir><dir name="Model"><file name="Filter.php" hash="cd3bc9276ff4566802e2d43280394e6f"/><file name="Filter2.php" hash="7e57bc59a4cf6464975cef52f6c4ab78"/><file name="Item.php" hash="f95b853b873a6b4564f8a93e4d6b361f"/><file name="Observer.php" hash="e835045553a7e4d8d821eed81e6492a1"/><file name="Operation.php" hash="54d01ace78c5b6ba3facf1a2f3255618"/><file name="Query.php" hash="8f7bc844a3467768aae06eacdc18f650"/><file name="Repository.php" hash="e0cf842a98aa5ae27fc107c18f190fab"/><file name="Sort.php" hash="95804fcd46ca143587747dc7dfe9845e"/><dir name="Config"><dir name="Display"><file name="Default.php" hash="e16716300e514ef6ee7fa4c1c5fd3331"/></dir></dir><dir name="Filter"><file name="Attribute.php" hash="3c57959dc5b5c24feaa1ad3f48179235"/><file name="Category.php" hash="31258e6ab7ced0737658b4f174255bd4"/><file name="Common.php" hash="522b1695cf4f4f545c7174b90a8b06ba"/><file name="Decimal.php" hash="574432d807fdbf7b790e3ebb4bb33867"/><file name="Default.php" hash="960d7b6f0fd9c32cf9726e11a62cbb1e"/><file name="Price.php" hash="badca3bf0a10ba605acd9efd40f676f2"/></dir><dir name="Filter2"><file name="Store.php" hash="d82d20f485c4417bc51a73bcf01cd374"/><file name="Value.php" hash="bc0f76d7b7e2b7341ba3ac51c9a88bb6"/><dir name="Value"><file name="Store.php" hash="695bf8aad7ff431fe5a511098cf23f48"/></dir></dir><dir name="Solr"><file name="Attribute.php" hash="c60628b8ec074147918ea7a96e85ecd5"/><file name="Category.php" hash="281864a88dc542de2dd8bd15812a64d4"/><file name="Decimal.php" hash="4c732a1189b7cd5c96ece2f2040c4704"/><file name="Price.php" hash="aa4ec52784e2a5084f635388421b3c54"/><dir name="Adapter"><file name="HttpStream.php" hash="e9825f7c9b0a2a39411da3e4c983967c"/><file name="PhpExtension.php" hash="866e113bce375b16d3a531ba705ffacb"/></dir><dir name="And"><file name="Attribute.php" hash="3df0798bc675483dd4b327299fc00b33"/></dir><dir name="Reverse"><file name="Attribute.php" hash="c23dc7f104559c3df2f3394438735537"/><file name="Decimal.php" hash="89810a0c5fe707af354d7be73b8dfe36"/><file name="Price.php" hash="bf207efb2854f99a15775f38f019f5b4"/></dir></dir><dir name="Source"><file name="Display.php" hash="509e389d33e3175e304ab67ffdb79325"/><file name="Filterable.php" hash="618680f75072220ad711dec6e220d43b"/><dir name="Display"><file name="All.php" hash="1875630a7565c9655c8c8724dad45bba"/><file name="Attribute.php" hash="d2bd347e70e3924490dff6e57274ff40"/><file name="Category.php" hash="437b3f678edd292a0110529aadfb1530"/><file name="Decimal.php" hash="b432f32e93fb1991f8882bfe25f0514e"/><file name="Price.php" hash="c6a017240beaf76666e9f702a9fcd48d"/></dir></dir></dir><dir name="Resource"><file name="Filter.php" hash="e74d789c7751fe0a126b38ab0bd3ac40"/><file name="Filter2.php" hash="73349aaf68f3080158f19b012ca6cf5a"/><file name="Setup.php" hash="83b12b7939ac1c7696360f77304d9d84"/><dir name="EnterpriseSearch"><file name="Engine.php" hash="51d77208587d1c55c8d508a3024bd269"/></dir><dir name="Filter"><file name="Attribute.php" hash="68ac9a25e6127a10de1cd812e73cc59a"/><file name="Collection.php" hash="6831f054791977048641d43c288ff53c"/><file name="Decimal.php" hash="b8d889a00673cadd5a79ebf498a2a137"/><file name="Price.php" hash="b165981a092366d05b3537c4684e6087"/><dir name="And"><file name="Attribute.php" hash="cdc41ca223083360b35bd5f455733cd8"/></dir><dir name="Attribute"><file name="Collection.php" hash="c854270f63ca3bfd44cfd6ab27888676"/></dir><dir name="Collection"><file name="Derived.php" hash="5240ac10d2989122c49665919a9555ff"/></dir><dir name="Reverse"><file name="Attribute.php" hash="0be2e3f5eef03862e13b37deb1f7f7a3"/><file name="Decimal.php" hash="9d9974cf64c5178812bcc6fca83bc9ff"/><file name="Price.php" hash="3be48facf6596b618fc0a621f625d460"/></dir></dir><dir name="Filter2"><file name="Collection.php" hash="822b71198d05e41e90d096cb7cc47fa5"/><file name="Store.php" hash="0c8554f52a7a0886ce0defbb749713e2"/><file name="Value.php" hash="356a37914ecc112d9de1b4a1152d7fc1"/><dir name="Store"><file name="Collection.php" hash="791101a5eac8aceb6398a24b433a2d1f"/></dir><dir name="Value"><file name="Collection.php" hash="3273b517dd65a46034cb3ef8adb3c610"/><file name="Store.php" hash="48d9631e8d34b15a72fc22e6bb3a98c2"/><dir name="Store"><file name="Collection.php" hash="073931492acfc99a3b5cd1ecf7113982"/></dir></dir></dir><dir name="Indexer"><file name="Source.php" hash="251589738ea54dcf6e986921f3810931"/></dir><dir name="Solr"><file name="Attribute.php" hash="f2b30e509881147f2f73ede11ac2fbed"/><file name="Collection.php" hash="9b35d28e731fc47f420447251a5e976b"/><file name="Engine.php" hash="e3c3306e436e6943aa10f9b1a77404be"/><dir name="And"><file name="Attribute.php" hash="a7dd5fbb9388a4b73efeeaa7e91a9b7b"/></dir><dir name="Reverse"><file name="Attribute.php" hash="1084278692e5ffe1d16640b530e33662"/></dir></dir></dir><dir name="sql"><dir name="mana_filters_setup"><file name="mysql4-install-1.1.1.php" hash="22f7381b5ea9261a2e8a00fda28f28ef"/><file name="mysql4-upgrade-1.1.1-1.9.1.php" hash="04c761bab20de6e0fed68e141fb68112"/><file name="mysql4-upgrade-11.09.24.09-11.09.28.09.php" hash="a007f769d492c43b1e7a583a2763300a"/><file name="mysql4-upgrade-11.10.19.18-11.10.23.01.php" hash="ef0b7b4f4530e5b01f349e3d534ebb16"/><file name="mysql4-upgrade-12.01.14.09-12.01.15.14.php" hash="001d8e035bc798d8779c29ac38912543"/><file name="mysql4-upgrade-12.04.10.23-12.04.17.18.php" hash="48f2d8cc8ca6afe014a95dea808e5087"/><file name="mysql4-upgrade-12.10.25.17-12.10.25.18.php" hash="5d726b388ac30fc00cd95bb86ab5641b"/><file name="mysql4-upgrade-12.11.02.16-12.11.13.15.php" hash="11fc0db6ff2f56fe95bfaf89ab758f61"/><file name="mysql4-upgrade-13.09.11.14-13.09.23.17.php" hash="aca62ea5d13c5bc3259a48e5cd4d5282"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mana_Core.xml" hash="0ca7883c0f5fcaa12b32842f142f92eb"/><file name="Mana_Db.xml" hash="9b4669b284f2a688e165abaac373c358"/><file name="Mana_Filters.xml" hash="85a5d5c92f66f775131459c3bfc2fc30"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mana_Filters</name>
4
+ <version>14.06.13.09</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
10
  <description>Add multiple selection features for attribute and price filters in Magento layered navigation</description>
11
  <notes>Adds multiple selection features for attribute and price filters in Magento layered navigation.</notes>
12
  <authors><author><name>Mana Team</name><user>auto-converted</user><email>team@manadev.com</email></author></authors>
13
+ <date>2014-06-16</date>
14
+ <time>19:24:25</time>
15
+ <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="mana_core.css" hash="cdc7b84e7e3e73b182cf7ed02bbc76a8"/></dir><dir name="images"><dir name="mana_core"><file name="m-wait.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="jquery"><file name="ui.css" hash="4ab351feeb25bfbcb84f61e722545525"/><dir name="images"><file name="animated-overlay.gif" hash="2b912f7c0653008ca28ebacda49025e7"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="95f9cceeb9d742dd3e917ec16ed754f8"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="f040b255ca13e693da34ab33c7d6b554"/><file name="ui-bg_flat_0_aaaaaa_40x100.png" hash="2a44fbdb7360c60122bcf6dcef0387d8"/><file name="ui-bg_flat_10_000000_40x100.png" hash="c18cd01623c7fed23c80d53e2f5e7c78"/><file name="ui-bg_flat_75_ffffff_40x100.png" hash="8692e6efddf882acbff144c38ea7dfdf"/><file name="ui-bg_glass_55_fbf9ee_1x400.png" hash="f8f4558e0b92ff2cd6136781533902ec"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="e5a8f32e28fd5c27bf0fed33c8a8b9b5"/><file name="ui-bg_glass_75_dadada_1x400.png" hash="c12c6510dad3ebfa64c8a30e959a2469"/><file name="ui-bg_glass_75_e6e6e6_1x400.png" hash="f4254356c2a8c9a383205ef2c4de22c4"/><file name="ui-bg_glass_95_fef1ec_1x400.png" hash="5a3be2d8fff8324d59aec3df7b0a0c83"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="5f1847175ba18c41322cb9cb0581e0fb"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="d386adb3d23db4588a3271526a530f51"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="34c616d227cbdaefd8a81534d6ca7813"/><file name="ui-bg_highlight-soft_75_cccccc_1x100.png" hash="72c593d16e998952cd8d798fee33c6f3"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="b806658954cb4d16ade8977af737f486"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="384c3f17709ba0f809b023b6e7b10b84"/><file name="ui-icons_2e83ff_256x240.png" hash="25162bf857a8eb83ea932a58436e1049"/><file name="ui-icons_228ef1_256x240.png" hash="79f41c0765e9ec18562b20b0801d748b"/><file name="ui-icons_222222_256x240.png" hash="9129e086dc488d8bcaf808510bc646ba"/><file name="ui-icons_454545_256x240.png" hash="771099482bdc1571ece41073b1752596"/><file name="ui-icons_888888_256x240.png" hash="faf6f5dc44e713178784c1fb053990aa"/><file name="ui-icons_cd0a0a_256x240.png" hash="5d8808d43cefca6f6781a5316d176632"/><file name="ui-icons_ef8c08_256x240.png" hash="380c866362e1e42896f973ea92f67013"/><file name="ui-icons_ffd27a_256x240.png" hash="2a20f483ddcbc84e6469ce5bbd280699"/><file name="ui-icons_ffffff_256x240.png" hash="342bc03f6264c75d3f1d7f99e34295b9"/></dir></dir><file name="mana_core.css" hash="4b45e64cd88e3fcb70ccb3f1c4f39917"/><file name="mana_filters.css" hash="1d9769421d9cd76993bb033107363821"/></dir><dir name="images"><dir name="mana_core"><file name="m-wait.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="css"><file name="mana_core.css" hash="c8533f81b029f25db3e3396cd75e779b"/><file name="mana_filters.css" hash="8b5cb1b1c480a051bed60ed64af2d790"/></dir><dir name="images"><dir name="mana_core"><file name="m-wait.gif" hash="79d9787b05ea3e0e5e1e7b23a357bca0"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mana_core.xml" hash="cc0feb9124aa77e1f323b61cf504c204"/></dir><dir name="template"><dir name="mana"><dir name="core"><file name="js.phtml" hash="53a4035fe21537c0cd7fde286ed4a611"/><file name="popup.phtml" hash="e2823a07a8eefcad23f1ea416e95f84c"/><file name="require.phtml" hash="b85203a9ecf3808b5cdde85fcb03ec6e"/><file name="wait.phtml" hash="7c0ffe76e7b3aca2163d9ecc5145e81b"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mana_core.xml" hash="67573b93ead87e30c31eedf5f39af2a2"/><file name="mana_filters.xml" hash="51005a99382d5450fbc6ea239bbbc7a2"/></dir><dir name="template"><dir name="mana"><dir name="core"><file name="js.phtml" hash="1aa41c842f1984142a864f667f99d33b"/><file name="popup.phtml" hash="e2823a07a8eefcad23f1ea416e95f84c"/><file name="require.phtml" hash="b85203a9ecf3808b5cdde85fcb03ec6e"/><file name="wait.phtml" hash="2fdb82f90c1aa8705fa76f500b967fef"/></dir><dir name="filters"><file name="cms.phtml" hash="b4c954289a496a8e79bddac6f89abbbe"/><file name="state.phtml" hash="d39975d6dc1fba2cec9679b023dfb667"/><dir name="items"><file name="list.phtml" hash="f5e0ac3cea381560e83d536433e303c7"/><file name="list_popup.phtml" hash="ff8d08726080a7eee21a85282d5294a4"/><file name="standard.phtml" hash="5c125504a6674f6eac8ea6ebd2c7ed1e"/><file name="standard_popup.phtml" hash="5318ff7766dce895a033ca0cea8a12d6"/></dir></dir></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="mana_filters.xml" hash="5aa157d9c8f9cdb68c7d0c03c1e8a0f3"/></dir><dir name="template"><dir name="mana"><dir name="filters"><dir name="items"><file name="list.phtml" hash="1adf0a61f5a3a216939ae03daaae7080"/><file name="standard.phtml" hash="983c40cf9136b3b879d2d1a41bdccbf6"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Mana_Core.csv" hash="264b6e6e44c593af6f79b93875091672"/><file name="Mana_Db.csv" hash="754c3b5f318886cb1eae04af5e841ada"/><file name="Mana_Filters.csv" hash="7a4c41f5f3d3a4f4389db3ba7cac53e4"/></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="advListRotator.js" hash="6629920522d9fd8364469abe1ae705c9"/><file name="fileuploader.js" hash="164c23d4b94b5424c8e1c00057d45ce4"/><file name="froogaloop.js" hash="aefc485211db6c55726e13759063d312"/><file name="froogaloop.min.js" hash="d39fd09571c0cae46b8c35d75cffeb77"/><file name="history.adapter.jquery.js" hash="8e34662937b6021c290077b353800702"/><file name="history.js" hash="89898d2f67eecb9f819588dcad2c8717"/><file name="jquery-ui.js" hash="6ac9f97eaab22d1a1f91572a20ef516b"/><file name="jquery-ui.min.js" hash="c1e83e4d225186ec057ea9eb18742dea"/><file name="jquery.easing.js" hash="cc674e02a06874bb5888ede6e0b1c977"/><file name="jquery.flexslider-min.js" hash="c236f33e84d73c1a873ec63cc25d7bd1"/><file name="jquery.js" hash="a581ffd88c93e2125e42f7ecb363739f"/><file name="jquery.min.js" hash="f8a9d24fe8df43991da1c0dd0dd9d1af"/><file name="jquery.noconflict.js" hash="0da09155d7323809b48494da0846bf34"/><file name="jquery.printf.js" hash="71e34de7c90b12d738ca6b912fef04da"/><file name="require.js" hash="a7afdceabeb04107653fdc7d274a00d1"/><file name="require.min.js" hash="215507e3b7eb905c61e436921c5736bd"/><dir name="validate"><file name="jquery.validate.js" hash="0bb7a2f5eea19acc7bb65f6c82ec15fb"/><dir name="localization"><file name="messages_ar.js" hash="a42cc9c91da7c4f6d2f48492dda14273"/><file name="messages_bg.js" hash="bc4ebf054b6a399abf518ef28bbad839"/><file name="messages_cn.js" hash="886e45b3ffd60a683ecc8e6ea644e519"/><file name="messages_cs.js" hash="6b794f90ab955c17fe02b6553876050c"/><file name="messages_da.js" hash="cc862df2998db2cc18c8276aa7bfe0f0"/><file name="messages_de.js" hash="70a9eb9abfc4365f36718b06b38f6725"/><file name="messages_el.js" hash="bd18b65d9f876e12997281e09d2a8bf3"/><file name="messages_es.js" hash="2f3a18c6d0377bc4658839a070853ed7"/><file name="messages_fa.js" hash="e32dd026bd9d2f626b7371bf025eb5c1"/><file name="messages_fi.js" hash="d8810a4f5b025594129f32957e521210"/><file name="messages_fr.js" hash="3081f76c1368d03d2e1a84a7ed9748e2"/><file name="messages_he.js" hash="028af705c2c07e946ce6de5e63223611"/><file name="messages_hu.js" hash="7612f6525fd5922f970d40b5929c88bb"/><file name="messages_it.js" hash="824964b0dcf1ea4904d18a125ff10b09"/><file name="messages_kk.js" hash="28c0dac0417ec5e0ec9271bfd11b7129"/><file name="messages_lt.js" hash="ef0a5dea6d4bfe7965ff9c719238f2b0"/><file name="messages_lv.js" hash="6d1d834333de4f018259481658d79e85"/><file name="messages_nl.js" hash="9f8aad8e3d769b0a636a02c672044232"/><file name="messages_no.js" hash="1a00dddbef393a2b8bc2e78934243566"/><file name="messages_pl.js" hash="28cea41b05ff80cc721b6896a2f658ba"/><file name="messages_ptbr.js" hash="194f1a4cbe9483dea4363400e046b923"/><file name="messages_ptpt.js" hash="3a9a7730cc461866e37f2cd8b0507f3a"/><file name="messages_ro.js" hash="eaf4c868e8fde6f5dee2f0a3ee0cbe12"/><file name="messages_ru.js" hash="e3d6e8809230c758b95438de4c783474"/><file name="messages_se.js" hash="b80035c9f1fdfba7c7f523838ec6510b"/><file name="messages_sk.js" hash="9e1b0a7378aff7add6100dc3c3e8d80c"/><file name="messages_tr.js" hash="7ecf31a65c2eefd8c7da62f65ccf33a7"/><file name="messages_tw.js" hash="b660609f8ddf6b17d71b72aa43512f1f"/><file name="messages_ua.js" hash="80e565078f016c8ea1cffc6c8cdd5a93"/><file name="methods_de.js" hash="a9d8792f8e46298165daaf4e9a5d98ad"/><file name="methods_nl.js" hash="8505eec534134eac849adca1cf8f2f9d"/><file name="methods_pt.js" hash="09b350c9c069b5a82d5811339ac15ab6"/></dir></dir></dir><dir name="mana"><file name="core.js" hash="cdfda671a3361d34c08e544e0357489e"/><file name="core.js.map" hash="11d54f3b87ba371680f3a64575d02e0d"/><file name="core.min.js" hash="0c1905f1da4b3dddac590a3d5a307d34"/></dir><dir name="src"><dir name="Mana"><dir name="Core"><file name="Ajax.js" hash="a4adb98a7e0e46efb596ef46d12f591c"/><file name="Base64.js" hash="32c5eca8e7ae6860935f6026c810bb7f"/><file name="Block.js" hash="aa31f18ce505d2c43ddfac845b3516d6"/><file name="Config.js" hash="2592b48b066c51fad272c471c14e1ca1"/><file name="Core.js" hash="e251a9d5950eb1ca8303879c5d6c84c2"/><file name="header.js" hash="53b9f4625f72a5e2d93edbc0129c1b82"/><file name="init.js" hash="e05d11b113604d27530c83bb9ff557cb"/><file name="Json.js" hash="226ab2f431754f2338aec47ecaabf720"/><file name="Layout.js" hash="e0e953dc2d8e2421830e642b02fbc7fd"/><file name="Mana.js" hash="fa1102a7f579b5dda5db1f2dfa848672"/><file name="Object.js" hash="8c84b51fafe42654f920a776e5250309"/><file name="obsolete.js" hash="6c05b74822091b64f27019f433afb5ec"/><file name="PageBlock.js" hash="4798d5992ded92dc472bde54486327cc"/><file name="PopupBlock.js" hash="22bdd511747703b95d267a9d649e3d8e"/><file name="rwd.js" hash="3bbb8b6175369e03560444faa9061264"/><file name="StringTemplate.js" hash="7cd14ce2f038bf9d1f88c516f0ec11a3"/><file name="UrlTemplate.js" hash="340bfd288bfdbe53e562fac6f81ee1c7"/><file name="Utf8.js" hash="a7381e9d7e3b54f8169d58ad660c8f13"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="Mana"><dir name="Core"><file name="Profiler.php" hash="750f9a6490534be89ef5a55ddf62db21"/><file name="Profiler2.php" hash="65d3000031d885779b195558cecc159a"/><dir name="Block"><file name="Js.php" hash="23b65253ab9b20b0c80f5cb30b25e63f"/><file name="List.php" hash="8a54149b3d24b8f1447ee77dc7c691ed"/><file name="Require.php" hash="39764e20e72f331223f1ad85a21c15a3"/><file name="Singleton.php" hash="74e1cb457680fb2f999af95fa3af26c2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6245429c5bc31a6b9667afe2e714cdb9"/><file name="config.xml" hash="6857907ac085b0ae0a1fad1bc8e23bb1"/><file name="system.xml" hash="107f9fc56e6b83ceb92fa20bfcc93705"/></dir><dir name="Exception"><file name="Validation.php" hash="fea7418326430c7acd04c34d8a4b3f07"/></dir><dir name="Helper"><file name="Data.php" hash="415f11ed029a3b252d04cb8fde071ce0"/><file name="Db.php" hash="8f63c21d8e5d1feda88727d222a233a3"/><file name="Debug.php" hash="6fd3859ac2e817d36aadd8ba6c47405a"/><file name="Files.php" hash="d0f013090c6266c8e39d7b095985ba27"/><file name="Image.php" hash="75ade04d12f104d05314f2d9343ec539"/><file name="Js.php" hash="a9866a72f35c584a0c4684d4b2a371dd"/><file name="Json.php" hash="39f860c7189913faad31b234903ea6d6"/><file name="Layer.php" hash="30a33c43ac0b4fdcd8cb4e20968ea664"/><file name="Layout.php" hash="32d6016c0ddad2f414791dee4712c13e"/><file name="Lock.php" hash="7567ccb21cef8c90dac0e9bbac321801"/><file name="Logger.php" hash="6fc13c5afbd795a4d0ecfe9c576baaac"/><file name="Mbstring.php" hash="1702040a0138b88445a36bdd23d44566"/><file name="PageType.php" hash="78c1ed2f6353d29f2f8ed580014176a2"/><file name="Router.php" hash="9713a66ad89d22b0d0a5c6d5a5937ae6"/><file name="Seo.php" hash="b8aafbf9d4ec1d796e83c9ff2f7fac0b"/><file name="StringTemplate.php" hash="a7720417ae715c37eb155853e3e84f90"/><file name="UrlTemplate.php" hash="2e04649154b3c1a80e40df17cc1846a6"/><file name="Utils.php" hash="611650a169c7747bbc8177dcd31ee2a4"/><dir name="Db"><file name="Aggregate.php" hash="ee2b6086c62e6870d2139b3e8f619bdc"/></dir><dir name="PageType"><file name="Category.php" hash="22851b663096414aa80a6504ff6d1196"/><file name="CmsPage.php" hash="4e0e65b61638212f4a7780d6e0b7f4b8"/><file name="HomePage.php" hash="64891fa7d23b59fc14ad38d2e9fc2f4b"/><file name="Search.php" hash="3b0e7e11924e950f0d9a2d30e7a83118"/></dir></dir><dir name="Model"><file name="Callback.php" hash="2e8955cf399ea302e8b19c6ccb999cc5"/><file name="Closure.php" hash="f1456fc3e6aa04906339198be3a0a544"/><file name="Eav.php" hash="ed4adbb339497fefe1db29a59c2ed110"/><file name="Indexer.php" hash="3fcaafc332c5fe3dca0cdef383228603"/><file name="Object.php" hash="dcb759ec94621a28c4e531715813513c"/><file name="Observer.php" hash="ca5d42b0d4bef6a312575f07df964d2d"/><dir name="Attribute"><file name="Scope.php" hash="7277aac766688c59886cff561b8c44a3"/></dir><dir name="Condition"><file name="Abstract.php" hash="2b4cb990a9c690d7a1f5033e5a97cc3c"/><file name="Combine.php" hash="ee16e0a17610f5b08bc04b2f2967820b"/></dir><dir name="Config"><file name="Default.php" hash="b69bd384a59f38f214f565d21af1ca3a"/></dir><dir name="Html"><file name="Filter.php" hash="ca77f8b76bd39d00001d6dfb12ff6929"/><file name="Parser.php" hash="5f4c098e69b582025f909ddeeab6e630"/><file name="Reader.php" hash="41a66c26ce51f3803eba50cea5b95d96"/><file name="State.php" hash="5952deebd020273729594ace8a2cae9b"/><file name="Token.php" hash="5c7a4ef3150a35b8a6bf9e296e53e739"/></dir><dir name="Source"><file name="Abstract.php" hash="bb05e3ce9f5e01ef2843a5a558a86fd8"/><file name="Config.php" hash="59b1d6927157e4b34bde55794a7a86be"/><file name="Country.php" hash="cd5c9dd00c4456db2e6b4f6316303a8c"/><file name="Design.php" hash="8c033c3585d0bf0bc31a95cbbbf7d4c4"/><file name="Js.php" hash="71852d9a46c5fca27d4b0403e9ee19d9"/><file name="Layout.php" hash="4eb47f747d5a91983fb62e802ec51793"/><file name="Status.php" hash="d4fdf128e0c4cf088f654baf426c5f0f"/><file name="Yesno.php" hash="3082e75e81e111aed0ac9f1cc17e579e"/><file name="YesNoDefault.php" hash="4a13c8de30d7f27b71dac16bbf1e18ae"/></dir></dir><dir name="Resource"><file name="Eav.php" hash="2ada400977d3a8b0883a03998e1a4e47"/><file name="Indexer.php" hash="6ced1a9ad6696345071a189c8c3e657d"/><dir name="Attribute"><file name="Collection.php" hash="7f01d6480b5110a431a5b50571a9ec62"/></dir><dir name="Eav"><file name="Collection.php" hash="5153a97a4021aebced2b0a538d10b4e7"/><file name="Setup.php" hash="13360360cbfada91713159a38c82e6b2"/><dir name="Collection"><file name="Derived.php" hash="03a87d87a781c8256b6414fb132ed30e"/></dir></dir><dir name="Virtual"><file name="Collection.php" hash="ac2d11980e9dc015ed0cfbe12fbf3fc7"/></dir></dir><dir name="Rewrite"><dir name="PageCache"><file name="Processor.php" hash="d5175e3a150d92ec32016654c8a7988a"/></dir></dir><dir name="sql"><dir name="mana_core_setup"><file name="mysql4-install-1.1.1.php" hash="a169406e2cc37282d001e9415eda219a"/></dir></dir></dir><dir name="Db"><dir name="etc"><file name="config.xml" hash="456710718979cc7987f6aed01a917b1f"/><file name="m_db.xml" hash="7fb95c96ed440dfc5efb8d3ed598dd20"/></dir><dir name="Exception"><file name="Formula.php" hash="f791f3d718241b9b004ae1719dd8fca8"/><file name="Validation.php" hash="7238432db3b3a24615dc186e60afc546"/></dir><dir name="Helper"><file name="Config.php" hash="947e93e74329de11cffe102dad3b5002"/><file name="Data.php" hash="a35a41643d9c5e875d0e8e2dbfa8d4d1"/><file name="Formula.php" hash="c5761ee937e3490d1508a3ed0cfac805"/><dir name="Formula"><file name="Abstract.php" hash="88283737316ebd8cafddce5e42ac2bd8"/><file name="DependencyFinder.php" hash="480e4097ef5e9b21c527f5c61dbd3987"/><file name="Entity.php" hash="e5f500a86b18b37dd43fc8ab151fd204"/><file name="Evaluator.php" hash="8dc9cf1b9ddf8cefd053909ba841d985"/><file name="Function.php" hash="db3fb341c32f9c285d37df84a36fb82c"/><file name="Parser.php" hash="7828e59f31c03e31da92a889b4e8b52f"/><file name="Processor.php" hash="4bf7bfa8a2cdcfbecaede6ab3aa67f04"/><file name="Selector.php" hash="91bee56da8ee75aa06edacb19cb925b9"/><dir name="Entity"><file name="Aggregate.php" hash="fab53a31e480228474de7015100d6498"/><file name="Foreign.php" hash="6d4159dcb6ff3f7e5a958b6e891057c1"/><file name="Frontend.php" hash="4bef999e0ca552c3fa8b518c36b6e239"/><file name="Normal.php" hash="6a91af1bd600ca9b8be40ee5be5c4fa5"/><dir name="Aggregate"><file name="Field.php" hash="682fc6e82caf400025ba22f6b1c40156"/></dir></dir><dir name="Function"><file name="Count.php" hash="62d463301d3eac82f9f8c2952cc23ed4"/><file name="Glue.php" hash="00abff0970bc94ef46ebdb91d773ab02"/><file name="If.php" hash="215287632f25bd541fe29051cc11fba4"/><file name="Lower.php" hash="7e91d1e618e66d262b0967f0a053adfd"/><file name="Seo.php" hash="70ce3da277c48fc84363c58baba3dd37"/><file name="SkinUrl.php" hash="059ac4b6d44bf7714886c023c30a1490"/></dir><dir name="Processor"><file name="Eav.php" hash="722b0888661d38b399f74eaf9ec4247e"/><file name="Entity.php" hash="b3d6e11b78cf782c9eae78ce1eefd155"/><file name="System.php" hash="c7a3c7bf6194b041dd17dc2b3a605f6f"/><file name="Table.php" hash="771155e0a194fcf7a821e51172100138"/></dir></dir></dir><dir name="Model"><file name="Entity.php" hash="88e63ed2ebdeb129757d7acbd6f4d805"/><file name="Indexer.php" hash="8596a12b7ee26e686937cef3d2985685"/><file name="Object.php" hash="91dac5c80f75dcb81c1aadaa8984b466"/><file name="Observer.php" hash="d52dc7c597890e130a6d0ee92846fa89"/><file name="Setup.php" hash="637ff1d605b453dacf2565587c78a8d9"/><file name="Validation.php" hash="f2dd026c3d73f3fd345e1b7abde51e7d"/><dir name="Entity"><file name="Indexer.php" hash="c807d323f91e2c38344332ae8e9654b3"/></dir><dir name="Formula"><file name="Alias.php" hash="d14575f9f0477021a2e53ff1fd9c5501"/><file name="Closure.php" hash="d773c0f5ed1f593acb5458bfb3187a7b"/><file name="Context.php" hash="5fd16cf22bc1bac09856606ee0d0a141"/><file name="Entity.php" hash="c0eb7a9362996c104bde5cd2c469db10"/><file name="Expr.php" hash="b739ab589ea0e3378e32c12a69ba78cc"/><file name="Field.php" hash="d00b8c25724e34f6cad819edf1497ede"/><file name="Node.php" hash="e28d2d8d0af762abbe3b9677937103fe"/><dir name="Alias"><file name="Array.php" hash="6719df8e4123c881980f5a2b6ef93a8f"/><file name="Empty.php" hash="93e05898f60e111f12b5febb119305dd"/><file name="Single.php" hash="8603f08d6415110c8c0f04a805055fab"/></dir><dir name="Closure"><file name="AggregateFieldJoin.php" hash="f1d19cb54eaf620d038508b7ad31fc60"/><file name="ForeignJoin.php" hash="b07167a5ef2a7caf479266269f232edf"/><file name="ForeignJoinEnd.php" hash="6b9000298615ce69eadc04e707fbe17f"/><file name="Join.php" hash="b8d368c1042754f18d027027acccb27a"/></dir><dir name="Node"><file name="Add.php" hash="22f6ec02b3226ce2c9313f713d1b03fb"/><file name="Field.php" hash="93c6bf27b93091ebe7672500e7e94e48"/><file name="FormulaExpr.php" hash="b6a36a818533775fa778c6dc66ec40f7"/><file name="FunctionCall.php" hash="bac31778c670aca74c9db49dcb40007a"/><file name="Identifier.php" hash="a38aa478e6485ef9ea95fb0758c2ea49"/><file name="Multiply.php" hash="292881a092500642e4d98aeb33aa2f75"/><file name="NullValue.php" hash="2ddeb334ac3e12cdec1b413904e02210"/><file name="NumberConstant.php" hash="fd2524859dc3ed2a3fb46468b8352f72"/><file name="StringConstant.php" hash="04cdb7baa502e001dfb35af748efde30"/></dir></dir><dir name="Replication"><file name="Target.php" hash="b918ef992096a72080a743352385b64b"/></dir><dir name="Setup"><file name="Abstract.php" hash="d8e84857de7b1cdb6ba6c03e5f4aa867"/><file name="V13012122.php" hash="a2ca004389d5145d819ff791f965ef9e"/></dir><dir name="Virtual"><file name="Result.php" hash="33f35c946b2285e62a5a1c08c1bb3ec8"/></dir></dir><dir name="Resource"><file name="Entity.php" hash="c5f9ee0f1475f2d4a2075b5cead6199d"/><file name="Formula.php" hash="53b21b55b710d119fc91bbcf841caea2"/><file name="Object.php" hash="9106bec7565a3bedaf2de81b18569157"/><file name="Replicate.php" hash="e4c75872344dde3ed8a04744110faace"/><dir name="Edit"><file name="Session.php" hash="07474c4d34f6ec1cd91ade3e871ec096"/></dir><dir name="Entity"><file name="Collection.php" hash="291cbdeef792ab848175c0ae9bb65fad"/><file name="Indexer.php" hash="9e102278a3cf4e69ead0a34b12d3c91c"/><file name="JsonCollection.php" hash="bf1f5a893a33affb7c1b182f803d600a"/></dir><dir name="Object"><file name="Collection.php" hash="6f7f393abef136226ed22eb8f45d2fdd"/></dir></dir><dir name="sql"><dir name="mana_db_setup"><file name="mysql4-install-11.09.28.09.php" hash="0d8c0873cbbabb1db406e1c0b709b4de"/><file name="mysql4-upgrade-11.09.28.09-11.09.28.10.php" hash="04ccee17b3b04906e8fed2b1ac9214a3"/><file name="mysql4-upgrade-11.10.08.23-11.10.20.22.php" hash="847b24ea006e99af80cc8980ff7ff021"/></dir></dir></dir><dir name="Filters"><dir name="Block"><file name="Filter.php" hash="af52c37fb8b8d83cb2cb0f318818aaee"/><file name="Layer.php" hash="0f8fac9a9277fb6e204a8ed32b164902"/><file name="Search.php" hash="e7c5d74b36406fb181ba149588070f95"/><file name="State.php" hash="c1b960278b23822b9a645f8b29e9e79e"/><file name="View.php" hash="5257cd7eefe0b40f6b479c098dcda36e"/></dir><dir name="etc"><file name="config.xml" hash="cafb094e9188b44b5a289f23e9c2a03c"/></dir><dir name="Helper"><file name="Data.php" hash="521f102ddc19b09476ebe43afad10cd4"/><file name="Extended.php" hash="5b065cc2be0a8b96dc4db32bc8279304"/><file name="Item.php" hash="7f482a48c1e661076ccea3c21f59677c"/></dir><dir name="Interface"><file name="Filter.php" hash="f1aaf305fa9d01c666d5d0801816ced0"/></dir><dir name="Model"><file name="Filter.php" hash="cd3bc9276ff4566802e2d43280394e6f"/><file name="Filter2.php" hash="81ef439832e656d8aad2c6a8d3c2cf47"/><file name="Item.php" hash="23f74f06de263e462f8ea2f096696f8e"/><file name="Observer.php" hash="e835045553a7e4d8d821eed81e6492a1"/><file name="Operation.php" hash="54d01ace78c5b6ba3facf1a2f3255618"/><file name="Query.php" hash="d97c90a1ef471babf2d7375b4aa3eb24"/><file name="Repository.php" hash="e0cf842a98aa5ae27fc107c18f190fab"/><file name="Sort.php" hash="95804fcd46ca143587747dc7dfe9845e"/><dir name="Config"><dir name="Display"><file name="Default.php" hash="e16716300e514ef6ee7fa4c1c5fd3331"/></dir></dir><dir name="Filter"><file name="Attribute.php" hash="fed1e49349cb00230e0db624591b7043"/><file name="Category.php" hash="064e14439f5999f53f04b360a6a25a5b"/><file name="Common.php" hash="522b1695cf4f4f545c7174b90a8b06ba"/><file name="Decimal.php" hash="345c021580768436dab88b304c20229e"/><file name="Default.php" hash="960d7b6f0fd9c32cf9726e11a62cbb1e"/><file name="Price.php" hash="d90bddf4d7ee8ec591e3e71159ad259c"/></dir><dir name="Filter2"><file name="Store.php" hash="d82d20f485c4417bc51a73bcf01cd374"/><file name="Value.php" hash="d3214a80a4c3fe1eb492ce860de8d60b"/><dir name="Value"><file name="Store.php" hash="695bf8aad7ff431fe5a511098cf23f48"/></dir></dir><dir name="Solr"><file name="Attribute.php" hash="c60628b8ec074147918ea7a96e85ecd5"/><file name="Category.php" hash="281864a88dc542de2dd8bd15812a64d4"/><file name="Decimal.php" hash="4c732a1189b7cd5c96ece2f2040c4704"/><file name="Price.php" hash="97f7ffaff98551516113a7e0151c743b"/><dir name="Adapter"><file name="HttpStream.php" hash="e22a03fe69b70da21546b54558a87763"/><file name="PhpExtension.php" hash="f3a9202c874765eda2e978c15dbaaf3c"/></dir><dir name="And"><file name="Attribute.php" hash="3df0798bc675483dd4b327299fc00b33"/></dir><dir name="Reverse"><file name="Attribute.php" hash="c23dc7f104559c3df2f3394438735537"/><file name="Decimal.php" hash="89810a0c5fe707af354d7be73b8dfe36"/><file name="Price.php" hash="bf207efb2854f99a15775f38f019f5b4"/></dir></dir><dir name="Source"><file name="Display.php" hash="509e389d33e3175e304ab67ffdb79325"/><file name="Filterable.php" hash="618680f75072220ad711dec6e220d43b"/><dir name="Display"><file name="All.php" hash="1875630a7565c9655c8c8724dad45bba"/><file name="Attribute.php" hash="d2bd347e70e3924490dff6e57274ff40"/><file name="Category.php" hash="437b3f678edd292a0110529aadfb1530"/><file name="Decimal.php" hash="b432f32e93fb1991f8882bfe25f0514e"/><file name="Price.php" hash="c6a017240beaf76666e9f702a9fcd48d"/></dir></dir></dir><dir name="Resource"><file name="Filter.php" hash="e74d789c7751fe0a126b38ab0bd3ac40"/><file name="Filter2.php" hash="ed398f976465a24464e92566a9b41f6a"/><file name="Item.php" hash="c90c3eb3649317e1746065ee3e15f44a"/><file name="ItemAdditionalInfo.php" hash="af989c2a78aadbe51831d216b6c54643"/><file name="Setup.php" hash="83b12b7939ac1c7696360f77304d9d84"/><dir name="EnterpriseSearch"><file name="Engine.php" hash="51d77208587d1c55c8d508a3024bd269"/></dir><dir name="Filter"><file name="Attribute.php" hash="db4bec9fe85abd13193a491ef533da27"/><file name="Collection.php" hash="6831f054791977048641d43c288ff53c"/><file name="Decimal.php" hash="472f527ca55851d319d28ad4119e38ac"/><file name="Price.php" hash="b165981a092366d05b3537c4684e6087"/><dir name="And"><file name="Attribute.php" hash="cdc41ca223083360b35bd5f455733cd8"/></dir><dir name="Attribute"><file name="Collection.php" hash="c854270f63ca3bfd44cfd6ab27888676"/></dir><dir name="Collection"><file name="Derived.php" hash="5240ac10d2989122c49665919a9555ff"/></dir><dir name="Reverse"><file name="Attribute.php" hash="0be2e3f5eef03862e13b37deb1f7f7a3"/><file name="Decimal.php" hash="9d9974cf64c5178812bcc6fca83bc9ff"/><file name="Price.php" hash="3be48facf6596b618fc0a621f625d460"/></dir></dir><dir name="Filter2"><file name="Collection.php" hash="822b71198d05e41e90d096cb7cc47fa5"/><file name="Store.php" hash="4c430d687e9ae90ec36a9faa1c283aa1"/><file name="Value.php" hash="ea33d71787937002c2c794df69b982a8"/><dir name="Store"><file name="Collection.php" hash="7998c9394089d23d21db58a4023cc180"/></dir><dir name="Value"><file name="Collection.php" hash="3273b517dd65a46034cb3ef8adb3c610"/><file name="Store.php" hash="48d9631e8d34b15a72fc22e6bb3a98c2"/><dir name="Store"><file name="Collection.php" hash="073931492acfc99a3b5cd1ecf7113982"/></dir></dir></dir><dir name="Indexer"><file name="Source.php" hash="251589738ea54dcf6e986921f3810931"/></dir><dir name="Solr"><file name="Attribute.php" hash="f2b30e509881147f2f73ede11ac2fbed"/><file name="Collection.php" hash="9b35d28e731fc47f420447251a5e976b"/><file name="Engine.php" hash="e3c3306e436e6943aa10f9b1a77404be"/><dir name="And"><file name="Attribute.php" hash="a7dd5fbb9388a4b73efeeaa7e91a9b7b"/></dir><dir name="Reverse"><file name="Attribute.php" hash="1084278692e5ffe1d16640b530e33662"/></dir></dir></dir><dir name="sql"><dir name="mana_filters_setup"><file name="mysql4-install-1.1.1.php" hash="22f7381b5ea9261a2e8a00fda28f28ef"/><file name="mysql4-upgrade-1.1.1-1.9.1.php" hash="04c761bab20de6e0fed68e141fb68112"/><file name="mysql4-upgrade-11.09.24.09-11.09.28.09.php" hash="a007f769d492c43b1e7a583a2763300a"/><file name="mysql4-upgrade-11.10.19.18-11.10.23.01.php" hash="ef0b7b4f4530e5b01f349e3d534ebb16"/><file name="mysql4-upgrade-12.01.14.09-12.01.15.14.php" hash="001d8e035bc798d8779c29ac38912543"/><file name="mysql4-upgrade-12.04.10.23-12.04.17.18.php" hash="48f2d8cc8ca6afe014a95dea808e5087"/><file name="mysql4-upgrade-12.10.25.17-12.10.25.18.php" hash="5d726b388ac30fc00cd95bb86ab5641b"/><file name="mysql4-upgrade-12.11.02.16-12.11.13.15.php" hash="11fc0db6ff2f56fe95bfaf89ab758f61"/><file name="mysql4-upgrade-13.09.11.14-13.09.23.17.php" hash="aca62ea5d13c5bc3259a48e5cd4d5282"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mana_Core.xml" hash="0ca7883c0f5fcaa12b32842f142f92eb"/><file name="Mana_Db.xml" hash="9b4669b284f2a688e165abaac373c358"/><file name="Mana_Filters.xml" hash="1a5a180ae37f2b369a2c8ce2d2d120b1"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
skin/adminhtml/default/default/css/mana_core.css CHANGED
@@ -19,7 +19,7 @@
19
  top:45%;
20
  left:50%;
21
  width:120px;
22
- margin-left:-60px;
23
  padding:15px 60px;
24
  background:#fff4e9;
25
  border:2px solid #f1af73;
@@ -27,4 +27,34 @@
27
  font-weight:bold;
28
  text-align:center;
29
  z-index:20100;
 
 
 
 
30
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  top:45%;
20
  left:50%;
21
  width:120px;
22
+ margin-left: -120px;
23
  padding:15px 60px;
24
  background:#fff4e9;
25
  border:2px solid #f1af73;
27
  font-weight:bold;
28
  text-align:center;
29
  z-index:20100;
30
+ -moz-box-sizing: content-box;
31
+ -webkit-box-sizing: content-box;
32
+ box-sizing: content-box;
33
+ -ms-box-sizing: content-box;
34
  }
35
+
36
+ .m-popup {
37
+ position: absolute;
38
+ background: white;
39
+ z-index: 20100;
40
+ }
41
+
42
+ .m-popup-overlay {
43
+ position: absolute;
44
+ background: black;
45
+ filter: alpha(opacity=0); /* percent */
46
+ -moz-opacity: 0;
47
+ -khtml-opacity: 0;
48
+ opacity: 0;
49
+ z-index: 10000;
50
+ }
51
+
52
+ .m-overlay {
53
+ position: absolute;
54
+ background: white;
55
+ filter: alpha(opacity=0); /* percent */
56
+ -moz-opacity: 0;
57
+ -khtml-opacity: 0;
58
+ opacity: 0;
59
+ z-index: 10000;
60
+ }
skin/frontend/base/default/css/mana_core.css CHANGED
@@ -19,7 +19,7 @@
19
  top:45%;
20
  left:50%;
21
  width:120px;
22
- margin-left:-60px;
23
  padding:15px 60px;
24
  background:#fff4e9;
25
  border:2px solid #f1af73;
@@ -27,7 +27,13 @@
27
  font-weight:bold;
28
  text-align:center;
29
  z-index:20100;
 
 
 
 
30
  }
 
 
31
  .m-popup {
32
  position: absolute;
33
  background: white;
@@ -53,4 +59,4 @@
53
  z-index: 10000;
54
  }
55
  a.m-disabled { }
56
- label span.m-disabled { }
19
  top:45%;
20
  left:50%;
21
  width:120px;
22
+ margin-left: -120px;
23
  padding:15px 60px;
24
  background:#fff4e9;
25
  border:2px solid #f1af73;
27
  font-weight:bold;
28
  text-align:center;
29
  z-index:20100;
30
+ -moz-box-sizing: content-box;
31
+ -webkit-box-sizing: content-box;
32
+ box-sizing: content-box;
33
+ -ms-box-sizing: content-box;
34
  }
35
+
36
+ #m-wait .loader { }
37
  .m-popup {
38
  position: absolute;
39
  background: white;
59
  z-index: 10000;
60
  }
61
  a.m-disabled { }
62
+ label span.m-disabled { }
skin/frontend/rwd/default/css/mana_core.css ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @category Mana
3
+ * @package Mana_Core
4
+ * @copyright Copyright (c) http://www.manadev.com
5
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
6
+ */
7
+ #m-wait {
8
+ position:absolute;
9
+ color:#d85909;
10
+ font-size:1.1em;
11
+ text-align:center;
12
+ /*opacity:0.80;
13
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE8 */
14
+ z-index:20000;
15
+ }
16
+ #m-wait .loader {
17
+ position:fixed;
18
+ top:45%;
19
+ left:50%;
20
+ width:120px;
21
+ margin-left: -120px;
22
+ padding:15px 60px;
23
+ background:rgba(255, 255, 255, 0.9);
24
+ border:2px solid #3399cc;
25
+ color:#3399cc;
26
+ text-align:center;
27
+ z-index:20100;
28
+ -moz-box-sizing: content-box;
29
+ -webkit-box-sizing: content-box;
30
+ box-sizing: content-box;
31
+ -ms-box-sizing: content-box;
32
+ }
33
+
34
+ #m-wait .loader img { margin: 10px auto 0; }
35
+ .m-popup {
36
+ position: absolute;
37
+ background: white;
38
+ z-index: 20100;
39
+ }
40
+ .m-popup-overlay {
41
+ position: absolute;
42
+ background: black;
43
+ filter: alpha(opacity = 0); /* percent */
44
+ -moz-opacity: 0;
45
+ -khtml-opacity: 0;
46
+ opacity: 0;
47
+ z-index: 10000;
48
+ }
49
+
50
+ .m-overlay {
51
+ position: absolute;
52
+ background: white;
53
+ filter: alpha(opacity=0); /* percent */
54
+ -moz-opacity: 0;
55
+ -khtml-opacity: 0;
56
+ opacity: 0;
57
+ z-index: 10000;
58
+ }
59
+ a.m-disabled { }
60
+ label span.m-disabled { }
skin/frontend/rwd/default/css/mana_filters.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @category Mana
3
+ * @package Mana_Filters
4
+ * @copyright Copyright (c) http://www.manadev.com
5
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
6
+ */
7
+ /*.m-filter-item-list .m-selected-filter-item { color: red; }*/
8
+ .m-filter-popup .m-selected-ln-item > a { font-weight: bold; text-decoration: none; }
9
+ .block-layered-nav .btn-remove { margin-top: 3px; }
10
+ .block-layered-nav .currently li { position: relative; }
11
+ .block-layered-nav .currently .btn-remove { margin-top: -10px; position: absolute; right: 0; top: 50%; margin-left: 0; }
12
+ .block-layered-nav dt { position: relative; zoom: 1; left: 0; top: 0; }
13
+ .block.block-layered-nav dl dd ol > li > span, .block.block-layered-nav dl dd ol > li > a { padding: 0; }
14
+
15
+ .block-layered-nav label { font-family: "Helvetica Neue", Verdana, Arial, sans-serif; line-height: 1.5;
16
+ font-size: 14px; color: #3399cc; }
17
+
18
+ @media only screen and (max-width: 770px) {
19
+ .block-layered-nav dl dd ol > li { background-color: #f4f4f4; padding: 3px 5px; margin: 5px 0; }
20
+ .block-layered-nav dl dd ol > li:hover { background-color: #e7e7e7; }
21
+ .block-layered-nav dl dd ol > li > a, .block-layered-nav dl dd ol > li > span { margin: 0; }
22
+ }
skin/frontend/rwd/default/images/mana_core/m-wait.gif ADDED
Binary file