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';
@@ 4274-4291 (lines=18) @@
4271
			unset($this->searchTypes['quick']);
4272
			unset($this->searchTypes['quickwithcc']);
4273
		}
4274
		if ( $this->mail_bo->icServer->hasCapability('SUPPORTS_KEYWORDS'))
4275
		{
4276
			$this->statusTypes = array_merge($this->statusTypes,array(
4277
				'keyword1'	=> 'important',//lang('important'),
4278
				'keyword2'	=> 'job',	//lang('job'),
4279
				'keyword3'	=> 'personal',//lang('personal'),
4280
				'keyword4'	=> 'to do',	//lang('to do'),
4281
				'keyword5'	=> 'later',	//lang('later'),
4282
			));
4283
		}
4284
		else
4285
		{
4286
			$keywords = array('keyword1','keyword2','keyword3','keyword4','keyword5');
4287
			foreach($keywords as &$k)
4288
			{
4289
				if (array_key_exists($k,$this->statusTypes)) unset($this->statusTypes[$k]);
4290
			}
4291
		}
4292
4293
		$response = Api\Json\Response::get();
4294
		$response->call('app.mail.mail_refreshCatIdOptions',$this->searchTypes);