Code Duplication    Length = 33-33 lines in 2 locations

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

@@ 655-687 (lines=33) @@
652
      return $output;
653
    }
654
655
    function install($module) {
656
      $cut_length = strlen('OSCOM_APP_PAYPAL_BRAINTREE_' . $module . '_');
657
658
      foreach ( $this->getParameters($module) as $key ) {
659
        $p = strtolower(substr($key, $cut_length));
660
661
        $cfg_class = 'OSCOM_Braintree_' . $module . '_Cfg_' . $p;
662
663
        if ( !class_exists($cfg_class) ) {
664
          $this->loadLanguageFile('modules/' . $module . '/cfg_params/' . $p . '.php');
665
666
          include(DIR_FS_CATALOG . 'includes/apps/braintree/modules/' . $module . '/cfg_params/' . $p . '.php');
667
        }
668
669
        $cfg = new $cfg_class();
670
671
        $this->saveParameter($key, $cfg->default, isset($cfg->title) ? $cfg->title : null, isset($cfg->description) ? $cfg->description : null, isset($cfg->set_func) ? $cfg->set_func : null);
672
      }
673
674
      $m_class = 'OSCOM_Braintree_' . $module;
675
676
      if ( !class_exists($m_class) ) {
677
        $this->loadLanguageFile('modules/' . $module . '/' . $module . '.php');
678
679
        include(DIR_FS_CATALOG . 'includes/apps/braintree/modules/' . $module . '/' . $module . '.php');
680
      }
681
682
      $m = new $m_class();
683
684
      if ( method_exists($m, 'install') ) {
685
        $m->install($this);
686
      }
687
    }
688
689
    function uninstall($module) {
690
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'OSCOM_APP_PAYPAL_BRAINTREE_" . tep_db_input($module) . "_%'");

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

@@ 707-739 (lines=33) @@
704
      return $output;
705
    }
706
707
    function install($module) {
708
      $cut_length = strlen('OSCOM_APP_PAYPAL_' . $module . '_');
709
710
      foreach ( $this->getParameters($module) as $key ) {
711
        $p = strtolower(substr($key, $cut_length));
712
713
        $cfg_class = 'OSCOM_PayPal_' . $module . '_Cfg_' . $p;
714
715
        if ( !class_exists($cfg_class) ) {
716
          $this->loadLanguageFile('modules/' . $module . '/cfg_params/' . $p . '.php');
717
718
          include(DIR_FS_CATALOG . 'includes/apps/paypal/modules/' . $module . '/cfg_params/' . $p . '.php');
719
        }
720
721
        $cfg = new $cfg_class();
722
723
        $this->saveParameter($key, $cfg->default, isset($cfg->title) ? $cfg->title : null, isset($cfg->description) ? $cfg->description : null, isset($cfg->set_func) ? $cfg->set_func : null);
724
      }
725
726
      $m_class = 'OSCOM_PayPal_' . $module;
727
728
      if ( !class_exists($m_class) ) {
729
        $this->loadLanguageFile('modules/' . $module . '/' . $module . '.php');
730
731
        include(DIR_FS_CATALOG . 'includes/apps/paypal/modules/' . $module . '/' . $module . '.php');
732
      }
733
734
      $m = new $m_class();
735
736
      if ( method_exists($m, 'install') ) {
737
        $m->install($this);
738
      }
739
    }
740
741
    function uninstall($module) {
742
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'OSCOM_APP_PAYPAL_" . tep_db_input($module) . "_%'");