Code Duplication    Length = 67-68 lines in 3 locations

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

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

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

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

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