Просмотр исходного кода

Disable WebUI header menu WEB, DNS, MAIL, DB, CRON, BACKUP if they are set "0" in the package.

JA 9 лет назад
Родитель
Сommit
cc15e4adad
2 измененных файлов с 63 добавлено и 2 удалено
  1. 14 1
      web/css/styles.min.css
  2. 49 1
      web/templates/scripts.html

+ 14 - 1
web/css/styles.min.css

@@ -993,6 +993,19 @@ input[type="checkbox"] {
   margin-right: -8px;
 }
 
+.l-stat__col a.disabled {
+	cursor: default;
+	text-decoration: none;
+}
+
+.l-stat__col a.disabled:hover {
+	border: none;
+}
+
+.l-stat__col a.disabled .l-stat__col-title, .l-stat__col a.disabled li {
+    color: #e0e0e0;
+}
+
 .l-separator.selected,
 .l-separator {
   height: 1px;
@@ -2512,7 +2525,7 @@ label:hover {
 }
 
 .vst-list.flat {
-  border: 1px solid #fff; 
+  border: 1px solid #fff;
   color: #2c9491;
   text-transform: uppercase;
   font-weight: bold;

+ 49 - 1
web/templates/scripts.html

@@ -15,6 +15,54 @@
     });
   </script>
 
+  <?php if($panel[$user]['WEB_DOMAINS'] == "0") { ?>
+  <script>
+  	$('a[href^="/list/web"]').addClass('disabled').click(function() {
+  		return false;
+  	});
+  </script>
+  <?php } ?>
+
+  <?php if($panel[$user]['DNS_DOMAINS'] == "0") { ?>
+  <script>
+  	$('a[href^="/list/dns"]').addClass('disabled').click(function() {
+  		return false;
+  	});
+  </script>
+  <?php } ?>
+
+  <?php if($panel[$user]['MAIL_DOMAINS'] == "0") { ?>
+  <script>
+  	$('a[href^="/list/mail"]').addClass('disabled').click(function() {
+  		return false;
+  	});
+  </script>
+  <?php } ?>
+
+  <?php if($panel[$user]['DATABASES'] == "0") { ?>
+  <script>
+  	$('a[href^="/list/db"]').addClass('disabled').click(function() {
+  		return false;
+  	});
+  </script>
+  <?php } ?>
+
+  <?php if($panel[$user]['CRON_JOBS'] == "0") { ?>
+  <script>
+  	$('a[href^="/list/cron"]').addClass('disabled').click(function() {
+  		return false;
+  	});
+  </script>
+  <?php } ?>
+
+  <?php if($panel[$user]['BACKUPS'] == "0") { ?>
+  <script>
+  	$('a[href^="/list/backup"]').addClass('disabled').click(function() {
+  		return false;
+  	});
+  </script>
+  <?php } ?>
+
 <?php
 // Dialogs
 // todo: display all the dialogs?
@@ -68,4 +116,4 @@ elseif (!empty($_SESSION['error_msg'])):
 <?php
   unset($_SESSION['error_msg']);
 endif;
-?>
+?>