This repository has been archived by the owner on Dec 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
navmegadrownevo.php
2065 lines (1990 loc) · 102 KB
/
navmegadrownevo.php
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
/**
* Module MeGa DrOwN mEnU Evolution - Main file
*
* @category Module / front_office_features
* @author Community (since GitHub)
* @author PrestaEdit <[email protected]> (since 2.0)
* @author DevForEver (special thanks to him)
* @copyright 2013 PrestaEdit
* @version 2.0
* @link http://www.prestaedit.com/
* @since File available since Release 1.0
*/
// Security
if (!defined('_PS_VERSION_'))
exit;
// Checking compatibility with older PrestaShop and fixing it
if (!defined('_MYSQL_ENGINE_'))
define('_MYSQL_ENGINE_', 'MyISAM');
class navmegadrownEvo extends Module
{
private $_style = '';
private $_menu = '';
private $_html = '';
private $eol = "\r\n";
protected $link;
public function __construct()
{
$this->name = 'navmegadrownevo';
$this->tab = 'front_office_features';
$this->version = '2.3.9.4';
$this->author = 'PrestaEdit';
$this->ps_versions_compliancy['min'] = '1.5.0.1';
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->l('MeGa DrOwN mEnU Evolution');
$this->description = $this->l('Add a MeGa DrOwN mEnU Evolution.');
$this->confirmUninstall = $this->l('Are you sure you want to delete this module ?');
$this->allow = intval(Configuration::get('PS_REWRITING_SETTINGS'));
if(!$this->isRegisteredInHook('displayBackOfficeHeader'))
$this->registerHook('displayBackOfficeHeader');
$this->link = new Link();
}
public function install()
{
// Install SQL
include(dirname(__FILE__).'/sql/install.php');
foreach ($sql as $s)
if (!Db::getInstance()->execute($s))
return false;
// Install Module
return parent::install()
&& $this->registerHook('displayTop')
&& $this->registerHook('displayHeader')
&& $this->registerHook('displayBackOfficeHeader');
}
public function uninstall()
{
// Uninstall SQL
include(dirname(__FILE__).'/sql/uninstall.php');
foreach ($sql as $s)
if (!Db::getInstance()->execute($s))
return false;
Configuration::deleteByName('MOD_MEGADROWN_ITEMS');
// Uninstall Module
if (!parent::uninstall())
return false;
return true;
}
public function getContent()
{
global $ButtonIdInEdit;
$defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT'));
$languages = Language::getLanguages();
$iso = Language::getIsoById($defaultLanguage);
$output = "";
$errors = array();
$errorsNb = 0;
$update_cache = false;
if(Tools::isSubmit('SubmitButton'))
{
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
'order_button'=>99
),
'INSERT'
);
$IdButton = Db::getInstance()->Insert_ID();
if(!$result) $errorsNb++;
$languages = Language::getLanguages();
foreach ($languages as $language) {
if(Tools::getValue('ButtonName_'.$language['id_lang']) != '') {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_lang',
array(
'id_button'=>$IdButton,
'id_lang'=>$language['id_lang'],
'name_button'=>addslashes(Tools::getValue('ButtonName_'.$language['id_lang']))
),
'INSERT'
);
if(!$result) $errorsNb++;
}
}
if($errorsNb!=0)
$output .= $this->displayError($this->l('Unable to add this button'));
else
$output .= $this->displayConfirmation($this->l('Button added'));
}
else if(Tools::isSubmit('SubmitButtonParameters'))
{
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
"buttonColor"=>(Tools::getValue('noColorButton')=="on" ? "" : Tools::getValue('buttonColor'))
),
"UPDATE", "id_button=".Tools::getValue('ButttonIdToUpdate'));
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_link_cat', "id_button = ".Tools::getValue('ButttonIdToUpdate'));
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_organization', "id_button = ".Tools::getValue('ButttonIdToUpdate'));
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_langcat', "id_button = ".Tools::getValue('ButttonIdToUpdate'));
if(is_array(Tools::getValue('categoryBox'))) {
foreach(Tools::getValue('categoryBox') as $id_cat=>$cat) {
$numLigneCat = Tools::getValue('lineBox_'.$cat);
$numColumnCat = Tools::getValue('columnBox_'.$cat);
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_link_cat',
array(
'id_button'=>Tools::getValue('ButttonIdToUpdate'),
'id_link_cat'=>$cat,
'num_ligne'=>$numLigneCat,
'num_column'=>$numColumnCat,
'view_products'=>Tools::getValue('viewProducts_'.$cat)
),
'INSERT'
);
}
foreach($_POST as $kPost=>$vPost) {
if(substr($kPost, 0 , 7)=="lineBox") {
$tabDatas = explode('_', $kPost);
$idCat = $tabDatas[1];
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_organization',
array(
'id_button' => Tools::getValue('ButttonIdToUpdate'),
'id_link_cat' => $idCat,
'state' => Tools::getValue('State_'.$idCat),
'num_ligne' => $vPost
),
'INSERT'
);
foreach ($languages as $language) {
if(Tools::getValue('textSubstitute_'.$idCat."_".$language['id_lang']) != '') {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_langcat',
array(
'id_button' => Tools::getValue('ButttonIdToUpdate'),
'id_cat' => $idCat,
'id_lang' => $language['id_lang'],
'name_substitute' => addslashes(Tools::getValue('textSubstitute_'.$idCat."_".$language['id_lang']))
),
'INSERT'
);
}
}
}
}
if(!$result) $errorsNb++;
}
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_link', "id_button = ".Tools::getValue('ButttonIdToUpdate'));
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_link',
array(
'id_button'=>Tools::getValue('ButttonIdToUpdate'),
'link'=>Tools::getValue('LinkPage')
),
'INSERT'
);
if(!$result) $errorsNb++;
$languages = Language::getLanguages();
$detailSubProgress = $this->getButtonDetail(Tools::getValue('ButttonIdToUpdate'));
if(sizeof($detailSubProgress)) {
foreach($detailSubProgress as $kSub=>$ValSub) {
$infoSub[$ValSub['id_lang']]['detailSub'] = html_entity_decode($ValSub['detailSub']);
$infoSub[$ValSub['id_lang']]['detailSubLeft'] = html_entity_decode($ValSub['detailSubLeft']);
$infoSub[$ValSub['id_lang']]['detailSubTR'] = html_entity_decode($ValSub['detailSubTR']);
}
}
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_lang', "id_button = ".Tools::getValue('ButttonIdToUpdate'));
foreach ($languages as $language) {
//if(Tools::getValue('ButtonNameEdit_'.$language['id_lang']) != '') {
if(1) {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_lang',
array(
'id_button'=>Tools::getValue('ButttonIdToUpdate'),
'id_lang'=>$language['id_lang'],
'name_button'=>addslashes(Tools::getValue('ButtonNameEdit_'.$language['id_lang'])),
'detailSub'=>htmlentities(addslashes((isset($infoSub[$language['id_lang']]['detailSub']) ? $infoSub[$language['id_lang']]['detailSub'] : ''))),
'detailSubLeft'=>htmlentities(addslashes((isset($infoSub[$language['id_lang']]['detailSubLeft']) ? $infoSub[$language['id_lang']]['detailSubLeft'] : ''))),
'detailSubTR'=>htmlentities(addslashes((isset($infoSub[$language['id_lang']]['detailSubTR']) ? $infoSub[$language['id_lang']]['detailSubTR'] : '')))
),
'INSERT'
);
if(!$result) $errorsNb++;
}
}
if(!$result) $errorsNb++;
if($errorsNb!=0)
$output .= $this->displayError($this->l('Unable to update this button'));
else
$output .= $this->displayConfirmation($this->l('Button updated'));
$ButtonIdInEdit = Tools::getValue('ButttonIdToUpdate');
}
else if(Tools::isSubmit('SubmitButtonOrganization'))
{
if(trim(Tools::getValue('Organisation')) != '') {
$ButtonOrganisation = explode(',', Tools::getValue('Organisation'));
$position = 1;
foreach($ButtonOrganisation as $KPos=>$VPos) {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
"order_button"=>$position
),
"UPDATE",
"id_button =".str_replace("button_", "", $VPos)
);
$position++;
if(!$result) $errorsNb++;
}
}
if($errorsNb!=0)
$output .= $this->displayError($this->l('Unable to save the organization'));
else
$output .= $this->displayConfirmation($this->l('Organziation saved'));
}
else if(Tools::isSubmit('SubmitButtonDesign'))
{
$errorsNb = 0;
//Db::getInstance()->delete(_DB_PREFIX_.'admevo_parameters');
$tabDesign = array();
Tools::getValue('MenuWidth')=="" ? false : $tabDesign["MenuWidth"] = Tools::getValue('MenuWidth');
Tools::getValue('MenuHeight')=="" ? false : $tabDesign["MenuHeight"] = Tools::getValue('MenuHeight');
Tools::getValue('MinWidthButton')=="" ? false : $tabDesign["MinButtonWidth"] = Tools::getValue('MinWidthButton');
Tools::getValue('MaxWidthButton')=="" ? false : $tabDesign["MaxButtonWidth"] = Tools::getValue('MaxWidthButton');
Tools::getValue('ColumnSize')=="" ? false : $tabDesign["columnSize"] = Tools::getValue('ColumnSize');
Tools::getValue('paddingLeft')=="" ? false : $tabDesign["paddingLeft"] = Tools::getValue('paddingLeft');
Tools::getValue('marginTop')=="" ? false : $tabDesign["marginTop"] = Tools::getValue('marginTop');
Tools::getValue('marginBottom')=="" ? false : $tabDesign["marginBottom"] = Tools::getValue('marginBottom');
Tools::getValue('GeneralColor')=="" ? false : $tabDesign["GeneralColor"] = Tools::getValue('GeneralColor');
Tools::getValue('FontSizeMenu')=="" ? false : $tabDesign["FontSizeMenu"] = Tools::getValue('FontSizeMenu');
Tools::getValue('FontSizeSubmenu')=="" ? false : $tabDesign["FontSizeSubmenu"] = Tools::getValue('FontSizeSubmenu');
Tools::getValue('FontSizeSubsubmenu')=="" ? false : $tabDesign["FontSizeSubsubmenu"] = Tools::getValue('FontSizeSubsubmenu');
Tools::getValue('MenuColor')=="" ? false : $tabDesign["ColorFontMenu"] = Tools::getValue('MenuColor');
Tools::getValue('SubMenuColor')=="" ? false : $tabDesign["ColorFontSubMenu"] = Tools::getValue('SubMenuColor');
Tools::getValue('SubSubMenuColor')=="" ? false : $tabDesign["ColorFontSubSubMenu"] = Tools::getValue('SubSubMenuColor');
Tools::getValue('MenuColorHover')=="" ? false : $tabDesign["ColorFontMenuHover"] = Tools::getValue('MenuColorHover');
Tools::getValue('SubMenuColorHover')=="" ? false : $tabDesign["ColorFontSubMenuHover"] = Tools::getValue('SubMenuColorHover');
Tools::getValue('SubSubMenuColorHover')=="" ? false : $tabDesign["ColorFontSubSubMenuHover"] = Tools::getValue('SubSubMenuColorHover');
Tools::getValue('VerticalPadding')=="" ? false : $tabDesign["VerticalPadding"] = Tools::getValue('VerticalPadding');
Tools::getValue('noColorTR1')=="on" ? $tabDesign["backgroundTR1"] = "" : $tabDesign["backgroundTR1"] = Tools::getValue('backgroundTR1');
Tools::getValue('noColorTD1')=="on" ? $tabDesign["backgroundTD1"] = "" : $tabDesign["backgroundTD1"] = Tools::getValue('backgroundTD1');
Tools::getValue('noColorTD2')=="on" ? $tabDesign["backgroundTD2"] = "" : $tabDesign["backgroundTD2"] = Tools::getValue('backgroundTD2');
Tools::getValue('noColorTD3')=="on" ? $tabDesign["backgroundTD3"] = "" : $tabDesign["backgroundTD3"] = Tools::getValue('backgroundTD3');
Tools::getValue('heightTR1')=="" ? false : $tabDesign["heightTR1"] = Tools::getValue('heightTR1');
Tools::getValue('widthTD1')=="" ? false : $tabDesign["widthTD1"] = Tools::getValue('widthTD1');
Tools::getValue('widthTD3')=="" ? false : $tabDesign["widthTD3"] = Tools::getValue('widthTD3');
Tools::getValue('stateTR1')=="" ? $tabDesign["stateTR1"]="off" : $tabDesign["stateTR1"] = Tools::getValue('stateTR1');
Tools::getValue('stateTD1')=="" ? $tabDesign["stateTD1"]="off" : $tabDesign["stateTD1"] = Tools::getValue('stateTD1');
Tools::getValue('stateTD3')=="" ? $tabDesign["stateTD3"]="off" : $tabDesign["stateTD3"] = Tools::getValue('stateTD3');
Tools::getValue('SearchBar')=="" ? $tabDesign["SearchBar"]="off" : $tabDesign["SearchBar"] = Tools::getValue('SearchBar');
$result = Db::getInstance()->autoExecuteWithNullValues(
_DB_PREFIX_.'admevo_parameters',
$tabDesign,
"UPDATE"
);
$AutorizeExtensions = array(0=>".jpg", 1=>".gif", 2=>".png");
if(isset($_FILES['PictureMenu']) && $_FILES['PictureMenu']['tmp_name']!="") {
$extension = strtolower(substr($_FILES['PictureMenu']['name'], -4));
if(in_array($extension, $AutorizeExtensions)) {
$img = dirname(__FILE__).'/views/img/menu/bg_menu-'.$this->context->shop->id.$extension;
if ( !move_uploaded_file( $_FILES['PictureMenu']['tmp_name'], $img ) )
$errorsNb++;
else
Db::getInstance()->autoExecuteWithNullValues(
_DB_PREFIX_.'admevo_parameters',
array(
"extensionMenu"=> $extension
),
"UPDATE"
);
}
else
$output .= $this->displayError($this->l('File ').$_FILES['PictureMenu']['name'].$this->l(' not uploaded, wrong type (only jpg).'));
}
if(isset($_FILES['PictureButton']) && $_FILES['PictureButton']['tmp_name']!="") {
$extension = strtolower(substr($_FILES['PictureButton']['name'], -4));
if(in_array($extension, $AutorizeExtensions)) {
$img = dirname(__FILE__).'/views/img/menu/bg_bout-'.$this->context->shop->id.$extension;
if ( !move_uploaded_file( $_FILES['PictureButton']['tmp_name'], $img ) )
$errorsNb++;
else
Db::getInstance()->autoExecuteWithNullValues(
_DB_PREFIX_.'admevo_parameters',
array(
"extensionBout"=> $extension
),
"UPDATE"
);
}
else
$output .= $this->displayError($this->l('File ').$_FILES['PictureButton']['name'].$this->l(' not uploaded, wrong type (only jpg).'));
}
if(isset($_FILES['PictureListArrow']) && $_FILES['PictureListArrow']['tmp_name']!="") {
$extension = strtolower(substr($_FILES['PictureListArrow']['name'], -4));
if(in_array($extension, $AutorizeExtensions)) {
$img = dirname(__FILE__).'/views/img/menu/navlist_arrow-'.$this->context->shop->id.$extension;
if ( !move_uploaded_file( $_FILES['PictureListArrow']['tmp_name'], $img ) )
$errorsNb++;
else
Db::getInstance()->autoExecuteWithNullValues(
_DB_PREFIX_.'admevo_parameters',
array(
"extensionArro"=> $extension
),
"UPDATE"
);
}
else
$output .= $this->displayError($this->l('File ').$_FILES['PictureListArrow']['name'].$this->l(' not uploaded, wrong type (only jpg).'));
}
if(isset($_FILES['PicturebackSubMenu']) && $_FILES['PicturebackSubMenu']['tmp_name']!="") {
$extension = strtolower(substr($_FILES['PicturebackSubMenu']['name'], -4));
if(in_array($extension, $AutorizeExtensions)) {
$img = dirname(__FILE__).'/views/img/menu/sub_bg-'.$this->context->shop->id.$extension;
if ( !move_uploaded_file( $_FILES['PicturebackSubMenu']['tmp_name'], $img ) )
$errorsNb++;
else
Db::getInstance()->autoExecuteWithNullValues(
_DB_PREFIX_.'admevo_parameters',
array(
"extensionBack"=> $extension
),
"UPDATE"
);
}
else
$output .= $this->displayError($this->l('File ').$_FILES['PicturebackSubMenu']['name'].$this->l(' not uploaded, wrong type (only jpg).'));
}
if($errorsNb!=0)
$output .= $this->displayError($this->l('Error during the upload'));
else
$output .= $this->displayConfirmation($this->l('File uploaded and parameters saved'));
$this->_clearCache('views/front/cssnavmegadrownevo.tpl');
}
else if(isset($_POST['Action']) && $_POST['Action']!="")
{
switch($_POST['Action'])
{
case "EditButton":
$ButtonIdInEdit = $_POST['ButtonIdAction'];
break;
case "DeleteButton":
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button', "id_button = ".$_POST['ButtonIdAction']);
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_lang', "id_button = ".$_POST['ButtonIdAction']);
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_link', "id_button = ".$_POST['ButtonIdAction']);
Db::getInstance()->delete(_DB_PREFIX_.'admevo_button_link_cat', "id_button = ".$_POST['ButtonIdAction']);
Db::getInstance()->delete(_DB_PREFIX_.'admevo_custom_menu', "id_button = ".$_POST['ButtonIdAction']);
Db::getInstance()->delete(_DB_PREFIX_.'admevo_custom_menu_lang', "id_button = ".$_POST['ButtonIdAction']);
break;
}
}
else if(isset($_POST['ActionFile']) && $_POST['ActionFile']!="")
{
switch($_POST['ActionFile']) {
case "DeleteFile":
$FileToDelete = $_POST['FileToDelete'];
if(is_file(dirname(__FILE__).'/views/img/menu/'.$FileToDelete))
if(unlink(dirname(__FILE__).'/views/img/menu/'.$FileToDelete))
$output .= $this->displayConfirmation($this->l('File deleted'));
else
$output .= $this->displayError($this->l('File not deleted'));
break;
}
}
else if(isset($_POST['ActionPicture']) && $_POST['ActionPicture']!="")
{
switch($_POST['ActionPicture'])
{
case "UploadPicture":
$AutorizeExtensions = array(0=>".gif", 1=>".jpg", 2=>".png");
$extension = strtolower(substr($_FILES['PictureFile']['name'], -4));
$idButton = $_POST['idButton'];
if(in_array($extension, $AutorizeExtensions)) {
if ( isset($_FILES['PictureFile']['name']) ) {
$img = dirname(__FILE__).'/views/img/menu/imgBout'.$idButton.$extension;
if ( move_uploaded_file( $_FILES['PictureFile']['tmp_name'], $img ) ) {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
"img_name"=>'imgBout'.$idButton.$extension,
"img_link"=>urlencode($_POST['imgLink'])
),
"UPDATE", "id_button=".$idButton);
$output .= $this->displayConfirmation($this->l('Picture has been uploaded'));
}
else
$output .= $this->displayError($this->l('Error during the upload'));
}
}
if(isset($_POST['imgLink'])) {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
"img_link"=>urlencode($_POST['imgLink'])
),
"UPDATE", "id_button=".$idButton);
}
$ButtonIdInEdit = $idButton;
break;
case "DeletePicture":
$idButton = $_POST['idButton'];
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
"img_name"=>''
),
"UPDATE", "id_button=".$idButton);
if(is_file(dirname(__FILE__).'/views/img/menu/'.$_POST['NamePicture']))
if(unlink(dirname(__FILE__).'/views/img/menu/'.$_POST['NamePicture']))
$output .= $this->displayConfirmation($this->l('File deleted'));
else
$output .= $this->displayError($this->l('File not deleted'));
$ButtonIdInEdit = $idButton;
break;
}
foreach ($languages as $language)
{
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_lang',
array(
'detailSubLeft'=>htmlentities(addslashes(Tools::getValue('detailSubLeft_'.$language['id_lang'])))
),
'UPDATE',
'id_button='.$_POST['idButton'].' AND
id_lang='.$language['id_lang']
);
if(!$result) $errorsNb++;
}
$ButtonIdInEdit = $_POST['idButton'];
}
else if(isset($_POST['ActionPictureBackground']) && $_POST['ActionPictureBackground']!="")
{
switch($_POST['ActionPictureBackground']) {
case "UploadPictureBackground":
$AutorizeExtensions = array(0=>".gif", 1=>".jpg", 2=>".png");
$extension = strtolower(substr($_FILES['PictureFileBackground']['name'], -4));
$idButton = $_POST['idButton'];
if(in_array($extension, $AutorizeExtensions)) {
if ( isset($_FILES['PictureFileBackground']['name']) ) {
$img = dirname(__FILE__).'/views/img/menu/imgBackground'.$idButton.$extension;
if ( move_uploaded_file( $_FILES['PictureFileBackground']['tmp_name'], $img ) ) {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
"img_name_background"=>'imgBackground'.$idButton.$extension
),
"UPDATE", "id_button=".$idButton);
$output .= $this->displayConfirmation($this->l('Picture has been uploaded'));
}
else
$output .= $this->displayError($this->l('Error during the upload'));
}
}
$ButtonIdInEdit = $idButton;
break;
case "DeletePicture":
$idButton = $_POST['idButton'];
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button',
array(
"img_name_background"=>''
),
"UPDATE", "id_button=".$idButton);
if(is_file(dirname(__FILE__).'/views/img/menu/'.$_POST['NamePictureBackground']))
if(unlink(dirname(__FILE__).'/views/img/menu/'.$_POST['NamePictureBackground']))
$output .= $this->displayConfirmation($this->l('File deleted'));
else
$output .= $this->displayError($this->l('File not deleted'));
$ButtonIdInEdit = $idButton;
break;
}
$ButtonIdInEdit = $_POST['idButton'];
}
else if(Tools::isSubmit('SubmitDetailSub'))
{
foreach ($languages as $language) {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_lang',
array(
'detailSub'=>htmlentities(addslashes(Tools::getValue('detailSub_'.$language['id_lang'])))
),
'UPDATE',
'id_button='.Tools::getValue('idButton').' AND
id_lang='.$language['id_lang']
);
if(!$result) $errorsNb++;
}
$ButtonIdInEdit = $_POST['idButton'];
}
else if(Tools::isSubmit('SubmitDetailSubTr'))
{
foreach ($languages as $language) {
$result = Db::getInstance()->autoExecute(
_DB_PREFIX_.'admevo_button_lang',
array(
'detailSubTR'=>htmlentities(addslashes(Tools::getValue('detailSubTr_'.$language['id_lang'])))
),
'UPDATE',
'id_button='.Tools::getValue('idButton').' AND
id_lang='.$language['id_lang']
);
if(!$result) $errorsNb++;
}
$ButtonIdInEdit = Tools::getValue('idButton');
}
$this->_clearCache('views/front/navmegadrownevo.tpl');
return $output.$this->displayForm();
}
static public function getButtonDetail($IdButton) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_button tb LEFT JOIN '._DB_PREFIX_.'admevo_button_lang tbl
ON (tb.id_button=tbl.id_button)
WHERE tb.id_button='.$IdButton.' ORDER BY order_button ASC, name_button ASC
' );
}
static public function getButtonLinksCat($IdButton) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_button_link_cat
WHERE id_button='.$IdButton.' ORDER BY num_ligne ASC, num_column ASC, id_link_cat ASC
' );
}
static public function getButtonLinksCustom($IdButton, $idLang) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_custom_menu tb
INNER JOIN '._DB_PREFIX_.'admevo_custom_menu_lang tbl
ON (tb.id_button=tbl.id_button AND tb.id_custom=tbl.id_custom)
WHERE tb.id_button='.$IdButton.' AND tb.id_parent = 0 AND tbl.id_lang='.$idLang.'
ORDER BY tb.num_ligne ASC, tb.num_column ASC
' );
}
static public function getButtonLinks($IdButton) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_button_link WHERE id_button='.$IdButton.'
' );
}
static public function getButtonOrganization($IdButton) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_button_organization WHERE id_button='.$IdButton.'
' );
}
static public function getNameCategory($IdCat, $IdLang, $IdButton) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'category_lang tb INNER JOIN '._DB_PREFIX_.'admevo_button_organization tbl
ON (tb.id_category=tbl.id_link_cat) WHERE tb.id_category='.$IdCat.' AND tb.id_lang='.$IdLang.' and
tbl.id_button='.$IdButton.'
' );
}
static public function getNameSubstitute($IdCat, $IdLang, $IdButton) {
$return[0]['name_substitute'] = "";
$result = Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_button_langcat WHERE id_cat='.$IdCat.' AND id_lang='.$IdLang.' and
id_button='.$IdButton.'
' );
if($result)
return $result;
return $return;
}
static public function getAllNameSubstitute($IdButton) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_button_langcat WHERE
id_button='.$IdButton.'
' );
}
static public function getNameCategoryUnder($IdCat, $IdButton) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'category tb INNER JOIN '._DB_PREFIX_.'admevo_button_organization tbl
ON (tb.id_category=tbl.id_link_cat)
WHERE tb.id_parent='.$IdCat.' and tbl.state=1 and tb.active=1 and
tbl.id_button='.$IdButton.' ORDER BY tbl.num_ligne ASC
' );
}
static public function getProductsUnder($id_category, $id_lang, $id_shop = 1) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM ('._DB_PREFIX_.'category_product cp INNER JOIN '._DB_PREFIX_.'product_lang pl
ON (cp.id_product=pl.id_product)) INNER JOIN '._DB_PREFIX_.'product p on (cp.id_product=p.id_product)
WHERE cp.id_category='.(int)$id_category.'
AND p.active=1
AND pl.id_lang = '.(int)$id_lang.'
AND pl.id_shop = '.(int)$id_shop.'
ORDER BY pl.name ASC
' );
}
static public function getButtonLinksCustomUnder($IdButton, $IdParent, $idLang) {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_custom_menu tb
INNER JOIN '._DB_PREFIX_.'admevo_custom_menu_lang tbl
ON (tb.id_button=tbl.id_button AND tb.id_custom=tbl.id_custom)
WHERE tb.id_button='.$IdButton.' AND tb.id_parent = '.$IdParent.' AND tbl.id_lang = '.$idLang.'
ORDER BY tb.num_ligne ASC');
}
private function getParameters() {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_parameters LIMIT 1
' );
}
private function getConfigurations() {
return Db::getInstance()->ExecuteS('
SELECT *
FROM '._DB_PREFIX_.'admevo_button tb LEFT JOIN '._DB_PREFIX_.'admevo_button_lang tbl
ON (tb.id_button=tbl.id_button)
WHERE tbl.id_lang='.(int)$this->context->cookie->id_lang.' ORDER BY order_button ASC, name_button ASC');
}
static public function getMaxColumns($IdButton) {
$maxCols = 0;
$result = Db::getInstance()->ExecuteS('
SELECT num_ligne, count(id_link_cat) as nbCat
FROM '._DB_PREFIX_.'admevo_button_link_cat WHERE id_button='.$IdButton.' GROUP BY num_ligne
' );
if(sizeof($result)) {
foreach($result as $kr=>$ValResult)
if($maxCols<$ValResult['nbCat'])
$maxCols = $ValResult['nbCat'];
}
return $maxCols;
}
static public function getNbColumns($IdButton, $Line) {
return Db::getInstance()->ExecuteS('
SELECT count(id_link_cat) as nbCols
FROM '._DB_PREFIX_.'admevo_button_link_cat WHERE id_button='.$IdButton.' AND num_ligne='.$Line);
}
function recurseCategory($indexedCategories, $categories, $current, $id_category = 1, $id_category_default = NULL, $CategorySelected, $CategoryLine, $CategoryColumn, $CategoryName, $CategoryState, $ViewProducts)
{
global $done;
$defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT'));
$languages = Language::getLanguages();
$iso = Language::getIsoById($defaultLanguage);
static $irow;
if(!is_array($CategorySelected))
$CategorySelected = array();
$id_obj = intval(Tools::getValue($this->identifier));
if (!isset($done[$current['infos']['id_parent']]))
$done[$current['infos']['id_parent']] = 0;
$done[$current['infos']['id_parent']] += 1;
$todo = sizeof($categories[$current['infos']['id_parent']]);
$doneC = $done[$current['infos']['id_parent']];
$level = $current['infos']['level_depth'] + 1;
$img = $level == 1 ? 'lv1.png' : 'lv'.$level.'_'.($todo == $doneC ? 'f' : 'b').'.png';
$this->_html .= '
<tr class="'.($irow++ % 2 ? 'alt_row' : '').'">
<td>
<input type="checkbox" name="categoryBox[]" class="categoryBox'.($id_category_default != NULL ? ' id_category_default' : '').'" id="categoryBox_'.$id_category.'" value="'.$id_category.'"'.(((in_array($id_category, $indexedCategories) OR (intval(Tools::getValue('id_category')) == $id_category AND !intval($id_obj))) OR in_array($id_category, $CategorySelected)) ? ' checked="checked"' : '').' '.($current['infos']['active'] == 0 ? " disabled" : false).'/>
</td>
<td>
'.$id_category.'
</td>
<td valign="top">
<img src="../img/admin/'.$img.'" alt="" /> <label for="categoryBox_'.$id_category.'" class="t">'.stripslashes($current['infos']['name']).'</label>';
$this->_html .= '</td>';
$this->_html .= '<td>';
$this->_html .= '<table cellpadding="0" cellspacing="0" width="100%">
<tr><td>'.$this->l('Position').' : </td><td>'.$this->l('Category').' <select name="columnBox_'.$id_category.'" style="font-size : 10px">';
for($c=1; $c<=10; $c++)
$this->_html .= '<option value="'.$c.'" '.(isset($CategoryColumn[$id_category]) && $CategoryColumn[$id_category] == $c ? " selected" : false).'> '.$this->l('Column').' '.$c.' </option>';
$this->_html .= '</select>';
// Under Category
$this->_html .= ' • '.$this->l('Under category').' ';
$this->_html .= '<select name="lineBox_'.$id_category.'" style="font-size : 10px">';
for($i=1;$i<=10;$i++)
$this->_html .= '<option value="'.$i.'" '.(isset($CategoryLine[$id_category]) && $CategoryLine[$id_category] == $i ? 'selected="selected"' : false).'>
'.$this->l('Line').' '.$i.'
</option>';
$this->_html .= '</select>';
// End Under Category
$this->_html .= ' <select id="State_'.$id_category.'" name="State_'.$id_category.'" style="font-size : 10px">
<option value="0" '.(isset($CategoryState[$id_category]) && $CategoryState[$id_category] == 0 ? 'selected="selected"' : false).'>'.$this->l('disabled').'</option>
<option value="1" '.(isset($CategoryState[$id_category]) && $CategoryState[$id_category] == 1 ? 'selected="selected"' : false).'>'.$this->l('enabled').'</option>
</select></td></tr>
<tr><td>'.$this->l('Name').' : </td><td>';
foreach ($languages as $language) {
$this->_html .= '<div id="DivLang'.$id_category.'_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $defaultLanguage ? 'block' : 'none').'; float: left" class="divLang">';
$this->_html .= '<input type="text" id="textSubstitute_'.$id_category.'_'.$language['id_lang'].'" name="textSubstitute_'.$id_category.'_'.$language['id_lang'].'" value="'.(isset($CategoryName[$id_category][$language['id_lang']]) ? $CategoryName[$id_category][$language['id_lang']] : '').'" size = "45" style="font-size : 10px"></div>';
}
$this->_html .= $this->displayFlagsMD($languages, $defaultLanguage, 'DivLang'.$id_category, 'DivLang'.$id_category, true);
$this->_html .= ' <input type="checkbox" id="viewProducts_'.$id_category.'" name="viewProducts_'.$id_category.'" '.(isset($ViewProducts[$id_category]) && $ViewProducts[$id_category]=='on' ? " checked=\"checked\"" : false).'> '.$this->l('view products');
$this->_html .= '</td></tr></table>';
$this->_html.= '</td>';
$this->_html .= '</tr>';
if (isset($categories[$id_category]))
foreach ($categories[$id_category] AS $key => $row)
if ($key != 'infos')
$this->recurseCategory($indexedCategories, $categories, $categories[$id_category][$key], $key, NULL, $CategorySelected, $CategoryLine, $CategoryColumn, $CategoryName, $CategoryState, $ViewProducts);
}
public function displayFlagsMD($languages, $defaultLanguage, $ids, $id, $return = false)
{
if (sizeof($languages) == 1)
return false;
$defaultIso = Language::getIsoById($defaultLanguage);
$output = '
<div class="display_flags" style="float: left">
<img src="../img/l/'.$defaultLanguage.'.jpg" class="pointer" id="language_current_'.$id.'" onclick="showLanguagesMD(\''.$id.'\');" alt="" />
</div>
<div id="languages_'.$id.'" class="language_flags">';
foreach ($languages as $language)
$output .= '<img src="../img/l/'.intval($language['id_lang']).'.jpg" class="pointer" alt="'.$language['name'].'" title="'.$language['name'].'" onclick="changeLanguageMD(\''.$id.'\', \''.$ids.'\', '.$language['id_lang'].', \''.$language['iso_code'].'\');" /> ';
$output .= '</div>';
if ($return)
return $output;
echo $output;
}
public function displayForm()
{
global $ButtonIdInEdit;
$defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT'));
$languages = Language::getLanguages();
$iso = Language::getIsoById($defaultLanguage);
($ButtonIdInEdit!='' && $ButtonIdInEdit!=0) ? $languageIds = 'ButtonsEdit'.utf8_encode('�').'Buttons' :$languageIds = 'Buttons';
$tabButtonsOrganizate = array();
$MDConfiguration = $this->getConfigurations();
$MDParameters = $this->getParameters();
$this->_html .='
<link rel="stylesheet" href="'.$this->_path.'views/css/colorpicker.css" type="text/css" />
<link rel="stylesheet" href="'.$this->_path.'views/css/layout.css" type="text/css"/>
<script type="text/javascript" src="'.$this->_path.'views/js/colorpicker.js"></script>
<script type="text/javascript" src="'.$this->_path.'views/js/eye.js"></script>
<script type="text/javascript" src="'.$this->_path.'views/js/layout.js?ver=1.0.2"></script>
';
$this->_html .='
<script type="text/javascript">id_language = Number('.$defaultLanguage.');</script>
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,advimage,advlink,inlinepopups,media,searchreplace,contextmenu,paste,directionality,fullscreen",
// Theme options
theme_advanced_buttons1 : "forecolor,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : false,
content_css : "'.__PS_BASE_URI__.'themes/'._THEME_NAME_.'/css/global.css",
document_base_url : "'.__PS_BASE_URI__.'",
width: "600",
height: "auto",
font_size_style_values : "8pt, 10pt, 12pt, 14pt, 18pt, 24pt, 36pt",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
elements : "nourlconvert",
convert_urls : false,
language : "'.(file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en').'"
});
//tinyMCEInit(\'textarea.rte\');
function showLanguagesMD(id)
{
getE("languages_" + id).style.display = "block";
}
function EditButton(ButtonId) {
$("#Action").val("EditButton");
$("#ButtonIdAction").val(ButtonId);
$("#formnewbutton").submit();
}
function DeleteButton(ButtonId) {
$("#Action").val("DeleteButton");
$("#ButtonIdAction").val(ButtonId);
$("#formnewbutton").submit();
}
function AfficheMasqueSlide(elt) {
($("#"+elt).css("display") == "none") ? $("#"+elt).slideDown("normal") : $("#"+elt).slideUp("normal");
}
function deletePicture(pictureToDelete) {
if(confirm("'.$this->l('Do you want to delete this file ?').'")) {
$("#ActionFile").val("DeleteFile");
$("#FileToDelete").val(pictureToDelete);
$("#formdesign").submit();
}
}
var wait = "<div widht=\'100%\' align=\'center\' style=\'height : 190px\'><br /><br /><br /><br /><img src=\''.$this->_path.'views/img/ajaxLoading.gif\'><br />'.$this->l('Loading').'</div>";
function displayDetailMenu() {
$.ajax({
method : "GET",
url: "'.$this->_path.'ajax_update_button.php",
data: {
action: "DetailMenu",
idButton: $("#ButttonIdToUpdate").val(),
idLang: '.$this->context->cookie->id_lang.'
},
success: function(data) {
$("#customMenu").html(data)
}
});
}
function addCustomMenu(IdButton) {
if($("#CustomMenuName").val() != "") {
$("#customMenu").html(wait)
$.ajax({
method : "GET",
url: "'.$this->_path.'ajax_update_button.php",
data: {
action: "CustomMenuAdd",
idButton: $("#ButttonIdToUpdate").val(),';
foreach ($languages as $language)
$this->_html .= 'MenuName_'.$language['id_lang'].' : $("#CustomMenuName_'.$language['id_lang'].'").val(),';
$this->_html .= 'idLang: '.$this->context->cookie->id_lang.'
},
success: function() {
displayDetailMenu()
}
});
}
else {
alert("'.$this->l('Please entre Menu name.').'")
}
}
function deleteCustomMenu(ButtonId, CustomMenuId) {
$("#customMenu").html(wait)
$.ajax({
method : "GET",
url: "'.$this->_path.'ajax_update_button.php",
data: {
action: "CustomMenuDelete",
idButton: ButtonId,
idCustomMenu: CustomMenuId,
idLang: '.$this->context->cookie->id_lang.'
},
success: function() {
displayDetailMenu()
}
});
}
function saveCustomMenu(ButtonId, CustomMenuId) {
';
foreach ($languages as $language) {
$this->_html .= 'NewNameMenu_'.$language['id_lang'].' = $("#MenuName_"+ButtonId+"_"+CustomMenuId+"_'.$language['id_lang'].'").val();
';
}
$this->_html .= '
NewMenuLink = $("#MenuLink_"+ButtonId+"_"+CustomMenuId).val();
Newline = $("#line_"+ButtonId+"_"+CustomMenuId).val();
Newcolumn = $("#column_"+ButtonId+"_"+CustomMenuId).val();
$("#customMenu").html(wait)
$.ajax({
method : "GET",
url: "'.$this->_path.'ajax_update_button.php",
data: {
action: "CustomMenuSave",
idButton: ButtonId,
idCustomMenu: CustomMenuId,
';
foreach ($languages as $language)
$this->_html .= 'nameMenu_'.$language['id_lang'].': NewNameMenu_'.$language['id_lang'].',
';
$this->_html .= 'linkMenu: NewMenuLink,
lineMenu: Newline,
columnMenu: Newcolumn,
idLang: '.$this->context->cookie->id_lang.'
},
success: function(data) {
displayDetailMenu()
}
});
}
function addCustomSubMenu(ButtonId, CustomMenuId) {
if($("#CustomSubMenuName" + CustomMenuId).val() != "") {
';
foreach ($languages as $language)
$this->_html .= 'NewSubMenu_'.$language['id_lang'].' = $("#CustomSubMenuName_" + CustomMenuId + "_'.$language['id_lang'].'").val();
';
$this->_html .= '$("#customMenu").html(wait)
$.ajax({
method : "GET",
url: "'.$this->_path.'ajax_update_button.php",
data: {
action: "CustomSubMenuAdd",
idButton: ButtonId,
idCustomMenu: CustomMenuId,
';
foreach ($languages as $language)
$this->_html .= 'SubMenuName_'.$language['id_lang'].' : NewSubMenu_'.$language['id_lang'].',
';
$this->_html .= 'idLang: '.$this->context->cookie->id_lang.'
},
success: function() {
displayDetailMenu()
}
});
}
else {
alert("'.$this->l('Please entre Sub-Menu name.').'")
}
}
function changeLanguageMD(field, fieldsString, id_language_new, iso_code)
{
var fields = $(".divLang");
for (var i = 0; i < fields.length; ++i)
{
eltId = fields[i].id;
eltTab = eltId.split("_");
(eltTab[1] != id_language_new) ? getE(eltId).style.display = "none" : getE(eltId).style.display = "block";
getE("language_current_" + eltTab[0]).src = "../img/l/" + id_language_new + ".jpg";
}
getE("languages_" + field).style.display = "none";
id_language = id_language_new;
}
function deletePictureMenu() {
$("#ActionPicture").val("DeletePicture")
$("#form_upload_picture").submit();
}
function deletePictureBackground() {
$("#ActionPictureBackground").val("DeletePicture")
$("#form_upload_picture_background").submit();
}
</script>
';
$this->_html .= '
<style>
.Buttonlistitem
{
position: relative;
display: block;
float: left;
list-style-type: none;
text-align: center;
}
.display_flags {
padding-top : 3px;