/** * Return fake-ID "root" if no ID is found (needed to upload files into the root-folder) */ public function currentPageID() { return ($result = parent::currentPageID()) === null ? 0 : $result; }
public function currentPageID() { $id = parent::currentPageID(); $this->extend('updateCurrentPageID', $id); // Fall back to homepage record if (!$id) { $homepageSegment = RootURLController::get_homepage_link(); $homepageRecord = DataObject::get_one('SiteTree', sprintf('"SiteTree"."URLSegment" = \'%s\'', Convert::raw2sql($homepageSegment))); if ($homepageRecord) { $id = $homepageRecord->ID; } } return $id; }
public function currentPageID() { $id = parent::currentPageID(); $this->extend('updateCurrentPageID', $id); return $id; }
public function currentPageID() { $id = parent::currentPageID(); // Fall back to homepage record if (!$id) { $homepageSegment = RootURLController::get_homepage_link(); $homepageRecord = DataObject::get_one('SiteTree', sprintf('"URLSegment" = \'%s\'', $homepageSegment)); if ($homepageRecord) { $id = $homepageRecord->ID; } } return $id; }
function currentPageID() { $id = parent::currentPageID(); $reports = SS_Report::get_reports('ReportAdmin'); return isset($reports[$id]) ? $reports[$id] : null; }