Example #1
0
 /**
  * Proxy function that receives all interaction with the desktop and updates the internal data.
  * This function should be called by your controller on whatever feedback  you get from the desktop (resize, move etc).
  * Please configure eventUrl to the correct route so the javascript can call your controller action
  *
  * @return bool      true if data has changed, false if not (on true you might want to save the desktop)
  */
 public function event()
 {
     $request = \Yii::$app->request;
     $type = $request->post('action');
     $application = $this->findApplicationById(Application::toRegularId($request->post('application')));
     if ($application && $application->canHandleEvent($type)) {
         return $application->event($request->post());
     }
     $shortcut = $this->findShortcutById($request->post('shortcut'));
     if ($shortcut && $shortcut->canHandleEvent($type)) {
         return $shortcut->event($request->post());
     }
     return false;
 }