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

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