Code Duplication    Length = 22-22 lines in 2 locations

lib/ar/content/html.php 1 location

@@ 319-340 (lines=22) @@
316
				unset($node['attribs'][$contentEditable]);
317
				$result = true;
318
			}
319
			if ($node['attribs']['ar:type'] == "template") {
320
					$path		= $me->make_path($node['attribs']['ar:path']);
321
					$template	= $node['attribs']['ar:name'];
322
					$argsarr	= array();
323
					if (is_array($node['attribs'])) {
324
						foreach ($node['attribs'] as $key => $value) {
325
							if (substr($key, 0, strlen('arargs:')) == 'arargs:') {
326
								$name = substr($key, strlen('arargs:'));
327
								$argsarr[$name] = $name."=".$value;
328
							}
329
						}
330
					}
331
					$args = implode('&', $argsarr);
332
333
					$node['children'] = array();
334
					$node['children'][] = array(
335
						"type" => "text",
336
						"html" => "{arCall:$path$template?$args}"
337
					);
338
					// return from worker function
339
					return true;
340
			}
341
			if (is_array($node['children'])) {
342
				foreach ($node['children'] as $key => $child) {
343
					// single | makes the following line always run the compileworker

lib/modules/mod_page.php 1 location

@@ 183-204 (lines=22) @@
180
			unset($node['attribs'][$contentEditable]);
181
			$result = true;
182
		}
183
		if ($node['attribs']['ar:type'] == "template") {
184
				$path     = $node['attribs']['ar:path'];
185
				$template = $node['attribs']['ar:name'];
186
				$argsarr  = array();
187
				if (is_array($node['attribs'])) {
188
					foreach ($node['attribs'] as $key => $value) {
189
						if (substr($key, 0, strlen('arargs:')) == 'arargs:') {
190
							$name = substr($key, strlen('arargs:'));
191
							$argsarr[$name] = $name."=".$value;
192
						}
193
					}
194
				}
195
				$args = implode('&', $argsarr);
196
197
				$node['children'] = array();
198
				$node['children'][] = array(
199
					"type" => "text",
200
					"html" => "{arCall:$path$template?$args}"
201
				);
202
				// return from worker function
203
				return true;
204
		}
205
		if (is_array($node['children'])) {
206
			foreach ($node['children'] as $key => $child) {
207
				// single | makes the following line always run the compileworker