public function onAfterWrite() {
		if(!$this->owner->HasConfiguredDashboard && !$this->owner->DashboardPanels()->exists()) {
			foreach(SiteConfig::current_site_config()->DashboardPanels() as $p) {
				$clone = $p->duplicate();
				$clone->SiteConfigID = 0;
				$clone->MemberID = $this->owner->ID;
				$clone->write();
			}

			DB::query("UPDATE \"Member\" SET \"HasConfiguredDashboard\" = 1 WHERE \"ID\" = {$this->owner->ID}");
			$this->owner->flushCache();
		}
	}
public function onAfterWrite() {
		if(!$this->owner->HasConfiguredDashboard && !$this->owner->DashboardPanels()->exists()) {
			foreach(SiteConfig::current_site_config()->DashboardPanels() as $p) {
				$clone = $p->duplicate();
				$clone->SiteConfigID = 0;
				$clone->MemberID = $this->owner->ID;
				$clone->write();
			}

			DB::query("UPDATE \"Member\" SET \"HasConfiguredDashboard\" = 1 WHERE \"ID\" = {$this->owner->ID}");
			$this->owner->flushCache();
		}
	}
public function onAfterWrite ( ) { if ( ! $ this -> owner -> HasConfiguredDashboard && ! $ this -> owner -> DashboardPanels ( ) -> exists ( ) ) { foreach ( SiteConfig :: current_site_config ( ) -> DashboardPanels ( ) as $ p ) { $ clone = $ p -> duplicate ( ) ; $ clone -> SiteConfigID = 0 ; $ clone -> MemberID = $ this -> owner -> ID ; $ clone -> write ( ) ; } DB :: query ( "UPDATE \"Member\" SET \"HasConfiguredDashboard\" = 1 WHERE \"ID\" = {$this->owner->ID}" ) ; $ this -> owner -> flushCache ( ) ; } }
Ensures that new members get the default dashboard configuration. Once it has been applied,
make sure this doesn't happen again, if for some reason a user insists on having an empty
dashboard.
Ensures that new members get the default dashboard configuration . Once it has been applied make sure this doesn t happen again if for some reason a user insists on having an empty dashboard .