Created
September 13, 2013 16:46
-
-
Save jaspertandy/6553124 to your computer and use it in GitHub Desktop.
in method visible_columns()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$default_hide = array('site_id', 'entry_id', 'complete'); | |
foreach ($default_hide as $hide_me_seymour) | |
{ | |
if (in_array($hide_me_seymour, $visible_columns)) | |
{ | |
unset( | |
$visible_columns[ | |
array_search( | |
$hide_me_seymour, | |
$visible_columns | |
) | |
] | |
); | |
} | |
} | |
$form_id = ee()->input->get('form_id'); | |
$layout = $this->composer_field_order( $form_id ); | |
if ( $layout ) { | |
$sorted = array(); | |
$top = array(); | |
foreach ( $visible_columns as $column ) { | |
preg_match( '#[0-9]+$#' , $column , $match ); | |
if ( $match ) { | |
$sorted[ array_search( $match[0] , $layout ) ] = $column; | |
} else { | |
$top[] = $column; | |
} | |
} | |
ksort( $sorted ); | |
$visible_columns = array_merge( $top , $sorted ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment