Code Duplication    Length = 18-18 lines in 2 locations

mail/inc/class.mail_ui.inc.php 2 locations

@@ 511-528 (lines=18) @@
508
				//error_log(__METHOD__.__LINE__. " time used: ".$zendtime);
509
				$content[self::$nm_index]['selectedFolder'] = $this->mail_bo->profileID.self::$delimiter.(!empty($this->mail_bo->sessionData['mailbox'])?$this->mail_bo->sessionData['mailbox']:'INBOX');
510
				// since we are connected,(and selected the folder) we check for capabilities SUPPORTS_KEYWORDS to eventually add the keyword filters
511
				if ( $this->mail_bo->icServer->hasCapability('SUPPORTS_KEYWORDS'))
512
				{
513
					$this->statusTypes = array_merge($this->statusTypes,array(
514
						'keyword1'	=> 'important',//lang('important'),
515
						'keyword2'	=> 'job',	//lang('job'),
516
						'keyword3'	=> 'personal',//lang('personal'),
517
						'keyword4'	=> 'to do',	//lang('to do'),
518
						'keyword5'	=> 'later',	//lang('later'),
519
					));
520
				}
521
				else
522
				{
523
					$keywords = array('keyword1','keyword2','keyword3','keyword4','keyword5');
524
					foreach($keywords as &$k)
525
					{
526
						if (array_key_exists($k,$this->statusTypes)) unset($this->statusTypes[$k]);
527
					}
528
				}
529
530
				if (!isset($content[self::$nm_index]['foldertree'])) $content[self::$nm_index]['foldertree'] = $this->mail_bo->profileID.self::$delimiter.'INBOX';
531
				if (!isset($content[self::$nm_index]['selectedFolder'])) $content[self::$nm_index]['selectedFolder'] = $this->mail_bo->profileID.self::$delimiter.'INBOX';
@@ 4273-4290 (lines=18) @@
4270
			unset($this->searchTypes['quick']);
4271
			unset($this->searchTypes['quickwithcc']);
4272
		}
4273
		if ( $this->mail_bo->icServer->hasCapability('SUPPORTS_KEYWORDS'))
4274
		{
4275
			$this->statusTypes = array_merge($this->statusTypes,array(
4276
				'keyword1'	=> 'important',//lang('important'),
4277
				'keyword2'	=> 'job',	//lang('job'),
4278
				'keyword3'	=> 'personal',//lang('personal'),
4279
				'keyword4'	=> 'to do',	//lang('to do'),
4280
				'keyword5'	=> 'later',	//lang('later'),
4281
			));
4282
		}
4283
		else
4284
		{
4285
			$keywords = array('keyword1','keyword2','keyword3','keyword4','keyword5');
4286
			foreach($keywords as &$k)
4287
			{
4288
				if (array_key_exists($k,$this->statusTypes)) unset($this->statusTypes[$k]);
4289
			}
4290
		}
4291
4292
		$response = Api\Json\Response::get();
4293
		$response->call('app.mail.mail_refreshCatIdOptions',$this->searchTypes);