Index: trunk/kernel/admin/include/summary/root.php =================================================================== diff -u -N -r13 -r22 --- trunk/kernel/admin/include/summary/root.php (.../root.php) (revision 13) +++ trunk/kernel/admin/include/summary/root.php (.../root.php) (revision 22) @@ -1,36 +1,37 @@ CountPending(); +//$PendingUsers = (int)$objUsers->CountPending(); -if( isset($objTopicList) && is_object($objTopicList) ) $PendingTopics = (int)@$objTopicList->CountPending(); -if( isset($objTopicList) && is_object($objArticleList) ) $PendingNews = (int)@$objArticleList->CountPending(); +//if( isset($objTopicList) && is_object($objTopicList) ) $PendingTopics = (int)@$objTopicList->CountPending(); +//if( isset($objTopicList) && is_object($objArticleList) ) $PendingNews = (int)@$objArticleList->CountPending(); -$PendingLinks = (int)@$objLinkList->CountPending(); -$PendingCats = (int)@$objCatList->CountPending(); +//$PendingLinks = (int)@$objLinkList->CountPending(); +//$PendingCats = (int)@$objCatList->CountPending(); -$PendingTotal = $PendingUsers + $PendingTopics+$PendingNews+$PendingLinks+$PendingCats; +$PendingTotal = 0; //$PendingUsers + $PendingCats + $PendingTopics + $PendingNews + $PendingLinks; $date_str = adodb_date("F j, Y"); @@ -40,7 +41,7 @@

- +
@@ -64,7 +65,7 @@ $i = 0; $col = 1; $o = ""; -while($i<$ItemsPerCol) +while($i < $ItemsPerCol) { $s = $objStats->GetItemByIndex($i); @@ -91,6 +92,90 @@ print $o; +// ---- prepare pending items list based on modules installed: begin ----- + +$m = GetModuleArray(); +foreach($m as $key => $value) +{ + $path = $pathtoroot.$value."admin/include/parser.php"; + if( file_exists($path) ) include_once($path); +} + +$modules = $objModules->GetModuleList(); +$pending_source = $objModules->ExecuteFunction('GetModuleInfo', 'summary_pending'); + + +// get total pending item count & merge them into one array +$all_pending = Array(); +$pending_col_1 = ''; +$pending_col_2 = ''; + +foreach($pending_source as $module_name => $pending_items) + foreach($pending_items as $p_item) + $all_pending[] = $p_item; + +if( count($all_pending) % 2 ) $all_pending[] = 'empty'; + +$ItemCount = count($all_pending); +$ItemsPerCol = ceil($ItemCount / 2); + + +// lTDi, rTDi, lTD, rTD + + +$i = 0; +while($i < $ItemCount) +{ + // create cell content + $item_count = 0; + $col_type = ($i < $ItemsPerCol) ? 'l' : 'r'; + $class = $col_type.'TDi'; + + // if last item then change class + if($i+1 == $ItemsPerCol) + $class = 'lTD'; + elseif($i+1 == $ItemsPerCol*2) + $class = 'rTD'; + + //print_pre($all_pending[$i]); + $cell = is_array($all_pending[$i]) ? PendingCell($all_pending[$i], $class, $item_count) : ''; + + if($col_type == 'l') + $pending_col_1 .= $cell; + elseif($col_type == 'r') + $pending_col_2 .= $cell; + + $PendingTotal += $item_count; + + //allocate it to row + + + $i++; +} + +// <- ok + +//if($peding_items_count % 2 != 0) $pending_html .= ''; + +function PendingCell($params, $class, &$pending_count) +{ + $pending_count = $GLOBALS[ $params['list_var_name'] ]->CountPending(); + $o = ''."\n"; + $o .= ''."\n"; + $o .= ''."\n"; + return $o; +} + + + + +// ---- prepare pending items list based on modules installed: end ----- + print << @@ -118,7 +203,7 @@

-
Overview $date_str 
 
 
'."\n"; + $o .= ''."\n"; + $o .= ''."\n"; + $o .= admin_language($params['phrase']); + $o .= ' ('.$pending_count.')'."\n"; + $o .= '
+
@@ -127,34 +212,19 @@
-
$lang_PendingItems  ($PendingTotal)
+
- - + + - - - - - - - -
- - $lang_Users ($PendingUsers) - - - $lang_Topics ($PendingTopics) - + + $pending_col_1 +
+
+ + $pending_col_2 +
+
- - $lang_Categories ($PendingCats) - - - $lang_Articles ($PendingNews) -
- - $lang_Links ($PendingLinks) -