Code Duplication    Length = 28-28 lines in 3 locations

modules/calendar.php 1 location

@@ 539-566 (lines=28) @@
536
			break;
537
538
			// Delete link
539
			case 'delete':
540
541
				if (!isset($link_id) && $link_id >= sizeof($events))
542
				{
543
					trigger_error($this->user->lang['NO_EVENT'] . adm_back_link($u_action), E_USER_WARNING);
544
				}
545
546
				if (confirm_box(true))
547
				{
548
					$cur_event_title = $events[$link_id]['title'];
549
					// delete the selected link and reset the array numbering afterwards
550
					array_splice($events, $link_id, 1);
551
					$events = array_merge($events);
552
553
					$board3_events_array = json_encode($events);
554
					set_portal_config('board3_calendar_events_' . $module_id, $board3_events_array);
555
556
					$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_REMOVED', false, array($cur_event_title));
557
				}
558
				else
559
				{
560
					confirm_box(false, $this->user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
561
						'link_id'	=> $link_id,
562
						'action'	=> 'delete',
563
					)));
564
				}
565
566
			break;
567
568
			// Edit or add menu item
569
			case 'edit':

modules/links.php 1 location

@@ 330-357 (lines=28) @@
327
			break;
328
329
			// Delete link
330
			case 'delete':
331
332
				if (!isset($link_id) && $link_id >= sizeof($links))
333
				{
334
					trigger_error($this->user->lang['MUST_SELECT_LINK'] . adm_back_link($u_action), E_USER_WARNING);
335
				}
336
337
				if (confirm_box(true))
338
				{
339
					$cur_link_title = $links[$link_id]['title'];
340
					// delete the selected link and reset the array numbering afterwards
341
					array_splice($links, $link_id, 1);
342
					$links = array_merge($links);
343
344
					$board3_links_array = json_encode($links);
345
					set_portal_config('board3_links_array_' . $module_id, $board3_links_array);
346
347
					$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_REMOVED', false, array($cur_link_title));
348
				}
349
				else
350
				{
351
					confirm_box(false, $this->user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
352
						'link_id'	=> $link_id,
353
						'action'	=> 'delete',
354
					)));
355
				}
356
357
			break;
358
359
			// Move items up or down
360
			case 'move_up':

modules/main_menu.php 1 location

@@ 390-417 (lines=28) @@
387
			break;
388
389
			// Delete link
390
			case 'delete':
391
392
				if (!isset($link_id) && $link_id >= sizeof($links))
393
				{
394
					trigger_error($this->user->lang['MUST_SELECT_LINK'] . adm_back_link($u_action), E_USER_WARNING);
395
				}
396
397
				if (confirm_box(true))
398
				{
399
					$cur_link_title = $links[$link_id]['title'];
400
					// delete the selected link and reset the array numbering afterwards
401
					array_splice($links, $link_id, 1);
402
					$links = array_merge($links);
403
404
					$board3_menu_array = json_encode($links);
405
					set_portal_config('board3_menu_array_' . $module_id, $board3_menu_array);
406
407
					$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_REMOVED', false, array($cur_link_title));
408
				}
409
				else
410
				{
411
					confirm_box(false, $this->user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
412
						'link_id'	=> $link_id,
413
						'action'	=> 'delete',
414
					)));
415
				}
416
417
			break;
418
419
			// Move items up or down
420
			case 'move_up':