Code Duplication    Length = 31-31 lines in 2 locations

catalog/includes/apps/braintree/OSCOM_Braintree.php 1 location

@@ 595-625 (lines=31) @@
592
      }
593
    }
594
595
    function getAlerts() {
596
      global $OSCOM_Braintree_Alerts;
597
598
      $output = '';
599
600
      if ( tep_session_is_registered('OSCOM_Braintree_Alerts') && !empty($OSCOM_Braintree_Alerts) ) {
601
        $result = array();
602
603
        foreach ( $OSCOM_Braintree_Alerts as $type => $messages ) {
604
          if ( in_array($type, array('error', 'warning', 'success')) ) {
605
            $m = '<ul class="bt-alerts-' . $type . '">';
606
607
            foreach ( $messages as $message ) {
608
              $m .= '<li>' . tep_output_string_protected($message) . '</li>';
609
            }
610
611
            $m .= '</ul>';
612
613
            $result[] = $m;
614
          }
615
        }
616
617
        if ( !empty($result) ) {
618
          $output .= '<div class="bt-alerts">' . implode("\n", $result) . '</div>';
619
        }
620
      }
621
622
      tep_session_unregister('OSCOM_Braintree_Alerts');
623
624
      return $output;
625
    }
626
627
    function install($module) {
628
      $cut_length = strlen('OSCOM_APP_PAYPAL_BRAINTREE_' . $module . '_');

catalog/includes/apps/paypal/OSCOM_PayPal.php 1 location

@@ 649-679 (lines=31) @@
646
      }
647
    }
648
649
    function getAlerts() {
650
      global $OSCOM_PayPal_Alerts;
651
652
      $output = '';
653
654
      if ( tep_session_is_registered('OSCOM_PayPal_Alerts') && !empty($OSCOM_PayPal_Alerts) ) {
655
        $result = array();
656
657
        foreach ( $OSCOM_PayPal_Alerts as $type => $messages ) {
658
          if ( in_array($type, array('error', 'warning', 'success')) ) {
659
            $m = '<ul class="pp-alerts-' . $type . '">';
660
661
            foreach ( $messages as $message ) {
662
              $m .= '<li>' . tep_output_string_protected($message) . '</li>';
663
            }
664
665
            $m .= '</ul>';
666
667
            $result[] = $m;
668
          }
669
        }
670
671
        if ( !empty($result) ) {
672
          $output .= '<div class="pp-alerts">' . implode("\n", $result) . '</div>';
673
        }
674
      }
675
676
      tep_session_unregister('OSCOM_PayPal_Alerts');
677
678
      return $output;
679
    }
680
681
    function install($module) {
682
      $cut_length = strlen('OSCOM_APP_PAYPAL_' . $module . '_');