소스 검색

Menu: Add confirmation modal to Restore Default action.

Nate 4 년 전
부모
커밋
c549cf2239
2개의 변경된 파일27개의 추가작업 그리고 2개의 파일을 삭제
  1. 22 1
      core/menu/app_languages.php
  2. 5 1
      core/menu/menu_edit.php

+ 22 - 1
core/menu/app_languages.php

@@ -925,4 +925,25 @@ $text['button-move_down']['ru-ru'] = "Переместить вниз";
 $text['button-move_down']['sv-se'] = "Flytta Ned";
 $text['button-move_down']['uk-ua'] = "Перемістити вниз";
 
-?>
+$text['confirm-restore']['en-us'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['en-gb'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['ar-eg'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['de-at'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['de-ch'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['de-de'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['es-cl'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['es-mx'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['fr-ca'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['fr-fr'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['he-il'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['it-it'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['nl-nl'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['pl-pl'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['pt-br'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['pt-pt'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['ro-ro'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['ru-ru'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['sv-se'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+$text['confirm-restore']['uk-ua'] = "You are about to restore all <i>unprotected</i> items on this menu.";
+
+?>

+ 5 - 1
core/menu/menu_edit.php

@@ -165,13 +165,17 @@
 	echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','link'=>'menu.php']);
 	echo button::create(['type'=>'button','label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reload'],'collapse'=>'hide-xs','style'=>'margin-left: 15px;','link'=>'menu_reload.php?menu_uuid='.urlencode($menu_uuid).'&menu_language='.urlencode($menu_language)]);
 	if (permission_exists('menu_restore') && $action == "update") {
-		echo button::create(['type'=>'button','label'=>$text['button-restore_default'],'icon'=>'key','collapse'=>'hide-xs','link'=>'menu_restore_default.php?menu_uuid='.urlencode($menu_uuid).'&menu_language='.urlencode($menu_language)]);
+		echo button::create(['type'=>'button','label'=>$text['button-restore_default'],'icon'=>'undo-alt','collapse'=>'hide-xs','onclick'=>"modal_open('modal-restore','btn_restore');"]);
 	}
 	echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']);
 	echo "	</div>\n";
 	echo "	<div style='clear: both;'></div>\n";
 	echo "</div>\n";
 
+	if (permission_exists('menu_restore') && $action == "update") {
+		echo modal::create(['id'=>'modal-restore','type'=>'confirmation','message'=>$text['confirm-restore'],'actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_restore','style'=>'float: right; margin-left: 15px;','collapse'=>'never','link'=>'menu_restore_default.php?menu_uuid='.urlencode($menu_uuid).'&menu_language='.urlencode($menu_language),'onclick'=>'modal_close();'])]);
+	}
+
 	echo $text['description-menu']."\n";
 	echo "<br /><br />\n";