} else { $bundleType = MM_Utils::getIcon('dollar', 'red', '1.3em', '2px', 'Free Bundle'); $productAssociations = MM_NO_DATA; $purchaseLinks = MM_NO_DATA; } // Name / Subscribers if (!empty($item->member_count)) { $item->name .= '<p>' . MM_Utils::getIcon('users', 'blue', '1.2em', '1px', '', 'margin-right:2px;') . ' <a href="' . MM_ModuleUtils::getUrl(MM_MODULE_MANAGE_MEMBERS, MM_MODULE_BROWSE_MEMBERS) . '&bundleId=' . $item->id . '">' . $item->member_count . ' Subscribers</a></p>'; } else { $item->name .= '<p>' . MM_Utils::getIcon('users', 'grey', '1.2em', '1px', '', 'margin-right:2px;') . ' <i>No Subscribers</i></p>'; } // Actions $editActionUrl = 'onclick="mmjs.edit(\'mm-bundles-dialog\', \'' . $item->id . '\')"'; $deleteActionUrl = 'onclick="mmjs.remove(\'' . $item->id . '\')"'; $actions = MM_Utils::getEditIcon("Edit Bundle", '', $editActionUrl); if (!$tag->hasAssociations() && intval($item->member_count) <= 0) { $actions .= MM_Utils::getDeleteIcon("Delete Bundle", 'margin-left:5px;', $deleteActionUrl); } else { $actions .= MM_Utils::getDeleteIcon("This bundle is currently being used and cannot be deleted", 'margin-left:5px;', '', true); } $rows[] = array(array('content' => "<span title='ID [" . $item->id . "]'>" . $item->name . "</span>"), array('content' => $bundleType), array('content' => $productAssociations), array('content' => $purchaseLinks), array('content' => MM_Utils::getStatusImage($item->status)), array('content' => $actions)); } $headers = array('name' => array('content' => '<a onclick="mmjs.sort(\'name\');" href="#">Name / Subscribers</a>'), 'is_free' => array('content' => '<a onclick="mmjs.sort(\'is_free\');" href="#">Type</a>'), 'products' => array('content' => 'Products', 'attr' => 'style="width:500px;"'), 'purchaselinks' => array('content' => 'Purchase Links'), 'status' => array('content' => '<a onclick="mmjs.sort(\'status\');" href="#">Status</a>'), 'actions' => array('content' => 'Actions')); $dataGrid->setHeaders($headers); $dataGrid->setRows($rows); $dgHtml = $dataGrid->generateHtml(); if ($dgHtml == "") { $dgHtml = "<p><i>No bundles.</i></p>"; } ?> <div class="mm-wrap">