Code Duplication    Length = 8-9 lines in 3 locations

code/Controllers/CMSMain.php 3 locations

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