Skip to content

Commit

Permalink
Port Remove helper_alternate_class function
Browse files Browse the repository at this point in the history
The helper_alternate_class function used to add odd and even classes to HTML
elements. This is not needed with modern CSS styled layouts.

Stylesheets will need to be updated to provide the correct styling now
that this function has been removed.

commit 2e64cc6
  • Loading branch information
mantis committed Oct 8, 2013
1 parent 5610541 commit 6aa5e9b
Show file tree
Hide file tree
Showing 57 changed files with 313 additions and 366 deletions.
20 changes: 10 additions & 10 deletions account_page.php
Expand Up @@ -125,12 +125,12 @@

if ( !helper_call_custom_function( 'auth_can_change_password', array() ) ) {
# With LDAP --> ?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<span class="display-label"><span><?php echo lang_get( 'username' ) ?></span></span>
<span class="input"><span class="field-value"><?php echo string_display_line( $u_username ) ?></span></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<span class="display-label"><span><?php echo lang_get( 'password' ) ?></span></span>
<span class="input"><span class="field-value"><?php echo lang_get( 'no_password_change' ) ?></span></span>
<span class="label-style"></span>
Expand All @@ -139,23 +139,23 @@
# Without LDAP
$t_show_update_button = true;
?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<span class="display-label"><span><?php echo lang_get( 'username' ) ?></span></span>
<span class="input"><span class="field-value"><?php echo string_display_line( $u_username ) ?></span></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="password" <?php if ( $t_force_pw_reset ) { ?> class="required" <?php } ?>><span><?php echo lang_get( 'password' ) ?></span></label>
<span class="input"><input id="password" type="password" name="password" size="32" maxlength="<?php echo auth_get_password_max_size(); ?>" /></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="password-confirm" <?php if ( $t_force_pw_reset ) { ?> class="required" <?php } ?>><span><?php echo lang_get( 'confirm_password' ) ?></span></label>
<span class="input"><input id="password-confirm" type="password" name="password_confirm" size="32" maxlength="<?php echo auth_get_password_max_size(); ?>" /></span>
<span class="label-style"></span>
</div><?php
} ?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<span class="display-label"><span><?php echo lang_get( 'email' ) ?></span></span>
<span class="input"><?php
if ( $t_ldap && ON == config_get( 'use_ldap_email' ) ) {
Expand All @@ -169,7 +169,7 @@
</span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>"><?php
<div class="field-container"><?php
if ( $t_ldap && ON == config_get( 'use_ldap_realname' ) ) {
# With LDAP
echo '<span class="display-label"><span>' . lang_get( 'realname' ) . '</span></span>';
Expand All @@ -188,20 +188,20 @@
} ?>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<span class="display-label"><span><?php echo lang_get( 'access_level' ) ?></span></span>
<span class="input"><span class="field-value"><?php echo get_enum_element( 'access_levels', $u_access_level ); ?></span></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<span class="display-label"><span><?php echo lang_get( 'access_level_project' ) ?></span></span>
<span class="input"><span class="field-value"><?php echo get_enum_element( 'access_levels', current_user_get_access_level() ); ?></span></span>
<span class="label-style"></span>
</div>
<?php
$t_projects = user_get_assigned_projects( auth_get_current_user_id() );
if( count( $t_projects ) > 0 ) {
echo '<div class="field-container ' . helper_alternate_class_no_attribute() . '">';
echo '<div class="field-container">';
echo '<span class="display-label"><span>' . lang_get( 'assigned_projects' ) . '</span></span>';
echo '<div class="input">';
echo '<ul class="project-list">';
Expand Down
32 changes: 16 additions & 16 deletions account_prefs_inc.php
Expand Up @@ -88,7 +88,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
print_account_menu( 'account_prefs_page.php' );
}
?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="default-project-id"><span><?php echo lang_get( 'default_project' ) ?></span></label>
<span class="select">
<select id="default-project-id" name="default_project">
Expand All @@ -106,17 +106,17 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="refresh-delay"><span><?php echo lang_get( 'refresh_delay' ) ?></span></label>
<span class="input"><input id="refresh-delay" type="text" name="refresh_delay" size="4" maxlength="4" value="<?php echo $t_pref->refresh_delay ?>" /> <?php echo lang_get( 'minutes' ) ?></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="redirect-delay"><span><?php echo lang_get( 'redirect_delay' ) ?></span></label>
<span class="input"><input id="redirect-delay" type="text" name="redirect_delay" size="4" maxlength="3" value="<?php echo $t_pref->redirect_delay ?>" /> <?php echo lang_get( 'seconds' ) ?></span>
<span class="label-style"></span>
</div>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><span><?php echo lang_get( 'bugnote_order' ) ?></span></legend>
<span class="radio"><input id="bugnote-order-desc" type="radio" name="bugnote_order" value="DESC" <?php check_checked( $t_pref->bugnote_order, 'DESC' ); ?> /></span>
<label for="bugnote-order-desc"><span><?php echo lang_get( 'bugnote_order_desc' ) ?></span></label>
Expand All @@ -125,7 +125,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
<span class="label-style"></span>
</fieldset>
<?php if ( ON == config_get( 'enable_email_notification' ) ) { ?>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-new"><?php echo lang_get( 'email_on_new' ) ?></label></legend>
<span class="checkbox"><input id="email-on-new" type="checkbox" name="email_on_new" <?php check_checked( (int)$t_pref->email_on_new, ON ); ?> /></span>
<label for="email-on-new-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -138,7 +138,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-assigned"><?php echo lang_get( 'email_on_assigned' ) ?></label></legend>
<span class="checkbox"><input id="email-on-assigned" type="checkbox" name="email_on_assigned" <?php check_checked( (int)$t_pref->email_on_assigned, ON ); ?> /></span>
<label for="email-on-assigned-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -151,7 +151,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-feedback"><?php echo lang_get( 'email_on_feedback' ) ?></label></legend>
<span class="checkbox"><input id="email-on-feedback" type="checkbox" name="email_on_feedback" <?php check_checked( (int)$t_pref->email_on_feedback, ON ); ?> /></span>
<label for="email-on-feedback-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -164,7 +164,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-resolved"><?php echo lang_get( 'email_on_resolved' ) ?></label></legend>
<span class="checkbox"><input id="email-on-resolved" type="checkbox" name="email_on_resolved" <?php check_checked( (int)$t_pref->email_on_resolved, ON ); ?> /></span>
<label for="email-on-resolved-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -177,7 +177,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-closed"><?php echo lang_get( 'email_on_closed' ) ?></label></legend>
<span class="checkbox"><input id="email-on-closed" type="checkbox" name="email_on_closed" <?php check_checked( (int)$t_pref->email_on_closed, ON ); ?> /></span>
<label for="email-on-closed-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -190,7 +190,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-reopened"><?php echo lang_get( 'email_on_reopened' ) ?></label></legend>
<span class="checkbox"><input id="email-on-reopened" type="checkbox" name="email_on_reopened" <?php check_checked( (int)$t_pref->email_on_reopened, ON ); ?> /></span>
<label for="email-on-reopened-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -203,7 +203,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-bugnote-added"><?php echo lang_get( 'email_on_bugnote_added' ) ?></label></legend>
<span class="checkbox"><input id="email-on-bugnote-added" type="checkbox" name="email_on_bugnote" <?php check_checked( (int)$t_pref->email_on_bugnote, ON ); ?> /></span>
<label for="email-on-bugnote-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -216,7 +216,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-status"><?php echo lang_get( 'email_on_status_change' ) ?></label></legend>
<span class="checkbox"><input id="email-on-status" type="checkbox" name="email_on_status" <?php check_checked( (int)$t_pref->email_on_status, ON ); ?> /></span>
<label for="email-on-status-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -229,7 +229,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<fieldset class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<fieldset class="field-container">
<legend><label for="email-on-priority-change"><?php echo lang_get( 'email_on_priority_change' ) ?></label></legend>
<span class="checkbox"><input id="email-on-priority-change" type="checkbox" name="email_on_priority" <?php check_checked( (int)$t_pref->email_on_priority , ON); ?> /></span>
<label for="email-on-priority-min-severity" class="email-on-severity-label"><span><?php echo lang_get( 'with_minimum_severity' ) ?></span></label>
Expand All @@ -242,7 +242,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</fieldset>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="email-bugnote-limit"><span><?php echo lang_get( 'email_bugnote_limit' ) ?></span></label>
<span class="input"><input id="email-bugnote-limit" type="text" name="email_bugnote_limit" maxlength="2" size="2" value="<?php echo $t_pref->email_bugnote_limit ?>" /></span>
<span class="label-style"></span>
Expand All @@ -268,7 +268,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
<input type="hidden" name="email_on_priority_min_severity" value="<?php echo $t_pref->email_on_priority_min_severity ?>" />
<input type="hidden" name="email_bugnote_limit" value="<?php echo $t_pref->email_bugnote_limit ?>" />
<?php } ?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="timezone"><span><?php echo lang_get( 'timezone' ) ?></span></label>
<span class="select">
<select id="timezone" name="timezone">
Expand All @@ -277,7 +277,7 @@ function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_
</span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="language"><span><?php echo lang_get( 'language' ) ?></span></label>
<span class="select">
<select id="language" name="language">
Expand Down
16 changes: 8 additions & 8 deletions account_prof_menu_page.php
Expand Up @@ -99,22 +99,22 @@
print_account_menu( 'account_prof_menu_page.php' );
}
?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="platform" class="required"><span><?php echo lang_get( 'platform' ) ?></span></label>
<span class="input"><input id="platform" type="text" name="platform" size="32" maxlength="32" /></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="os" class="required"><span><?php echo lang_get( 'operating_system' ) ?></span></label>
<span class="input"><input id="os" type="text" name="os" size="32" maxlength="32" /></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="os-version" class="required"><span><?php echo lang_get( 'os_version' ) ?></span></label>
<span class="input"><input id="os-version" type="text" name="os_build" size="16" maxlength="16" /></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="description"><span><?php echo lang_get( 'additional_description' ) ?></span></label>
<span class="textarea"><textarea id="description" name="description" cols="80" rows="8"></textarea></span>
<span class="label-style"></span>
Expand All @@ -136,24 +136,24 @@
<fieldset>
<legend><span><?php echo lang_get( 'edit_or_delete_profiles_title' ) ?></span></legend>
<?php echo form_security_field( 'profile_update' )?>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="action-edit"><span><?php echo lang_get( 'edit_profile' ) ?></span></label>
<span class="input"><input id="action-edit" type="radio" name="action" value="edit" /></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<?php if ( !$g_global_profiles ) { ?>
<label for="action-default"><span><?php echo lang_get( 'make_default' ) ?></span></label>
<span class="input"><input id="action-default" type="radio" name="action" value="make_default" /></span>
<?php } ?>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="action-delete"><span><?php echo lang_get( 'delete_profile' ) ?></span></label>
<span class="input"><input id="action-delete" type="radio" name="action" value="delete" /></span>
<span class="label-style"></span>
</div>
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="select-profile"><span><?php echo lang_get( 'select_profile' ) ?></span></label>
<span class="input">
<select id="select-profile" name="profile_id">
Expand Down
12 changes: 6 additions & 6 deletions adm_config_report.php
Expand Up @@ -354,7 +354,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {

?>
<!-- Repeated Info Rows -->
<tr <?php echo helper_alternate_class() ?> width="100%">
<tr width="100%">
<td >
<?php echo ($v_user_id == 0) ? lang_get( 'all_users' ) : string_display_line( user_get_name( $v_user_id ) ) ?>
</td>
Expand Down Expand Up @@ -428,7 +428,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
</span></legend>

<!-- Username -->
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="config-user-id"><span><?php echo lang_get( 'username' ) ?></span></label>
<span class="select">
<select id="config-user-id" name="user_id">
Expand All @@ -443,7 +443,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
</div>

<!-- Project -->
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="config-project-id"><span><?php echo lang_get( 'project_name' ) ?></span></label>
<span class="select">
<select id="config-project-id" name="project_id">
Expand All @@ -458,7 +458,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
</div>

<!-- Config option name -->
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="config-option"><span><?php echo lang_get( 'configuration_option' ) ?></span></label>
<span class="input">
<input type="text" name="config_option"
Expand All @@ -469,7 +469,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
</div>

<!-- Option type -->
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="config-type"><span><?php echo lang_get( 'configuration_option_type' ) ?></span></label>
<span class="select">
<select id="config-type" name="type">
Expand All @@ -480,7 +480,7 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
</div>

<!-- Option Value -->
<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
<div class="field-container">
<label for="config-value"><span><?php echo lang_get( 'configuration_option_value' ) ?></span></label>
<span class="textarea">
<textarea name="value" cols="80" rows="10"><?php
Expand Down

1 comment on commit 6aa5e9b

@dregad
Copy link
Member

@dregad dregad commented on 6aa5e9b Oct 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylesheets will need to be updated to provide the correct styling now that this function has been removed.

Do you have the related commit with the CSS updates somewhere ? If yes, please push it now.

Otherwise, I'll revert this change until you come up with something that does not make big lists difficult to read (e.g. manage_user_page.php, manage_configuration_page.php)

manage users - mantis dev 1 3 0dev master - mozilla firefox_003

Please sign in to comment.