@@ -71,28 +71,32 @@ public static function function_removeprefix($src_path, $dst_path, $moduleDirNam
71
71
$ crFields ->add (new \Criteria ('field_tid ' , $ tid ));
72
72
$ fieldsAll = $ helper ->getHandler ('Fields ' )->getAll ($ crFields );
73
73
foreach (\array_keys ($ fieldsAll ) as $ k ) {
74
- $ fieldName = $ fieldsAll [$ k ]->getVar ('field_name ' );
74
+ $ fieldName = $ fieldsAll [$ k ]->getVar ('field_name ' );
75
+ $ rpFieldName = '' ;
75
76
if (\mb_strpos ($ fieldName , '_ ' )) {
76
77
$ str = \mb_strpos ($ fieldName , '_ ' );
77
78
if (false !== $ str ) {
78
79
$ rpFieldName = \mb_substr ($ fieldName , $ str + 1 , \mb_strlen ($ fieldName ));
79
80
}
80
81
}
81
- // for getVar, setVar,....
82
- $ patKeys [] = "' " . $ fieldName . "' " ;
82
+ // for getVar, setVar, forms, ....
83
+ $ patKeys [] = "' " . $ fieldName . "' " ;
83
84
$ patValues [] = "' " . $ rpFieldName . "' " ;
84
- $ patKeys [] = 'showImgSelected(\"imglabel_ ' . $ fieldName . '\", ' ;
85
+ $ patKeys [] = 'showImgSelected(\"imglabel_ ' . $ fieldName . '\", ' ;
85
86
$ patValues [] = 'showImgSelected(\"imglabel_ ' . $ rpFieldName . '\", ' ;
86
- $ patKeys [] = '\" ' . $ fieldName . '\", ' ;
87
+ $ patKeys [] = '\" ' . $ fieldName . '\", ' ;
87
88
$ patValues [] = '\" ' . $ rpFieldName . '\", ' ;
88
- $ patKeys [] = "id='imglabel_ " . $ fieldName . "' alt= " ;
89
+ $ patKeys [] = "id='imglabel_ " . $ fieldName . "' alt= " ;
89
90
$ patValues [] = "id='imglabel_ " . $ rpFieldName . "' alt= " ;
90
- $ patKeys [] = "sort = ' " . $ fieldName . ' ASC, ' ;
91
+ $ patKeys [] = "sort = ' " . $ fieldName . ' ASC, ' ;
91
92
$ patValues [] = "sort = ' " . $ rpFieldName . ' ASC, ' ;
92
- $ patKeys [] = 'ASC, ' . $ fieldName . "', \$order " ;
93
+ $ patKeys [] = 'ASC, ' . $ fieldName . "', \$order " ;
93
94
$ patValues [] = 'ASC, ' . $ rpFieldName . "', \$order " ;
95
+ //clone feature
96
+ $ patKeys [] = "' " . $ fieldName . "_source' " ;
97
+ $ patValues [] = "' " . $ rpFieldName . "_source' " ;
94
98
// for tpl files
95
- if ($ rpFieldName== 'id ' ) {
99
+ if ($ rpFieldName === 'id ' ) {
96
100
$ patKeys [] = 'op=edit& ' . $ fieldName . '= ' ;
97
101
$ patValues [] = 'op=edit& ' . $ rpFieldName . '= ' ;
98
102
$ patKeys [] = 'op=show& ' . $ fieldName . '= ' ;
@@ -582,7 +586,7 @@ public static function getFormModulesTab($action = false)
582
586
* @param bool $action
583
587
* @return \XoopsSimpleForm
584
588
*/
585
- public static function getFormModulesRemovePrefix ($ action = false )
589
+ public static function getFormModulesRemovePrefix ($ dst_path , $ action = false )
586
590
{
587
591
if (!$ action ) {
588
592
$ action = $ _SERVER ['REQUEST_URI ' ];
@@ -599,6 +603,10 @@ public static function getFormModulesRemovePrefix($action = false)
599
603
$ modulesSelect ->addOption ($ mod , $ mod );
600
604
}
601
605
$ form ->addElement ($ modulesSelect , true );
606
+ $ destradioSelect = new \XoopsFormRadio (\_AM_MODULEBUILDER_DEVTOOLS_RP_DEST , 'rp_dest ' , 1 );
607
+ $ destradioSelect ->addOption ('1 ' , \str_replace ('%s ' , $ dst_path , \_AM_MODULEBUILDER_DEVTOOLS_RP_DEST1 ));
608
+ $ destradioSelect ->addOption ('2 ' , \_AM_MODULEBUILDER_DEVTOOLS_RP_DEST2 );
609
+ $ form ->addElement ($ destradioSelect );
602
610
// To Save
603
611
$ form ->addElement (new \XoopsFormHidden ('op ' , 'remove_prefix ' ));
604
612
$ form ->addElement (new \XoopsFormButtonTray ('' , \_SUBMIT , 'submit ' , '' , false ));
0 commit comments