$listObj->addCell($pageNav->rowNumber($i)); // The Checkbox $listObj->addCell(vmCommonHTML::idBox($i, $db->f("module_id"), false, "module_id")); $tmp_cell = "<a href=\"" . $sess->url($_SERVER['PHP_SELF'] . "?page={$modulename}.module_form&&limitstart={$limitstart}&module_id=" . $db->f("module_id")) . "\">"; $tmp_cell .= $db->f("module_name") . "</a>"; $listObj->addCell($tmp_cell); $module_perms = explode(',', $db->f("module_perms")); while ($usergroups->next_record()) { $checked = in_array($usergroups->f('group_name'), $module_perms) ? 'checked="checked"' : ''; if ($db->f("module_name") == 'admin' && $usergroups->f('group_name') == 'admin') { $type = 'hidden'; } else { $type = 'checkbox'; } $listObj->addCell('<input type="' . $type . '" name="module_perms[' . $i . '][' . $usergroups->f('group_name') . ']" value="1" ' . $checked . ' />'); } $checked = in_array('none', $module_perms) ? 'checked="checked"' : ''; $listObj->addCell('<input type="checkbox" name="module_perms[' . $i . '][none]" value="1" ' . $checked . ' />'); $listObj->addCell(''); $usergroups->reset(); $tmp_cell = "<a href=\"" . $sess->url($_SERVER['PHP_SELF'] . "?page={$modulename}.function_list&module_id=" . $db->f("module_id")) . "&limitstart=0\">" . $VM_LANG->_('PHPSHOP_FUNCTION_LIST_LBL') . "</a>"; $listObj->addCell($tmp_cell); $tmp_cell = "<div align=\"center\">" . $pageNav->orderUpIcon($i, $i > 0, "orderup", $VM_LANG->_('CMN_ORDER_UP'), $page, "changeordering") . "\n " . $pageNav->orderDownIcon($i, $db->num_rows(), $i - 1 <= $db->num_rows(), 'orderdown', $VM_LANG->_('CMN_ORDER_DOWN'), $page, "changeordering") . "</div>"; $listObj->addCell($tmp_cell); $listObj->addCell(vmCommonHTML::getOrderingField($db->f('list_order'))); $listObj->addCell($ps_html->deleteButton("module_id", $db->f("module_id"), "moduleDelete", $keyword, $limitstart)); $i++; } $listObj->writeTable(); $listObj->endTable(); $listObj->writeFooter($keyword);
$db_cat->query("SELECT #__{vm}_category.category_id, category_name FROM #__{vm}_category,#__{vm}_product_category_xref\n\t\t\t\t\t\t\tWHERE #__{vm}_category.category_id=#__{vm}_product_category_xref.category_id\n\t\t\t\t\t\t\tAND #__{vm}_product_category_xref.product_id='" . $db->f("product_id") . "'"); while ($db_cat->next_record()) { $tmpcell .= $db_cat->f("category_name") . "<br/>"; } } else { $tmpcell .= $VM_LANG->_('PHPSHOP_CATEGORY_FORM_PARENT') . ": <a href=\""; $url = $_SERVER['PHP_SELF'] . "?page={$modulename}.product_form&limitstart={$limitstart}&keyword=" . urlencode($keyword) . "&product_id={$product_parent_id}"; $tmpcell .= $sess->url($url); $tmpcell .= "\">" . $ps_product->get_field($product_parent_id, "product_name") . "</a>"; } $listObj->addCell($tmpcell); // reordering if ($category_id && !$product_parent_id) { $tmp_cell = "<div align=\"center\">" . $pageNav->orderUpIcon($i, $i > 0, "orderup", $VM_LANG->_('CMN_ORDER_UP'), $page, "changeordering") . "\n " . $pageNav->orderDownIcon($i, $db->num_rows(), $i - 1 <= $db->num_rows(), 'orderdown', $VM_LANG->_('CMN_ORDER_DOWN'), $page, "changeordering") . "</div>"; $listObj->addCell($tmp_cell); $listObj->addCell(vmCommonHTML::getOrderingField($db->f('product_list'))); } $listObj->addCell($ps_product->get_mf_name($db->f("product_id"))); $db_cat->query("SELECT count(*) as num_rows FROM #__{vm}_product_reviews WHERE product_id='" . $db->f("product_id") . "'"); $db_cat->next_record(); if ($db_cat->f("num_rows")) { $tmpcell = $db_cat->f("num_rows") . " "; $tmpcell .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?option=com_virtuemart&page=product.review_list&product_id=" . $db->f("product_id") . "\">"; $tmpcell .= "[" . $VM_LANG->_('PHPSHOP_SHOW') . "]</a>"; } else { $link = $sess->url($_SERVER['PHP_SELF'] . '?page=product.review_form&product_id=' . $db->f('product_id')); $text = '[' . $VM_LANG->_('VM_REVIEW_FORM_LBL') . ']'; $tmpcell = " - <a href=\"{$link}\">{$text}</a>\n"; } $listObj->addCell($tmpcell); // publish
} if (!$downCondition || !$upCondition) { if ($levelcounter[$categories[$row_list[$n]]["category_parent_id"]] > $levels[$depth_list[$n] + 1]) { $downCondition = true; } if ($levels[$depth_list[$n] + 1] > 1) { $upCondition = true; } if ($levelcounter[$categories[$row_list[$n]]["category_parent_id"]] == $levels[$depth_list[$n] + 1]) { $upCondition = true; $downCondition = false; } if ($levelcounter[$categories[$row_list[$n]]["category_parent_id"]] < $levels[$depth_list[$n] + 1]) { $downCondition = false; $upCondition = false; } } $levels[$depth_list[$n] + 1]++; $listObj->addCell($pageNav->orderUpIcon($ibg, $upCondition, 'orderup', $VM_LANG->_('CMN_ORDER_UP'), $page, 'reorder') . ' ' . $pageNav->orderDownIcon($ibg, $levelcounter[$categories[$row_list[$n]]["category_parent_id"]], $downCondition, 'orderdown', $VM_LANG->_('CMN_ORDER_DOWN'), $page, 'reorder')); $listObj->addCell(vmCommonHTML::getOrderingField($categories[$row_list[$n]]["list_order"])); } else { $listObj->addCell(' '); $listObj->addCell(' '); } $listObj->addCell($ps_html->deleteButton("category_id", $categories[$row_list[$n]]["category_child_id"], "productCategoryDelete", $keyword, $limitstart)); $listObj->addCell($categories[$row_list[$n]]["category_child_id"]); $ibg++; } $listObj->writeTable(); $listObj->endTable(); $listObj->writeFooter($keyword);