r373: Register language phrases
authorRobert Sesek <rsesek@bluestatic.org>
Thu, 25 Aug 2005 01:22:33 +0000 (01:22 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Thu, 25 Aug 2005 01:22:33 +0000 (01:22 +0000)
24 files changed:
admin/autoaction.php
admin/field.php
admin/global.php
admin/index.php
admin/jump.php
admin/language.php
admin/product.php
admin/setting.php
admin/severity.php
admin/status.php
admin/usergroup.php
attachment.php
editcomment.php
editreport.php
favourite.php
login.php
newcomment.php
newreport.php
register.php
search.php
showhistory.php
showreport.php
viewattachment.php
vote.php

index da70d2b6f30f6a48c4583ce02fe01e6b586e0673..710b4f06137f70b40bee184210fbc142403dd497 100644 (file)
@@ -49,7 +49,7 @@ if ($_REQUEST['do'] == 'delete')
                $admin->error(lang::p('error_invalid_id'));
        }
        
-       $admin->page_confirm('Are you sure you want to delete this action?', "autoaction.php?do=kill&amp;actionid=$action[actionid]");
+       $admin->page_confirm(lang::r('Are you sure you want to delete this action?'), "autoaction.php?do=kill&amp;actionid=$action[actionid]");
 }
 
 // ###################################################################
@@ -58,7 +58,7 @@ if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update')
 {
        if (empty($bugsys->in['name']))
        {
-               $admin->error('You need to specify a name for this action.');
+               $admin->error(lang::r('You need to specify a name for this action.'));
        }
        
        foreach ($bugsys->in['fields'] AS $key => $value)
@@ -79,7 +79,7 @@ if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update')
        
        if (count($deltas['custom']) < 1 AND count($deltas['builtin']) < 1)
        {
-               $admin->error('You need to specify some fields to change.');
+               $admin->error(lang::r('You need to specify some fields to change.'));
        }
        
        if ($_POST['do'] == 'insert')
@@ -132,7 +132,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                $action['fields'] = unserialize($action['fieldchanges']);
        }
 
-       $admin->page_start((($add) ? 'New Automatic Action' : 'Edit Auto Action'));
+       $admin->page_start(lang::r((($add) ? 'New Automatic Action' : 'Edit Auto Action')));
        
        $admin->form_start('autoaction.php', (($add) ? 'insert' : 'update'));
        
@@ -142,27 +142,27 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        }
        
        $admin->table_start();
-       $admin->table_head((($add) ? 'New Automatic Action' : 'Edit Auto Action'));
+       $admin->table_head(lang::r((($add) ? 'New Automatic Action' : 'Edit Auto Action')));
        
-       $admin->row_input('Name', 'name', $action['name']);
-       $admin->row_textarea('Description', 'description', $action['description']);
-       $admin->row_textarea('Add Comment', 'comment', $action['comment']);
+       $admin->row_input(lang::r('Name'), 'name', $action['name']);
+       $admin->row_textarea(lang::r('Description'), 'description', $action['description']);
+       $admin->row_textarea(lang::r('Add Comment'), 'comment', $action['comment']);
        
        $admin->row_span('Field Changes', 'thead', 'center');
                
        // -------------------------------------------------------------------
        // built-in fields      
        construct_datastore_select('severity', 'severity', 'severityid', $action['fields']['builtin']['severity'], true, true);
-       $admin->row_list('Severity', 'fields[severity]');
+       $admin->row_list(lang::r('Severity'), 'fields[severity]');
        
        construct_datastore_select('priority', 'priority', 'priorityid', $action['fields']['builtin']['priority'], true, true);
-       $admin->row_list('Priority', 'fields[priority]');
+       $admin->row_list(lang::r('Priority'), 'fields[priority]');
        
        construct_datastore_select('status', 'status', 'statusid', $action['fields']['builtin']['status'], true, true);
-       $admin->row_list('Status', 'fields[status]');
+       $admin->row_list(lang::r('Status'), 'fields[status]');
        
        construct_datastore_select('resolution', 'resolution', 'resolutionid', $action['fields']['builtin']['resolution'], true, true);
-       $admin->row_list('Resolution', 'fields[resolution]');
+       $admin->row_list(lang::r('Resolution'), 'fields[resolution]');
        
        $admin->row_span('', 'tcat', 'center');
        
@@ -187,8 +187,8 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                        
                        case 'input_checkbox':
                                $admin->list_item('', 0, ((!$action['fields']['custom']["$field[fieldid]"]) ? true : false));
-                               $admin->list_item('Checked', 1, (($action['fields']['custom']["$field[fieldid]"] == 1) ? true : false));
-                               $admin->list_item('Un-Checked', 2, (($action['fields']['custom']["$field[fieldid]"] == 2) ? true : false));
+                               $admin->list_item(lang::r('Checked'), 1, (($action['fields']['custom']["$field[fieldid]"] == 1) ? true : false));
+                               $admin->list_item(lang::r('Un-Checked'), 2, (($action['fields']['custom']["$field[fieldid]"] == 2) ? true : false));
                                $admin->row_list($field['name'], "fields[custom][$field[fieldid]]");
                        break;
                        
@@ -218,18 +218,18 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start('Automatic Actions');
+       $admin->page_start(lang::r('Automatic Actions'));
        
        $admin->table_start();
-       $admin->table_head('Automatic Actions');
+       $admin->table_head(lang::r('Automatic Actions'));
        
        $actions = $db->query("SELECT * FROM " . TABLE_PREFIX . "autoaction ORDER BY name ASC");
        while ($action = $db->fetch_array($actions))
        {
-               $admin->row_text($action['name'] . "\n<div class=\"smallfont\">$action[description]</div>", "<a href=\"autoaction.php?do=edit&amp;actionid=$action[actionid]\">[Edit]</a> <a href=\"autoaction.php?do=delete&amp;actionid=$action[actionid]\">[Delete]</a>");
+               $admin->row_text($action['name'] . "\n<div class=\"smallfont\">$action[description]</div>", "<a href=\"autoaction.php?do=edit&amp;actionid=$action[actionid]\">[" . lang::r('Edit') . "]</a> <a href=\"autoaction.php?do=delete&amp;actionid=$action[actionid]\">[" . lang::r('Delete') . "]</a>");
        }
        
-       $admin->row_span('<a href="autoaction.php?do=add">[Add New Action]</a>', 'tfoot', 'center', 3);
+       $admin->row_span('<a href="autoaction.php?do=add">[' . lang::r('Add New Action') . ']</a>', 'tfoot', 'center', 3);
        $admin->table_end();
        
        $admin->page_end();
index a8091fd22d73f5b9b2763e640a6cd9b2b19c2fce..5afe91e2cc4454fb7a7112d071119394ef044fdf 100644 (file)
@@ -18,9 +18,9 @@ if (!can_perform('canadminfields'))
 }
 
 $TYPES = array(
-       'input_text' => 'Single-Line Text Box',
-       'input_checkbox' => 'Checkbox Flag',
-       'select_single' => 'Drop-Down Menu',
+       'input_text' => lang::r('Single-Line Text Box'),
+       'input_checkbox' => lang::r('Checkbox Flag'),
+       'select_single' => lang::r('Drop-Down Menu'),
 );
 
 // ###################################################################
@@ -45,7 +45,7 @@ if ($_REQUEST['do'] == 'kill')
        $db->query("ALTER TABLE " . TABLE_PREFIX . "bugvaluefill DROP field$field[fieldid]");
        $db->query("OPTIMIZE TABLE " . TABLE_PREFIX . "bugvaluefill");
        
-       $admin->redirect('field.php?do=modify', 'The field has been successfully removed from the system.');
+       $admin->redirect('field.php?do=modify', lang::r('The field has been successfully removed from the system.'));
 }
 
 // ###################################################################
@@ -58,7 +58,7 @@ if ($_REQUEST['do'] == 'delete')
                $admin->error(lang::p('error_invalid_id'));
        }
        
-       $admin->page_confirm('Are you sure you want to delete this bug field? Doing so will remove everything for this field and it cannot be undone!', "field.php?do=kill&amp;fieldid=$field[fieldid]");
+       $admin->page_confirm(lang::r('Are you sure you want to delete this bug field? Doing so will remove everything for this field and it cannot be undone!'), "field.php?do=kill&amp;fieldid=$field[fieldid]");
 }
 
 // ###################################################################
@@ -85,11 +85,11 @@ if ($_REQUEST['do'] == 'update')
        
        if (empty($bugsys->in['name']))
        {
-               $admin->error('You must specify a display name.');
+               $admin->error(lang::r('You must specify a display name.'));
        }
        if (!isset($TYPES["$type"]) AND $add)
        {
-               $admin->error('Invalid field type specified.');
+               $admin->error(lang::r('Invalid field type specified.'));
        }
        
        switch ($type)
@@ -115,7 +115,7 @@ if ($_REQUEST['do'] == 'update')
                        array_walk($selects, 'trim');
                        if (count($selects) < 1)
                        {
-                               $admin->error('You need to specify some select values.');
+                               $admin->error(lang::r('You need to specify some select values.'));
                        }
                        
                        $extradata = "'" . $bugsys->escape(serialize($selects)) . "', " . intval($bugsys->in['usedefault']);
@@ -153,7 +153,7 @@ if ($_REQUEST['do'] == 'update')
                );
        }
        
-       $admin->redirect('field.php?do=modify', (($add) ? 'The custom bug field has been added.' : 'The bug field has been updated.'));
+       $admin->redirect('field.php?do=modify', lang::r((($add) ? 'The custom bug field has been added.' : 'The bug field has been updated.')));
 }
 
 // ###################################################################
@@ -174,7 +174,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        {
                $admin->form_hidden_field('step', 1);
                $admin->table_start(true, '40%');
-               $admin->table_head('Select Type');
+               $admin->table_head(lang::r('Select Type'));
        }
        else
        {
@@ -219,36 +219,36 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                }
                
                // global fields
-               $admin->row_span('Global Fields', 'thead', 'center');
-               $admin->row_text('Field Type', $TYPES["$type"]);
-               $admin->row_input('Display Name', 'name', $field['name']);
-               $admin->row_textarea('Description', 'description', $field['description']);
-               $admin->row_yesno('Required', 'required', $field['required']);
-               $admin->row_yesno('Can Be Searched', 'cansearch', ((isset($field['cansearch'])) ? $field['cansearch'] : true));
+               $admin->row_span(lang::r('Global Fields'), 'thead', 'center');
+               $admin->row_text(lang::r('Field Type'), $TYPES["$type"]);
+               $admin->row_input(lang::r('Display Name'), 'name', $field['name']);
+               $admin->row_textarea(lang::r('Description'), 'description', $field['description']);
+               $admin->row_yesno(lang::r('Required'), 'required', $field['required']);
+               $admin->row_yesno(lang::r('Can Be Searched'), 'cansearch', ((isset($field['cansearch'])) ? $field['cansearch'] : true));
                
                // type-specific fields
-               $admin->row_span('Type-Specific Fields', 'thead', 'center');
+               $admin->row_span(lang::r('Type-Specific Fields'), 'thead', 'center');
                
                switch ($type)
                {
                        case 'input_text':
-                               $admin->row_input('Default Value', 'defaultvalue', $field['defaultvalue']);
-                               $admin->row_input('Regular Expression Match', 'regexmatch', $field['regexmatch']);
-                               $admin->row_input('Maximum Length', 'maxlength', $field['maxlength'], 2, 10);
+                               $admin->row_input(lang::r('Default Value'), 'defaultvalue', $field['defaultvalue']);
+                               $admin->row_input(lang::r('Regular Expression Match'), 'regexmatch', $field['regexmatch']);
+                               $admin->row_input(lang::r('Maximum Length'), 'maxlength', $field['maxlength'], 2, 10);
                        break;
                        
                        case 'input_checkbox':
-                               $admin->row_yesno('Checked By Default', 'defaultvalue', $field['defaultvalue']);
+                               $admin->row_yesno(lang::r('Checked By Default'), 'defaultvalue', $field['defaultvalue']);
                        break;
                        
                        case 'select_single':
-                               $admin->row_textarea('Selection Values', 'selects', stripslashes(implode("\n", unserialize($field['selects']))));
-                               $admin->row_yesno('Make the First Option Default', 'usedefault', $field['usedefault']);
+                               $admin->row_textarea(lang::r('Selection Values'), 'selects', stripslashes(implode("\n", unserialize($field['selects']))));
+                               $admin->row_yesno(lang::r('Make the First Option Default'), 'usedefault', $field['usedefault']);
                        break;
                }
                
                // end table
-               $admin->row_submit((($edit) ? '<a href="field.php?do=delete&amp;fieldid=' . $field['fieldid'] . '">[Delete Field]</a>' : ''));
+               $admin->row_submit((($edit) ? '<a href="field.php?do=delete&amp;fieldid=' . $field['fieldid'] . '">[' . lang::r('Delete Field') . ']</a>' : ''));
                $admin->table_end();
                $admin->form_end();
        }
@@ -264,7 +264,7 @@ if ($_REQUEST['do'] == 'modify')
        
        $admin->table_start();
        $admin->table_head(lang::p('additional_bug_fields'), 3);
-       $admin->table_column_head(array('Display Name/Description', 'Field ID', 'Actions'));
+       $admin->table_column_head(array(lang::r('Display Name/Description'), lang::r('Field ID'), lang::r('Actions')));
        
        $fields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid ASC");
        while ($field = $db->fetch_array($fields))
@@ -273,7 +273,7 @@ if ($_REQUEST['do'] == 'modify')
                        array(
                                "$field[name]<div class=\"smallfont\"><em>$field[description]</em></div>" => 'l',
                                "(fieldid: $field[fieldid])" => 'c',
-                               "<a href=\"field.php?do=edit&amp;fieldid=$field[fieldid]\">[Edit]</a> <a href=\"field.php?do=delete&amp;fieldid=$field[fieldid]\">[Delete]</a>" => 'c'
+                               "<a href=\"field.php?do=edit&amp;fieldid=$field[fieldid]\">[" . lang::r('Edit') . "]</a> <a href=\"field.php?do=delete&amp;fieldid=$field[fieldid]\">[" . lang::r('Delete') . "]</a>" => 'c'
                        )
                );
        }
index 180a8a001bd5423e10283f1778c267f138e2eb13..62ed91c268b55152afb0b0efb9c69425e72adb9a 100755 (executable)
@@ -19,28 +19,28 @@ require_once('./includes/functions.php');
 // admin navigation
 
 $globalnav = array(
-       'Admin Locations' => array(
-               'Home' => 'index.php',
-               'Logout' => '../login.php?do=cplogout'
+       lang::r('Admin Locations') => array(
+               lang::r('Home') => 'index.php',
+               lang::r('Logout') => '../login.php?do=cplogout'
        ),
        
-       'Options' => array(
-               'BugStrike Settings' => 'setting.php',
+       lang::r('Options') => array(
+               lang::r('BugStrike Settings') => 'setting.php',
                //'Manage Languages' => 'language.php'
        ),
        
-       'Bug Fields' => array(
-               'Products / Versions / Components' => 'product.php',
-               'Priorities' => 'priority.php',
-               'Resolutions' => 'resolution.php',
-               'Severities' => 'severity.php',
-               'Statuses' => 'status.php',
-               'Custom Bug Fields' => 'field.php',
-               'Automatic Actions' => 'autoaction.php'
+       lang::r('Bug Fields') => array(
+               lang::r('Products / Versions / Components') => 'product.php',
+               lang::r('Priorities') => 'priority.php',
+               lang::r('Resolutions') => 'resolution.php',
+               lang::r('Severities') => 'severity.php',
+               lang::r('Statuses') => 'status.php',
+               lang::r('Custom Bug Fields') => 'field.php',
+               lang::r('Automatic Actions') => 'autoaction.php'
        ),
        
-       'User Management' => array(
-               'Usergroups' => 'usergroup.php'
+       lang::r('User Management') => array(
+               lang::r('Usergroups') => 'usergroup.php'
        )
 );
 
index 185a4ba1b66832569bbd642fdb8e43aa670d7fb4..09a21a9fb459d8d80984fc1f6d65c531771be799 100755 (executable)
@@ -15,7 +15,7 @@ require_once('./global.php');
 $admin->page_start('Index');
 
 $admin->table_start(true, '25%');
-$admin->table_head('BugStrike Administration Menu');
+$admin->table_head(lang::r('BugStrike Administration Menu'));
 
 $navdata = '<ul>';
 foreach  ($globalnav AS $group => $links)
index b39c121e211d0520fa998380d900a0a65b1c74d1..6381bad5a05dd9475b7de2dbb286f0da02aca984 100755 (executable)
@@ -14,7 +14,7 @@ require_once('./global.php');
 
 if ($bugsys->in['jumplocation'] == -1)
 {
-       $admin->error('Please select a location to jump to. Your selection is invalid.');
+       $admin->error(lang::r('Please select a location to jump to. Your selection is invalid.'));
 }
 
 header("Location: " . $bugsys->in['jumplocation']);
index 58e54c41017d263ad736b492b935acb2eacac128..86753252143f588e8c26831de740c46c9018516c 100644 (file)
@@ -69,17 +69,17 @@ if ($_REQUEST['do'] == 'edit')
                $admin->error(lang::p('error_invalid_id'));
        }
        
-       $admin->page_start("Edit Language");
+       $admin->page_start(lang::r('Edit Language'));
        
        $admin->form_start('language.php', 'update');
        $admin->table_start();
-       $admin->table_head('Edit Language - ' . $language['title']);
+       $admin->table_head(lang::r('Edit Language - ' . $language['title']));
        
-       $admin->row_input('Title', 'title', $language['title']);
-       $admin->row_input('Character Set', 'charset', $language['charset']);
-       $admin->list_item('Left-to-Right', 'ltr', (($language['direction'] == 'ltr') ? true : false));
-       $admin->list_item('Right-to-Left', 'rtl', (($language['direction'] == 'rtl') ? true : false));
-       $admin->row_list('Direction', 'direction');
+       $admin->row_input(lang::r('Title'), 'title', $language['title']);
+       $admin->row_input(lang::r('Character Set'), 'charset', $language['charset']);
+       $admin->list_item(lang::r('Left-to-Right'), 'ltr', (($language['direction'] == 'ltr') ? true : false));
+       $admin->list_item(lang::r('Right-to-Left'), 'rtl', (($language['direction'] == 'rtl') ? true : false));
+       $admin->row_list(lang::r('Direction'), 'direction');
        
        $admin->row_submit();
        $admin->table_end();
@@ -92,12 +92,12 @@ if ($_REQUEST['do'] == 'edit')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start('Manage Languages');
+       $admin->page_start(lang::r('Manage Languages'));
                
        $admin->table_start();
-       $admin->table_head('Manage Languages', 4);
+       $admin->table_head(lang::r('Manage Languages'), 4);
        
-       $admin->table_column_head(array('Title', 'Charset', 'Options', 'Actions'));
+       $admin->table_column_head(array(lang::r('Title'), lang::r('Charset'), lang::r('Options'), lang::r('Actions')));
        
        $languages = $db->query("SELECT * FROM " . TABLE_PREFIX . "language ORDER BY languageid ASC");
        while ($language = $db->fetch_array($languages))
@@ -105,12 +105,12 @@ if ($_REQUEST['do'] == 'modify')
                $admin->row_multi_item(array(
                        $language['title'] => 'l',
                        $language['charset'] => 'c',
-                       (($language['default']) ? '<strong>DEFAULT LANGUAGE</strong> / ' : '') . (($language['userselect']) ? 'User Selectable' : 'Private Language') => 'c',
-                       "<a href=\"language.php?do=edit&amp;languageid=$language[languageid]\">[Edit Settings]</a> <a href=\"phrase.php?languageid=$language[languageid]\">[Manage Phrases]</a>" => 'c'
+                       (($language['default']) ? '<strong>' . lang::r('DEFAULT LANGUAGE') . '</strong> / ' : '') . (($language['userselect']) ? lang::r('User Selectable') : lang::r('Private Language')) => 'c',
+                       "<a href=\"language.php?do=edit&amp;languageid=$language[languageid]\">[" . lang::r('Edit Settings') . "]</a> <a href=\"phrase.php?languageid=$language[languageid]\">[" . lang::r('Manage Phrases') . "]</a>" => 'c'
                ));
        }
        
-       $admin->row_span('<a href="language.php?do=add">[Add New Language]</a>', 'tfoot', 'center', 4);
+       $admin->row_span('<a href="language.php?do=add">[' . lang::r('Add New Language') . ']</a>', 'tfoot', 'center', 4);
        $admin->table_end();
        
        $admin->page_end();
index 75dc80b8fc267be20ed76b7138588a49ea864725..479334bb6d9975b88516240aacc2ac04415987a9 100755 (executable)
@@ -26,12 +26,12 @@ function construct_option_list($type, $id, $edit, $addcomponent, $addversion, $d
        
        if ($edit)
        {
-               $opt .= '<option value="product.php?do=edit' . $type . '&' . $type_action . '=' . $id . '">Edit ' . $type_display . '</option>';
+               $opt .= '<option value="product.php?do=edit' . $type . '&' . $type_action . '=' . $id . '">' . lang::r('Edit') . ' ' . $type_display . '</option>';
        }
        
        if ($delete)
        {
-               $opt .= '<option value="product.php?do=delete' . $type . '&' . $type_action . '=' . $id . '">Delete ' . $type_display . '</option>';
+               $opt .= '<option value="product.php?do=delete' . $type . '&' . $type_action . '=' . $id . '">' . lang::r('Delete') . ' ' . $type_display . '</option>';
        }
        
        if ($addcomponent)
index 97bd6457338518604d9801f8b8bbb82b1487b7ef..2dae1054119703c51033faeec637767d37e813e2 100755 (executable)
@@ -46,7 +46,7 @@ if ($_POST['do'] == 'update')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start('Settings');
+       $admin->page_start(lang::r('Settings'));
        
        $admin->form_start('setting.php', 'update');
        
index 3b0d5c9e42722066e5497e513b4b6338d5c2349f..55237dbe3f1e57e60d6e043fd7436a6e059a1ff5 100755 (executable)
@@ -107,13 +107,13 @@ if ($_REQUEST['do'] == 'edit')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start('Severity Manager');
+       $admin->page_start(lang::r('Severity Manager'));
        
        $severities = $db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder");
        
        $admin->form_start('severity.php', 'null');
        $admin->table_start();
-       $admin->table_head('Severity Manager');
+       $admin->table_head(lang::r('Severity Manager'));
        
        while ($severity = $db->fetch_array($severities))
        {
index 304089ce9916409812024e7d867d43897ee968dc..79c65896c488ed117a063bc03e2590e4af039e4b 100755 (executable)
@@ -108,13 +108,13 @@ if ($_REQUEST['do'] == 'edit')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start('Status Manager');
+       $admin->page_start(lang::r('Status Manager'));
        
        $statuses = $db->query("SELECT * FROM " . TABLE_PREFIX . "status");
        
        $admin->form_start('status.php', 'null');
        $admin->table_start();
-       $admin->table_head('Status Manager');
+       $admin->table_head(lang::r('Status Manager'));
        
        while ($status = $db->fetch_array($statuses))
        {
index 868455a47ded51850855be48f5438183b626a2c1..1f02bd5be4691f7f8bb626acf4fd63f945f7aa66 100755 (executable)
@@ -139,7 +139,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                
        // custom field permissions
        $admin->table_start();
-       $admin->table_head('Custom Field Permissions');
+       $admin->table_head(lang::r('Custom Field Permissions'));
        
        if ($edit)
        {
@@ -154,9 +154,9 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        while ($field = $db->fetch_array($fields))
        {
                unset($listitem);
-               $admin->list_item('No Permission', 0, $permissions["$field[fieldid]"] == 0);
-               $admin->list_item('Can View Field', 1, $permissions["$field[fieldid]"] == 1);
-               $admin->list_item('Can View, Edit Field', 2, $permissions["$field[fieldid]"] == 2);
+               $admin->list_item(lang::r('No Permission'), 0, $permissions["$field[fieldid]"] == 0);
+               $admin->list_item(lang::r('Can View Field'), 1, $permissions["$field[fieldid]"] == 1);
+               $admin->list_item(lang::r('Can View, Edit Field'), 2, $permissions["$field[fieldid]"] == 2);
                $admin->row_list($field['name'], "custom[$field[fieldid]]");
        }
        
index d089a2afe255bb59f22987dfb51be862534e7535..7d28fdc56c07b5f41c368257e5014d4b5131bb46 100755 (executable)
@@ -26,14 +26,14 @@ if (isset($bugsys->in['attachmentid']))
        $attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . intval($bugsys->in['attachmentid']));
        if (!$attachment)
        {
-               $message->error('alert: bad attachment');
+               $message->error(lang::r('alert: bad attachment'));
        }
 }
 
 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . (($attachment['attachmentid']) ? $attachment['bugid'] : intval($bugsys->in['bugid'])));
 if (!$bug)
 {
-       $message->error('alert: bad bug');
+       $message->error(lang::r('alert: bad bug'));
 }
 
 // setup logging
@@ -57,7 +57,7 @@ if ($_REQUEST['do'] == 'kill')
        $log->allowempty = true;
        $log->log();
        
-       $message->redirect('attachment removed', "showreport.php?bugid=$bug[bugid]");
+       $message->redirect(lang::r('attachment removed'), "showreport.php?bugid=$bug[bugid]");
 }
 
 // ###################################################################
@@ -69,7 +69,7 @@ if ($_REQUEST['do'] == 'delete')
                $message->error_permission();
        }
        
-       echo "are you sure you want to delete this attachment? <a href=\"attachment.php?do=kill&amp;attachmentid=$attachment[attachmentid]\">yes</a>";
+       $message->message(lang::r("are you sure you want to delete this attachment? <a href=\"attachment.php?do=kill&amp;attachmentid=$attachment[attachmentid]\">yes</a>"));
 }
 
 // ###################################################################
@@ -88,24 +88,24 @@ if ($_POST['do'] == 'insert')
        switch ($FILE['error'])
        {
                case 0: break;
-               case 1: $message->error('PHP said the file you uploaded was too big.'); break;
-               case 2: $message->error('The file exceeds the allowed upload size.'); break;
-               case 3: $message->error('The file was only partially uploaded.'); break;
-               case 4: $message->error('The file was not uploaded at all.'); break;
-               case 6: $message->error('PHP could not find the /tmp directory.'); break;
+               case 1: $message->error(lang::r('PHP said the file you uploaded was too big.')); break;
+               case 2: $message->error(lang::r('The file exceeds the allowed upload size.')); break;
+               case 3: $message->error(lang::r('The file was only partially uploaded.')); break;
+               case 4: $message->error(lang::r('The file was not uploaded at all.')); break;
+               case 6: $message->error(lang::r('PHP could not find the /tmp directory.')); break;
        }
        
        // did it upload?
        if (!is_uploaded_file($FILE['tmp_name']))
        {
-               $message->error('The file you specified did not upload.');
+               $message->error(lang::r('The file you specified did not upload.'));
        }
        
        // #*# put some MIME-type validation here
        
        if (!$bugsys->in['description'])
        {
-               $message->error('you need a file description!');
+               $message->error(lang::r('you need a file description!'));
        }
        
        $filedata = $bugsys->escape(file_get_contents($FILE['tmp_name']), true, true);
@@ -139,7 +139,7 @@ if ($_POST['do'] == 'insert')
                
                $log->language = 'log_mark_obsoletes';
                $log->arguments = array($attachmentid, $FILE['name'], implode(', ', $obsoletes));
-               $log->log($log->diff('obsoleted attachments', '', implode(', ', $obsoletes)));
+               $log->log($log->diff(lang::r('obsoleted attachments'), '', implode(', ', $obsoletes)));
        }
        
        // handle comment stuff
@@ -173,7 +173,7 @@ if ($_POST['do'] == 'insert')
        // update the last post data
        $db->query("UPDATE " . TABLE_PREFIX . "bug SET lastposttime = $time, lastpostby = " . $bugsys->userinfo['userid'] . " WHERE bugid = $bug[bugid]");
        
-       $message->redirect('attachment added', "showreport.php?bugid=$bug[bugid]");
+       $message->redirect(lang::r('attachment added'), "showreport.php?bugid=$bug[bugid]");
 }
 
 // ###################################################################
@@ -227,7 +227,7 @@ if ($_POST['do'] == 'update')
        $log->log($log->diff('description', $diff[0]['description'], $diff[1]['description']));
        $log->log($log->diff('obsolete', $diff[0]['obsolete'], $diff[1]['obsolete']));
        
-       echo "<a href=\"showreport.php?bugid=$bug[bugid]\">attachment updated</a>";
+       $message->redirect(lang::r('attachment updated'), "showreport.php?bugid=$bug[bugid]");
 }
 
 // ###################################################################
index 97d67586650864c671b8b70fb104fc4ab76cd4b0..cd909820c338d1bf9cea7ae22fe880d2aa2dda67 100644 (file)
@@ -30,7 +30,7 @@ $comment = $db->query_first("
 
 if (!$comment)
 {
-       $message->error('alert: bad comment');
+       $message->error(lang::r('alert: bad comment'));
 }
 
 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]");
@@ -58,7 +58,7 @@ if ($_POST['do'] == 'update')
 {
        if (!$bugsys->in['comment'])
        {
-               $message->error('you need to enter some text');
+               $message->error(lang::r('you need to enter some text'));
        }
        
        $bugsys->in['comment_parsed'] = $bugsys->in['comment'];
@@ -93,7 +93,7 @@ if ($_POST['do'] == 'update')
                WHERE bugid = $bug[bugid]"
        );
        
-       $message->redirect('comment saved', "showreport.php?bugid=$bug[bugid]");
+       $message->redirect(lang::r('comment saved'), "showreport.php?bugid=$bug[bugid]");
 }
 
 // ###################################################################
index de2f70c638877c6ef4eb6c2af4182fe5a4806241..58a3cf052470f92ede55001e9ff7c533b625055f 100644 (file)
@@ -117,11 +117,11 @@ if ($_POST['do'] == 'update')
        
        if (!$bugsys->in['summary'])
        {
-               $message->error('you need to enter a summary');
+               $message->error(lang::r('you need to enter a summary'));
        }
        if (!$pcv)
        {
-               $message->error('invalid product/component/version');
+               $message->error(lang::r('invalid product/component/version'));
        }
        
        $hist[0] = (array)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[bugid]");
@@ -315,7 +315,7 @@ if ($_POST['do'] == 'update')
        }
 
        
-       $message->redirect('done with update bug', "showreport.php?bugid=$bug[bugid]");
+       $message->redirect(lang::r('done with update bug'), "showreport.php?bugid=$bug[bugid]");
 }
 
 /*=====================================================================*\
index 4badda89167668c3670e1d0113f36dd43735aefb..50e8e6fd926258777e87fe771bbff496701fb891 100644 (file)
@@ -41,12 +41,12 @@ if ($_REQUEST['do'] == 'handle')
        if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . intval($bugsys->in['bugid'])))
        {
                $db->query("DELETE FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . intval($bugsys->in['bugid']));
-               $message->redirect('Favourite removed', "showreport.php?bugid=" . intval($bugsys->in['bugid']));
+               $message->redirect(lang::r('Favourite removed'), "showreport.php?bugid=" . intval($bugsys->in['bugid']));
        }
        else
        {
                $db->query("INSERT INTO " . TABLE_PREFIX . "favourite (userid, bugid) VALUES (" . $bugsys->userinfo['userid'] . ", " . intval($bugsys->in['bugid']) . ")");
-               $message->redirect('Favourite added', "showreport.php?bugid=" . intval($bugsys->in['bugid']));
+               $message->redirect(lang::r('Favourite added'), "showreport.php?bugid=" . intval($bugsys->in['bugid']));
        }
 }
 
index e098006b0f8ef4fcda9dc11a67462cda84babffa..0ca3a5262a599f37698be1f611ab0c4798bd7180 100755 (executable)
--- a/login.php
+++ b/login.php
@@ -24,7 +24,7 @@ require_once('./global.php');
 
 if ($bugsys->userinfo['userid'] AND $_REQUEST['do'] != 'logout' AND $_POST['do'] != 'cplogin' AND $_REQUEST['do'] != 'cplogout')
 {
-       $message->error('You are already logged in.');
+       $message->error(lang::r('You are already logged in.'));
 }
 
 // ###################################################################
@@ -75,10 +75,10 @@ if ($_POST['do'] == 'login' OR $_POST['do'] == 'cplogin')
                        $funct->cookie(COOKIE_PREFIX . 'authkey');
                }
                
-               $message->error('Invalid email or password.');
+               $message->error(lang::r('Invalid email or password.'));
        }
        
-       $message->redirect('You are now logged in :-)', $url);
+       $message->redirect(lang::r('You are now logged in :-)'), $url);
 }
 
 // ###################################################################
@@ -94,7 +94,7 @@ if ($_REQUEST['do'] == 'logout')
        }
        else
        {
-               $message->error('You need to be logged in!');
+               $message->error(lang::r('You need to be logged in!'));
        }
 }
 
@@ -105,11 +105,11 @@ if ($_REQUEST['do'] == 'cplogout')
        if ($_COOKIE[COOKIE_PREFIX . 'adminsession'])
        {
                $funct->cookie(COOKIE_PREFIX . 'adminsession');
-               $message->redirect('logged out', 'admin/');
+               $message->redirect(lang::r('logged out'), 'admin/');
        }
        else
        {
-               $message->error('you are not logged in');
+               $message->error(lang::r('you are not logged in'));
        }
 }
 
index 9449801e76edebad800966e828dfcfa12476fbae..7a5bf28f6fccd06c3df42785c3488bfbe42ec95d 100644 (file)
@@ -61,7 +61,7 @@ if ($_POST['do'] == 'insert')
        $log->arguments = array($commentid);
        $log->log();
 
-       $message->redirect('comment inesrted', "showreport.php?bugid=" . intval($bugsys->in['bugid']));
+       $message->redirect(lang::r('comment inesrted'), "showreport.php?bugid=" . intval($bugsys->in['bugid']));
 }
 
 /*=====================================================================*\
index 9e41b8998ebc2b2d77ec2bba08f481291976026f..cf2b3de1ed0ea889523129155f3a7c1fa040ea4c 100755 (executable)
@@ -83,15 +83,15 @@ if ($_POST['do'] == 'insert')
        // sanity checks
        if (!$pcv)
        {
-               $message->error('there was a problem selecting the product, component, or version');
+               $message->error(lang::r('there was a problem selecting the product, component, or version'));
        }
        if (!$bugsys->in['summary'])
        {
-               $message->error('please enter a bug title');
+               $message->error(lang::r('please enter a bug title'));
        }
        if (!$bugsys->in['comment'])
        {
-               $message->error('please enter a bug description');
+               $message->error(lang::r('please enter a bug description'));
        }
        
        // -------------------------------------------------------------------
@@ -144,7 +144,7 @@ if ($_POST['do'] == 'insert')
        
        $db->query("INSERT INTO " . TABLE_PREFIX . "vote (bugid, votefor, voteagainst) VALUES ($bugid, 0, 0)");
        
-       $message->redirect('bug is done!', "showreport.php?bugid=$bugid");
+       $message->redirect(lang::r('bug is done!'), "showreport.php?bugid=$bugid");
 }
 
 // ###################################################################
index 2e85e4db20c6cb358b11bc0899ce23aea415826d..9b9ef3efa709b616a9f1e5a33ce824b5dbdb1f6e 100755 (executable)
@@ -26,12 +26,12 @@ if (empty($_REQUEST['do']))
 {
        if ($bugsys->userinfo['userid'])
        {
-               $message->error('Sorry, you are already registered!');
+               $message->error(lang::r('Sorry, you are already registered!'));
        }
        
        if (!$bugsys->options['allownewreg'])
        {
-               $message->error('Sorry, we don\'t allow new registrations!');
+               $message->error(lang::r('Sorry, we don\'t allow new registrations!'));
        }
 
        foreach ($bugsys->datastore['language'] AS $value => $temp)
@@ -49,12 +49,12 @@ if ($_POST['do'] == 'insert')
 {
        if ($bugsys->userinfo['userid'])
        {
-               $message->error('Sorry, you are already registered!');
+               $message->error(lang::r('Sorry, you are already registered!'));
        }
        
        if (!$bugsys->options['allownewreg'])
        {
-               $message->error('Sorry, we don\'t allow new registrations!');
+               $message->error(lang::r('Sorry, we don\'t allow new registrations!'));
        }
 
        if ($bugsys->in['email'] != $bugsys->in['confirmemail'])
@@ -136,29 +136,29 @@ if ($_POST['do'] == 'insert')
                $db->query("INSERT INTO " . TABLE_PREFIX . "useractivation (userid, activator, dateline, usergroupid) VALUES ($userid, '$activationid', " . TIMENOW . ", 2)");
                
                $mail->to = $bugsys->in['email'];
-               $mail->subject =  'Welcome to ' . $bugsys->options['trackertitle'];
-               $mail->body = "Hi " . $bugsys->in['displayname'] . " you need to activate your account: http://devbox/bugtraq/register.php?do=activate&userid=" . $userid . "&activator=" . $activationid;
+               $mail->subject =  lang::r('Welcome to ' . $bugsys->options['trackertitle']);
+               $mail->body = lang::r("Hi " . $bugsys->in['displayname'] . " you need to activate your account: http://devbox/bugtraq/register.php?do=activate&userid=" . $userid . "&activator=" . $activationid);
                $mail->send();
        
-               $message->message('You now need to activate your account via email.');
+               $message->message(lang::r('You now need to activate your account via email.'));
        }
        else if ($usergroupid == 4 OR $usergroupid == 2)
        {
                if ($bugsys->options['sendwelcomemail'])
                {
                        $mail->to = $bugsys->in['email'];
-                       $mail->subject = 'Welcome to ' . $bugsys->options['trackertitle'];
-                       $mail->body = "Hi " . $bugsys->in['displayname'] . " and welcome to the " . $bugsys->options['trackertitle'] . " bug tracker! Thanks for registering.";
+                       $mail->subject = lang::r('Welcome to ' . $bugsys->options['trackertitle']);
+                       $mail->body = lang::r("Hi " . $bugsys->in['displayname'] . " and welcome to the " . $bugsys->options['trackertitle'] . " bug tracker! Thanks for registering.");
                        $mail->send();
                }
                
                if ($usergroupid == 4)
                {
-                       $message->message('Your account is pending approval.');
+                       $message->message(lang::r('Your account is pending approval.'));
                }
                else
                {
-                       $message->message('Registration complete!');
+                       $message->message(lang::r('Registration complete!'));
                }
        }
 }
@@ -176,16 +176,16 @@ if ($_REQUEST['do'] == 'activate')
                if ($bugsys->options['sendwelcomemail'])
                {
                        $mail->to = $user['email'];
-                       $mail->subject = 'Welcome to ' . $bugsys->options['trackertitle'];
-                       $mail->body = "Hi " . $user['displayname'] . " and welcome to the " . $bugsys->options['trackertitle'] . " bug tracker! Thanks for registering.";
+                       $mail->subject = lang::r('Welcome to ' . $bugsys->options['trackertitle']);
+                       $mail->body = lang::r("Hi " . $user['displayname'] . " and welcome to the " . $bugsys->options['trackertitle'] . " bug tracker! Thanks for registering.");
                        $mail->send();
                }
                
-               $message->message('your account is now activated and you can now login');
+               $message->message(lang::r('your account is now activated and you can now login'));
        }
        else
        {
-               $message->error('we could not match your registration string. please make sure you entered the correct url');
+               $message->error(lang::r('we could not match your registration string. please make sure you entered the correct url'));
        }
 }
 
index 455d37a69d0b1880fba3b303ee77f6d99649ff6f..ab46feed2bee289eac91ddeac8c9709c028203b3 100644 (file)
@@ -223,7 +223,7 @@ if ($_REQUEST['do'] == 'process')
        // have to search something
        if (count($querybuild) < 1)
        {
-               $message->error('you need to search for something!');
+               $message->error(lang::r('you need to search for something!'));
        }
        
        // -------------------------------------------------------------------
@@ -254,7 +254,7 @@ if ($_REQUEST['do'] == 'process')
        
        if ($numrows < 1)
        {
-               $message->error('no results found');
+               $message->error(lang::r('no results found'));
        }
        
        while ($result = $db->fetch_array($search))
index 1fcf96a4626923241cc50c488c823be826ca00be..9c5505fd2d68a2e9bffa093adf52c0724472c663 100644 (file)
@@ -25,7 +25,7 @@ require_once('./global.php');
 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . intval($bugsys->in['bugid']));
 if (!$bug)
 {
-       $message->error('alert: bad bug');
+       $message->error(lang::r('alert: bad bug'));
 }
 
 if ($bug['hidden'] AND !can_perform('canviewhidden'))
index 9cf9f14fdcbe5815c78206c888498f4b7a9d34f3..615964f0dabb4c9970b865ad06b3de9e21023630 100644 (file)
@@ -84,7 +84,7 @@ if ($bug['hidden'] AND !can_perform('canviewhidden'))
 // global display items
 
 $favourite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']);
-$favouritetext = (($favourite) ? 'Remove from Favourites' : 'Add to Favourites');
+$favouritetext = (($favourite) ? lang::r('Remove from Favourites') : lang::r('Add to Favourites'));
 
 $bug['userinfo'] = construct_user_display($bug);
 $bug['datetime'] = $datef->format($bugsys->options['dateformat'], $bug['dateline']);
index 9a51f4a6a4a358dd2f3734a6384553ad0bb87fc4..06aa7d7f961914d643ec9eeecb78acd7c475796d 100755 (executable)
@@ -21,7 +21,7 @@ require_once('./global.php');
 $attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . intval($bugsys->in['attachmentid']));
 if (!$attachment)
 {
-       $message->error('alert: bad attachment');
+       $message->error(lang::r('alert: bad attachment'));
 }
 
 if (!can_perform('cangetattach') AND !can_perform('caneditattach'))
index 62321197fb03bd537b2d2ab14437b1ff9e951e60..8dfd73cd9413ebab832d5c18481a1421fe9ad955 100644 (file)
--- a/vote.php
+++ b/vote.php
@@ -42,7 +42,7 @@ if ($_REQUEST['do'] == 'vote')
        
        if ($vote['uservote'])
        {
-               $message->error('you have already voted on this bug');
+               $message->error(lang::r('you have already voted on this bug'));
        }
        
        // handle userids
@@ -75,7 +75,7 @@ if ($_REQUEST['do'] == 'vote')
        
        $db->query("UPDATE " . TABLE_PREFIX . "vote SET userids = '$userids', votefor = $votefor, voteagainst = $voteagainst WHERE bugid = $bug[bugid]");
 
-       $message->redirect('your vote has been added', "showreport.php?bugid=$bug[bugid]");
+       $message->redirect(lang::r('your vote has been added'), "showreport.php?bugid=$bug[bugid]");
 }
 
 /*=====================================================================*\