Code Duplication    Length = 77-78 lines in 2 locations

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

@@ 61-138 (lines=78) @@
58
      return defined('MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STATUS');
59
    }
60
61
    function install() {
62
      $OSCOM_Db = Registry::get('Db');
63
64
      $OSCOM_Db->save('configuration', [
65
        'configuration_title' => 'Enable Facebook Like Module',
66
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STATUS',
67
        'configuration_value' => 'True',
68
        'configuration_description' => 'Do you want to allow products to be shared through Facebook Like?',
69
        'configuration_group_id' => '6',
70
        'sort_order' => '1',
71
        'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ',
72
        'date_added' => 'now()'
73
      ]);
74
75
      $OSCOM_Db->save('configuration', [
76
        'configuration_title' => 'Layout Style',
77
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STYLE',
78
        'configuration_value' => 'Standard',
79
        'configuration_description' => 'Determines the size and amount of social context next to the button.',
80
        'configuration_group_id' => '6',
81
        'sort_order' => '1',
82
        'set_function' => 'tep_cfg_select_option(array(\'Standard\', \'Button Count\'), ',
83
        'date_added' => 'now()'
84
      ]);
85
86
      $OSCOM_Db->save('configuration', [
87
        'configuration_title' => 'Show Faces',
88
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_FACES',
89
        'configuration_value' => 'False',
90
        'configuration_description' => 'Show profile pictures below the button?',
91
        'configuration_group_id' => '6',
92
        'sort_order' => '1',
93
        'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ',
94
        'date_added' => 'now()'
95
      ]);
96
97
      $OSCOM_Db->save('configuration', [
98
        'configuration_title' => 'Width',
99
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_WIDTH',
100
        'configuration_value' => '125',
101
        'configuration_description' => 'The width of the iframe in pixels.',
102
        'configuration_group_id' => '6',
103
        'sort_order' => '1',
104
        'date_added' => 'now()'
105
      ]);
106
107
      $OSCOM_Db->save('configuration', [
108
        'configuration_title' => 'Verb to Display',
109
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_VERB',
110
        'configuration_value' => 'Like',
111
        'configuration_description' => 'The verb to display in the button.',
112
        'configuration_group_id' => '6',
113
        'sort_order' => '1',
114
        'set_function' => 'tep_cfg_select_option(array(\'Like\', \'Recommend\'), ',
115
        'date_added' => 'now()'
116
      ]);
117
118
      $OSCOM_Db->save('configuration', [
119
        'configuration_title' => 'Color Scheme',
120
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_SCHEME',
121
        'configuration_value' => 'Light',
122
        'configuration_description' => 'The color scheme of the button.',
123
        'configuration_group_id' => '6',
124
        'sort_order' => '1',
125
        'set_function' => 'tep_cfg_select_option(array(\'Light\', \'Dark\'), ',
126
        'date_added' => 'now()'
127
      ]);
128
129
      $OSCOM_Db->save('configuration', [
130
        'configuration_title' => 'Sort Order',
131
        'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_SORT_ORDER',
132
        'configuration_value' => '0',
133
        'configuration_description' => 'Sort order of display. Lowest is displayed first.',
134
        'configuration_group_id' => '6',
135
        'sort_order' => '0',
136
        'date_added' => 'now()'
137
      ]);
138
    }
139
140
    function remove() {
141
      return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")');

catalog/includes/modules/header_tags/ht_google_adwords_conversion.php 1 location

@@ 106-182 (lines=77) @@
103
      return defined('MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_STATUS');
104
    }
105
106
    function install() {
107
      $OSCOM_Db = Registry::get('Db');
108
109
      $OSCOM_Db->save('configuration', [
110
        'configuration_title' => 'Enable Google AdWords Conversion Module',
111
        'configuration_key' => 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_STATUS',
112
        'configuration_value' => 'True',
113
        'configuration_description' => 'Do you want to allow the Google AdWords Conversion Module on your checkout success page?',
114
        'configuration_group_id' => '6',
115
        'sort_order' => '1',
116
        'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ',
117
        'date_added' => 'now()'
118
      ]);
119
120
      $OSCOM_Db->save('configuration', [
121
        'configuration_title' => 'Conversion ID',
122
        'configuration_key' => 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_ID',
123
        'configuration_value' => '',
124
        'configuration_description' => 'The Google AdWords Conversion ID',
125
        'configuration_group_id' => '6',
126
        'sort_order' => '0',
127
        'date_added' => 'now()'
128
      ]);
129
130
      $OSCOM_Db->save('configuration', [
131
        'configuration_title' => 'Tracking Notification Layout',
132
        'configuration_key' => 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_FORMAT',
133
        'configuration_value' => '1',
134
        'configuration_description' => 'A small message will appear on your site telling customers that their visits on your site are being tracked. We recommend you use it.',
135
        'configuration_group_id' => '6',
136
        'sort_order' => '0',
137
        'set_function' => 'tep_cfg_google_adwords_conversion_set_format(',
138
        'use_function' => 'tep_cfg_google_adwords_conversion_get_format',
139
        'date_added' => 'now()'
140
      ]);
141
142
      $OSCOM_Db->save('configuration', [
143
        'configuration_title' => 'Page Background Color',
144
        'configuration_key' => 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_COLOR',
145
        'configuration_value' => 'ffffff',
146
        'configuration_description' => 'Enter a HTML color to match the color of your website background page.',
147
        'configuration_group_id' => '6',
148
        'sort_order' => '0',
149
        'date_added' => 'now()'
150
      ]);
151
152
      $OSCOM_Db->save('configuration', [
153
        'configuration_title' => 'Conversion Label',
154
        'configuration_key' => 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_LABEL',
155
        'configuration_value' => '',
156
        'configuration_description' => 'The alphanumeric code generated by Google for your AdWords Conversion',
157
        'configuration_group_id' => '6',
158
        'sort_order' => '0',
159
        'date_added' => 'now()'
160
      ]);
161
162
      $OSCOM_Db->save('configuration', [
163
        'configuration_title' => 'Javascript Placement',
164
        'configuration_key' => 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_JS_PLACEMENT',
165
        'configuration_value' => 'Footer',
166
        'configuration_description' => 'Should the Google AdWords Conversion javascript be loaded in the header or footer?',
167
        'configuration_group_id' => '6',
168
        'sort_order' => '0',
169
        'set_function' => 'tep_cfg_select_option(array(\'Header\', \'Footer\'), ',
170
        'date_added' => 'now()'
171
      ]);
172
173
      $OSCOM_Db->save('configuration', [
174
        'configuration_title' => 'Sort Order',
175
        'configuration_key' => 'MODULE_HEADER_TAGS_GOOGLE_ADWORDS_CONVERSION_SORT_ORDER',
176
        'configuration_value' => '0',
177
        'configuration_description' => 'Sort order of display. Lowest is displayed first.',
178
        'configuration_group_id' => '6',
179
        'sort_order' => '0',
180
        'date_added' => 'now()'
181
      ]);
182
    }
183
184
    function remove() {
185
      return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")');