Code Duplication    Length = 10-11 lines in 3 locations

forms/htmleditor/TinyMCEConfig.php 3 locations

@@ 279-288 (lines=10) @@
276
     * The button names to insert before that button
277
	 * @return bool True if insertion occured, false if it did not (because the given button name was not found)
278
	 */
279
	public function insertButtonsBefore($before, $buttons) {
280
        if(func_num_args() > 2) {
281
            $buttons = func_get_args();
282
            array_shift($buttons);
283
        }
284
        if(!is_array($buttons)) {
285
            $buttons = [$buttons];
286
        }
287
		return $this->modifyButtons($before, 0, 0, $buttons);
288
	}
289
290
	/**
291
	 * Insert buttons after the first occurance of another button
@@ 297-306 (lines=10) @@
294
     * The button names to insert after that button
295
	 * @return bool True if insertion occured, false if it did not (because the given button name was not found)
296
	 */
297
	public function insertButtonsAfter($after, $buttons) {
298
		if(func_num_args() > 2) {
299
            $buttons = func_get_args();
300
            array_shift($buttons);
301
        }
302
        if(!is_array($buttons)) {
303
            $buttons = [$buttons];
304
        }
305
		return $this->modifyButtons($after, 1, 0, $buttons);
306
	}
307
308
	/**
309
	 * Remove the first occurance of buttons
@@ 313-323 (lines=11) @@
310
	 * @param string $buttons,... one or more strings - the name of the buttons to remove
311
	 * @return null
312
	 */
313
	public function removeButtons($buttons) {
314
        if(func_num_args() > 1) {
315
            $buttons = func_get_args();
316
        }
317
        if(!is_array($buttons)) {
318
            $buttons = [$buttons];
319
        }
320
		foreach ($buttons as $button) {
321
			$this->modifyButtons($button, 0, 1);
322
		}
323
	}
324
325
	/**
326
	 * Generate the JavaScript that will set TinyMCE's configuration: