Diff for /Amaya/amaya/templates.c between versions 1.143 and 1.144

version 1.143, 2007/06/05 09:32:26 version 1.144, 2007/06/08 09:53:28
Line 166  static int LoadTemplateRepositoryList (P Line 166  static int LoadTemplateRepositoryList (P
     /* The config file dont exist, create it. */      /* The config file dont exist, create it. */
     file = TtaWriteOpen ((char *)path);      file = TtaWriteOpen ((char *)path);
     fprintf (file, "http://www.w3.org/Amaya/Templates/cv.xtd\n");      fprintf (file, "http://www.w3.org/Amaya/Templates/cv.xtd\n");
       fprintf (file, "http://www.w3.org/Amaya/Templates/slides.xtd\n");
       fprintf (file, "http://www.w3.org/Amaya/Templates/ACM-Proc-Article.xtd\n");
     TtaWriteClose (file);      TtaWriteClose (file);
     /* Retry to open it.*/      /* Retry to open it.*/
     file = TtaReadOpen ((char *)path);      file = TtaReadOpen ((char *)path);
Line 327  void CreateInstanceOfTemplate (Document Line 329  void CreateInstanceOfTemplate (Document
   
   LoadTemplate (0, templatename);    LoadTemplate (0, templatename);
   DontReplaceOldDoc = dontReplace;    DontReplaceOldDoc = dontReplace;
   CreateInstance (templatename, docname);    CreateInstance (templatename, docname, doc);
 #endif /* TEMPLATES */  #endif /* TEMPLATES */
 }  }
   
Line 1221  ThotBool OptionButtonClicked (NotifyElem Line 1223  ThotBool OptionButtonClicked (NotifyElem
 void CheckTemplate (Document doc)  void CheckTemplate (Document doc)
 {  {
 #ifdef TEMPLATES  #ifdef TEMPLATES
   if (DocumentMeta[doc] && DocumentMeta[doc]->template_url &&    Element    root;
       !GetXTigerTemplate (DocumentMeta[doc]->template_url))  
     if (DocumentMeta[doc] && DocumentMeta[doc]->template_url)
     {      {
       // the template cannot be loaded        XTigerTemplate   t;
       InitConfirm (doc, 1, TtaGetMessage (AMAYA, AM_BAD_TEMPLATE));  
       TtaSetAccessRight (TtaGetRootElement (doc), ReadOnly, doc);        root = TtaGetRootElement (doc);
       TtaSetDocumentAccessMode (doc, 0); // document readonly        TtaSetAccessRight (root, ReadOnly, doc);
         t = GetXTigerTemplate (DocumentMeta[doc]->template_url);
         if (t == NULL)
           {
             // the template cannot be loaded
             InitConfirm (doc, 1, TtaGetMessage (AMAYA, AM_BAD_TEMPLATE));
             TtaSetDocumentAccessMode (doc, 0); // document readonly
           }
         else
           {
             // fix all access rights in the instance
             Template_FixAccessRight (t, root, doc);
             TtaUpdateAccessRightInViews (doc, root);
           }
     }      }
 #endif /* TEMPLATES */  #endif /* TEMPLATES */
 }  }

Removed from v.1.143  
changed lines
  Added in v.1.144


Webmaster