Code Duplication    Length = 8-9 lines in 3 locations

code/Controllers/CMSMain.php 3 locations

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