@@ -871,11 +871,6 @@ function bpi_build_search_facets(array &$form) {
871871 * @throws \Bpi\Sdk\Exception\SDKException
872872 */
873873function bpi_build_top_rank (&$ form ) {
874- $ heading = array (
875- t ('Title ' ),
876- t ('Amount ' )
877- );
878-
879874 $ form ['bpi_top_rank ' ] = array (
880875 '#type ' => 'fieldset ' ,
881876 '#title ' => t ('Top ranking ' ),
@@ -889,52 +884,68 @@ function bpi_build_top_rank(&$form) {
889884 ),
890885 );
891886
892- $ topNodesSyndicated = bpi_get_top_ranked ('-1 months ' , BPI_TOP_RANK_AMOUNT , 'syndicate ' , 'node ' );
893- $ rows = bpi_build_top_rank_rows ($ topNodesSyndicated , '/admin/bpi/syndicate ' );
887+ $ bpi_rank_results = bpi_get_top_ranked ('-1 months ' , BPI_TOP_RANK_AMOUNT , 'syndicate ' , 'node ' );
888+ $ rows = bpi_build_top_rank_rows ($ bpi_rank_results , '/admin/bpi/syndicate ' );
894889 $ form ['bpi_top_rank ' ]['top_nodes_syndicated ' ] = array (
895890 '#theme ' => 'table ' ,
896- '#caption ' => t ('Top syndicated (1 month) ' ),
897- '#header ' => $ heading ,
891+ '#caption ' => t ('Most shared articles (1 month) ' ),
892+ '#header ' => array (
893+ t ('Title ' ),
894+ t ('Amount of articles ' ),
895+ ),
898896 '#rows ' => $ rows ,
899897 '#empty ' => t ('No data so far. ' ),
900898 );
901899
902- $ topNodesSyndicated = bpi_get_top_ranked ('-3 months ' , BPI_TOP_RANK_AMOUNT , 'syndicate ' , 'node ' );
903- $ rows = bpi_build_top_rank_rows ($ topNodesSyndicated , '/admin/bpi/syndicate ' );
900+ $ bpi_rank_results = bpi_get_top_ranked ('-3 months ' , BPI_TOP_RANK_AMOUNT , 'syndicate ' , 'node ' );
901+ $ rows = bpi_build_top_rank_rows ($ bpi_rank_results , '/admin/bpi/syndicate ' );
904902 $ form ['bpi_top_rank ' ]['top_nodes_syndicated_three_months ' ] = array (
905903 '#theme ' => 'table ' ,
906- '#caption ' => t ('Top syndicated (3 months) ' ),
907- '#header ' => $ heading ,
904+ '#caption ' => t ('Most shared articles (3 months) ' ),
905+ '#header ' => array (
906+ t ('Title ' ),
907+ t ('Amount of articles ' ),
908+ ),
908909 '#rows ' => $ rows ,
909910 '#empty ' => t ('No data so far. ' ),
910911 );
911912
912- $ topAgenciesSyndicate = bpi_get_top_ranked ('-3 months ' );
913- $ rows = bpi_build_top_rank_rows ($ topAgenciesSyndicate );
913+ $ bpi_rank_results = bpi_get_top_ranked ('-3 months ' );
914+ $ rows = bpi_build_top_rank_rows ($ bpi_rank_results );
914915 $ form ['bpi_top_rank ' ]['top_agency_syndications ' ] = array (
915916 '#theme ' => 'table ' ,
916- '#caption ' => t ('Top syndications (3 months) ' ),
917- '#header ' => $ heading ,
917+ '#caption ' => t ('Top agency downloader (3 months) ' ),
918+ '#header ' => array (
919+ t ('Library ' ),
920+ t ('Amount of articles ' ),
921+ ),
918922 '#rows ' => $ rows ,
919923 '#empty ' => t ('No data so far. ' ),
920924 );
921925
922- $ topAgenciesPush = bpi_get_top_ranked ('-3 months ' , BPI_TOP_RANK_AMOUNT , 'push ' );
923- $ rows = bpi_build_top_rank_rows ($ topAgenciesPush );
926+ $ bpi_rank_results = bpi_get_top_ranked ('-3 months ' , BPI_TOP_RANK_AMOUNT , 'push ' );
927+ $ rows = bpi_build_top_rank_rows ($ bpi_rank_results );
924928 $ form ['bpi_top_rank ' ]['top_agency_pushes ' ] = array (
925929 '#theme ' => 'table ' ,
926- '#caption ' => t ('Top pushes (3 months) ' ),
927- '#header ' => $ heading ,
930+ '#caption ' => t ('Top agency contributor (3 months) ' ),
931+ '#header ' => array (
932+ t ('Library ' ),
933+ t ('Amount of articles ' ),
934+ ),
928935 '#rows ' => $ rows ,
929936 '#empty ' => t ('No data so far. ' ),
930937 );
931938
932- $ topNodesSyndicatedCreatedByMe = bpi_get_top_ranked ('-3 months ' , BPI_TOP_RANK_AMOUNT , 'syndicate ' , 'node ' , ['999999 ' ]);
933- $ rows = bpi_build_top_rank_rows ($ topNodesSyndicatedCreatedByMe );
939+ $ self_agency = variable_get ('ting_agency ' , '' );
940+ $ bpi_rank_results = bpi_get_top_ranked ('-3 months ' , BPI_TOP_RANK_AMOUNT , 'syndicate ' , 'node ' , [$ self_agency ]);
941+ $ rows = bpi_build_top_rank_rows ($ bpi_rank_results , '/bpi/edit ' );
934942 $ form ['bpi_top_rank ' ]['top_my_nodes_syndicated ' ] = array (
935943 '#theme ' => 'table ' ,
936- '#caption ' => t ('Most syndications (3 months) authored by me ' ),
937- '#header ' => $ heading ,
944+ '#caption ' => t ('Most syndicated articles by my library ' ),
945+ '#header ' => array (
946+ t ('Title ' ),
947+ t ('Amount of articles ' ),
948+ ),
938949 '#rows ' => $ rows ,
939950 '#empty ' => t ('No data so far. ' ),
940951 );
0 commit comments