# ----------------------------------------------------------------
# Plugin for PreCreateForm()
sub PreCreateForm()
{

   $bIsAnon = $oSessionGL->getState("IsAnonymous");

   if($bIsAnon)
   {
      &MySetVal("State Init", "BtnNew", "-");
      &MySetVal("State Init", "BtnDef", "-");
      &MySetVal("Layout Label comment", "Text",
                b(i18n("Please note that anonymous users " .
                       "can't change any settings.")));
   }

   if(&GetAttr("LastBtn") ne "BtnNew")
   {
      foreach (split ", ", &MyVal("Data", "ExtraFields"))
      {
         &SetField("$_", $oSessionGL->getState($_));
      }
   }

   return;
}



# ----------------------------------------------------------------
# Plugin for MyBtnNew()
sub MyBtnNew()
{

   foreach (split ", ", &MyVal("Data", "ExtraFields"))
   {
      $oSessionGL->setState("$_", &GetField("$_"));
   }

   &OkForm("", i18n("Attributes saved!"));

   &MyExit();
   return;
}


1;
