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