-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathxoops_version.php
More file actions
1730 lines (1582 loc) · 52.1 KB
/
Copy pathxoops_version.php
File metadata and controls
1730 lines (1582 loc) · 52.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* oledrion
*
* @copyright {@link https://xoops.org/ XOOPS Project}
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @author Hervé Thouzard (http://www.herve-thouzard.com/)
*/
use XoopsModules\Oledrion;
require_once __DIR__ . '/preloads/autoloader.php';
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
$moduleDirName = basename(__DIR__);
$modversion['version'] = 2.35;
$modversion['module_status'] = 'RC-1';
$modversion['release_date'] = '2019/05/018';
$modversion['name'] = _MI_OLEDRION_NAME;
$modversion['description'] = _MI_OLEDRION_DESC;
$modversion['author'] = 'Hervé Thouzard (http://www.herve-thouzard.com/)';
$modversion['credits'] = 'Don Curioso, Voltan, Bezoops, Mariane Antoun, Defkon1, Feichtl, Carlos Pérez, JardaR, Wishcraft, Mamba, and all the other';
$modversion['help'] = 'page=help';
$modversion['license'] = 'GNU GPL 2.0';
$modversion['license_url'] = 'www.gnu.org/licenses/gpl-2.0.html/';
$modversion['official'] = 0; //1 indicates supported by XOOPS Dev Team, 0 means 3rd party supported
$modversion['image'] = 'assets/images/logoModule.png';
$modversion['dirname'] = basename(__DIR__);
$modversion['onInstall'] = 'include/oninstall.php';
$modversion['onUpdate'] = 'include/onupdate.php';
$modversion['onUninstall'] = 'include/onuninstall.php';
$modversion['modicons16'] = 'assets/images/icons/16';
$modversion['modicons32'] = 'assets/images/icons/32';
$modversion['module_website_url'] = 'www.xoops.org';
$modversion['module_website_name'] = 'XOOPS';
$modversion['min_php'] = '5.5';
$modversion['min_xoops'] = '2.5.10';
$modversion['min_admin'] = '1.2';
$modversion['min_db'] = ['mysql' => '5.5'];
// ------------------- Mysql ------------------- //
$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
// Tables created by sql file (without prefix!)
$modversion['tables'] = [
$moduleDirName . '_' . 'manufacturer',
$moduleDirName . '_' . 'products',
$moduleDirName . '_' . 'productsmanu',
$moduleDirName . '_' . 'caddy',
$moduleDirName . '_' . 'cat',
$moduleDirName . '_' . 'commands',
$moduleDirName . '_' . 'related',
$moduleDirName . '_' . 'vat',
$moduleDirName . '_' . 'votedata',
$moduleDirName . '_' . 'discounts',
$moduleDirName . '_' . 'vendors',
$moduleDirName . '_' . 'files',
$moduleDirName . '_' . 'persistent_cart',
$moduleDirName . '_' . 'gateways_options',
$moduleDirName . '_' . 'lists',
$moduleDirName . '_' . 'products_list',
$moduleDirName . '_' . 'attributes',
$moduleDirName . '_' . 'caddy_attributes',
$moduleDirName . '_' . 'packing',
$moduleDirName . '_' . 'location',
$moduleDirName . '_' . 'delivery',
$moduleDirName . '_' . 'payment',
$moduleDirName . '_' . 'location_delivery',
$moduleDirName . '_' . 'delivery_payment',
$moduleDirName . '_' . 'payment_log',
];
$modversion['hasAdmin'] = 1;
$modversion['system_menu'] = 1;
$modversion['adminindex'] = 'admin/index.php';
$modversion['adminmenu'] = 'admin/menu.php';
// ------------------- Help files ------------------- //
$modversion['helpsection'] = [
['name' => _MI_OLEDRION_OVERVIEW, 'link' => 'page=help'],
['name' => _MI_OLEDRION_DISCLAIMER, 'link' => 'page=disclaimer'],
['name' => _MI_OLEDRION_LICENSE, 'link' => 'page=license'],
['name' => _MI_OLEDRION_SUPPORT, 'link' => 'page=support'],
];
// Blocks
/**
* Recent products block
*/
$modversion['blocks'][] = [
'file' => 'oledrion_new.php',
'name' => _MI_OLEDRION_BNAME1,
'description' => _MI_OLEDRION_BNAME1_DESC,
'show_func' => 'b_oledrion_new_show',
'edit_func' => 'b_oledrion_new_edit',
'options' => '10|0|0', // Voir 10 produits, pour toutes les catégories, uniquement les produits du mois ?
'template' => 'oledrion_block_new.tpl',
];
/**
* Most viewed products block
*/
$modversion['blocks'][] = [
'file' => 'oledrion_top.php',
'name' => _MI_OLEDRION_BNAME2,
'description' => _MI_OLEDRION_BNAME2_DESC,
'show_func' => 'b_oledrion_top_show',
'edit_func' => 'b_oledrion_top_edit',
'options' => '10|0',
'template' => 'oledrion_block_top.tpl',
];
/**
* Categories block
*/
$modversion['blocks'][] = [
'file' => 'oledrion_categories.php',
'name' => _MI_OLEDRION_BNAME3,
'description' => _MI_OLEDRION_BNAME3_DESC,
'show_func' => 'b_oledrion_category_show',
'edit_func' => 'b_oledrion_category_edit',
'options' => '0', // 0 = en relation avec la page, 1=classique, 2=Déplié
'template' => 'oledrion_block_categories.tpl',
];
/**
* Best sellers block
*/
$modversion['blocks'][] = [
'file' => 'oledrion_best_sales.php',
'name' => _MI_OLEDRION_BNAME4,
'description' => _MI_OLEDRION_BNAME4_DESC,
'show_func' => 'b_oledrion_bestsales_show',
'edit_func' => 'b_oledrion_bestsales_edit',
'options' => '10|0', // Voir 10 produits, pour toutes les catégories
'template' => 'oledrion_block_bestsales.tpl',
];
/**
* Top rated products
*/
$modversion['blocks'][] = [
'file' => 'oledrion_rated.php',
'name' => _MI_OLEDRION_BNAME5,
'description' => _MI_OLEDRION_BNAME5_DESC,
'show_func' => 'b_oledrion_rated_show',
'edit_func' => 'b_oledrion_rated_edit',
'options' => '10|0',
'template' => 'oledrion_block_rated.tpl',
];
/**
* Random product(s) block
*/
$modversion['blocks'][] = [
'file' => 'oledrion_random.php',
'name' => _MI_OLEDRION_BNAME6,
'description' => _MI_OLEDRION_BNAME6_DESC,
'show_func' => 'b_oledrion_random_show',
'edit_func' => 'b_oledrion_random_edit',
'options' => '1|0|0', // Nombre de produits, catégorie, produits du mois uniquement ?
'template' => 'oledrion_block_random.tpl',
];
/**
* Products with a discount block
*/
$modversion['blocks'][] = [
'file' => 'oledrion_promotion.php',
'name' => _MI_OLEDRION_BNAME7,
'description' => _MI_OLEDRION_BNAME7_DESC,
'show_func' => 'b_oledrion_promotion_show',
'edit_func' => 'b_oledrion_promotion_edit',
'options' => '10|0',
'template' => 'oledrion_block_promotion.tpl',
];
/**
* Cart block
*/
$modversion['blocks'][] = [
'file' => 'oledrion_cart.php',
'name' => _MI_OLEDRION_BNAME8,
'description' => _MI_OLEDRION_BNAME8_DESC,
'show_func' => 'b_oledrion_cart_show',
'edit_func' => 'b_oledrion_cart_edit',
'options' => '4', // Maximum count of items to show
'template' => 'oledrion_block_cart.tpl',
];
/**
* Recommended products
*/
$modversion['blocks'][] = [
'file' => 'oledrion_recommended.php',
'name' => _MI_OLEDRION_BNAME9,
'description' => _MI_OLEDRION_BNAME9_DESC,
'show_func' => 'b_oledrion_recomm_show',
'edit_func' => 'b_oledrion_recomm_edit',
'options' => '10|0',
'template' => 'oledrion_block_recommended.tpl',
];
/**
* Recently Sold
*/
$modversion['blocks'][] = [
'file' => 'oledrion_recentlysold.php',
'name' => _MI_OLEDRION_BNAME10,
'description' => _MI_OLEDRION_BNAME10_DESC,
'show_func' => 'b_oledrion_recentlysold_show',
'edit_func' => 'b_oledrion_recentlysold_edit',
'options' => '10', // Nombre maximum de produits à voir
'template' => 'oledrion_block_recentlysold.tpl',
];
/**
* Last lists
*/
$modversion['blocks'][] = [
'file' => 'oledrion_recent_lists.php',
'name' => _MI_OLEDRION_BNAME11,
'description' => _MI_OLEDRION_BNAME11_DESC,
'show_func' => 'b_oledrion_recent_lists_show',
'edit_func' => 'b_oledrion_recent_lists_edit',
'options' => '10|0', // Nombre maximum de listes à voir, Type de listes (0 = les 2, 1 = liste cadeaux, 2 = produits recommandés)
'template' => 'oledrion_block_recent_lists.tpl',
];
/**
* My lists
*/
$modversion['blocks'][] = [
'file' => 'oledrion_my_lists.php',
'name' => _MI_OLEDRION_BNAME12,
'description' => _MI_OLEDRION_BNAME12_DESC,
'show_func' => 'b_oledrion_my_lists_show',
'edit_func' => 'b_oledrion_my_lists_edit',
'options' => '10', // Nombre maximum de listes à afficher
'template' => 'oledrion_block_my_lists.tpl',
];
/**
* Lists of the current category ("according to the current category")
*/
$modversion['blocks'][] = [
'file' => 'oledrion_categoy_lists.php',
'name' => _MI_OLEDRION_BNAME13,
'description' => _MI_OLEDRION_BNAME13_DESC,
'show_func' => 'b_oledrion_category_lists_show',
'edit_func' => 'b_oledrion_category_lists_edit',
'options' => '10|0', // Nombre maximum de listes à voir, Type de listes (0 = les 2, 1 = liste cadeaux, 2 = produits recommandés)
'template' => 'oledrion_block_category_lists.tpl',
];
/**
* Random lists
*/
$modversion['blocks'][] = [
'file' => 'oledrion_random_lists.php',
'name' => _MI_OLEDRION_BNAME14,
'description' => _MI_OLEDRION_BNAME14_DESC,
'show_func' => 'b_oledrion_random_lists_show',
'edit_func' => 'b_oledrion_random_lists_edit',
'options' => '10|0', // Nombre maximum de listes à voir, Type de listes (0 = les 2, 1 = liste cadeaux, 2 = produits recommandés)
'template' => 'oledrion_block_random_lists.tpl',
];
/**
* Most viewed lists
*/
$modversion['blocks'][] = [
'file' => 'oledrion_mostviewed_lists.php',
'name' => _MI_OLEDRION_BNAME15,
'description' => _MI_OLEDRION_BNAME15_DESC,
'show_func' => 'b_oledrion_mostviewed_lists_show',
'edit_func' => 'b_oledrion__mostviewed_lists_edit',
'options' => '10|0', // Nombre maximum de listes à voir, Type de listes (0 = les 2, 1 = liste cadeaux, 2 = produits recommandés)
'template' => 'oledrion_block_mostviewed_lists.tpl',
];
/**
* Ajax search
*/
$modversion['blocks'][] = [
'file' => 'oledrion_ajax_search.php',
'name' => _MI_OLEDRION_BNAME16,
'description' => _MI_OLEDRION_BNAME16_DESC,
'show_func' => 'b_oledrion_ajax_search_show',
'edit_func' => 'b_oledrion__ajax_search_edit',
'options' => '1',
'template' => 'oledrion_block_ajax_search.tpl',
];
/*
* $options:
* $options[0] - number of tags to display
* $options[1] - time duration, in days, 0 for all the time
* $options[2] - max font size (px or %)
* $options[3] - min font size (px or %)
*/
$modversion['blocks'][] = [
'file' => 'oledrion_block_tag.php',
'name' => _MI_OLEDRION_TAG_CLOUD,
'description' => 'Show tag cloud',
'show_func' => 'oledrion_tag_block_cloud_show',
'edit_func' => 'oledrion_tag_block_cloud_edit',
'options' => '100|0|150|80',
'template' => 'oledrion_tag_block_cloud.tpl',
];
/*
* $options:
* $options[0] - number of tags to display
* $options[1] - time duration, in days, 0 for all the time
* $options[2] - sort: a - alphabet; c - count; t - time
*/
$modversion['blocks'][] = [
'file' => 'oledrion_block_tag.php',
'name' => _MI_OLEDRION_TOP_TAGS,
'description' => 'Show top tags',
'show_func' => 'oledrion_tag_block_top_show',
'edit_func' => 'oledrion_tag_block_top_edit',
'options' => '50|30|c',
'template' => 'oledrion_tag_block_top.tpl',
];
// Menu
$modversion['hasMain'] = 1;
$cptm = 0;
/** @var Oledrion\Utility $utility */
if (\XoopsModules\Oledrion\Utility::getModuleOption('use_price')) {
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME1;
$modversion['sub'][$cptm]['url'] = 'caddy.php';
}
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME3;
$modversion['sub'][$cptm]['url'] = 'category.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME4;
$modversion['sub'][$cptm]['url'] = 'categories-map.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME5;
$modversion['sub'][$cptm]['url'] = 'whoswho.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME6;
$modversion['sub'][$cptm]['url'] = 'all-products.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME9;
$modversion['sub'][$cptm]['url'] = 'recommended.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME7;
$modversion['sub'][$cptm]['url'] = 'search.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME8;
$modversion['sub'][$cptm]['url'] = 'cgv.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME10;
$modversion['sub'][$cptm]['url'] = 'my-lists.php';
++$cptm;
$modversion['sub'][$cptm]['name'] = _MI_OLEDRION_SMNAME11;
$modversion['sub'][$cptm]['url'] = 'all-lists.php';
// Adding parent categories in submenu ********************************************************
global $xoopsModule;
if (is_object($xoopsModule) && $xoopsModule->getVar('isactive') && $xoopsModule->getVar('dirname') == $modversion['dirname']) {
if (!isset($categoryHandler)) {
//mb $categoryHandler = xoops_getModuleHandler('oledrion_cat', 'oledrion');
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$categoryHandler = new Oledrion\CategoryHandler($db);
}
$categories = $categoryHandler->getMotherCategories();
foreach ($categories as $category) {
++$cptm;
$modversion['sub'][$cptm]['name'] = $category->getVar('cat_title');
$modversion['sub'][$cptm]['url'] = basename($category->getLink());
}
}
// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = 'include/search.inc.php';
$modversion['search']['func'] = 'oledrion_search';
// Comments
$modversion['hasComments'] = 1;
$modversion['comments']['itemName'] = 'product_id';
$modversion['comments']['pageName'] = 'product.php';
// Comment callback functions
$modversion['comments']['callbackFile'] = 'include/comment_functions.php';
$modversion['comments']['callback']['approve'] = 'oledrion_com_approve';
$modversion['comments']['callback']['update'] = 'oledrion_com_update';
// Templates
$cptt = 0;
$modversion['templates'] = [
['file' => 'oledrion_product_price.tpl', 'description' => "Used in Ajax to display product's price"],
['file' => 'oledrion_chunk.tpl', 'description' => ''],
['file' => 'oledrion_categories_list.tpl', 'description' => ''],
['file' => 'oledrion_index.tpl', 'description' => ''],
['file' => 'oledrion_category.tpl', 'description' => ''],
['file' => 'oledrion_product.tpl', 'description' => ''],
['file' => 'oledrion_bill.tpl', 'description' => ''],
['file' => 'oledrion_caddy.tpl', 'description' => ''],
['file' => 'oledrion_command.tpl', 'description' => ''],
['file' => 'oledrion_thankyou.tpl', 'description' => ''],
['file' => 'oledrion_cgv.tpl', 'description' => 'General Conditions Of Sale'],
['file' => 'oledrion_search.tpl', 'description' => ''],
['file' => 'oledrion_rss.tpl', 'description' => ''],
['file' => 'oledrion_map.tpl', 'description' => ''],
['file' => 'oledrion_whoswho.tpl', 'description' => ''],
['file' => 'oledrion_allproducts.tpl', 'description' => ''],
['file' => 'oledrion_manufacturer.tpl', 'description' => ''],
['file' => 'oledrion_rate_product.tpl', 'description' => ''],
['file' => 'oledrion_pdf_catalog.tpl', 'description' => ''],
['file' => 'oledrion_purchaseorder.tpl', 'description' => ''],
['file' => 'oledrion_cancelpurchase.tpl', 'description' => ''],
['file' => 'oledrion_recommended.tpl', 'description' => 'Latest recommended products'],
['file' => 'oledrion_admin_discounts.tpl', 'description' => ''],
['file' => 'oledrion_attribute_radio.tpl', 'description' => 'Template for attributes of type radio'],
['file' => 'oledrion_attribute_checkbox.tpl', 'description' => 'Template for attributes of type checkbox'],
['file' => 'oledrion_attribute_select.tpl', 'description' => 'Template for attributes of type select (listbox)'],
['file' => 'oledrion_all_lists.tpl', 'description' => 'List of all lists'],
['file' => 'oledrion_list.tpl', 'description' => 'Show a list content'],
['file' => 'oledrion_mylists.tpl', 'description' => 'Enable user to manage his/her lists'],
['file' => 'oledrion_productsselector.tpl', 'description' => 'Used to select products'],
['file' => 'oledrion_product_box.tpl', 'description' => 'Product box'],
['file' => 'oledrion_product_print.tpl', 'description' => 'Product print'],
['file' => 'oledrion_bill_print.tpl', 'description' => 'Bill print'],
['file' => 'oledrion_user.tpl', 'description' => 'User page'],
];
// ********************************************************************************************************************
// ****************************************** SETTINGS ****************************************************************
// ********************************************************************************************************************
// Load class
xoops_load('xoopslists');
/**
* Do you want to use URL rewriting ?
*/
$modversion['config'][] = [
'name' => 'urlrewriting',
'title' => '_MI_OLEDRION_URL_REWR',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* Editor to use
*/
//$modversion['config'][] = [
// 'name' => 'bl_form_options',
// 'title' => '_MI_OLEDRION_FORM_OPTIONS',
// 'description' => '_MI_OLEDRION_FORM_OPTIONS_DESC',
// 'formtype' => 'select',
// 'valuetype' => 'text',
// 'options' => \XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor'),
// 'default' => 'dhtmltextarea',
//];
$modversion['config'][] = [
'name' => 'editorAdmin',
'title' => '_MI_OLEDRION_FORM_OPTIONS_ADMIN',
'description' => '_MI_OLEDRION_FORM_OPTIONS_ADMIN_DESC',
'formtype' => 'select',
'valuetype' => 'text',
'options' => \XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor'),
'default' => 'tinymce',
];
$modversion['config'][] = [
'name' => 'editorUser',
'title' => '_MI_OLEDRION_FORM_OPTIONS_USER',
'description' => '_MI_OLEDRION_FORM_OPTIONS_USER_DESC',
'formtype' => 'select',
'valuetype' => 'text',
'options' => \XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor'),
'default' => 'dhtmltextarea',
];
/**
* Tooltips, or infotips are some small textes you can see when you
* move your mouse over an article's title. This text contains the
* first (x) characters of the story
*/
$modversion['config'][] = [
'name' => 'infotips',
'title' => '_MI_OLEDRION_INFOTIPS',
'description' => '_MI_OLEDRION_INFOTIPS_DES',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => '0',
];
/**
* MAX Filesize Upload in kilo bytes
*/
$modversion['config'][] = [
'name' => 'maxuploadsize',
'title' => '_MI_OLEDRION_UPLOADFILESIZE',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 10485760,
];
/**
* Do you want to enable your visitors to rate products ?
*/
$modversion['config'][] = [
'name' => 'rateproducts',
'title' => '_MI_OLEDRION_RATE',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* Global module's Advertisement
*/
$modversion['config'][] = [
'name' => 'advertisement',
'title' => '_MI_OLEDRION_ADVERTISEMENT',
'description' => '_MI_OLEDRION_ADV_DESCR',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => '',
];
/**
* Mime Types
* Default values : Web pictures (png, gif, jpeg), zip, pdf, gtar, tar, pdf
*/
$modversion['config'][] = [
'name' => 'mimetypes',
'title' => '_MI_OLEDRION_MIMETYPES',
'description' => '',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => "image/gif\nimage/jpeg\nimage/pjpeg\nimage/x-png\nimage/png\napplication/x-zip-compressed\napplication/zip\napplication/pdf\napplication/x-gtar\napplication/x-tar",
];
/**
* Group of users to which send an email when a product's stock is low (if nothing is typed then there's no alert)
*/
$modversion['config'][] = [
'name' => 'stock_alert_email',
'title' => '_MI_OLEDRION_STOCK_EMAIL',
'description' => '_MI_OLEDRION_STOCK_EMAIL_DSC',
'formtype' => 'group',
'valuetype' => 'int',
'default' => 0,
];
/**
* Group of users to wich send an email when a product is sold
*/
$modversion['config'][] = [
'name' => 'grp_sold',
'title' => '_MI_OLEDRION_GRP_SOLD',
'description' => '',
'formtype' => 'group',
'valuetype' => 'int',
'default' => 0,
];
/**
* Group of users authorized to modify products quantities from the product page
*/
$modversion['config'][] = [
'name' => 'grp_qty',
'title' => '_MI_OLEDRION_GRP_QTY',
'description' => '',
'formtype' => 'group',
'valuetype' => 'int',
'default' => 0,
];
/**
* Use RSS Feeds ?
*/
$modversion['config'][] = [
'name' => 'use_rss',
'title' => '_MI_OLEDRION_OPT7',
'description' => '_MI_OLEDRION_OPT7_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/**
* Enable PDF Catalog ?
*/
$modversion['config'][] = [
'name' => 'pdf_catalog',
'title' => '_MI_OLEDRION_PDF_CATALOG',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/**
* Use the price field ?
*/
$modversion['config'][] = [
'name' => 'use_price',
'title' => '_MI_OLEDRION_USE_PRICE',
'description' => '_MI_OLEDRION_USE_PRICE_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/**
* Multiply Shipping by product's quantity ?
*/
$modversion['config'][] = [
'name' => 'shipping_quantity',
'title' => '_MI_OLEDRION_SHIPPING_QUANTITY',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/**
* Use tags ?
*/
$modversion['config'][] = [
'name' => 'use_tags',
'title' => '_MI_OLEDRION_USE_TAGS',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* Use stocks in products attributes ?
*
* @since 2.3.2009.03.11
*/
$modversion['config'][] = [
'name' => 'attributes_stocks',
'title' => '_MI_OLEDRION_USE_STOCK_ATTRIBUTES',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
// Get Admin groups
$criteria = new \CriteriaCompo();
$criteria->add(new \Criteria('group_type', 'Admin'));
/** @var \XoopsMemberHandler $memberHandler */
$memberHandler = xoops_getHandler('member');
$admin_xoopsgroups = $memberHandler->getGroupList($criteria);
foreach ($admin_xoopsgroups as $key => $admin_group) {
$admin_groups[$admin_group] = $key;
}
$modversion['config'][] = [
'name' => 'admin_groups',
'title' => '_MI_OLEDRION_ADMINGROUPS',
'description' => '_MI_OLEDRION_ADMINGROUPS_DSC',
'formtype' => 'select_multi',
'valuetype' => 'array',
'options' => $admin_groups,
'default' => $admin_groups,
];
$modversion['config'][] = [
'name' => 'admin_groups_part',
'title' => '_MI_OLEDRION_ADMINGROUPS_PARTS',
'description' => '',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => 'attributes|delivery|gateways|location|manufacturers|packing|property|vendors|categories|discounts|lowstock|newsletter|payment|texts|dashboard|files|lists|maintain|products|vat',
];
$modversion['config'][] = [
'name' => 'breakmeta',
'title' => '_MI_OLEDRION_BREAK_META',
'description' => '',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'odd',
'category' => 'group_header',
];
/**
* Enter meta data manually ?
*/
$modversion['config'][] = [
'name' => 'manual_meta',
'title' => '_MI_OLEDRION_MANUAL_META',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* METAGEN, Max count of keywords to create
*/
$modversion['config'][] = [
'name' => 'metagen_maxwords',
'title' => '_MI_OLEDRION_OPT23',
'description' => '_MI_OLEDRION_OPT23_DSC',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 40,
];
/**
* METAGEN - Keywords order
*/
$modversion['config'][] = [
'name' => 'metagen_order',
'title' => '_MI_OLEDRION_OPT24',
'description' => '',
'formtype' => 'select',
'valuetype' => 'int',
'default' => 5,
'options' => [
'_MI_OLEDRION_OPT241' => 0,
'_MI_OLEDRION_OPT242' => 1,
'_MI_OLEDRION_OPT243' => 2,
],
];
/**
* METAGEN - Black list
*/
$modversion['config'][] = [
'name' => 'metagen_blacklist',
'title' => '_MI_OLEDRION_OPT25',
'description' => '_MI_OLEDRION_OPT25_DSC',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => '',
];
$modversion['config'][] = [
'name' => 'break_money',
'title' => '_MI_OLEDRION_BREAK_MONEY',
'description' => '',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'odd',
'category' => 'group_header',
];
/**
* Money, full label
*/
$modversion['config'][] = [
'name' => 'money_full',
'title' => '_MI_OLEDRION_MONEY_F',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => _MI_OLEDRION_SETTING_1,
];
/**
* Money, short label
*/
$modversion['config'][] = [
'name' => 'money_short',
'title' => '_MI_OLEDRION_MONEY_S',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => _MI_OLEDRION_SETTING_2,
];
/**
* Decimals count
*/
$modversion['config'][] = [
'name' => 'decimals_count',
'title' => '_MI_OLEDRION_DECIMAL',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => _MI_OLEDRION_SETTING_3,
];
/**
* Monnaie's place (left or right) ?
*/
$modversion['config'][] = [
'name' => 'monnaie_place',
'title' => '_MI_OLEDRION_CONF00',
'description' => '_MI_OLEDRION_CONF00_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => _MI_OLEDRION_SETTING_4,
];
/**
* Thousands separator
*/
$modversion['config'][] = [
'name' => 'thousands_sep',
'title' => '_MI_OLEDRION_CONF04',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => _MI_OLEDRION_SETTING_5,
];
/**
* Decimal separator
*/
$modversion['config'][] = [
'name' => 'decimal_sep',
'title' => '_MI_OLEDRION_CONF05',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => _MI_OLEDRION_SETTING_6,
];
$modversion['config'][] = [
'name' => 'break_view',
'title' => '_MI_OLEDRION_BREAK_VIEW',
'description' => '',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'odd',
'category' => 'group_header',
];
$modversion['config'][] = [
'name' => 'newproducts',
'title' => '_MI_OLEDRION_NEWLINKS',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 10,
];
$modversion['config'][] = [
'name' => 'perpage',
'title' => '_MI_OLEDRION_PERPAGE',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 10,
];
$modversion['config'][] = [
'name' => 'related_limit',
'title' => '_MI_OLEDRION_RELATEDLIMIT',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 10,
];
$modversion['config'][] = [
'name' => 'index_colums',
'title' => '_MI_OLEDRION_COLUMNS_INDEX',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 1,
];
$modversion['config'][] = [
'name' => 'category_colums',
'title' => '_MI_OLEDRION_COLUMNS_CATEGORY',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 1,
];
$modversion['config'][] = [
'name' => 'max_products',
'title' => '_MI_OLEDRION_ADAPTED_LIST',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 200,
];
/**
* Display a summary table of the last published products (in all categories) ?
*/
$modversion['config'][] = [
'name' => 'summarylast',
'title' => '_MI_OLEDRION_SUMMARY1_SHOW',
'description' => '_MI_OLEDRION_SUMMARY1_SHOW_DESC',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 10,
];
/**
* Display a summary table of the last published products in the same category ?
*/
$modversion['config'][] = [
'name' => 'summarycategory',
'title' => '_MI_OLEDRION_SUMMARY2_SHOW',
'description' => '_MI_OLEDRION_SUMMARY2_SHOW_DESC',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 10,
];
/**
* Better Together ?
*/
$modversion['config'][] = [
'name' => 'better_together',
'title' => '_MI_OLEDRION_BEST_TOGETHER',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* Display unpublished products ?
*/
$modversion['config'][] = [
'name' => 'show_unpublished',
'title' => '_MI_OLEDRION_UNPUBLISHED',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* If you set this option to yes then you will see two links at the bottom
* of each item. The first link will enable you to go to the previous
* item and the other link will bring you to the next item
*/
$modversion['config'][] = [
'name' => 'showprevnextlink',
'title' => '_MI_OLEDRION_PREVNEX_LINK',
'description' => '_MI_OLEDRION_PREVNEX_LINK_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* Display products when there are no more products ?
*/
$modversion['config'][] = [
'name' => 'nostock_display',
'title' => '_MI_OLEDRION_NO_MORE',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/**
* Message to display when there's not more quantity for a product ?
*/
$modversion['config'][] = [
'name' => 'nostock_msg',
'title' => '_MI_OLEDRION_MSG_NOMORE',
'description' => '',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => '',
];
/**
* Count of visible items in the module's administration
*/
$modversion['config'][] = [
'name' => 'items_count',
'title' => '_MI_OLEDRION_ITEMSCNT',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 30,
];
$modversion['config'][] = [
'name' => 'break_image',
'title' => '_MI_OLEDRION_BREAK_IMAGE',
'description' => '',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'odd',
'category' => 'group_header',