diff --git a/Source/Source.FilterAPI.php b/Source/Source.FilterAPI.php index c4eb9bf..05cd0fe 100644 --- a/Source/Source.FilterAPI.php +++ b/Source/Source.FilterAPI.php @@ -6,6 +6,17 @@ define( 'SOURCE_ANY', 0 ); define( 'SOURCE_NONE', 1 ); +function Source_Twomap( $func, $list ) { + $new_list2 = array(); + $new_list = array(); + + foreach( $list as $key => $item ) { + list( $new_list[$key], $new_list2[$key] ) = call_user_func( $func, $key, $item ); + } + + return array( $new_list, $new_list2 ); +} + class SourceFilterOption { var $how = SOURCE_ANY; var $value; @@ -53,7 +64,7 @@ } function find( $p_page=1, $p_limit=25 ) { - list( $t_filters, $t_filter_params ) = twomap( 'Source_Process_FilterOption', $this->filters ); + list( $t_filters, $t_filter_params ) = Source_Twomap( 'Source_Process_FilterOption', $this->filters ); list ( $t_query_tail, $t_params ) = Source_Process_Filters( $t_filters, $t_filter_params ); $t_count_query = "SELECT COUNT(c.id) $t_query_tail"; @@ -177,9 +188,9 @@ $value = explode( ' ', $value ); } - $wc = map( 'db_param', $value ); - $wc = map( create_function( '$item','return "' . $key . ' LIKE $item";' ), $wc ); - $value = map( create_function( '$item', 'return "%$item%";' ), $value ); + $wc = array_map( 'db_param', $value ); + $wc = array_map( create_function( '$item','return "' . $key . ' LIKE $item";' ), $wc ); + $value = array_map( create_function( '$item', 'return "%$item%";' ), $value ); $sql = '(' . implode( ' OR ', $wc ) . ')'; @@ -222,7 +233,7 @@ # Standard values if ( is_array( $value ) ) { - $wc = map( 'db_param', $value ); + $wc = array_map( 'db_param', $value ); $count = count( $value ); if ( $count > 1 ) { @@ -549,7 +560,7 @@ return null; } - return map( create_function( '$in', 'return (int) $in;' ), array_slice( $t_matches, 1, 3 ) ); + return array_map( create_function( '$in', 'return (int) $in;' ), array_slice( $t_matches, 1, 3 ) ); } function Source_Date_Select( $p_name, $p_selected=null ) { @@ -562,7 +573,7 @@ $t_result = db_query_bound( $t_query ); $t_row = db_fetch_array( $t_result ); - $t_row = map( 'Source_Date_StampArray', $t_row ); + $t_row = array_map( 'Source_Date_StampArray', $t_row ); $s_min = $t_row['min'][0]; $s_max = $t_row['max'][0]; diff --git a/Source/Source.php b/Source/Source.php index 15a120b..02742dc 100755 --- a/Source/Source.php +++ b/Source/Source.php @@ -10,7 +10,7 @@ * with the Mantis bug tracker software. */ class SourcePlugin extends MantisPlugin { - static $framework_version = '0.16.3'; + static $framework_version = '0.16.4'; static $cache = array(); function register() { @@ -20,7 +20,6 @@ $this->version = self::$framework_version; $this->requires = array( 'MantisCore' => '1.2.0', - 'Meta' => '0.1', ); $this->uses = array( 'jQuery' => '1.3', diff --git a/Source/pages/list.php b/Source/pages/list.php index 0f45ca0..4bf0ac5 100644 --- a/Source/pages/list.php +++ b/Source/pages/list.php @@ -83,7 +83,7 @@ echo $t_page_link( $f_offset-1, '<<' ), '  '; } - $t_page_set = map( $t_page_link, $t_page_set ); + $t_page_set = array_map( $t_page_link, $t_page_set ); echo join( ' ', $t_page_set ); if ( $t_current < $t_pages ) { diff --git a/Source/pages/search.php b/Source/pages/search.php index 130dfae..75dc5c9 100644 --- a/Source/pages/search.php +++ b/Source/pages/search.php @@ -78,7 +78,7 @@ echo $t_page_link( $f_offset-1, '<<' ), '  '; } - $t_page_set = map( $t_page_link, $t_page_set ); + $t_page_set = array_map( $t_page_link, $t_page_set ); echo join( ' ', $t_page_set ); if ( $t_current < $t_pages ) { diff --git a/SourceCgit/SourceCgit.php b/SourceCgit/SourceCgit.php index 834d008..8620409 100644 --- a/SourceCgit/SourceCgit.php +++ b/SourceCgit/SourceCgit.php @@ -148,7 +148,7 @@ $t_branch = 'master'; } - $t_branches = map( 'trim', explode( ',', $t_branch ) ); + $t_branches = array_map( 'trim', explode( ',', $t_branch ) ); $t_changesets = array(); $t_changeset_table = plugin_table( 'changeset', 'Source' ); diff --git a/SourceGithub/SourceGithub.php b/SourceGithub/SourceGithub.php index eb4bb9d..e6118e7 100644 --- a/SourceGithub/SourceGithub.php +++ b/SourceGithub/SourceGithub.php @@ -224,7 +224,7 @@ $t_branch = 'master'; } - $t_branches = map( 'trim', explode( ',', $t_branch ) ); + $t_branches = array_map( 'trim', explode( ',', $t_branch ) ); $t_changesets = array(); $t_changeset_table = plugin_table( 'changeset', 'Source' ); diff --git a/SourceGitweb/SourceGitweb.php b/SourceGitweb/SourceGitweb.php index 635f75b..e0116a7 100644 --- a/SourceGitweb/SourceGitweb.php +++ b/SourceGitweb/SourceGitweb.php @@ -140,7 +140,7 @@ $t_branch = 'master'; } - $t_branches = map( 'trim', explode( ',', $t_branch ) ); + $t_branches = array_map( 'trim', explode( ',', $t_branch ) ); $t_changesets = array(); $t_changeset_table = plugin_table( 'changeset', 'Source' );