Skip to content

Commit

Permalink
Code cleanup. Update translate phrases. Stay in PHP more. Lines mostl…
Browse files Browse the repository at this point in the history
…y < 80 chars. Cut dupe code.
  • Loading branch information
bbannon committed Apr 20, 2007
1 parent a95d32d commit 603f3b3
Show file tree
Hide file tree
Showing 17 changed files with 1,218 additions and 1,307 deletions.
20 changes: 11 additions & 9 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@

load_global_settings ();
load_user_preferences ();
$WebCalendar->setLanguage();
$WebCalendar->setLanguage ();

$cat_id = getPostValue ( 'cat_id' );
$name = getPostValue ( 'name' );
$page = getPostValue ( 'page' );
$cat_id = getPostValue ( 'cat_id' );

// We're processing edit_remotes Calendar ID field.
if ( $page == 'edit_remotes' || $page == 'edit_nonuser' ) {
$res = dbi_execute ( 'SELECT cal_login FROM webcal_nonuser_cals
Expand All @@ -45,18 +46,18 @@
array ( $name ) );
if ( $res ) {
$row = dbi_fetch_row ( $res );
// translate ( 'Username already exists' )
// translate ( 'Username already exists.' )
if ( $row[0] == $name )
echo str_replace ( 'XXX', $name,
translate ( 'Username XXX already exists.', true ) );
}
} elseif ( $page == 'email' ) {
// We're processing email field from any page field.
$res = dbi_execute ( 'SELECT cal_email FROM webcal_user
WHERE cal_email = ?', array ( $name ) );
// We're processing email field from any page.
$res = dbi_execute ( 'SELECT cal_email FROM webcal_user WHERE cal_email = ?',
array ( $name ) );
if ( $res ) {
$row = dbi_fetch_row ( $res );
// translate ( 'Email address already exists' )
// translate ( 'Email address already exists.' )
if ( $row[0] == $name )
echo str_replace ( 'XXX', $name,
translate ( 'Email address XXX already exists.', true ) );
Expand All @@ -68,8 +69,9 @@
include_once 'includes/gradient.php';
$column_array = array ( 'we.cal_priority', 'we.cal_name',
'we.cal_due_date', 'weu.cal_percent' );
$task_filter = ' ORDER BY ' . $column_array[$name % 4] .
( $name > 3 ? ' ASC' : ' DESC' );
$task_filter = ' ORDER BY ' . $column_array[$name % 4]
. ( $name > 3 ? ' ASC' : ' DESC' );
echo display_small_tasks ( $cat_id );
}

?>
3 changes: 1 addition & 2 deletions datesel.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
}
//build month grid
$mdays = '';
for ( $i = $wkstart; date ( 'Ymd', $i ) <= $monthendYmd;
$i += ( 86400 * 7 ) ) {
for ( $i = $wkstart; date ( 'Ymd', $i ) <= $monthendYmd; $i += 604800 ) {
$mdays .= '
<tr>';
for ( $j = 0; $j < 7; $j++ ) {
Expand Down
Loading

0 comments on commit 603f3b3

Please sign in to comment.