From cd1025f9cf30e4260cf0d264c360442de3b34c1a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 8 Aug 2003 16:29:34 +0000 Subject: [PATCH] 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 --- .../doc/et_media/inc/class.et_media.inc.php | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/etemplate/doc/et_media/inc/class.et_media.inc.php b/etemplate/doc/et_media/inc/class.et_media.inc.php index 307970b238..4899700a38 100644 --- a/etemplate/doc/et_media/inc/class.et_media.inc.php +++ b/etemplate/doc/et_media/inc/class.et_media.inc.php @@ -17,12 +17,6 @@ class et_media extends so_sql { - var $messages = array( - 'nothing_found' => 'Nothing matched search criteria !!!', - 'anz_found' => '%1 matches on search criteria', - 'saved' => 'Entry saved', - 'error_writeing' => 'Error: writeing !!!' - ); var $types = array( '' => 'Select one ...', 'cd' => 'Compact Disc', @@ -31,7 +25,7 @@ 'video' => 'Video Tape' ); - function et_media($lang_on_messages = True) + function et_media() { $this->tmpl = CreateObject('etemplate.etemplate','et_media.edit'); @@ -42,13 +36,6 @@ 'edit' => True, 'writeLangFile' => True ); - - if ($lang_on_messages) - { - reset($this->messages); - while (list($key,$msg) = each($this->messages)) - $this->messages[$key] = lang($msg); - } } function edit($content='',$msg = '') @@ -65,7 +52,7 @@ if (isset($content['save'])) { - $msg .= $this->messages[!$this->save() ? 'saved' : 'error_writeing']; + $msg .= !$this->save() ? lang('Entry saved') : lang('Error: writeing !!!'); } elseif (isset($content['read'])) { @@ -74,7 +61,7 @@ if (!$found) { - $msg .= $this->messages['nothing_found']; + $msg .= lang('Nothing matched search criteria !!!'); } elseif (count($found) == 1) { @@ -134,7 +121,7 @@ $entry[$row] = $data; } $content = array( - 'msg' => sprintf($this->messages['anz_found'],count($found)), + 'msg' => lang('%1 matches on search criteria',count($found)), 'entry' => $entry ); $this->tmpl->read('et_media.show'); @@ -144,15 +131,13 @@ /*! @function writeLangFile - @abstract writes langfile with all templates and messages registered here + @abstract writes langfile with all templates and types here @discussion can be called via [write Langfile] in the eTemplate editor or @discussion http://domain/phpgroupware/index.php?et_media.et_media.writeLangFile */ function writeLangFile() { - $etm = new et_media(False); // no lang on messages - - return $this->tmpl->writeLangFile('et_media','en',$etm->messages+$etm->types); + return $this->tmpl->writeLangFile('et_media','en',$this->types); } };