- changed the way so_sql is loaded

- modified writeLangFile to include the types and return the message
This commit is contained in:
Ralf Becker 2002-10-19 11:15:23 +00:00
parent 510dbb355e
commit 87f812451a
2 changed files with 15 additions and 15 deletions

View File

@ -12,11 +12,8 @@
/* $Id$ */
if(!isset($GLOBALS['phpgw_info']['flags']['included_classes']['so_sql']))
{
include(PHPGW_API_INC . '/../../etemplate/inc/class.so_sql.inc.php');
$GLOBALS['phpgw_info']['flags']['included_classes']['so_sql'] = True;
}
include_once(PHPGW_INCLUDE_ROOT . '/etemplate/inc/class.so_sql.inc.php');
$GLOBALS['phpgw_info']['flags']['included_classes']['so_sql'] = True; // for 0.9.14
class et_media extends so_sql
{
@ -154,7 +151,7 @@
{
$etm = new et_media(False); // no lang on messages
$this->tmpl->writeLangFile('et_media','en',$etm->messages);
return $this->tmpl->writeLangFile('et_media','en',$etm->messages+$etm->types);
}
};

View File

@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!-- $Id$ -->
<html>
<head>
<title>phpGroupware: eTemplates - Templates and Dialog-Editor</title>
<!-- $Id$ -->
<STYLE type="text/css">
<!--
pre { font-family: monospace; background-color: #e0e0e0; padding: 2mm; border-width: thin; border-style: solid; border-color: black; white-space: pre; }
@ -167,13 +167,10 @@ Create the file <b>/et_media/index.php</b> with the following content:</p>
* option) any later version. *
\**************************************************************************/</span>
<span>/* $Id$ */</span>
<span>/* $ Id: class.et_media.inc.php,v 1.2 2002/10/19 11:11:03 ralfbecker Exp $ */</span>
if(!isset($GLOBALS['phpgw_info']['flags']['included_classes']['so_sql']))
{
include(PHPGW_API_INC . '/../../etemplate/inc/class.so_sql.inc.php');
$GLOBALS['phpgw_info']['flags']['included_classes']['so_sql'] = True;
}
include_once(PHPGW_INCLUDE_ROOT . '/etemplate/inc/class.so_sql.inc.php');
$GLOBALS['phpgw_info']['flags']['included_classes']['so_sql'] = True;
</pre>
<p>This loads the class so_sql, in a way that more than one class may use it (would be nice if we had an api-function for that).</p>
@ -454,11 +451,17 @@ There are 2 possibilties to create it automaticaly:</p>
</ol>
<pre>
<span>/*!
@function writeLangFile
@abstract writes langfile with all templates and messages registered here
@discussion can be called via [write Langfile] in eTemplate editor or
@discussion http://domain/phpgroupware/index.php?et_media.et_media.writeLangFile
*/</span>
function writeLangFile()
{
$etm = new et_media(False); <span>// no lang() on messages</span>
$etm = new et_media(False); <span>// no lang on messages</span>
$this->tmpl->writeLangFile('et_media','en',$etm->messages);
return $this->tmpl->writeLangFile('et_media','en',$etm->messages+$etm->types);
}
</pre>