1
+ <?php global $ wpdb ; ?>
2
+ <div class="wrap">
3
+ <div id="icon-snippets" class="icon32"><br /></div><h2>Snippets <a href="<?php echo $ this ->edit_snippets_url ; ?> " class="add-new-h2">Add New</a></h2>
4
+ <?php if ( strlen ( $ msg ) ) : ?>
5
+ <div id="message" class="updated fade"><p><?php echo $ msg ; ?> </p></div>
6
+ <?php endif ; ?>
7
+ <?php $ snippets = $ wpdb ->get_results ( 'select * from ' . $ this ->table_name ); ?>
8
+ <form action="" method="post">
9
+ <div class="tablenav top">
10
+ <div class="alignleft actions">
11
+ <select name='action' class="bulk-actions">
12
+ <option value='-1' selected='selected'>Bulk Actions</option>
13
+ <option value='activate'>Activate</option>
14
+ <option value='deactivate'>Deactivate</option>
15
+ <option value='delete'>Delete</option>
16
+ </select>
17
+ <input type="submit" id="doaction" class="button-secondary" value="Apply" />
18
+ </div>
19
+ </div>
20
+ <table class="widefat manage-snippets" style="margin-top: .5em">
21
+ <thead>
22
+ <tr>
23
+ <th scope="col" class="check-column"><input type="checkbox" name="toggle" id="toggle" /></th>
24
+ <th scope="col" id="name">Name</th>
25
+ <th scope="col" id="description">Description</th>
26
+ </tr>
27
+ </thead>
28
+ <?php if ( count ( $ snippets ) ): ?>
29
+ <?php foreach ( $ snippets as $ snippet ) : ?>
30
+ <tr class='<?php
31
+ if ($ snippet ->active == false )
32
+ echo 'inactive ' ;
33
+ else
34
+ echo 'active ' ;
35
+ ?> '>
36
+ <th scope="row" class="check-column"><input class="snippets" type="checkbox" name="snippets[]" value="<?php echo $ snippet ->id ; ?> " /></th>
37
+ <td class="snippet-title"><strong><?php echo stripslashes ($ snippet ->name );?> </strong>
38
+ <div class="row-actions-visible">
39
+ <?php if ( $ snippet ->active == 0 ) : ?>
40
+ <span class='activate'><a href="<?php echo $ this ->manage_snippets_url . '&action=activate&id= ' . $ snippet ->id ; ?> " title="Activate this plugin" class="edit">Activate</a> | </span>
41
+ <?php else : ?>
42
+ <span class='deactivate'><a href="<?php echo $ this ->manage_snippets_url . '&action=deactivate&id= ' . $ snippet ->id ; ?> " title="Deactivate this plugin" class="edit">Deactivate</a> | </span>
43
+ <?php endif ; ?>
44
+ <span class='edit'><a href="<?php echo $ this ->edit_snippets_url . '&action=edit&id= ' . $ snippet ->id ; ?> " title="Edit this Snippet" class="edit">Edit</a> | </span>
45
+ <span class='delete'><a href="<?php echo $ this ->manage_snippets_url . '&action=delete&id= ' . $ snippet ->id ; ?> " title="Delete this plugin" class="delete" onclick="return confirm('Are you sure? This action is non-reversable');">Delete</a></span>
46
+ </div>
47
+ </td>
48
+ <td><?php echo stripslashes ( html_entity_decode ( $ snippet ->description ) ); ?> </td>
49
+ </tr>
50
+ <?php endforeach ; ?>
51
+ <?php else : ?>
52
+ <tr id='no-groups'>
53
+ <th scope="row" class="check-column"> </th>
54
+ <td colspan="4">You do not appear to have any snippets available at this time.</td>
55
+ </tr>
56
+ <?php endif ;?>
57
+ </table>
58
+ <div class="tablenav bottom">
59
+ <div class="alignleft actions">
60
+ <select name='action2' class="bulk-actions">
61
+ <option value='-1' selected='selected'>Bulk Actions</option>
62
+ <option value='activate'>Activate</option>
63
+ <option value='deactivate'>Deactivate</option>
64
+ <option value='delete'>Delete</option>
65
+ </select>
66
+ <input type="submit" id="doaction2" class="button-secondary action" value="Apply" />
67
+ </div>
68
+ </div>
69
+ </form>
70
+ </div>
0 commit comments