--- mambo/branches/4.6/includes/mamboHTML.php 2006/01/19 13:29:35 149 +++ mambo/branches/4.6/includes/mamboHTML.php 2006/01/25 21:36:13 183 @@ -18,7 +18,7 @@ echo ''; echo '' . $folder . '/'; echo ''; - echo is_writable( "../$folder" ) ? ''.T_('Writeable').'' : ''.T_('Unwriteable').'' . ''; + echo is_writable( "../$folder" ) ? ''.T_('Writeable').'' : ''.T_('Unwriteable').'' . ''; echo ''; } @@ -38,7 +38,7 @@ for ($i=0, $n=count( $arr ); $i < $n; $i++ ) { $k = $arr[$i]->$key; $t = $arr[$i]->$text; - $id = @$arr[$i]->id; + $id = isset($arr[$i]->id) ? $arr[$i]->id : null; $extra = ''; $extra .= $id ? " id=\"" . $arr[$i]->id . "\"" : ''; @@ -92,18 +92,18 @@ */ function monthSelectList( $tag_name, $tag_attribs, $selected ) { $arr = array( - mosHTML::makeOption( '01', _JAN ), - mosHTML::makeOption( '02', _FEB ), - mosHTML::makeOption( '03', _MAR ), - mosHTML::makeOption( '04', _APR ), - mosHTML::makeOption( '05', _MAY ), - mosHTML::makeOption( '06', _JUN ), - mosHTML::makeOption( '07', _JUL ), - mosHTML::makeOption( '08', _AUG ), - mosHTML::makeOption( '09', _SEP ), - mosHTML::makeOption( '10', _OCT ), - mosHTML::makeOption( '11', _NOV ), - mosHTML::makeOption( '12', _DEC ) + mosHTML::makeOption( '01', T_('January') ), + mosHTML::makeOption( '02', T_('February') ), + mosHTML::makeOption( '03', T_('March') ), + mosHTML::makeOption( '04', T_('April') ), + mosHTML::makeOption( '05', T_('May') ), + mosHTML::makeOption( '06', T_('June') ), + mosHTML::makeOption( '07', T_('July') ), + mosHTML::makeOption( '08', T_('August') ), + mosHTML::makeOption( '09', T_('September') ), + mosHTML::makeOption( '10', T_('October') ), + mosHTML::makeOption( '11', T_('November') ), + mosHTML::makeOption( '12', T_('December') ) ); return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected ); @@ -116,10 +116,10 @@ * @param mixed The key that is selected * @returns string HTML for the select list values */ - function yesnoSelectList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) { + function yesnoSelectList( $tag_name, $tag_attribs, $selected, $yes=false, $no=false ) { $arr = array( - mosHTML::makeOption( '0', $no ), - mosHTML::makeOption( '1', $yes ), + mosHTML::makeOption( '0', $no ? $no : T_('Yes') ), + mosHTML::makeOption( '1', $yes ? $yes : T_('No') ), ); return mosHTML::selectList( $arr, $tag_name, $tag_attribs, 'value', 'text', $selected ); @@ -138,25 +138,20 @@ function radioList( &$arr, $tag_name, $tag_attribs, $selected=null, $key='value', $text='text' ) { reset( $arr ); $html = ""; - for ($i=0, $n=count( $arr ); $i < $n; $i++ ) { - $k = $arr[$i]->$key; - $t = $arr[$i]->$text; - $id = @$arr[$i]->id; - - $extra = ''; - $extra .= $id ? " id=\"" . $arr[$i]->id . "\"" : ''; + foreach ($arr as $choice) { + $id = @$choice->id; + $extra = $id ? " id=\"" . $choice->id . "\"" : ''; if (is_array( $selected )) { foreach ($selected as $obj) { - $k2 = $obj->$key; - if ($k == $k2) { - $extra .= " selected=\"selected\""; + if ($choice->$key == $obj->$key) { + $extra .= ' selected="selected"'; break; } } } else { - $extra .= ($k == $selected ? " checked=\"checked\"" : ''); + $extra .= ($choice->$key == $selected ? " checked=\"checked\"" : ''); } - $html .= "\n\t" . $t; + $html .= "\n\t$key."\"$extra $tag_attribs />" . $choice->$text; } $html .= "\n"; return $html; @@ -169,11 +164,11 @@ * @param mixed The key that is selected * @returns string HTML for the radio list */ - function yesnoRadioList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) { + function yesnoRadioList( $tag_name, $tag_attribs, $selected, $yes=false, $no=false ) { $arr = array( - mosHTML::makeOption( '0', $no, true ), - mosHTML::makeOption( '1', $yes, true ) + mosHTML::makeOption( '0', $no ? $no : T_('Yes') ), + mosHTML::makeOption( '1', $yes ? $yes : T_('No') ) ); return mosHTML::radioList( $arr, $tag_name, $tag_attribs, $selected ); } @@ -197,9 +192,9 @@ global $mosConfig_live_site; $alts = array( - 'none' => _CMN_SORT_NONE, - 'asc' => _CMN_SORT_ASC, - 'desc' => _CMN_SORT_DESC, + 'none' => T_('No Sorting'), + 'asc' => T_('Sort Ascending'), + 'desc' => T_('Sort Descending'), ); $next_state = 'asc'; if ($state == 'asc') { @@ -224,7 +219,7 @@
- +
@@ -241,7 +236,7 @@ ?>
- +
get( 'icons' ) ) { $mainframe = mosMainFrame::getInstance(); - $image = $mainframe->ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, _CMN_PRINT ); + $image = $mainframe->ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, T_('Print')); } else { - $image = _ICON_SEP .' '. _CMN_PRINT. ' '. _ICON_SEP; + $image = _ICON_SEP .' '. T_('Print'). ' '. _ICON_SEP; } if ( $params->get( 'popup' ) && !$hide_js ) { // Print Preview button - used when viewing page ?> - + @@ -296,7 +291,7 @@ // Print Button - used in pop-up window ?> - + @@ -352,7 +347,7 @@ $replacement .= "//--> \n"; $replacement .= " \n"; $replacement .= " \n"; return $replacement; @@ -377,33 +372,33 @@
- Pending + <?php T_('Pending') ?> - Published, but is Pending | + Pending') ?> | - Visible + <?php T_('Visible') ?> - Published and is Current | + Current') ?> | - Finished + <?php T_('Finished') ?> - Published, but has Expired | + Expired') ?> | - Finished + <?php T_('Finished') ?> - Not Published +
- Click on icon to toggle state. +
@@ -440,21 +435,21 @@ - Menu + - + menutype; ?> - Link Name + - + name; ?> @@ -462,20 +457,20 @@ - State + published ) { case -2: - echo 'Trashed'; + echo ''.T_('Trashed').''; break; case 0: - echo 'UnPublished'; + echo T_('UnPublished') ; break; case 1: default: - echo 'Published'; + echo ''.T_('Published').''; break; } ?> @@ -519,17 +514,17 @@ - Menu + - + menutype; ?> - Type + type; ?> @@ -537,11 +532,11 @@ - Item Name + - + name; ?> @@ -549,20 +544,20 @@ - State + published ) { case -2: - echo 'Trashed'; + echo ''.T_('Trashed').''; break; case 0: - echo 'UnPublished'; + echo T_('UnPublished'); break; case 1: default: - echo 'Published'; + echo ''.T_('Published').''; break; } ?> @@ -586,7 +581,7 @@ $checked_out_text .= ''. $date .''; $checked_out_text .= ''. $time .''; $checked_out_text .= ''; - $hover = 'onMouseOver="return overlib(\''. $checked_out_text .'\', CAPTION, \'Checked Out\', BELOW, RIGHT);" onMouseOut="return nd();"'; + $hover = 'onMouseOver="return overlib(\''. $checked_out_text .'\', CAPTION, \''.T_('Checked Out') .'\', BELOW, RIGHT);" onMouseOut="return nd();"'; } $checked = ''; @@ -655,8 +650,8 @@ function PublishedProcessing( &$row, $i ) { $img = $row->published ? 'publish_g.png' : 'publish_x.png'; $task = $row->published ? 'unpublish' : 'publish'; - $alt = $row->published ? 'Published' : 'Unpublished'; - $action = $row->published ? 'Unpublish Item' : 'Publish item'; + $alt = $row->published ? T_('Published') : T_('Unpublished'); + $action = $row->published ? T_('Unpublish Item') : T_('Publish item'); $href = '