Source of file AutomatedLinkReport.php
Size: 1,862 Bytes - Last Modified: 2021-12-24T06:45:30+00:00
/var/www/docs.ssmods.com/process/src/code/reports/AutomatedLinkReport.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | <?php /** * Plugin: SEOToolbox * Author: Dylan Grech * Copyright: 2016 * * Automated Link Report is a report that lists all automated * links and how they affect the website */ class AutomatedLinkReport extends SS_Report{ protected $title = 'Automated Link Report'; protected $description = 'Shows a list of all automated links and how they affect the site'; // Configs private static $run_in_realtime = true; public function Title() { return (string) $this->title; } public function columns() { return array( 'Title' => array( 'title' => 'Page Title', 'link' => true, ), 'URLSegment' => 'Page URLSegment', 'OriginalLinkCount' => 'Amount of links originally', 'Links' => 'List of automated links present', 'LinkCount' => 'Amount of links created', 'TotalLinks' => 'Total Amount of links' ); } public function sourceRecords(){ if( !Config::inst()->get( $this->class, 'run_in_realtime' ) ) { return AutomatedLinkPageResult::get(); } $task = new AutomatedLinkReportTask(); return $task->checkLinks(); } public function getReportField() { $gridField = parent::getReportField(); $gridField->setModelClass('reportTotalBookings'); $gridConfig = $gridField->getConfig(); $gridConfig->removeComponentsByType('GridFieldPrintButton'); $gridConfig->removeComponentsByType('GridFieldExportButton'); $gridConfig->addComponents( new GridFieldPrintAllAutomatedLinksButton('buttons-after-left'), new GridFieldExportAllAutomatedLinksButton('buttons-after-left') ); return $gridField; } } |