Code Duplication    Length = 16-16 lines in 2 locations

Sources/CacheAPI-smf.php 1 location

@@ 161-176 (lines=16) @@
158
	/**
159
	 * {@inheritDoc}
160
	 */
161
	public function cacheSettings(array &$config_vars)
162
	{
163
		global $context, $txt;
164
165
		$config_vars[] = $txt['cache_smf_settings'];
166
		$config_vars[] = array('cachedir', $txt['cachedir'], 'file', 'text', 36, 'cache_cachedir');
167
168
		if (!isset($context['settings_post_javascript']))
169
			$context['settings_post_javascript'] = '';
170
171
		$context['settings_post_javascript'] .= '
172
			$("#cache_accelerator").change(function (e) {
173
				var cache_type = e.currentTarget.value;
174
				$("#cachedir").prop("disabled", cache_type != "smf");
175
			});';
176
	}
177
178
	/**
179
	 * Sets the $cachedir or uses the SMF default $cachedir..

Sources/CacheAPI-sqlite.php 1 location

@@ 120-135 (lines=16) @@
117
	/**
118
	 * {@inheritDoc}
119
	 */
120
	public function cacheSettings(array &$config_vars)
121
	{
122
		global $context, $txt;
123
124
		$config_vars[] = $txt['cache_sqlite_settings'];
125
		$config_vars[] = array('cachedir_sqlite', $txt['cachedir_sqlite'], 'file', 'text', 36, 'cache_sqlite_cachedir');
126
127
		if (!isset($context['settings_post_javascript']))
128
		{
129
			$context['settings_post_javascript'] = '';
130
		}
131
132
		$context['settings_post_javascript'] .= '
133
			$("#cache_accelerator").change(function (e) {
134
				var cache_type = e.currentTarget.value;
135
				$("#cachedir_sqlite").prop("disabled", cache_type != "sqlite");
136
			});';
137
	}
138