Code Duplication    Length = 8-9 lines in 3 locations

code/Controllers/CMSMain.php 3 locations

@@ 315-322 (lines=8) @@
312
        return $this->LinkWithSearch(CMSMain::singleton()->Link('listview'));
313
    }
314
315
    public function LinkPageEdit($id = null)
316
    {
317
        if (!$id) {
318
            $id = $this->currentPageID();
319
        }
320
        return $this->LinkWithSearch(
321
            Controller::join_links(CMSPageEditController::singleton()->Link('show'), $id)
322
        );
323
    }
324
325
    public function LinkPageSettings()
@@ 325-333 (lines=9) @@
322
        );
323
    }
324
325
    public function LinkPageSettings()
326
    {
327
        if ($id = $this->currentPageID()) {
328
            return $this->LinkWithSearch(
329
                Controller::join_links(CMSPageSettingsController::singleton()->Link('show'), $id)
330
            );
331
        } else {
332
            return null;
333
        }
334
    }
335
336
    public function LinkPageHistory()
@@ 336-344 (lines=9) @@
333
        }
334
    }
335
336
    public function LinkPageHistory()
337
    {
338
        if ($id = $this->currentPageID()) {
339
            return $this->LinkWithSearch(
340
                Controller::join_links(CMSPageHistoryController::singleton()->Link('show'), $id)
341
            );
342
        } else {
343
            return null;
344
        }
345
    }
346
347
    public function LinkWithSearch($link)