Source: site.view [edit]
Function name: resetDefaultContent
Arguments: dataFunction
Description: Resets contents of "dataFunction" function to the default content, stored in 'dataFunction' + "Default" (e.g. resetDefaultContent(myPortletData) overwrites myPortletData with contents of myPortletDataDefault)
Page type: webl
Render function:  
Module: site

Page source:

var pdInfo = Wub_GetFunctionInfo(dataFunction);
var pddInfo = Wub_GetFunctionInfo(dataFunction + "Default");
if (pdInfo == nil) then
   "Error: function '" + dataFunction+ "' not found."
elsif (pddInfo == nil) then
   "Error: default content for function '" + dataFunction + "' not found in '" + dataFunction + "Default'."
else
   var data = (WubEval(pdInfo.exec) ? nil);
   if (!data.editable ? true) then
      "Error: '" + dataFunction + "' does not appear to be editable." 
   else
      pdInfo.exec := pddInfo.exec;
      Wub_SaveFunctionInfo(pdInfo)
   end
end;