/**
* @service theme write
*/
public function revertFile(Gpf_Rpc_Params $params) {
$action = new Gpf_Rpc_Action($params);
try{
$themeId = $action->getParam('themeId');
$itemId = $action->getParam("Id");
$themeBase = $this->getThemeFile($action->getParam('panelName'));
$file_original = new Gpf_Io_File($themeBase.'/'.Gpf_Paths::DEFAULT_THEME.$itemId);
$file_new = new Gpf_Io_File($themeBase.'/'.$themeId.$itemId);
if($file_original->isExists() && $file_new->isExists()){
if(!$file_new->delete()){
throw new Gpf_Exception(_("Revert of file has failed"));
}else{
$action->setInfoMessage(_("Revert of file success"));
}
}else{
$action->setInfoMessage(_("This file cannot be reverted"));
}
$action->addOk();
}catch (Gpf_Exception $e){
$action->addError();
$action->setErrorMessage($e->getMessage());
}
return $action;
}