Source of file WidgetPageWidgetArea.php
Size: 1,053 Bytes - Last Modified: 2021-12-23T11:00:36+00:00
/var/www/docs.ssmods.com/process/src/code/WidgetPageWidgetArea.php
12345678910111213141516171819202122232425262728293031323334353637383940 | <?php /** * Extension for widgets/WidgetArea */ class WidgetPageWidgetArea extends DataExtension { private static $many_many = array( 'ManyWidgets' => 'Widget' ); private static $many_many_extraFields = array( 'ManyWidgets' => array( 'WidgetAreaSort' => 'Int' ) ); public function SortedWidgets($filtered=true) { $retVal = $this->owner->ManyWidgets()->sort('WidgetAreaSort'); if ($filtered && $retVal->count() > 0) { $retVal = $retVal->filter(array('Enabled' => 1)); } return $retVal; } public function SortedWidgetsOld() { if ($this->owner->InheritWidgets == 0) { return $this->owner->Widgets()->sort('PageSort'); } else { if ($this->owner->ParentID == 0 || !$this->owner->getParent()->hasExtension('WidgetPage')) { return null; } else { return $this->owner->getParent()->SortedWidgets(false); } } } } |