Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Feb 1, 4:50 PM

in-portal

Index: trunk/kernel/admin/include/summary/root.php
===================================================================
--- trunk/kernel/admin/include/summary/root.php (revision 22)
+++ trunk/kernel/admin/include/summary/root.php (revision 23)
@@ -1,254 +1,222 @@
<?php
$lang_Search = admin_language("la_prompt_Search");
$lang_Users = admin_language("la_Text_Users");
-//$lang_Active = admin_language("la_Text_Active");
-//$lang_Disabled = admin_language("la_Text_Disabled");
-//$lang_Pending = admin_language("la_Text_Pending");
-//$lang_Denied = admin_language("la_Text_Denied");
$lang_PendingItems = admin_language("la_prompt_PendingItems");
-//$lang_Categories = admin_language("la_tab_Categories");
-//$lang_Topics = admin_language("la_Text_Topics");
-//$lang_Articles = admin_language("la_Text_Articles");
-//$lang_Links = admin_language("la_Text_Links");
-//$lang_QuickLinks = admin_language("la_Text_QuickLinks");
$lang_Catalog = admin_language("la_Text_Catalog");
global $adminURL,$rootURL,$admin;
$UserURL = $adminURL."/users/user_list.php?env=".BuildEnv();
$browseURL = $adminURL."/browse.php?env=".BuildEnv();
-//$topicURL = $rootURL."in-bulletin";
-//$newsURL = $rootURL."in-news";
-//$linkURL = $rootURL."in-link";
-
-//$PendingUsers = (int)$objUsers->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();
-
-$PendingTotal = 0; //$PendingUsers + $PendingCats + $PendingTopics + $PendingNews + $PendingLinks;
+$PendingTotal = 0;
$date_str = adodb_date("F j, Y");
print <<<END
<div isBox="true" id="overview">
<div class="overviewbox_header" func="header" STYLE="background:url($imagesURL/summary/overviewbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td><img isEI="true" src="$imagesURL/summary/overviewbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4"><span class="overview">Overview</span></td>
<td class="info" valign="top" align="right"><span class="overviewDate">$date_str</span>&nbsp;</td>
</tr>
</table>
</div>
<div class="overviewbox_body" func="body" STYLE="background:url($imagesURL/summary/overviewbox_bg.gif);">
<div style="padding:4px; width:100%">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="lTD" width="50%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
END;
$template = "<TR><TD class=\"oInfo\"><inp:stats_label /></TD><td width=\"1%\" nowrap class=\"oValue\"><inp:stats_value /></TD></TR>";
$objStats = new clsStatList();
$objStats->Query_Item("SELECT * FROM ".GetTablePrefix()."StatItem WHERE AdminSummary=1");
$ItemCount = $objStats->NumItems();
$ItemsPerCol = ceil($ItemCount / 2);
$i = 0;
$col = 1;
$o = "";
while($i < $ItemsPerCol)
{
$s = $objStats->GetItemByIndex($i);
$o .= $s->ParseTemplateText($template);
$i++;
}
print $o;
print <<<END
</table>
</td>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
END;
$o = "";
while($i<$ItemCount)
{
$s = $objStats->GetItemByIndex($i);
$o .= $s->ParseTemplateText($template);
$i++;
}
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) : '<tr><td class="rTD">&nbsp;</td></tr>';
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 .= '<td class="rTD">&nbsp;</td>';
-
function PendingCell($params, $class, &$pending_count)
{
$pending_count = $GLOBALS[ $params['list_var_name'] ]->CountPending();
$o = '<tr>'."\n";
$o .= '<td class="'.$class.'">'."\n";
$o .= '<a href="javascript:'.$params['link'].';" class="userslink">'."\n";
$o .= '<img src="'.$params['icon_image'].'" border="0" align="absMiddle">'."\n";
$o .= admin_language($params['phrase']);
$o .= '<span class="info">&nbsp;('.$pending_count.')</span></a>'."\n";
$o .= '</td>'."\n";
$o .= '</tr>'."\n";
return $o;
}
-
-
-
// ---- prepare pending items list based on modules installed: end -----
print <<<END
</table>
</td>
</tr>
</table>
</div>
<img src="$imagesURL/spacer.gif" height="21" width="1">
</div>
</div>
<div isBox="true" id="searchBox">
<div class="searchbox_header" func="header" STYLE="background:url($imagesURL/summary/searchbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br />
<img isEI="true" src="$imagesURL/summary/searchbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4">$lang_Search $lang_Users
</div>
<div class="searchbox_body" func="body" STYLE="background:url($imagesURL/summary/searchbox_bg.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="12"><br />
<form NAME="user_search" ID="user_search" method=POST action="$UserURL">
<img src="$imagesURL/spacer.gif" width="12" height="1"><input NAME="list_search" class="search" type="text">
<INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_user_search">
<img isImgButton="true" src="$imagesURL/toolbar/icon16_search.gif" width="22" height="22" align="absMiddle" onclick="user_search.submit();">
</FORM>
</div>
</div>
<div isBox="true" id="pendingitems">
<div class="usersbox_header" func="header" STYLE="background:url($imagesURL/summary/usersbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><img isEI="true" src="$imagesURL/summary/usersbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4"><b>$lang_PendingItems</b></td>
<td class="info" valign="top">&nbsp;($PendingTotal)</td>
</tr>
</table>
</div>
<div class="usersbox_body" func="body" STYLE="background:url($imagesURL/summary/usersbox_bg.gif);">
<div style="padding:8px; width:100%">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="50%">
<table cellspacing="0" cellpadding="4" border="0" width="100%">
$pending_col_1
</table>
</td>
<td valign="top" width="50%">
<table cellspacing="0" cellpadding="4" border="0" width="100%">
$pending_col_2
</table>
</td>
</tr>
</table>
</div>
<img src="images/spacer.gif" height="21" width="1">
</div>
</DIV>
<div isBox="true" id="quicklinks">
<div class="overviewbox_header" func="header" STYLE="background:url($imagesURL/summary/overviewbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td><img isEI="true" src="$imagesURL/summary/overviewbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4"><span class="overview">Quick Links</span></td>
<td class="info" valign="top" align="right"><span class="overviewDate"></span>&nbsp;</td>
</tr>
</table>
</div>
<div class="overviewbox_body" func="body" STYLE="background:url($imagesURL/summary/overviewbox_bg.gif);">
<div style="padding:4px; width:100%">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr><td><a class="userslink" href="$browseURL"><img hSpace="3" src="$adminURL/icons/icon24_navigate.gif" border="0" align="absMiddle">$lang_Catalog</a></td></tr>
<tr><td><a class="userslink" href="$UserURL"><img hSpace="3" src="$adminURL/icons/icon24_users.gif" border="0" align="absMiddle">$lang_Users</a></td></tr>
</table>
</div>
<img src="images/spacer.gif" height="21" width="1">
</div>
</div>
END;
?>
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/summary/root.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property

Event Timeline