gforge-commits
[Top][All Lists]
Advanced

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

[Gforge-commits] gforge/www/news/admin news_admin_utils.php, 1.5, 1.6 in


From: gsmet
Subject: [Gforge-commits] gforge/www/news/admin news_admin_utils.php, 1.5, 1.6 index.php, 1.11, 1.12
Date: Sat, 16 Oct 2004 15:28:02 -0500

Update of /cvsroot/gforge/gforge/www/news/admin
In directory db.perdue.net:/tmp/cvs-serv18430/www/news/admin

Modified Files:
        news_admin_utils.php index.php 
Log Message:
localized news

Index: news_admin_utils.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/news/admin/news_admin_utils.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- news_admin_utils.php        8 Oct 2004 23:17:31 -0000       1.5
+++ news_admin_utils.php        16 Oct 2004 20:27:59 -0000      1.6
@@ -26,7 +26,7 @@
  */
 
 function show_news_approve_form($sql_pending, $sql_rejected, $sql_approved) {
-
+       global $Language;
         /*
                        Show list of waiting news items
                */
@@ -34,22 +34,21 @@
                // function to show single news item
                // factored out because called 3 time below
                function show_news_item($result,$i,$approved,$selectable) {
+               global $PHP_SELF,$HTML, $sys_shortdatefmt;
 
-               global $PHP_SELF,$HTML;
-
-               echo '<tr '. $HTML->boxGetAltRowStyle($i) . '><td>';
+               echo '<tr '. $HTML->boxGetAltRowStyle($i) . '><td width="20%">';
                        if ($selectable) {
                                echo '<input type="checkbox" '
                                     .'name="news_id[]" value="'
                                     .db_result($result, $i, 'id').'" />';
                        }
-                       echo date('Y-m-d', 
db_result($result,$i,'post_date')).'</td>
-                       <td>';
+                       echo date($sys_shortdatefmt, 
db_result($result,$i,'post_date')).'</td>
+                       <td width="45%">';
                        echo '
                        <a 
href="'.$PHP_SELF.'?approve=1&amp;id='.db_result($result,$i,'id').'">'.db_result($result,$i,'summary').'</a>
                        </td>
 
-                       <td>
+                       <td width="35%">
                        <a href="/projects/'
                        .db_result($result,$i,'unix_group_name').'/">'
                        .db_result($result,$i,'group_name')
@@ -60,10 +59,11 @@
                        ;
                }
 
-               $title_arr=array();
-               $title_arr[]='Date';
-               $title_arr[]='Title';
-               $title_arr[]='Project';
+               $title_arr=array(
+                       $Language->getText('news_admin', 'date'),
+                       $Language->getText('news_admin', 'subject'),
+                       $Language->getText('news_admin', 'project')
+               );
 
                $result=db_query($sql_pending);
                $rows=db_numrows($result);
@@ -74,15 +74,15 @@
 
                if ($rows < 1) {
                        echo '
-                               <h4>No Queued Items Found</h4>';
+                               <h4>'.$Language->getText('news_admin', 
'noqueued').'</h4>';
                } else {
-                       echo '<h4>These items need to be approved (total: 
'.$rows.')</h4>';
+                       echo '<h4>'.$Language->getText('news_admin', 
'newsbytes_to_approve', array($rows)).'</h4>';
                        echo $GLOBALS['HTML']->listTableTop($title_arr);
                        for ($i=0; $i<$rows; $i++) {
                                show_news_item($result,$i,false,true);
                        }
                        echo $GLOBALS['HTML']->listTableBottom();
-                       echo '<br /><input type="submit" name="submit" 
value="Reject Selected" />';
+                       echo '<br /><input type="submit" name="submit" 
value="'.$Language->getText('news_admin', 'reject_selected').'" />';
                }
                echo '</form>';
 
@@ -94,9 +94,9 @@
                $rows=db_numrows($result);
                if ($rows < 1) {
                        echo '
-                               <h4>No rejected items found for this week</h4>';
+                               <h4>'.$Language->getText('news_admin', 
'norejected').'</h4>';
                } else {
-                       echo '<h4>These items were rejected this past week 
(total: '.$rows.')</h4>';
+                       echo '<h4>'.$Language->getText('news_admin', 
'rejected_newsbytes', array($rows)).'</h4>';
                        echo $GLOBALS['HTML']->listTableTop($title_arr);
                        for ($i=0; $i<$rows; $i++) {
                                show_news_item($result,$i,false,false);
@@ -112,9 +112,9 @@
                $rows=db_numrows($result);
                if ($rows < 1) {
                        echo '
-                               <h4>No approved items found for this week</h4>';
+                               <h4>'.$Language->getText('news_admin', 
'noapproved').'</h4>';
                } else {
-                       echo '<h4>These items were approved this past week 
(total: '.$rows.')</h4>';
+                       echo '<h4>'.$Language->getText('news_admin', 
'approved_newsbytes', array($rows)).'</h4>';
                        echo $GLOBALS['HTML']->listTableTop($title_arr);
                        for ($i=0; $i<$rows; $i++) {
                                show_news_item($result,$i,true,false);

Index: index.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/news/admin/index.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- index.php   8 Oct 2004 23:17:31 -0000       1.11
+++ index.php   16 Oct 2004 20:27:59 -0000      1.12
@@ -68,9 +68,9 @@
                        $result=db_query($sql);
 
                        if (!$result || db_affected_rows($result) < 1) {
-                               $feedback .= ' ERROR doing group update ';
+                               $feedback .= $Language->getText('general', 
'error_on_update');
                        } else {
-                               $feedback .= ' Project NewsByte Updated. ';
+                               $feedback .= $Language->getText('news_admin', 
'newsbyte_updated');
                        }
                        /*
                                Show the list_queue
@@ -80,7 +80,7 @@
                }
        }
 
-       news_header(array('title'=>'NewsBytes','pagename'=>'news_admin'));
+       news_header(array('title'=>$Language->getText('news_admin', 
'title'),'pagename'=>'news_admin'));
 
        if ($approve) {
                /*
@@ -90,30 +90,36 @@
                $sql="SELECT * FROM news_bytes WHERE id='$id' AND 
group_id='$group_id'";
                $result=db_query($sql);
                if (db_numrows($result) < 1) {
-                       exit_error('Error','Error - none found');
+                       exit_error($Language->getText('general', 'error'), 
$Language->getText('newsbyte_admin', 'newsbyte_not_found'));
                }
+               
+               $group =& group_get_object($group_id);
+               
                echo notepad_func();
                echo '
-               <h3>Approve a NewsByte For Project: 
'.group_getname($group_id).'</h3>
+               <h3>'.$Language->getText('news_admin', 'approve_newsbyte', 
array($group->getPublicName())).'</h3>
                <p />
                <form action="'.$PHP_SELF.'" method="post">
                <input type="hidden" name="group_id" 
value="'.db_result($result,0,'group_id').'" />
-               <input type="hidden" name="id" 
value="'.db_result($result,0,'id').'" />
+               <input type="hidden" name="id" 
value="'.db_result($result,0,'id').'" />';
 
-               <strong>Submitted by:</strong> 
'.user_getname(db_result($result,0,'submitted_by')).'<br />
+               $user =& user_get_object(db_result($result,0,'submitted_by'));
+
+               echo '
+               <strong>'.$Language->getText('news_admin', 
'submitted_by').':</strong> '.$user->getRealName().'<br />
                <input type="hidden" name="approve" value="y" />
                <input type="hidden" name="post_changes" value="y" />
 
-               <strong>Status:</strong><br />
-               <input type="radio" name="status" value="0" checked="checked" 
/> Displayed<br />
-               <input type="radio" name="status" value="4" /> Delete<br />
+               <strong>'.$Language->getText('news_admin', 
'status').':</strong><br />
+               <input type="radio" name="status" value="0" checked="checked" 
/> '.$Language->getText('news_admin', 'status_displayed').'<br />
+               <input type="radio" name="status" value="4" /> 
'.$Language->getText('news_admin', 'status_delete').'<br />
 
-               <strong>Subject:</strong><br />
+               <strong>'.$Language->getText('news_admin', 
'subject').':</strong><br />
                <input type="text" name="summary" 
value="'.db_result($result,0,'summary').'" size="30" maxlength="60"><br />
-               
<strong>Details:</strong>'.notepad_button('document.forms[1].details').'<br />
+               <strong>'.$Language->getText('news_admin', 
'details').':</strong>'.notepad_button('document.forms[1].details').'<br />
                <textarea name="details" rows="5" 
cols="50">'.db_result($result,0,'details').'</textarea><p>
-               <strong>If this item is on the '.$GLOBALS['sys_name'].' home 
page and you edit it, it will be removed from the home page.</strong><br /></p>
-               <input type="submit" name="submit" value="SUBMIT">
+               <strong>'.$Language->getText('news_admin', 'removal_when_edit', 
array($GLOBALS['sys_name'])).'</strong><br /></p>
+               <input type="submit" name="submit" 
value="'.$Language->getText('general', 'submit').'" />
                </form>';
 
        } else {
@@ -124,19 +130,22 @@
                $sql="SELECT * FROM news_bytes WHERE is_approved <> 4 AND 
group_id='$group_id'";
                $result=db_query($sql);
                $rows=db_numrows($result);
+               $group =& group_get_object($group_id);
+               
                if ($rows < 1) {
                        echo '
-                               
<h4>'.$Language->getText('news_admin','noqueued').': 
'.group_getname($group_id).'</h4>';
+                               
<h4>'.$Language->getText('news_admin','noqueued').': 
'.$group->getPublicName().'</h4>';
                } else {
                        echo '
-                               
<h4>'.$Language->getText('news_admin','queued').': 
'.group_getname($group_id).'</h4>
-                               <p>';
+                               
<h4>'.$Language->getText('news_admin','queued').': 
'.$group->getPublicName().'</h4>
+                               <ul>';
                        for ($i=0; $i<$rows; $i++) {
                                echo '
-                               <a 
href="/news/admin/?approve=1&id='.db_result($result,$i,'id').'&amp;group_id='.
+                               <li><a 
href="/news/admin/?approve=1&id='.db_result($result,$i,'id').'&amp;group_id='.
                                        db_result($result,$i,'group_id').'">'.
-                                       
db_result($result,$i,'summary').'</a><br /></p>';
+                                       
db_result($result,$i,'summary').'</a></li>';
                        }
+                       echo '</ul>';
                }
 
        }
@@ -162,9 +171,9 @@
                                        
"summary='".htmlspecialchars($summary)."', 
details='".htmlspecialchars($details)."' WHERE id='$id'";
                                $result=db_query($sql);
                                if (!$result || db_affected_rows($result) < 1) {
-                                       $feedback .= ' ERROR doing update ';
+                                       $feedback .= 
$Language->getText('general', 'error_on_update');
                                } else {
-                                       $feedback .= ' NewsByte Updated. ';
+                                       $feedback .= 
$Language->getText('news_admin', 'newsbyte_updated');
                                }
                        } else if ($status==2) {
                                /*
@@ -173,10 +182,10 @@
                                $sql="UPDATE news_bytes SET is_approved='2' 
WHERE id='$id'";
                                $result=db_query($sql);
                                if (!$result || db_affected_rows($result) < 1) {
-                                       $feedback .= ' ERROR doing update ';
+                                       $feedback .= 
$Language->getText('general', 'error_on_update');
                                        $feedback .= db_error();
                                } else {
-                                       $feedback .= ' NewsByte Deleted. ';
+                                       $feedback .= 
$Language->getText('news_admin', 'newsbyte_deleted');
                                }
                        }
 
@@ -194,15 +203,15 @@
                             ."WHERE id IN ('".implode($news_id,"','")."')";
                        $result=db_query($sql);
                        if (!$result || db_affected_rows($result) < 1) {
-                               $feedback .= ' ERROR doing update ';
+                               $feedback .= $Language->getText('general', 
'error_on_update');
                                $feedback .= db_error();
                        } else {
-                               $feedback .= ' NewsBytes Rejected. ';
+                               $feedback .= $Language->getText('news_admin', 
'newsbyte_rejected');
                        }
                }
        }
 
-       news_header(array('title'=>'NewsBytes','pagename'=>'news_admin'));
+       news_header(array('title'=>$Language->getText('news_admin', 
'title'),'pagename'=>'news_admin'));
 
        if ($approve) {
                /*
@@ -214,27 +223,30 @@
                        "AND news_bytes.group_id=groups.group_id ";
                $result=db_query($sql);
                if (db_numrows($result) < 1) {
-                       exit_error('Error','Error - not found');
+                       exit_error($Language->getText('general', 'error'), 
$Language->getText('newsbyte_admin', 'newsbyte_not_found'));
                }
+               
+               $group =& group_get_object(db_result($result,0,'group_id'));
+               $user =& user_get_object(db_result($result,0,'submitted_by'));
 
                echo '
-               <h3>Approve a NewsByte</h3>
+               <h3>'.$Language->getText('news_admin', 'approve_newsbyte', 
array($group->getPublicName())).'</h3>
                <p />
                <form action="'.$PHP_SELF.'" method="post">
                <input type="hidden" name="for_group" 
value="'.db_result($result,0,'group_id').'" />
                <input type="hidden" name="id" 
value="'.db_result($result,0,'id').'" />
-               <strong>Submitted for group:</strong> <a 
href="/projects/'.strtolower(db_result($result,0,'unix_group_name')).'/">'.group_getname(db_result($result,0,'group_id')).'</a><br
 />
-               <strong>Submitted by:</strong> 
'.user_getname(db_result($result,0,'submitted_by')).'<br />
+               <strong>'.$Language->getText('news_admin', 
'submitted_for_group').':</strong> <a 
href="/projects/'.strtolower(db_result($result,0,'unix_group_name')).'/">'.$group->getPublicName().'</a><br
 />
+               <strong>'.$Language->getText('news_admin', 
'submitted_by').':</strong> '.$user->getRealName().'<br />
                <input type="hidden" name="approve" value="y" />
                <input type="hidden" name="post_changes" value="y" />
-               <input type="radio" name="status" value="1" /> Approve For 
Front Page<br />
-               <input type="radio" name="status" value="0" /> Do Nothing<br />
-               <input type="radio" name="status" value="2" checked="checked" 
/> Delete<br />
-               <strong>Subject:</strong><br />
+               <input type="radio" name="status" value="1" /> 
'.$Language->getText('news_admin', 'approve_for_frontpage').'<br />
+               <input type="radio" name="status" value="0" /> 
'.$Language->getText('news_admin', 'do_nothing').'<br />
+               <input type="radio" name="status" value="2" checked="checked" 
/> '.$Language->getText('news_admin', 'reject').'<br />
+               <strong>'.$Language->getText('news_admin', 
'subject').':</strong><br />
                <input type="text" name="summary" 
value="'.db_result($result,0,'summary').'" size="30" maxlength="60" /><br />
-               <strong>Details:</strong><br />
+               <strong>'.$Language->getText('news_admin', 
'details').':</strong><br />
                <textarea name="details" rows="5" 
cols="50">'.db_result($result,0,'details').'</textarea><br />
-               <input type="submit" name="submit" value="SUBMIT" />
+               <input type="submit" name="submit" 
value="'.$Language->getText('general', 'submit').'" />
                </form>';
 
        } else {





reply via email to

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