KERNEL::LoadModule("Action"); KERNEL::LoadModule("ItemAction"); KERNEL::LoadModule("UserAction"); KERNEL::LoadModule("Servers"); KERNEL::LoadModule("License"); KERNEL::AddPage("home", "Home", true); KERNEL::AddPage("store", "Store", true, null, function () { $btnHtm = ' <li class="dropdown closed"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Store <span class="caret"></span> </a> <ul class="dropdown-menu"> '; foreach (ItemCategory::GetCachedResults("ItemCategory") as $ItemCat) { $btnHtm .= '<li><a href="?page=store&cat=' . $ItemCat->GetValue("ID") . '">' . $ItemCat->GetValue("Name") . '</a></li>'; } return $btnHtm . ' </ul> </li> <script> $( ".dropdown-toggle" ).dropdown(); </script> '; }); KERNEL::AddPage("account", "Your Account", true, User::AccessCheck_LoggedIn()); KERNEL::AddPage("donate", "Donate", true, User::AccessCheck_LoggedIn()); KERNEL::AddPage("admin", "Admin", true, User::AccessCheck_Admin()); KERNEL::AddPage("login", "Login", false);
<?php $ItemCategories = ItemCategory::GetCachedResults("ItemCategory"); if (count($ItemCategories) == 0) { KERNEL::OnError("You must add an item category before accessing this page.", false); } else { foreach ($ItemCategories as $ItemCat) { echo ' <div class="panel panel-default"> <div class="panel-heading"> <a href="?page=admin&area=items&newitem=1&catid=' . $ItemCat->GetValue("ID") . '" style="float: right;"><span class="btn btn-xs btn-success">Add Item</span></a> <b>' . $ItemCat->GetValue("Name") . ' Items</b> </div> <table class="table"> <thead style="font-size: 12px;"> <th style="width: 50%;">Name</th> <th style="width: 25%;">Cost</th> <th style="width: 25%;text-align: right;">Actions</th> </thead> <tbody> '; $Items = Item::SearchCachedResults("Item", "Category", $ItemCat->GetValue("ID")); if (count($Items) == 0) { echo '<tr><td colspan=3 style="text-align: center;padding: 16px;font-size: 12px;"><i>No items to display!</i></td></tr>'; } else { foreach ($Items as $ItemObj) { echo ' <tr style="font-size: 12px;"> <td>' . $ItemObj->GetValue("Name") . '