exposeMethod('toggleLeftPanel'); } function process(Vtiger_Request $request) { $mode = $request->get('mode'); if(!empty($mode)) { $this->invokeExposedMethod($mode, $request); return; } } public function toggleLeftPanel (Vtiger_Request $request) { $currentUser = Users_Record_Model::getCurrentUserModel(); $currentUser->set('leftpanelhide',$request->get('showPanel')); $currentUser->leftpanelhide = $request->get('showPanel'); $currentUser->set('mode','edit'); $response = new Vtiger_Response(); try{ $currentUser->save(); $response->setResult(array('success'=>true)); }catch(Exception $e){ $response->setError($e->getCode(),$e->getMessage()); } $response->emit(); } }