Code Duplication    Length = 17-17 lines in 9 locations

app/Module/HtmlBlockModule.php 1 location

@@ 104-120 (lines=17) @@
101
			$content .= '<br>' . FunctionsDate::formatTimestamp($this->getBlockSetting($block_id, 'timestamp', WT_TIMESTAMP) + WT_TIMESTAMP_OFFSET);
102
		}
103
104
		if ($template) {
105
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
106
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
107
			} else {
108
				$config_url = '';
109
			}
110
111
			return View::make('blocks/template', [
112
				'block'      => str_replace('_', '-', $this->getName()),
113
				'id'         => $block_id,
114
				'config_url' => $config_url,
115
				'title'      => $title,
116
				'content'    => $content,
117
			]);
118
		} else {
119
			return $content;
120
		}
121
	}
122
123
	/** {@inheritdoc} */

app/Module/OnThisDayModule.php 1 location

@@ 83-99 (lines=17) @@
80
				break;
81
		}
82
83
		if ($template) {
84
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
85
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
86
			} else {
87
				$config_url = '';
88
			}
89
90
			return View::make('blocks/template', [
91
				'block'      => str_replace('_', '-', $this->getName()),
92
				'id'         => $block_id,
93
				'config_url' => $config_url,
94
				'title'      => $this->getTitle(),
95
				'content'    => $content,
96
			]);
97
		} else {
98
			return $content;
99
		}
100
	}
101
102
	/** {@inheritdoc} */

app/Module/UpcomingAnniversariesModule.php 1 location

@@ 90-106 (lines=17) @@
87
				break;
88
		}
89
90
		if ($template) {
91
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
92
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
93
			} else {
94
				$config_url = '';
95
			}
96
97
			return View::make('blocks/template', [
98
				'block'      => str_replace('_', '-', $this->getName()),
99
				'id'         => $block_id,
100
				'config_url' => $config_url,
101
				'title'      => $this->getTitle(),
102
				'content'    => $content,
103
			]);
104
		} else {
105
			return $content;
106
		}
107
	}
108
109
	/** {@inheritdoc} */

app/Module/ReviewChangesModule.php 1 location

@@ 135-151 (lines=17) @@
132
			}
133
			$content .= '</ul>';
134
135
			if ($template) {
136
				if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
137
					$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
138
				} else {
139
					$config_url = '';
140
				}
141
142
				return View::make('blocks/template', [
143
					'block'      => str_replace('_', '-', $this->getName()),
144
					'id'         => $block_id,
145
					'config_url' => $config_url,
146
					'title'      => $this->getTitle(),
147
					'content'    => $content,
148
				]);
149
			} else {
150
				return $content;
151
			}
152
		}
153
154
		return '';

app/Module/TopPageViewsModule.php 1 location

@@ 98-114 (lines=17) @@
95
		}
96
		$content .= '</table>';
97
98
		if ($template) {
99
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
100
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
101
			} else {
102
				$config_url = '';
103
			}
104
105
			return View::make('blocks/template', [
106
				'block'      => str_replace('_', '-', $this->getName()),
107
				'id'         => $block_id,
108
				'config_url' => $config_url,
109
				'title'      => $this->getTitle(),
110
				'content'    => $content,
111
			]);
112
		} else {
113
			return $content;
114
		}
115
	}
116
117
	/**

app/Module/ResearchTaskModule.php 1 location

@@ 101-117 (lines=17) @@
98
			$content = View::make('blocks/research-tasks', ['tasks' => $tasks]);
99
		}
100
101
		if ($template) {
102
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
103
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
104
			} else {
105
				$config_url = '';
106
			}
107
108
			return View::make('blocks/template', [
109
				'block'      => str_replace('_', '-', $this->getName()),
110
				'id'         => $block_id,
111
				'config_url' => $config_url,
112
				'title'      => $this->getTitle(),
113
				'content'    => $content,
114
			]);
115
		} else {
116
			return $content;
117
		}
118
	}
119
120
	/** {@inheritdoc} */

app/Module/FamilyTreeStatisticsModule.php 1 location

@@ 124-140 (lines=17) @@
121
			'surnames'             => $surnames,
122
		]);
123
124
		if ($template) {
125
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
126
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
127
			} else {
128
				$config_url = '';
129
			}
130
131
			return View::make('blocks/template', [
132
				'block'      => str_replace('_', '-', $this->getName()),
133
				'id'         => $block_id,
134
				'config_url' => $config_url,
135
				'title'      => $this->getTitle(),
136
				'content'    => $content,
137
			]);
138
		} else {
139
			return $content;
140
		}
141
	}
142
143
	/** {@inheritdoc} */

app/Module/YahrzeitModule.php 1 location

@@ 209-225 (lines=17) @@
206
			break;
207
		}
208
209
		if ($template) {
210
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
211
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
212
			} else {
213
				$config_url = '';
214
			}
215
216
			return View::make('blocks/template', [
217
				'block'      => str_replace('_', '-', $this->getName()),
218
				'id'         => $block_id,
219
				'config_url' => $config_url,
220
				'title'      => $this->getTitle(),
221
				'content'    => $content,
222
			]);
223
		} else {
224
			return $content;
225
		}
226
	}
227
228
	/** {@inheritdoc} */

app/Module/SlideShowModule.php 1 location

@@ 124-140 (lines=17) @@
121
			$content = I18N::translate('This family tree has no images to display.');
122
		}
123
124
		if ($template) {
125
			if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) {
126
				$config_url = Html::url('block_edit.php', ['block_id' => $block_id, 'ged' => $WT_TREE->getName()]);
127
			} else {
128
				$config_url = '';
129
			}
130
131
			return View::make('blocks/template', [
132
				'block'      => str_replace('_', '-', $this->getName()),
133
				'id'         => $block_id,
134
				'config_url' => $config_url,
135
				'title'      => $this->getTitle(),
136
				'content'    => $content,
137
			]);
138
		} else {
139
			return $content;
140
		}
141
	}
142
143
	/** {@inheritdoc} */