Code Duplication    Length = 67-68 lines in 3 locations

catalog/includes/modules/shipping/item.php 1 location

@@ 77-144 (lines=68) @@
74
      return defined('MODULE_SHIPPING_ITEM_STATUS');
75
    }
76
77
    function install() {
78
      $OSCOM_Db = Registry::get('Db');
79
80
      $OSCOM_Db->save('configuration', [
81
        'configuration_title' => 'Enable Item Shipping',
82
        'configuration_key' => 'MODULE_SHIPPING_ITEM_STATUS',
83
        'configuration_value' => 'True',
84
        'configuration_description' => 'Do you want to offer per item rate shipping?',
85
        'configuration_group_id' => '6',
86
        'sort_order' => '1',
87
        'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ',
88
        'date_added' => 'now()'
89
      ]);
90
91
      $OSCOM_Db->save('configuration', [
92
        'configuration_title' => 'Shipping Cost',
93
        'configuration_key' => 'MODULE_SHIPPING_ITEM_COST',
94
        'configuration_value' => '2.50',
95
        'configuration_description' => 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.',
96
        'configuration_group_id' => '6',
97
        'sort_order' => '1',
98
        'date_added' => 'now()'
99
      ]);
100
101
      $OSCOM_Db->save('configuration', [
102
        'configuration_title' => 'Handling Fee',
103
        'configuration_key' => 'MODULE_SHIPPING_ITEM_HANDLING',
104
        'configuration_value' => '0',
105
        'configuration_description' => 'Handling fee for this shipping method.',
106
        'configuration_group_id' => '6',
107
        'sort_order' => '1',
108
        'date_added' => 'now()'
109
      ]);
110
111
      $OSCOM_Db->save('configuration', [
112
        'configuration_title' => 'Tax Class',
113
        'configuration_key' => 'MODULE_SHIPPING_ITEM_TAX_CLASS',
114
        'configuration_value' => '0',
115
        'configuration_description' => 'Use the following tax class on the shipping fee.',
116
        'configuration_group_id' => '6',
117
        'sort_order' => '1',
118
        'use_function' => 'tep_get_tax_class_title',
119
        'set_function' => 'tep_cfg_pull_down_tax_classes(',
120
        'date_added' => 'now()'
121
      ]);
122
123
      $OSCOM_Db->save('configuration', [
124
        'configuration_title' => 'Shipping Zone',
125
        'configuration_key' => 'MODULE_SHIPPING_ITEM_ZONE',
126
        'configuration_value' => '0',
127
        'configuration_description' => 'If a zone is selected, only enable this shipping method for that zone.',
128
        'configuration_group_id' => '6',
129
        'sort_order' => '1',
130
        'use_function' => 'tep_get_zone_class_title',
131
        'set_function' => 'tep_cfg_pull_down_zone_classes(',
132
        'date_added' => 'now()'
133
      ]);
134
135
      $OSCOM_Db->save('configuration', [
136
        'configuration_title' => 'Sort Order',
137
        'configuration_key' => 'MODULE_SHIPPING_ITEM_SORT_ORDER',
138
        'configuration_value' => '0',
139
        'configuration_description' => 'Sort order of display. Lowest is displayed first.',
140
        'configuration_group_id' => '6',
141
        'sort_order' => '0',
142
        'date_added' => 'now()'
143
      ]);
144
    }
145
146
    function remove() {
147
      return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")');

catalog/includes/modules/social_bookmarks/sb_google_plus_one.php 1 location

@@ 84-150 (lines=67) @@
81
      return defined('MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_STATUS');
82
    }
83
84
    function install() {
85
      $OSCOM_Db = Registry::get('Db');
86
87
      $OSCOM_Db->save('configuration', [
88
        'configuration_title' => 'Enable Google+ +1 Button Module',
89
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_STATUS',
90
        'configuration_value' => 'True',
91
        'configuration_description' => 'Do you want to allow products to be recommended through Google+ +1 Button?',
92
        'configuration_group_id' => '6',
93
        'sort_order' => '1',
94
        'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ',
95
        'date_added' => 'now()'
96
      ]);
97
98
      $OSCOM_Db->save('configuration', [
99
        'configuration_title' => 'Button Size',
100
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SIZE',
101
        'configuration_value' => 'Small',
102
        'configuration_description' => 'Sets the size of the button.',
103
        'configuration_group_id' => '6',
104
        'sort_order' => '1',
105
        'set_function' => 'tep_cfg_select_option(array(\'Small\', \'Medium\', \'Standard\', \'Tall\'), ',
106
        'date_added' => 'now()'
107
      ]);
108
109
      $OSCOM_Db->save('configuration', [
110
        'configuration_title' => 'Annotation',
111
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION',
112
        'configuration_value' => 'None',
113
        'configuration_description' => 'The annotation to display next to the button.',
114
        'configuration_group_id' => '6',
115
        'sort_order' => '1',
116
        'set_function' => 'tep_cfg_select_option(array(\'None\', \'Bubble\', \'Inline\'), ',
117
        'date_added' => 'now()'
118
      ]);
119
120
      $OSCOM_Db->save('configuration', [
121
        'configuration_title' => 'Inline Width',
122
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_WIDTH',
123
        'configuration_value' => '120',
124
        'configuration_description' => 'The width of the inline annotation in pixels (minimum 120).',
125
        'configuration_group_id' => '6',
126
        'sort_order' => '1',
127
        'date_added' => 'now()'
128
      ]);
129
130
      $OSCOM_Db->save('configuration', [
131
        'configuration_title' => 'Inline Alignment',
132
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ALIGN',
133
        'configuration_value' => 'Left',
134
        'configuration_description' => 'The alignment of the inline annotation.',
135
        'configuration_group_id' => '6',
136
        'sort_order' => '1',
137
        'set_function' => 'tep_cfg_select_option(array(\'Left\', \'Right\'), ',
138
        'date_added' => 'now()'
139
      ]);
140
141
      $OSCOM_Db->save('configuration', [
142
        'configuration_title' => 'Sort Order',
143
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SORT_ORDER',
144
        'configuration_value' => '0',
145
        'configuration_description' => 'Sort order of display. Lowest is displayed first.',
146
        'configuration_group_id' => '6',
147
        'sort_order' => '0',
148
        'date_added' => 'now()'
149
      ]);
150
    }
151
152
    function remove() {
153
      return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")');

catalog/includes/modules/social_bookmarks/sb_google_plus_share.php 1 location

@@ 90-156 (lines=67) @@
87
      return defined('MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_STATUS');
88
    }
89
90
    function install() {
91
      $OSCOM_Db = Registry::get('Db');
92
93
      $OSCOM_Db->save('configuration', [
94
        'configuration_title' => 'Enable Google+ Share Module',
95
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_STATUS',
96
        'configuration_value' => 'True',
97
        'configuration_description' => 'Do you want to allow products to be shared through Google+?',
98
        'configuration_group_id' => '6',
99
        'sort_order' => '1',
100
        'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ',
101
        'date_added' => 'now()'
102
      ]);
103
104
      $OSCOM_Db->save('configuration', [
105
        'configuration_title' => 'Annotation',
106
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_ANNOTATION',
107
        'configuration_value' => 'Bubble',
108
        'configuration_description' => 'The annotation to display next to the button.',
109
        'configuration_group_id' => '6',
110
        'sort_order' => '1',
111
        'set_function' => 'tep_cfg_select_option(array(\'Inline\', \'Bubble\', \'Vertical-Bubble\', \'None\'), ',
112
        'date_added' => 'now()'
113
      ]);
114
115
      $OSCOM_Db->save('configuration', [
116
        'configuration_title' => 'Width',
117
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_WIDTH',
118
        'configuration_value' => '',
119
        'configuration_description' => 'The maximum width of the button.',
120
        'configuration_group_id' => '6',
121
        'sort_order' => '1',
122
        'date_added' => 'now()'
123
      ]);
124
125
      $OSCOM_Db->save('configuration', [
126
        'configuration_title' => 'Height',
127
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_HEIGHT',
128
        'configuration_value' => '20',
129
        'configuration_description' => 'Sets the height of the button.',
130
        'configuration_group_id' => '6',
131
        'sort_order' => '1',
132
        'set_function' => 'tep_cfg_select_option(array(\'15\', \'20\', \'24\', \'60\'), ',
133
        'date_added' => 'now()'
134
      ]);
135
136
      $OSCOM_Db->save('configuration', [
137
        'configuration_title' => 'Alignment',
138
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_ALIGN',
139
        'configuration_value' => 'Left',
140
        'configuration_description' => 'The alignment of the button assets.',
141
        'configuration_group_id' => '6',
142
        'sort_order' => '1',
143
        'set_function' => 'tep_cfg_select_option(array(\'Left\', \'Right\'), ',
144
        'date_added' => 'now()'
145
      ]);
146
147
      $OSCOM_Db->save('configuration', [
148
        'configuration_title' => 'Sort Order',
149
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_SORT_ORDER',
150
        'configuration_value' => '0',
151
        'configuration_description' => 'Sort order of display. Lowest is displayed first.',
152
        'configuration_group_id' => '6',
153
        'sort_order' => '0',
154
        'date_added' => 'now()'
155
      ]);
156
    }
157
158
    function remove() {
159
      return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")');