Code Duplication    Length = 8-9 lines in 3 locations

code/Controllers/CMSMain.php 3 locations

@@ 335-342 (lines=8) @@
332
        return $this->Link('treeview');
333
    }
334
335
    public function LinkPageEdit($id = null)
336
    {
337
        if (!$id) {
338
            $id = $this->currentPageID();
339
        }
340
        return $this->LinkWithSearch(
341
            Controller::join_links(CMSPageEditController::singleton()->Link('show'), $id)
342
        );
343
    }
344
345
    public function LinkPageSettings()
@@ 345-353 (lines=9) @@
342
        );
343
    }
344
345
    public function LinkPageSettings()
346
    {
347
        if ($id = $this->currentPageID()) {
348
            return $this->LinkWithSearch(
349
                Controller::join_links(CMSPageSettingsController::singleton()->Link('show'), $id)
350
            );
351
        } else {
352
            return null;
353
        }
354
    }
355
356
    public function LinkPageHistory()
@@ 356-364 (lines=9) @@
353
        }
354
    }
355
356
    public function LinkPageHistory()
357
    {
358
        if ($id = $this->currentPageID()) {
359
            return $this->LinkWithSearch(
360
                Controller::join_links(CMSPageHistoryController::singleton()->Link('show'), $id)
361
            );
362
        } else {
363
            return null;
364
        }
365
    }
366
367
    /**