<?php

class WidgetExtension extends DataObjectDecorator {

	function onBeforeWrite() {
		parent::onBeforeWrite();

		// Set locale from the currently choosen language locale 
		if ($this->owner->Locale != Translatable::get_current_locale()) {
			$this->owner->Locale = Translatable::get_current_locale();
		}
	}
    
    /*
     * Return Class Name of Current Page
     * @return ClassName string
     */
    public function currentPageClassOther() {
 
        $page = Director::currentPage();
        if($page) {
            return $page->ClassName;
        }
        return false;
    }
   

}