Code Duplication    Length = 8-9 lines in 3 locations

code/Controllers/CMSMain.php 3 locations

@@ 304-311 (lines=8) @@
301
        return $this->LinkWithSearch(CMSMain::singleton()->Link('listview'));
302
    }
303
304
    public function LinkPageEdit($id = null)
305
    {
306
        if (!$id) {
307
            $id = $this->currentPageID();
308
        }
309
        return $this->LinkWithSearch(
310
            Controller::join_links(CMSPageEditController::singleton()->Link('show'), $id)
311
        );
312
    }
313
314
    public function LinkPageSettings()
@@ 314-322 (lines=9) @@
311
        );
312
    }
313
314
    public function LinkPageSettings()
315
    {
316
        if ($id = $this->currentPageID()) {
317
            return $this->LinkWithSearch(
318
                Controller::join_links(CMSPageSettingsController::singleton()->Link('show'), $id)
319
            );
320
        } else {
321
            return null;
322
        }
323
    }
324
325
    public function LinkPageHistory()
@@ 325-333 (lines=9) @@
322
        }
323
    }
324
325
    public function LinkPageHistory()
326
    {
327
        if ($id = $this->currentPageID()) {
328
            return $this->LinkWithSearch(
329
                Controller::join_links(CMSPageHistoryController::singleton()->Link('show'), $id)
330
            );
331
        } else {
332
            return null;
333
        }
334
    }
335
336
    public function LinkWithSearch($link)