Code Duplication    Length = 8-9 lines in 2 locations

controller/admin_helper.php 1 location

@@ 101-109 (lines=9) @@
98
	 */
99
	public function assign_locations($ad_locations = false)
100
	{
101
		foreach ($this->location_manager->get_all_locations() as $location_id => $location_data)
102
		{
103
			$this->template->assign_block_vars('ad_locations', array(
104
				'LOCATION_ID'   => $location_id,
105
				'LOCATION_DESC' => $location_data['desc'],
106
				'LOCATION_NAME' => $location_data['name'],
107
				'S_SELECTED'    => $ad_locations ? in_array($location_id, $ad_locations) : false,
108
			));
109
		}
110
	}
111
112
	/**

controller/admin_controller.php 1 location

@@ 135-142 (lines=8) @@
132
133
		$hide_groups = json_decode($this->config_text->get('phpbb_ads_hide_groups'), true);
134
		$groups = $this->manager->load_groups();
135
		foreach ($groups as $group)
136
		{
137
			$this->template->assign_block_vars('groups', array(
138
				'ID'         => $group['group_id'],
139
				'NAME'       => $this->group_helper->get_name($group['group_name']),
140
				'S_SELECTED' => in_array($group['group_id'], $hide_groups),
141
			));
142
		}
143
144
		$this->template->assign_vars(array(
145
			'U_ACTION'          => $this->u_action,