|
430 | 430 | </a> |
431 | 431 | </li> |
432 | 432 | </ul> |
433 | | - |
| 433 | +
|
434 | 434 |
|
435 | 435 | <!-- Navbar Right Menu --> |
436 | 436 | <ul class="navbar-nav ml-auto">'; |
|
495 | 495 | <a href="'.tr('https://www.openstamanager.com').'" class="brand-link" title="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione elettronica").'" target="_blank"> |
496 | 496 | <img src="'.$rootdir.'/assets/dist/img/logo_completo.png" class="brand-image" alt="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione elettronica").'"> |
497 | 497 | <span class="brand-text font-weight-light"> </span> |
498 | | - |
| 498 | +
|
499 | 499 | </a> |
500 | 500 |
|
501 | 501 | <!-- Sidebar --> |
|
518 | 518 | </div> |
519 | 519 | </div> |
520 | 520 |
|
521 | | - |
| 521 | +
|
522 | 522 | <!-- SidebarSearch Form --> |
523 | 523 | <div class="form-inline"> |
524 | 524 | <div class="input-group" data-widget="sidebar-search"> |
|
632 | 632 | echo ' |
633 | 633 | <!-- Main content --> |
634 | 634 | <div class="content-wrapper"> |
635 | | - <section class="content">'; |
| 635 | + <section class="content"> |
| 636 | +
|
| 637 | + <script> |
| 638 | + $(document).ready(function() { |
| 639 | + // Funzione per controllare se siamo in un plugin e nascondere il pulsante "Aggiungi" principale |
| 640 | + function checkActiveTab() { |
| 641 | + var activeTabId = $(".tab-pane.active").attr("id"); |
| 642 | +
|
| 643 | + // Se il tab attivo è diverso da tab_0, siamo in un plugin |
| 644 | + if (activeTabId !== "tab_0") { |
| 645 | + // Nascondi il pulsante "Aggiungi" principale (quello accanto al nome del modulo) |
| 646 | + $(".content-header .btn-primary[data-title=\'Aggiungi...\'], .content-header .btn-primary[data-title=\'Aggiungi\'], .content-header button.btn-primary:has(i.fa-plus)").hide(); |
| 647 | + } else { |
| 648 | + // Mostra il pulsante "Aggiungi" principale quando siamo nel tab principale |
| 649 | + $(".content-header .btn-primary[data-title=\'Aggiungi...\'], .content-header .btn-primary[data-title=\'Aggiungi\'], .content-header button.btn-primary:has(i.fa-plus)").show(); |
| 650 | + } |
| 651 | + } |
| 652 | +
|
| 653 | + // Controlla all\'avvio |
| 654 | + checkActiveTab(); |
| 655 | +
|
| 656 | + // Controlla anche quando la pagina viene caricata con un hash nell\'URL |
| 657 | + if (window.location.hash && window.location.hash !== "#tab_0") { |
| 658 | + setTimeout(checkActiveTab, 100); // Piccolo ritardo per assicurarsi che il tab sia cambiato |
| 659 | + } |
| 660 | +
|
| 661 | + // Controlla quando cambia il tab |
| 662 | + $("a[data-toggle=\'tab\']").on("shown.bs.tab", function() { |
| 663 | + checkActiveTab(); |
| 664 | + }); |
| 665 | +
|
| 666 | + // Controlla anche quando viene cliccato un tab nella barra laterale |
| 667 | + $("a[data-toggle=\'control-sidebar\']").on("click", function() { |
| 668 | + setTimeout(checkActiveTab, 100); // Piccolo ritardo per assicurarsi che il tab sia cambiato |
| 669 | + }); |
| 670 | + }); |
| 671 | + </script>'; |
636 | 672 |
|
637 | 673 | if (string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php')) { |
638 | 674 | $location = 'editor_right'; |
|
666 | 702 | // Infomazioni |
667 | 703 | if (!empty($messages['info'])) { |
668 | 704 | foreach ($messages['info'] as $value) { |
669 | | - echo ' |
| 705 | + echo ' |
670 | 706 | <script> |
671 | 707 | $(document).ready( function(){ |
672 | 708 | window.parent.toastr.success("'.$value.'", toastr.options); |
|
0 commit comments