/**
  * set_preferred_pagelayout
  *
  * @param xxx $PAGE
  */
 public function set_preferred_pagelayout($PAGE)
 {
     // page layouts are defined in theme/xxx/config.php
     switch ($this->navigation) {
         case self::NAVIGATION_ORIGINAL:
         case self::NAVIGATION_NONE:
             // $PAGE->set_pagelayout('popup');
             $PAGE->set_pagelayout('embedded');
             break;
         case self::NAVIGATION_FRAME:
         case self::NAVIGATION_EMBED:
             $framename = optional_param('framename', '', PARAM_ALPHA);
             if ($framename == 'top') {
                 $PAGE->set_pagelayout('frametop');
             }
             if ($framename == 'main') {
                 $PAGE->set_pagelayout('embedded');
             }
             break;
         case self::NAVIGATION_TOPBAR:
             $PAGE->set_pagelayout('login');
             // no nav menu
             break;
     }
 }