Eabi_Livehandler - Version 0.1.3

Version Notes

* Fixed PHP errors related to call_user_func() is not valid function callback in Eabi_LiveHandler_Model_Directory_Collection
* Order manager is enabled by default

Download this release

Release Info

Developer Magento Core Team
Extension Eabi_Livehandler
Version 0.1.3
Comparing to
See all releases


Code changes from version 0.1.2 to 0.1.3

app/code/community/Eabi/Livehandler/Model/Directory/Collection.php CHANGED
@@ -38,6 +38,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
38
  protected $_recursionLevel=0;
39
  protected $_isRecursion;
40
  protected $_filters = array();
 
41
  /**
42
  * Constructor
43
  *
@@ -45,8 +46,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
45
  * @param bool $is_recursion - use or not recursion
46
  * @return none
47
  */
48
- public function __construct($path,$isRecursion=true,$recursionLevel = 0)
49
- {
50
  $this->setPath($path);
51
  $this->_dirName = $this->lastDir();
52
  $this->setRecursion($isRecursion);
@@ -60,8 +60,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
60
  *
61
  * @return string - name of this directory
62
  */
63
- public function getDirName()
64
- {
65
  return $this->_dirName;
66
  }
67
  /**
@@ -69,8 +68,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
69
  *
70
  * @return bool - is or not recursion
71
  */
72
- public function getRecursion()
73
- {
74
  return $this->_isRecursion;
75
  }
76
  /**
@@ -78,8 +76,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
78
  *
79
  * @return int - recursion level
80
  */
81
- public function getRecursionLevel()
82
- {
83
  return $this->_recursionLevel;
84
  }
85
  /**
@@ -87,8 +84,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
87
  *
88
  * @return string - path to this directory
89
  */
90
- public function getPath()
91
- {
92
  return $this->_path;
93
  }
94
  /**
@@ -97,8 +93,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
97
  * @param bool $isRecursion - use or not recursion
98
  * @return none
99
  */
100
- public function setPath($path, $isRecursion='')
101
- {
102
  if(is_dir($path)){
103
  if(isset($this->_path) && $this->_path!=$path && $this->_path!=''){
104
  $this->_path = $path;
@@ -117,8 +112,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
117
  * @param bool $isRecursion - use or not recursion
118
  * @return none
119
  */
120
- public function setRecursion($isRecursion)
121
- {
122
  $this->_isRecursion = $isRecursion;
123
  }
124
  /**
@@ -127,8 +121,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
127
  * @param int $recursionLevel - level of recursion
128
  * @return none
129
  */
130
- public function setRecursionLevel($recursionLevel)
131
- {
132
  $this->_recursionLevel = $recursionLevel;
133
  }
134
  /**
@@ -137,8 +130,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
137
  * @param string $path - path to directory
138
  * @return string - latest dir in the path
139
  */
140
- public function lastDir()
141
- {
142
  return self::getLastDir($this->getPath());
143
  }
144
  /**
@@ -147,7 +139,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
147
  * @param string $path - path to directory
148
  * @return string - latest dir in the path
149
  */
150
- static public function getLastDir($path){
151
  if($path=='') $path = $this->getPath();
152
  $last = strrpos($path, "/");
153
  return substr($path,$last+1);
@@ -158,8 +150,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
158
  * @param IFactory $item - item of collection
159
  * @return none
160
  */
161
- public function addItem($item)
162
- {
163
  $this->_items[] = $item;
164
  }
165
  /**
@@ -167,8 +158,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
167
  *
168
  * @return none
169
  */
170
- protected function parseDir()
171
- {
172
  $this->clear();
173
  $iter = new RecursiveDirectoryIterator($this->getPath());
174
  while ($iter->valid()) {
@@ -180,13 +170,12 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
180
  }
181
  }
182
 
183
- static public function getFactory($path,$is_recursion = true,$recurse_level=0)
184
- {
185
  if(is_dir($path)){
186
  $obj = new Eabi_Livehandler_Model_Directory_Collection($path,$is_recursion,$recurse_level+1);
187
  return $obj;
188
  } else {
189
- // return new Varien_File_Object($path);
190
  }
191
  }
192
 
@@ -197,8 +186,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
197
  * @param bool $useFilter - filter using
198
  * @return none
199
  */
200
- public function useFilter($useFilter)
201
- {
202
  $this->_renderFilters();
203
  $this->walk('useFilter', array($useFilter));
204
  }
@@ -207,8 +195,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
207
  *
208
  * @return array - files names of current collection
209
  */
210
- public function filesName()
211
- {
212
  $files = array();
213
  $this->getFilesName($files);
214
  return $files;
@@ -228,8 +215,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
228
  *
229
  * @return array - files paths of current collection
230
  */
231
- public function filesPaths()
232
- {
233
  $paths = array();
234
  $this->getFilesPaths($paths);
235
  return $paths;
@@ -240,8 +226,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
240
  * @param array $files - array of files paths
241
  * @return none
242
  */
243
- public function getFilesPaths(&$paths)
244
- {
245
  $this->walk('getFilesPaths', array(&$paths));
246
  }
247
  /**
@@ -249,8 +234,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
249
  *
250
  * @return array - array of SplFileObject objects
251
  */
252
- public function filesObj()
253
- {
254
  $objs = array();
255
  $this->getFilesObj($objs);
256
  return $objs;
@@ -261,8 +245,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
261
  * @param array $objs - array of SplFileObject objects
262
  * @return none
263
  */
264
- public function getFilesObj(&$objs)
265
- {
266
  $this->walk('getFilesObj', array(&$objs));
267
  }
268
  /**
@@ -270,8 +253,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
270
  *
271
  * @return array - array of names of dirs
272
  */
273
- public function dirsName()
274
- {
275
  $dir = array();
276
  $this->getDirsName($dir);
277
  return $dir;
@@ -282,8 +264,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
282
  * @param array $dirs - array of names of dirs
283
  * @return none
284
  */
285
- public function getDirsName(&$dirs)
286
- {
287
  $this->walk('getDirsName', array(&$dirs));
288
  if($this->getRecursionLevel()>0)
289
  $dirs[] = $this->getDirName();
@@ -294,8 +275,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
294
  * @param array $filter - array of filters
295
  * @return none
296
  */
297
- protected function setFilesFilter($filter)
298
- {
299
  $this->walk('setFilesFilter', array($filter));
300
  }
301
  /**
@@ -303,8 +283,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
303
  *
304
  * @return array
305
  */
306
- public function __toArray()
307
- {
308
  $arr = array();
309
  $this->toArray($arr);
310
  return $arr;
@@ -314,8 +293,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
314
  * @param array &$arr - this collection array
315
  * @return none
316
  */
317
- public function toArray($arrRequiredFields = array())
318
- {
319
  return array();
320
  }
321
  /**
@@ -324,8 +302,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
324
  * @param string $rootName - root element name
325
  * @return none
326
  */
327
- public function __toXml($addOpenTag=true,$rootName='Struct')
328
- {
329
  $xml='';
330
  $this->toXml($xml,$addOpenTag,$rootName);
331
  return $xml;
@@ -337,16 +314,14 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
337
  * @param string $rootName - root element name
338
  * @return none
339
  */
340
- public function toXml()
341
- {
342
  return '';
343
  }
344
  /**
345
  * apply filters
346
  * @return none
347
  */
348
- protected function _renderFilters()
349
- {
350
  $exts = array();
351
  $names = array();
352
  $regName = array();
@@ -404,8 +379,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
404
  * add filter
405
  * @return none
406
  */
407
- public function addFilter($field, $value, $type = 'and')
408
- {
409
  $filter = array();
410
  $filter['field'] = $field;
411
  $filter['value'] = $value;
@@ -431,8 +405,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
431
  *
432
  * @return Varien_Data_Collection
433
  */
434
- public function loadData($printQuery = false, $logQuery = false)
435
- {
436
  return $this;
437
  }
438
 
@@ -441,8 +414,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
441
  *
442
  * @return Varien_Data_Collection
443
  */
444
- public function load($printQuery = false, $logQuery = false)
445
- {
446
  return $this->loadData($printQuery, $logQuery);
447
  }
448
  /**
@@ -450,8 +422,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
450
  *
451
  * @return Varien_Data_Collection
452
  */
453
- public function clear()
454
- {
455
  $this->_setIsLoaded(false);
456
  $this->_items = array();
457
  return $this;
@@ -461,8 +432,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
461
  *
462
  * @return bool
463
  */
464
- public function isLoaded()
465
- {
466
  return $this->_isCollectionLoaded;
467
  }
468
 
@@ -472,8 +442,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
472
  * @param unknown_type $flag
473
  * @return unknown
474
  */
475
- protected function _setIsLoaded($flag = true)
476
- {
477
  $this->_isCollectionLoaded = $flag;
478
  return $this;
479
  }
@@ -487,8 +456,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
487
  * @param array $args
488
  * @return array
489
  */
490
- public function walk($callback, array $args=array())
491
- {
492
  $results = array();
493
  $useItemCallback = is_string($callback) && strpos($callback, '::')===false;
494
  foreach ($this->getItems() as $id=>$item) {
@@ -508,8 +476,7 @@ class Eabi_Livehandler_Model_Directory_Collection implements IteratorAggregate,
508
  *
509
  * @return array
510
  */
511
- public function getItems()
512
- {
513
  $this->load();
514
  return $this->_items;
515
  }
38
  protected $_recursionLevel=0;
39
  protected $_isRecursion;
40
  protected $_filters = array();
41
+
42
  /**
43
  * Constructor
44
  *
46
  * @param bool $is_recursion - use or not recursion
47
  * @return none
48
  */
49
+ public function __construct($path,$isRecursion=true,$recursionLevel = 0) {
 
50
  $this->setPath($path);
51
  $this->_dirName = $this->lastDir();
52
  $this->setRecursion($isRecursion);
60
  *
61
  * @return string - name of this directory
62
  */
63
+ public function getDirName() {
 
64
  return $this->_dirName;
65
  }
66
  /**
68
  *
69
  * @return bool - is or not recursion
70
  */
71
+ public function getRecursion() {
 
72
  return $this->_isRecursion;
73
  }
74
  /**
76
  *
77
  * @return int - recursion level
78
  */
79
+ public function getRecursionLevel() {
 
80
  return $this->_recursionLevel;
81
  }
82
  /**
84
  *
85
  * @return string - path to this directory
86
  */
87
+ public function getPath() {
 
88
  return $this->_path;
89
  }
90
  /**
93
  * @param bool $isRecursion - use or not recursion
94
  * @return none
95
  */
96
+ public function setPath($path, $isRecursion='') {
 
97
  if(is_dir($path)){
98
  if(isset($this->_path) && $this->_path!=$path && $this->_path!=''){
99
  $this->_path = $path;
112
  * @param bool $isRecursion - use or not recursion
113
  * @return none
114
  */
115
+ public function setRecursion($isRecursion) {
 
116
  $this->_isRecursion = $isRecursion;
117
  }
118
  /**
121
  * @param int $recursionLevel - level of recursion
122
  * @return none
123
  */
124
+ public function setRecursionLevel($recursionLevel) {
 
125
  $this->_recursionLevel = $recursionLevel;
126
  }
127
  /**
130
  * @param string $path - path to directory
131
  * @return string - latest dir in the path
132
  */
133
+ public function lastDir() {
 
134
  return self::getLastDir($this->getPath());
135
  }
136
  /**
139
  * @param string $path - path to directory
140
  * @return string - latest dir in the path
141
  */
142
+ static public function getLastDir($path) {
143
  if($path=='') $path = $this->getPath();
144
  $last = strrpos($path, "/");
145
  return substr($path,$last+1);
150
  * @param IFactory $item - item of collection
151
  * @return none
152
  */
153
+ public function addItem($item) {
 
154
  $this->_items[] = $item;
155
  }
156
  /**
158
  *
159
  * @return none
160
  */
161
+ protected function parseDir() {
 
162
  $this->clear();
163
  $iter = new RecursiveDirectoryIterator($this->getPath());
164
  while ($iter->valid()) {
170
  }
171
  }
172
 
173
+ static public function getFactory($path,$is_recursion = true,$recurse_level=0) {
 
174
  if(is_dir($path)){
175
  $obj = new Eabi_Livehandler_Model_Directory_Collection($path,$is_recursion,$recurse_level+1);
176
  return $obj;
177
  } else {
178
+ return new Eabi_Livehandler_Model_File_Object($path);
179
  }
180
  }
181
 
186
  * @param bool $useFilter - filter using
187
  * @return none
188
  */
189
+ public function useFilter($useFilter) {
 
190
  $this->_renderFilters();
191
  $this->walk('useFilter', array($useFilter));
192
  }
195
  *
196
  * @return array - files names of current collection
197
  */
198
+ public function filesName() {
 
199
  $files = array();
200
  $this->getFilesName($files);
201
  return $files;
215
  *
216
  * @return array - files paths of current collection
217
  */
218
+ public function filesPaths() {
 
219
  $paths = array();
220
  $this->getFilesPaths($paths);
221
  return $paths;
226
  * @param array $files - array of files paths
227
  * @return none
228
  */
229
+ public function getFilesPaths(&$paths) {
 
230
  $this->walk('getFilesPaths', array(&$paths));
231
  }
232
  /**
234
  *
235
  * @return array - array of SplFileObject objects
236
  */
237
+ public function filesObj() {
 
238
  $objs = array();
239
  $this->getFilesObj($objs);
240
  return $objs;
245
  * @param array $objs - array of SplFileObject objects
246
  * @return none
247
  */
248
+ public function getFilesObj(&$objs) {
 
249
  $this->walk('getFilesObj', array(&$objs));
250
  }
251
  /**
253
  *
254
  * @return array - array of names of dirs
255
  */
256
+ public function dirsName() {
 
257
  $dir = array();
258
  $this->getDirsName($dir);
259
  return $dir;
264
  * @param array $dirs - array of names of dirs
265
  * @return none
266
  */
267
+ public function getDirsName(&$dirs) {
 
268
  $this->walk('getDirsName', array(&$dirs));
269
  if($this->getRecursionLevel()>0)
270
  $dirs[] = $this->getDirName();
275
  * @param array $filter - array of filters
276
  * @return none
277
  */
278
+ protected function setFilesFilter($filter) {
 
279
  $this->walk('setFilesFilter', array($filter));
280
  }
281
  /**
283
  *
284
  * @return array
285
  */
286
+ public function __toArray() {
 
287
  $arr = array();
288
  $this->toArray($arr);
289
  return $arr;
293
  * @param array &$arr - this collection array
294
  * @return none
295
  */
296
+ public function toArray($arrRequiredFields = array()) {
 
297
  return array();
298
  }
299
  /**
302
  * @param string $rootName - root element name
303
  * @return none
304
  */
305
+ public function __toXml($addOpenTag=true,$rootName='Struct') {
 
306
  $xml='';
307
  $this->toXml($xml,$addOpenTag,$rootName);
308
  return $xml;
314
  * @param string $rootName - root element name
315
  * @return none
316
  */
317
+ public function toXml() {
 
318
  return '';
319
  }
320
  /**
321
  * apply filters
322
  * @return none
323
  */
324
+ protected function _renderFilters() {
 
325
  $exts = array();
326
  $names = array();
327
  $regName = array();
379
  * add filter
380
  * @return none
381
  */
382
+ public function addFilter($field, $value, $type = 'and') {
 
383
  $filter = array();
384
  $filter['field'] = $field;
385
  $filter['value'] = $value;
405
  *
406
  * @return Varien_Data_Collection
407
  */
408
+ public function loadData($printQuery = false, $logQuery = false) {
 
409
  return $this;
410
  }
411
 
414
  *
415
  * @return Varien_Data_Collection
416
  */
417
+ public function load($printQuery = false, $logQuery = false) {
 
418
  return $this->loadData($printQuery, $logQuery);
419
  }
420
  /**
422
  *
423
  * @return Varien_Data_Collection
424
  */
425
+ public function clear() {
 
426
  $this->_setIsLoaded(false);
427
  $this->_items = array();
428
  return $this;
432
  *
433
  * @return bool
434
  */
435
+ public function isLoaded() {
 
436
  return $this->_isCollectionLoaded;
437
  }
438
 
442
  * @param unknown_type $flag
443
  * @return unknown
444
  */
445
+ protected function _setIsLoaded($flag = true) {
 
446
  $this->_isCollectionLoaded = $flag;
447
  return $this;
448
  }
456
  * @param array $args
457
  * @return array
458
  */
459
+ public function walk($callback, array $args=array()) {
 
460
  $results = array();
461
  $useItemCallback = is_string($callback) && strpos($callback, '::')===false;
462
  foreach ($this->getItems() as $id=>$item) {
476
  *
477
  * @return array
478
  */
479
+ public function getItems() {
 
480
  $this->load();
481
  return $this->_items;
482
  }
app/code/community/Eabi/Livehandler/Model/File/Object.php ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@e-abi.ee so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade this module to newer
19
+ * versions in the future.
20
+ *
21
+ * @category Eabi
22
+ * @package Eabi_Livehandler
23
+ * @copyright Copyright (c) 2013 Insolo OY (http://infosolo.fi/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ * @author Matis Halmann
26
+ *
27
+
28
+ */
29
+
30
+ /**
31
+ * Description of Object
32
+ *
33
+ * @author Matis
34
+ */
35
+ class Eabi_Livehandler_Model_File_Object extends SplFileObject {
36
+ protected $_filename;
37
+ protected $_path;
38
+ protected $_filter;
39
+ protected $_isCorrect=true; # - pass or not filter checking
40
+ protected $filtered;
41
+
42
+ /**
43
+ * Constructor
44
+ *
45
+ * @param string $path - path to directory
46
+ * @return none
47
+ */
48
+ public function __construct($path)
49
+ {
50
+ parent::__construct($path);
51
+ $this->_path=$path;
52
+ $this->_filename=basename($path);
53
+ }
54
+ /**
55
+ * add file name to array
56
+ *
57
+ * @param array &$files - array of files
58
+ * @return none
59
+ */
60
+ public function getFilesName(&$files)
61
+ {
62
+ $this->getFileName($files);
63
+ }
64
+ /**
65
+ * add file name to array
66
+ *
67
+ * @param array &$files - array of files
68
+ * @return none
69
+ */
70
+ public function getFileName(&$files=null)
71
+ {
72
+ if($this->_isCorrect){
73
+ if($files===null)
74
+ return $this->_filename;
75
+ $files[] = $this->_filename;
76
+ }
77
+ }
78
+ /**
79
+ * add file path to array
80
+ *
81
+ * @param array &$paths - array of paths
82
+ * @return none
83
+ */
84
+ public function getFilesPaths(&$paths)
85
+ {
86
+ if($this->_isCorrect){
87
+ $paths[] = (string)$this->_path;
88
+ }
89
+ }
90
+ /**
91
+ * add file path to array
92
+ *
93
+ * @param array &$paths - array of paths
94
+ * @return none
95
+ */
96
+ public function getFilePath(&$path=null)
97
+ {
98
+ if($this->_isCorrect){
99
+ if($path===null)
100
+ return $this->_path;
101
+ $paths[] = $this->_path;
102
+ }
103
+ }
104
+ /**
105
+ * use filter
106
+ *
107
+ * @param bool $useFilter - use or not filter
108
+ * @return none
109
+ */
110
+ public function useFilter($useFilter)
111
+ {
112
+ if($useFilter){
113
+ $this->renderFilter();
114
+ } else {
115
+ $this->_isCorrect = true;
116
+ $this->filtered = false;
117
+ }
118
+
119
+ }
120
+ /**
121
+ * add file object to array
122
+ *
123
+ * @param array &$objs - array of gile objects
124
+ * @return none
125
+ */
126
+ public function getFilesObj(&$objs)
127
+ {
128
+ if($this->_isCorrect){
129
+ $objs[] = $this;
130
+ }
131
+ }
132
+ /**
133
+ * nothing
134
+ *
135
+ * @param array &$dirs - array of dirs
136
+ * @return none
137
+ */
138
+ public function getDirsName(&$dirs)
139
+ {
140
+ return Varien_Directory_Collection::getLastDir($this->_path);
141
+ }
142
+ /**
143
+ * nothing
144
+ *
145
+ * @param array &$dirs - array of dirs
146
+ * @return none
147
+ */
148
+ public function getDirName()
149
+ {
150
+ return Varien_Directory_Collection::lastDir($this->_path);
151
+ }
152
+ /**
153
+ * set file filter
154
+ *
155
+ * @param array $filter - array of filter
156
+ * @return none
157
+ */
158
+ public function setFilesFilter($filter)
159
+ {
160
+ $this->addFilter($filter);
161
+ }
162
+ /**
163
+ * set file filter
164
+ *
165
+ * @param array $filter - array of filter
166
+ * @return none
167
+ */
168
+ public function addFilter($filter)
169
+ {
170
+ $this->_filter = $filter;
171
+ }
172
+ /**
173
+ * get extension of file
174
+ *
175
+ * @return string - extension of file
176
+ */
177
+ public function getExtension()
178
+ {
179
+ return self::getExt($this->_filename);
180
+ }
181
+ /**
182
+ * get extension of file
183
+ *
184
+ * @param string $fileName - name of file
185
+ * @return string - extension of file
186
+ */
187
+ static public function getExt($fileName)
188
+ {
189
+ $path_parts = pathinfo($fileName);
190
+ if(isset($path_parts["extension"])) {
191
+ return $path_parts["extension"];
192
+ } else {
193
+ return '';
194
+ }
195
+ }
196
+ /**
197
+ * get name of file
198
+ *
199
+ * @return string - name of file
200
+ */
201
+ public function getName()
202
+ {
203
+ return basename($this->_filename,'.'.$this->getExtension());
204
+ }
205
+ /**
206
+ * render filters
207
+ *
208
+ * @return none
209
+ */
210
+ public function renderFilter()
211
+ {
212
+ #print_r($this->_filter);
213
+ if(isset($this->_filter) && count($this->_filter)>0 && $this->filtered==false){
214
+ $this->filtered = true;
215
+ if(isset($this->_filter['extension'])){
216
+ $filter = $this->_filter['extension'];
217
+ if($filter!=null){
218
+ if(is_array($filter)){
219
+ if(!in_array($this->getExtension(),$filter)){
220
+ $this->_isCorrect = false;
221
+ }
222
+ } else {
223
+ if($this->getExtension()!=$filter){
224
+ $this->_isCorrect = false;
225
+ }
226
+ }
227
+ }
228
+ }
229
+ if(isset($this->_filter['name'])){
230
+ $filter = $this->_filter['name'];
231
+ if($filter!=null){
232
+ if(is_array($filter)){
233
+ if(!in_array($this->getName(),$filter)){
234
+ $this->_isCorrect = false;
235
+ }
236
+ } else {
237
+ if($this->getName()!=$filter){
238
+ $this->_isCorrect = false;
239
+ }
240
+ }
241
+ }
242
+ }
243
+
244
+ if(isset($this->_filter['regName'])){
245
+ $filter = $this->_filter['regName'];
246
+
247
+ if($filter!=null){
248
+ foreach ($filter as $value) {
249
+ if(!preg_match($value,$this->getName())){
250
+ $this->_isCorrect = false;
251
+ }
252
+ }
253
+
254
+ }
255
+ }
256
+ }
257
+ }
258
+ /**
259
+ * add to array file name
260
+ *
261
+ * @param array &$arr -export array
262
+ * @return none
263
+ */
264
+ public function toArray(&$arr)
265
+ {
266
+ if($this->_isCorrect){
267
+ $arr['files_in_dirs'][] = $this->_filename;
268
+ }
269
+ }
270
+ /**
271
+ * add to xml file name
272
+ *
273
+ * @param array &$xml -export xml
274
+ * @param int $recursionLevel - level of recursion
275
+ * @param bool $addOpenTag - nothing
276
+ * @param string $rootName - nothing
277
+ * @return none
278
+ */
279
+ public function toXml(&$xml,$recursionLevel=0,$addOpenTag=true,$rootName='Struct')
280
+ {
281
+ if($this->_isCorrect){
282
+ $xml .=str_repeat("\t",$recursionLevel+2).'<fileName>'.$this->_filename.'</fileName>'."\n";
283
+ }
284
+ }
285
+
286
+ }
287
+
app/code/community/Eabi/Livehandler/etc/config.xml CHANGED
@@ -32,7 +32,7 @@
32
  <config>
33
  <modules>
34
  <Eabi_Livehandler>
35
- <version>0.1.2</version>
36
  </Eabi_Livehandler>
37
  </modules>
38
 
@@ -179,8 +179,8 @@
179
  <enabled>1</enabled>
180
  </main>
181
  <admintools>
182
- <enabled>0</enabled>
183
- <disable_url>1</disable_url>
184
  <disable_actions_read>0</disable_actions_read>
185
  <open_in_new>1</open_in_new>
186
  <buttons_url>http://en.e-abi.ee/magento/better-order-management.html</buttons_url>
32
  <config>
33
  <modules>
34
  <Eabi_Livehandler>
35
+ <version>0.1.3</version>
36
  </Eabi_Livehandler>
37
  </modules>
38
 
179
  <enabled>1</enabled>
180
  </main>
181
  <admintools>
182
+ <enabled>1</enabled>
183
+ <disable_url>0</disable_url>
184
  <disable_actions_read>0</disable_actions_read>
185
  <open_in_new>1</open_in_new>
186
  <buttons_url>http://en.e-abi.ee/magento/better-order-management.html</buttons_url>
app/etc/modules/Eabi_Livehandler.xml CHANGED
@@ -34,7 +34,7 @@
34
  <Eabi_Livehandler>
35
  <active>true</active>
36
  <codePool>community</codePool>
37
- <version>0.1.2</version>
38
  </Eabi_Livehandler>
39
  </modules>
40
  </config>
34
  <Eabi_Livehandler>
35
  <active>true</active>
36
  <codePool>community</codePool>
37
+ <version>0.1.3</version>
38
  </Eabi_Livehandler>
39
  </modules>
40
  </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Eabi_Livehandler</name>
4
- <version>0.1.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
@@ -12,13 +12,12 @@
12
  &lt;p&gt;You can navigate between orders by pressing directional keys or by pressing left/right icons on the order view&lt;/p&gt;&#xD;
13
  &lt;p&gt;Possibility to create your own action buttons, which allows to save lots of time when managing orders&lt;/p&gt;&#xD;
14
  &lt;p&gt;Possibility to purchase action buttons like &lt;strong&gt;Add order comment&lt;/strong&gt;, &lt;strong&gt;Create invoice&lt;/strong&gt;, &lt;strong&gt;Ship order&lt;/strong&gt; and more&lt;/p&gt;</description>
15
- <notes>* Refactored directory lister into the module, no more need to edit Varien_Data_Collection manually&#xD;
16
- * Displays order manager if only one order is in the list&#xD;
17
- * Fixed onclick htmlspecialchars javascript error</notes>
18
  <authors><author><name>Matis Matis</name><user>auto-converted</user><email>info@e-abi.ee</email></author></authors>
19
- <date>2013-11-21</date>
20
- <time>18:53:07</time>
21
- <contents><target name="magecommunity"><dir name="Eabi"><dir name="Livehandler"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Button.php" hash="769f934d1968eba40eb5f171dca1a1a6"/><file name="Remove.php" hash="0580ca2f3b46bfb5a26a2ba0de9c3b1b"/></dir></dir></dir></dir><file name="Footer.php" hash="7924e3ec5e05b47706852e2381426ff6"/></dir><dir name="Helper"><file name="Data.php" hash="778452358c06017367fd863de4b443e2"/></dir><dir name="Model"><dir name="Action"><file name="Abstract.php" hash="62e7b9907a19a8609ce497c1cfd6258a"/></dir><dir name="Adminhtml"><file name="Gridmanager.php" hash="d5bebdc44fb5923d04312db6340111ca"/></dir><dir name="Directory"><file name="Collection.php" hash="0c6342fcea78add76449fe4a52281ecb"/></dir><dir name="Mysql4"><dir name="Entry"><file name="Collection.php" hash="d09432a1d05ded81a8a159be04ddfb54"/></dir><file name="Entry.php" hash="71cd093acf45e30ef2e12da77691c411"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Button.php" hash="a1d66f26408347f018cdc5728717f87a"/></dir></dir></dir><file name="Abstract.php" hash="d672b74706f34a12f990895abefb9e7a"/><file name="Entry.php" hash="0a90d9fa154d8c6d0e4acb58add95b0a"/><file name="Ordergrid.php" hash="802bbfbda715aad45a4a1fb824464a6e"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LivehandlerController.php" hash="3141021b8271061ca6e4b324f87ab19e"/><file name="RemoveController.php" hash="85d600fadeae29fd6cd884b6b7910918"/></dir><file name="IndexController.php" hash="59f5435d2e9120e52e38f6da04b20843"/></dir><dir name="etc"><file name="config.xml" hash="50745aaf0a48e191d032a9030bb8b692"/><file name="system.xml" hash="8a6fa438c21963a9aabdca771a11e727"/></dir><dir name="sql"><dir name="eabi_livehandler_setup"><file name="mysql4-install-0.1.0.php" hash="dcde4eaa686eed03d0ad74f3d73e5039"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="d4141e847390d7af4381f50aaab8c0e9"/></dir></dir><file name="CHANGELOG.txt" hash="c1462eeb9d109135e8d451c7341c4e3b"/><file name="LICENCE.txt" hash="0191312e121c0b3e1165619b96efcf9f"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="eabi_livehandler.xml" hash="e384d89cb128626854f404565f6dc196"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="eabi_livehandler.xml" hash="456c30e8faf08cd251444e5245fb84d5"/></dir></dir></dir><dir name="base"><dir name="default"><dir name="layout"><file name="eabi_livehandler.xml" hash="456c30e8faf08cd251444e5245fb84d5"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eabi_Livehandler.xml" hash="e2b54a5b6126b249908d3cd663bd7186"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir><dir name="et_EE"><file name="Eabi_Livehandler.csv" hash="a30b4f480458b711e6a398e6fc153359"/></dir><dir name="fi_FI"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir><dir name="lt_LT"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir><dir name="sv_SE"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="eabi_admintools.css" hash="fa4d08faa9c1300e9a543ff408557c38"/></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="eabi_js"><file name="crossBrowser_initKeyboardEvent.js" hash="8600c5536225fd70c56ef313ee430e08"/></dir><dir name="livepipe"><file name="contextmenu.js" hash="a5dbab9663d94d9d848e84b524c1f925"/><file name="cookie.js" hash="eab2042ac637aec7777c7c64e3e2bb1a"/><file name="event_behavior.js" hash="a59a00ad652efb1596b5bd2e6f5cfe48"/><file name="hotkey.js" hash="c6193fc03e4cd4c94ee4fb37e3d5ed6b"/><file name="livepipe.js" hash="6e569402b2686976e7390f0b7a25b1eb"/><file name="progressbar.js" hash="69719eccbecbc0378d9919c53a3ef7dd"/><file name="rating.js" hash="adb5ce773c37b40fb590a877d949be7a"/><file name="resizable.js" hash="38fd18daa37e5612495cc7b42fd32b3d"/><file name="scrollbar.js" hash="7a2603c2107944b8a70e41e7a84133ba"/><file name="selection.js" hash="3f48981cccffdb5fcc5f5ff27d0b0b68"/><file name="selectmultiple.js" hash="d8f044eb344061bdcce405f671b15654"/><file name="tabs.js" hash="22abb9a3ec3933d54ff9ede0338ca7f3"/><file name="textarea.js" hash="9825782bf78d38efa53200a206d8cd77"/><file name="window.js" hash="f6eba488d6a80e05f59d97a0cef59730"/></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies/>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Eabi_Livehandler</name>
4
+ <version>0.1.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
12
  &lt;p&gt;You can navigate between orders by pressing directional keys or by pressing left/right icons on the order view&lt;/p&gt;&#xD;
13
  &lt;p&gt;Possibility to create your own action buttons, which allows to save lots of time when managing orders&lt;/p&gt;&#xD;
14
  &lt;p&gt;Possibility to purchase action buttons like &lt;strong&gt;Add order comment&lt;/strong&gt;, &lt;strong&gt;Create invoice&lt;/strong&gt;, &lt;strong&gt;Ship order&lt;/strong&gt; and more&lt;/p&gt;</description>
15
+ <notes>* Fixed PHP errors related to call_user_func() is not valid function callback in Eabi_LiveHandler_Model_Directory_Collection&#xD;
16
+ * Order manager is enabled by default</notes>
 
17
  <authors><author><name>Matis Matis</name><user>auto-converted</user><email>info@e-abi.ee</email></author></authors>
18
+ <date>2013-12-03</date>
19
+ <time>23:01:10</time>
20
+ <contents><target name="magecommunity"><dir name="Eabi"><dir name="Livehandler"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Button.php" hash="769f934d1968eba40eb5f171dca1a1a6"/><file name="Remove.php" hash="0580ca2f3b46bfb5a26a2ba0de9c3b1b"/></dir></dir></dir></dir><file name="Footer.php" hash="7924e3ec5e05b47706852e2381426ff6"/></dir><dir name="Helper"><file name="Data.php" hash="778452358c06017367fd863de4b443e2"/></dir><dir name="Model"><dir name="Action"><file name="Abstract.php" hash="62e7b9907a19a8609ce497c1cfd6258a"/></dir><dir name="Adminhtml"><file name="Gridmanager.php" hash="d5bebdc44fb5923d04312db6340111ca"/></dir><dir name="Directory"><file name="Collection.php" hash="749a61c5b1404cb657b73e31eed8daba"/></dir><dir name="File"><file name="Object.php" hash="5e76fb7fbda6ba5385a49a7c9de0f40f"/></dir><dir name="Mysql4"><dir name="Entry"><file name="Collection.php" hash="d09432a1d05ded81a8a159be04ddfb54"/></dir><file name="Entry.php" hash="71cd093acf45e30ef2e12da77691c411"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Button.php" hash="a1d66f26408347f018cdc5728717f87a"/></dir></dir></dir><file name="Abstract.php" hash="d672b74706f34a12f990895abefb9e7a"/><file name="Entry.php" hash="0a90d9fa154d8c6d0e4acb58add95b0a"/><file name="Ordergrid.php" hash="802bbfbda715aad45a4a1fb824464a6e"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LivehandlerController.php" hash="3141021b8271061ca6e4b324f87ab19e"/><file name="RemoveController.php" hash="85d600fadeae29fd6cd884b6b7910918"/></dir><file name="IndexController.php" hash="59f5435d2e9120e52e38f6da04b20843"/></dir><dir name="etc"><file name="config.xml" hash="1976fed1107ab9b252ba852e02282439"/><file name="system.xml" hash="8a6fa438c21963a9aabdca771a11e727"/></dir><dir name="sql"><dir name="eabi_livehandler_setup"><file name="mysql4-install-0.1.0.php" hash="dcde4eaa686eed03d0ad74f3d73e5039"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="d4141e847390d7af4381f50aaab8c0e9"/></dir></dir><file name="CHANGELOG.txt" hash="c1462eeb9d109135e8d451c7341c4e3b"/><file name="LICENCE.txt" hash="0191312e121c0b3e1165619b96efcf9f"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="eabi_livehandler.xml" hash="e384d89cb128626854f404565f6dc196"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="eabi_livehandler.xml" hash="456c30e8faf08cd251444e5245fb84d5"/></dir></dir></dir><dir name="base"><dir name="default"><dir name="layout"><file name="eabi_livehandler.xml" hash="456c30e8faf08cd251444e5245fb84d5"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eabi_Livehandler.xml" hash="d7d115cf2178130e975d73f7c09ebc7f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir><dir name="et_EE"><file name="Eabi_Livehandler.csv" hash="a30b4f480458b711e6a398e6fc153359"/></dir><dir name="fi_FI"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir><dir name="lt_LT"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir><dir name="sv_SE"><file name="Eabi_Livehandler.csv" hash="6e070637c1109df358ca7913a5a67458"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="eabi_admintools.css" hash="fa4d08faa9c1300e9a543ff408557c38"/></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="eabi_js"><file name="crossBrowser_initKeyboardEvent.js" hash="8600c5536225fd70c56ef313ee430e08"/></dir><dir name="livepipe"><file name="contextmenu.js" hash="a5dbab9663d94d9d848e84b524c1f925"/><file name="cookie.js" hash="eab2042ac637aec7777c7c64e3e2bb1a"/><file name="event_behavior.js" hash="a59a00ad652efb1596b5bd2e6f5cfe48"/><file name="hotkey.js" hash="c6193fc03e4cd4c94ee4fb37e3d5ed6b"/><file name="livepipe.js" hash="6e569402b2686976e7390f0b7a25b1eb"/><file name="progressbar.js" hash="69719eccbecbc0378d9919c53a3ef7dd"/><file name="rating.js" hash="adb5ce773c37b40fb590a877d949be7a"/><file name="resizable.js" hash="38fd18daa37e5612495cc7b42fd32b3d"/><file name="scrollbar.js" hash="7a2603c2107944b8a70e41e7a84133ba"/><file name="selection.js" hash="3f48981cccffdb5fcc5f5ff27d0b0b68"/><file name="selectmultiple.js" hash="d8f044eb344061bdcce405f671b15654"/><file name="tabs.js" hash="22abb9a3ec3933d54ff9ede0338ca7f3"/><file name="textarea.js" hash="9825782bf78d38efa53200a206d8cd77"/><file name="window.js" hash="f6eba488d6a80e05f59d97a0cef59730"/></dir></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>