Code Duplication    Length = 8-9 lines in 2 locations

controller/admin_helper.php 1 location

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

controller/admin_controller.php 1 location

@@ 142-149 (lines=8) @@
139
140
		$hide_groups = json_decode($this->config_text->get('phpbb_ads_hide_groups'), true);
141
		$groups = $this->manager->load_groups();
142
		foreach ($groups as $group)
143
		{
144
			$this->template->assign_block_vars('groups', array(
145
				'ID'         => $group['group_id'],
146
				'NAME'       => $this->group_helper->get_name($group['group_name']),
147
				'S_SELECTED' => in_array($group['group_id'], $hide_groups),
148
			));
149
		}
150
151
		$this->template->assign_vars(array(
152
			'U_ACTION'          => $this->u_action,