| | 96 | <?php |
| | 97 | $link_columns = array( |
| | 98 | 'name' => '<th width="15%">' . __('Name') . '</th>', |
| | 99 | 'url' => '<th>' . __('URL') . '</th>', |
| | 100 | 'categories' => '<th>' . __('Categories') . '</th>', |
| | 101 | 'rel' => '<th style="text-align: center">' . __('rel') . '</th>', |
| | 102 | 'visible' => '<th style="text-align: center">' . __('Visible') . '</th>', |
| | 103 | 'action' => '<th colspan="2" style="text-align: center">' . __('Action') . '</th>', |
| | 104 | ); |
| | 105 | $link_columns = apply_filters('manage_link_columns', $link_columns); |
| | 106 | ?> |
| 106 | | <th width="15%"><?php _e('Name') ?></th> |
| 107 | | <th><?php _e('URL') ?></th> |
| 108 | | <th><?php _e('Categories') ?></th> |
| 109 | | <th style="text-align: center"><?php _e('rel') ?></th> |
| 110 | | <th style="text-align: center"><?php _e('Visible') ?></th> |
| 111 | | <th colspan="2" style="text-align: center"><?php _e('Action') ?></th> |
| 112 | | <th style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('links'));" /></th> |
| | 117 | <?php foreach($link_columns as $column_display_name) { |
| | 118 | echo $column_display_name; |
| | 119 | } ?> |
| | 120 | <th style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('links'));" /></th> |
| 136 | | ?> |
| 137 | | <tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>> |
| 138 | | <td><strong><?php echo $link->link_name; ?></strong><br /> |
| 139 | | <?php |
| | 144 | ?><tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>><?php |
| | 145 | foreach($link_columns as $column_name=>$column_display_name) { |
| | 146 | switch($column_name) { |
| | 147 | case 'name': |
| | 148 | ?><td><strong><?php echo $link->link_name; ?></strong><br /><?php |
| | 149 | echo $link->link_description . "</td>"; |
| | 150 | break; |
| | 151 | case 'url': |
| | 152 | echo "<td><a href='$link->link_url' title='".sprintf(__('Visit %s'), $link->link_name)."'>$short_url</a></td>"; |
| | 153 | break; |
| | 154 | case 'categories': |
| | 155 | ?><td><?php |
| | 156 | $cat_names = array(); |
| | 157 | foreach ($link->link_category as $category) { |
| | 158 | $cat_name = get_the_category_by_ID($category); |
| | 159 | $cat_name = wp_specialchars($cat_name); |
| | 160 | if ( $cat_id != $category ) |
| | 161 | $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>"; |
| | 162 | $cat_names[] = $cat_name; |
| | 163 | } |
| | 164 | echo implode(', ', $cat_names); |
| | 165 | ?> </td><?php |
| | 166 | break; |
| | 167 | case 'rel': |
| | 168 | ?><td><?php echo $link->link_rel; ?></td><?php |
| | 169 | break; |
| | 170 | case 'visible': |
| | 171 | ?><td align='center'><?php echo $visible; ?></td><?php |
| | 172 | break; |
| | 173 | case 'action': |
| | 174 | echo '<td><a href="link.php?link_id='.$link->link_id.'&action=edit" class="edit">'.__('Edit').'</a></td>'; |
| | 175 | echo '<td><a href="' . wp_nonce_url('link.php?link_id='.$link->link_id.'&action=delete', 'delete-bookmark_' . $link->link_id ) . '"'." onclick=\"return deleteSomething( 'link', $link->link_id , '".js_escape(sprintf(__("You are about to delete the "%s" link to %s.\n"Cancel" to stop, "OK" to delete."), $link->link_name, $link->link_url )).'\' );" class="delete">'.__('Delete').'</a></td>'; |
| | 176 | break; |
| | 177 | default: |
| | 178 | ?> |
| | 179 | <td><?php do_action('manage_link_custom_column', $column_name, $id); ?></td> |
| | 180 | <?php |
| | 181 | break; |
| 141 | | |
| 142 | | echo $link->link_description . "</td>"; |
| 143 | | echo "<td><a href=\"$link->link_url\" title=\"".sprintf(__('Visit %s'), $link->link_name)."\">$short_url</a></td>"; |
| 144 | | ?> |
| 145 | | <td> |
| 146 | | <?php |
| 147 | | |
| 148 | | $cat_names = array(); |
| 149 | | foreach ($link->link_category as $category) { |
| 150 | | $cat_name = get_the_category_by_ID($category); |
| 151 | | $cat_name = wp_specialchars($cat_name); |
| 152 | | if ( $cat_id != $category ) |
| 153 | | $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>"; |
| 154 | | $cat_names[] = $cat_name; |
| | 183 | } |
| 156 | | echo implode(', ', $cat_names); |
| 157 | | ?> |
| 158 | | </td> |
| 159 | | <td><?php echo $link->link_rel; ?></td> |
| 160 | | <td align='center'><?php echo $visible; ?></td> |
| 161 | | <?php |
| 162 | | |
| 163 | | echo '<td><a href="link.php?link_id='.$link->link_id.'&action=edit" class="edit">'.__('Edit').'</a></td>'; |
| 164 | | echo '<td><a href="' . wp_nonce_url('link.php?link_id='.$link->link_id.'&action=delete', 'delete-bookmark_' . $link->link_id ) . '"'." onclick=\"return deleteSomething( 'link', $link->link_id , '".js_escape(sprintf(__("You are about to delete the "%s" link to %s.\\n"Cancel" to stop, "OK" to delete."), $link->link_name, $link->link_url )).'\' );" class="delete">'.__('Delete').'</a></td>'; |