//http://www.atutor.ca/atutor/mantis/view.php?id=3853 $is_http = preg_match("/^http/", $row['Url']); if ($is_http == 0) { $row['Url'] = 'http://' . $row['Url']; } //redirect header('Location: ' . $row['Url']); exit; } } require AT_INCLUDE_PATH . 'header.inc.php'; if ($_GET['reset_filter']) { unset($_GET); } //get appropriate categories $categories = get_link_categories(); //ascending decscending columns... $page_string = ''; $orders = array('asc' => 'desc', 'desc' => 'asc'); $cols = array('LinkName' => 1, 'name' => 1, 'description' => 1); if (isset($_GET['asc'])) { $order = 'asc'; $col = isset($cols[$_GET['asc']]) ? $_GET['asc'] : 'LinkName'; } else { if (isset($_GET['desc'])) { $order = 'desc'; $col = isset($cols[$_GET['desc']]) ? $_GET['desc'] : 'LinkName'; } else { // no order set $order = 'asc'; $col = 'LinkName';
<thead> <tr> <th scope="col"> </th> <th scope="col"><?php echo _AT('name'); ?> </th> <th scope="col"><?php echo _AT('parent'); ?> </th> </tr> </thead> <?php $categories = get_link_categories(true, true); if (!empty($categories)) { ?> <tfoot> <tr> <td colspan="4"> <div class="row buttons"> <input type="submit" name="edit" value="<?php echo _AT('edit'); ?> " /> <input type="submit" name="delete" value="<?php echo _AT('delete'); ?> " /> </div> </td>
/** Given a $cat_id, return IDs of all children of that ID as a comma seperated string. */ function get_child_categories($cat_id, $categories) { if (!isset($categories)) { $categories = get_link_categories(); } $category = $categories[$cat_id]; $children_string = ""; if (is_array($categories[$cat_id]['children'])) { foreach ($categories[$cat_id]['children'] as $child) { $children_string = $child . ","; } } return $children_string; }