version 1.107, 2007/01/31 11:58:12
|
version 1.108, 2007/01/31 13:37:15
|
Line 61 ThotBool IsTemplateInstanceDocument(Docu
|
Line 61 ThotBool IsTemplateInstanceDocument(Docu
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
AllocTemplateRepositoryListElement: alloc an element for the list of template repositories. |
AllocTemplateRepositoryListElement: allocates an element for the list |
|
of template repositories. |
path : path of the new element |
path : path of the new element |
return : address of the new element |
return : address of the new element |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
Line 288 void NewTemplate (Document doc, View vie
|
Line 289 void NewTemplate (Document doc, View vie
|
#endif /* TEMPLATES */ |
#endif /* TEMPLATES */ |
} |
} |
|
|
|
/*---------------------------------------------------------------------- |
|
Load a template and create the instance file - update images and |
|
stylesheets related to the template. |
|
----------------------------------------------------------------------*/ |
|
void CreateInstanceOfTemplate (Document doc, char *templatename, char *docname) |
|
{ |
|
#ifdef TEMPLATES |
|
|
|
char *s; |
|
ThotBool dontReplace = DontReplaceOldDoc; |
|
|
|
if (!IsW3Path (docname) && TtaFileExist (docname)) |
|
{ |
|
s = (char *)TtaGetMemory (strlen (docname) + |
|
strlen (TtaGetMessage (AMAYA, AM_OVERWRITE_CHECK)) + 2); |
|
sprintf (s, TtaGetMessage (AMAYA, AM_OVERWRITE_CHECK), docname); |
|
InitConfirm (0, 0, s); |
|
TtaFreeMemory (s); |
|
if (!UserAnswer) |
|
return; |
|
} |
|
|
|
LoadTemplate (0, templatename); |
|
DontReplaceOldDoc = dontReplace; |
|
CreateInstance (templatename, docname); |
|
|
|
#endif /* TEMPLATES */ |
|
} |
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
PreventReloadingTemplate |
PreventReloadingTemplate |
Line 952 ThotBool OptionButtonClicked (NotifyElem
|
Line 982 ThotBool OptionButtonClicked (NotifyElem
|
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
|
OpeningInstance checks if it is a template instance needs. |
|
If it's an instance and the template is not loaded, load it into a |
|
temporary file |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
void OpeningInstance (char *fileName, Document doc) |
void OpeningInstance (char *fileName, Document doc) |
{ |
{ |
Line 1015 void OpeningInstance (char *fileName, Do
|
Line 1048 void OpeningInstance (char *fileName, Do
|
t = (XTigerTemplate) Dictionary_Get (Templates_Dic, content); |
t = (XTigerTemplate) Dictionary_Get (Templates_Dic, content); |
if (!t) |
if (!t) |
{ |
{ |
LoadTemplate (0, content, fileName); |
LoadTemplate (doc, content); |
t = (XTigerTemplate) Dictionary_Get (Templates_Dic, content); |
t = (XTigerTemplate) Dictionary_Get (Templates_Dic, content); |
} |
} |
AddUser (t); |
AddUser (t); |