phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: etemplate/doc etemplate.html,1.18,1.19


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/doc etemplate.html,1.18,1.19
Date: Fri, 08 Aug 2003 12:20:18 -0400

Update of /cvsroot/phpgroupware/etemplate/doc
In directory subversions:/tmp/cvs-serv23695

Modified Files:
        etemplate.html 
Log Message:
1) partialy undoing gugux changes (label use '%s' if they want to place the 
widget within the label!)
2) useing a regular lang()-call with parameters instead of a message array, 
which got translated by the constructor


Index: etemplate.html
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/etemplate.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** etemplate.html      29 Jun 2003 17:00:05 -0000      1.18
--- etemplate.html      8 Aug 2003 16:20:16 -0000       1.19
***************
*** 1,3 ****
! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
  <!-- $Id$ -->
  <html>
--- 1,3 ----
! <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
  <!-- $Id$ -->
  <html>
***************
*** 78,86 ****
        setup_info['et_media']['depends'][] = array(
                 'appname' => 'phpgwapi',
!                'versions' => Array('0.9.13','0.9.14','0.9.15')
        );
        $setup_info['et_media']['depends'][] = array(   <span>// this is only 
necessary as long the etemplate-class is not in the api</span>
                 'appname' => 'etemplate',
!                'versions' => Array('0.9.13','0.9.14','0.9.15')
        );
  </pre>
--- 78,86 ----
        setup_info['et_media']['depends'][] = array(
                 'appname' => 'phpgwapi',
!                'versions' => Array('0.9.14','0.9.15','0.9.16')
        );
        $setup_info['et_media']['depends'][] = array(   <span>// this is only 
necessary as long the etemplate-class is not in the api</span>
                 'appname' => 'etemplate',
!                'versions' => Array('0.9.14','0.9.15','0.9.16')
        );
  </pre>
***************
*** 166,175 ****
  class et_media extends so_sql
  {
-       var $messages = array(
-               'nothing_found' => 'Nothing matched search criteria !!!',
-               'anz_found' => '%d matches on search criteria',
-               'saved' => 'Entry saved',
-               'error_writeing' => 'Error: writeing !!!'
-       );
        var $types = array(
                '' => 'Select one ...',
--- 166,169 ----
***************
*** 185,189 ****
  
  <pre>
!       function et_media($lang_on_messages = True)
        {
                $this->tmpl = 
CreateObject('etemplate.etemplate','et_media.edit');
--- 179,183 ----
  
  <pre>
!       function et_media()
        {
                $this->tmpl = 
CreateObject('etemplate.etemplate','et_media.edit');
***************
*** 196,206 ****
                        'writeLangFile' => True
                );
- 
-               if ($lang_on_messages)                  <span>// run all our 
messages throug lang</span>
-               {
-                       reset($this->messages);
-                       while (list($key,$msg) = each($this->messages))
-                               $this->messages[$key] = lang($msg);
-               }
        }
  </pre>
--- 190,193 ----
***************
*** 214,218 ****
        <li>set up / extends from so_sql the public_functions array, all 
functions called which should be called by links or as methode,
                like our callbacks, need to be listed here.
-       <li>run our messages through lang() if we are not called with False 
(see later)
  </ol>
  
--- 201,204 ----
***************
*** 230,234 ****
                        if (isset($content['save']))    <span>// save the entry 
($this->data)</span>
                        {
!                               $msg .= $this->messages[!$this->save() ? 
'saved' : 'error_writeing'];
                        }
                        elseif (isset($content['read']))
--- 216,220 ----
                        if (isset($content['save']))    <span>// save the entry 
($this->data)</span>
                        {
!                               $msg .= !$this->save() ? lang('Entry saved') : 
lang('Error: writeing !!!');
                        }
                        elseif (isset($content['read']))
***************
*** 239,243 ****
                                if (!$found)                    <span>// search 
returned empty</span>
                                {
!                                       $msg .= 
$this->messages['nothing_found'];
                                }
                                else
--- 225,229 ----
                                if (!$found)                    <span>// search 
returned empty</span>
                                {
!                                       $msg .= lang('Nothing matched search 
criteria !!!');
                                }
                                else
***************
*** 334,338 ****
                }
                $content = array(
!                       'msg' => 
sprintf($this->messages['anz_found'],count($found)),
                        'entry' => $entry               <span>// 
et_media.show.rows uses this, as we put 'entry' in the Options-field</span>
                );
--- 320,324 ----
                }
                $content = array(
!                       'msg' => lang('%d matches on search 
criteria',,count($found)),
                        'entry' => $entry               <span>// 
et_media.show.rows uses this, as we put 'entry' in the Options-field</span>
                );
***************
*** 369,373 ****
                                if (!$found)    <span>// search returned 
empty</span>
                                {
!                                       $msg .= 
$this->messages['nothing_found'];
                                }
                                elseif (count($found) == 1)             
<span>// only one match --> show it in the editor</span>
--- 355,359 ----
                                if (!$found)    <span>// search returned 
empty</span>
                                {
!                                       $msg .= lang('Nothing matched search 
criteria !!!');
                                }
                                elseif (count($found) == 1)             
<span>// only one match --> show it in the editor</span>
***************
*** 437,453 ****
        This is the function (don't forget to add it like the edit-function to 
public_functions):
  </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>
! 
!               return 
$this->tmpl->writeLangFile('et_media','en',$etm->messages+$etm->types);
        }
  </pre>
--- 423,437 ----
        This is the function (don't forget to add it like the edit-function to 
public_functions):
  </ol>
+ <p>Anyway we have to use the TranslationTools to find and write the 
lang()-messages of our code!</p>
  
  <pre>
        <span>/*!
        @function writeLangFile
!       @abstract writes langfile with all templates registered here
!       @discussion can be called via [write Langfile] in eTemplate editor
        */</span>
        function writeLangFile()
        {
!               return $this->tmpl->writeLangFile('et_media','en',$this->types);
        }
  </pre>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]