'Checked', 'Link' => 'External Link', 'HTTPCode' => 'HTTP Error Code', 'PageLink' => array( 'title' => 'Page link is on', 'link' => true ), ); public function init() { parent::init(); } /** * Returns the report title * * @return string */ public function title() { return _t('ExternalBrokenLinksReport.EXTERNALBROKENLINKS',"External broken links report"); } /** * Returns the column names of the report * * @return array */ public function columns() { return self::$columns; } /** * Alias of columns(), to support the export to csv action * in {@link GridFieldExportButton} generateExportFileData method. * @return array */ public function getColumns() { return $this->columns(); } public function sourceRecords() { $returnSet = new ArrayList(); $links = BrokenExternalLink::get(); foreach ($links as $link) { $link->PageLink = $link->Page()->Title; $returnSet->push($link); } return $returnSet; } public function getCMSFields() { Requirements::javascript('externallinks/javascript/BrokenExternalLinksReport.js'); $fields = parent::getCMSFields(); $reportResultSpan = '

'; $reportResult = new LiteralField('ResultTitle', $reportResultSpan); $fields->push($reportResult); $button = ''; $runReportButton = new LiteralField( 'runReport', sprintf( $button, _t('ExternalBrokenLinksReport.RUNREPORT', 'Create new report') ) ); $fields->push($runReportButton); return $fields; } }