Code Duplication    Length = 8-9 lines in 3 locations

code/Controllers/CMSMain.php 3 locations

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