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';
@@ 4399-4416 (lines=18) @@
4396
			unset($this->searchTypes['quick']);
4397
			unset($this->searchTypes['quickwithcc']);
4398
		}
4399
		if ( $this->mail_bo->icServer->hasCapability('SUPPORTS_KEYWORDS'))
4400
		{
4401
			$this->statusTypes = array_merge($this->statusTypes,array(
4402
				'keyword1'	=> 'important',//lang('important'),
4403
				'keyword2'	=> 'job',	//lang('job'),
4404
				'keyword3'	=> 'personal',//lang('personal'),
4405
				'keyword4'	=> 'to do',	//lang('to do'),
4406
				'keyword5'	=> 'later',	//lang('later'),
4407
			));
4408
		}
4409
		else
4410
		{
4411
			$keywords = array('keyword1','keyword2','keyword3','keyword4','keyword5');
4412
			foreach($keywords as &$k)
4413
			{
4414
				if (array_key_exists($k,$this->statusTypes)) unset($this->statusTypes[$k]);
4415
			}
4416
		}
4417
4418
		$response = Api\Json\Response::get();
4419
		$response->call('app.mail.mail_refreshCatIdOptions',$this->searchTypes);