use an array of profiles rather than a looping cursor for profile lists

This commit is contained in:
Evan Prodromou
2011-08-27 12:53:15 -04:00
parent 01fd24ce6a
commit f81c1f7554
4 changed files with 36 additions and 31 deletions

View File

@@ -130,17 +130,15 @@ class SortableSubscriptionList extends SubscriptionList
function showProfiles()
{
$cnt = 0;
$profiles = $this->profile->fetchAll();
while ($this->profile->fetch()) {
$cnt++;
if($cnt > PROFILES_PER_PAGE) {
break;
}
$cnt = count($profiles);
$odd = ($cnt % 2 == 0); // for zebra striping
$max = min($cnt, $this->maxProfiles());
$pli = $this->newListItem($this->profile, $odd);
for ($i = 0; $i < $max; $i++) {
$odd = ($i % 2 == 0); // for zebra striping
$pli = $this->newListItem($profiles[$i], $odd);
$pli->show();
}