Code Duplication    Length = 8-9 lines in 3 locations

code/Controllers/CMSMain.php 3 locations

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