PluginProbe
MaxButtons – Create buttons / 6.23
MaxButtons – Create buttons v6.23
6.23 6.24 6.25 6.26 6.26.1 6.27 6.28 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.1.1 7.1.2 7.1.3 7.10 7.11 7.13 7.13.1 7.13.2 7.13.3 All 100 releases
maxbuttons / includes / maxbuttons-collection-list.php

maxbuttons-collection-list.php in MaxButtons – Create buttons 6.23, at includes/maxbuttons-collection-list.php

108 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MaxButtons;
3 defined('ABSPATH') or die('No direct access permitted');
4
5 global $page_title;
6 $page_title = __("Social Share", "maxbuttons");
7 $admin = MB()->getClass("admin");
8
9 $action = "<a class='page-title-action add-new-h2' href='" . admin_url() . "admin.php?page=maxbuttons-collections&action=edit&collection=social'>" . __('Add New', 'maxbuttons') . "</a>";
10
11 $admin->get_header(array("tabs_active" => true, "title" => $page_title, "title_action" => $action));
12
13 $collections = maxCollections::getCollections();
14 $maxCol = new maxCollection();
15 ?>
16
17 <a class="page-title-action collection-addnew" href="<?php echo admin_url() ?>admin.php?page=maxbuttons-collections&action=edit&collection=social">
18 <?php _e("Add New","maxbuttons"); ?></a>
19
20 <?php
21
22 /* Display admin notices
23
24 Hook to display admin notices on error and other occurences in the editor. Follows WP guidelines on format.
25 @since 4.20
26 */
27 do_action('mb/collection/display_notices');
28 ?>
29 </span>
30
31
32 <span class="remove_action_title" style="display:none"><?php _e("Removing this collection","maxbuttons"); ?></span>
33 <span class="remove_action_text" style="display:none"><?php _e("Are you sure you want to permanently delete this collection?", "maxbuttons"); ?></span>
34
35
36
37 <div class='collection_list'>
38 <?php
39
40
41 foreach ($collections as $index => $data)
42 {
43 $id = $data["collection_id"];
44 $name = $maxCol->get_meta($id, "collection_name");
45 $name = isset($name['collection_name']) ? $name["collection_name"] : '';
46
47
48 $collection = maxCollections::getCollectionById($id);
49 if (! $collection)
50 continue;
51
52 $collection_type = $collection->getType();
53 $block_nonce = wp_create_nonce('mbpro_collection_block-' . $id);
54
55 $button_count = 0;
56 $picker = $collection->getBlock("picker");
57 if ($picker)
58 {
59 $picker_data = $picker->get();
60 $button_count = count($picker_data["selection"]);
61 }
62
63 ?>
64
65 <div class='collection collection-<?php echo $id ?>' data-id="<?php echo $id ?>" data-blocknonce="<?php echo $block_nonce ?>" data-type="<?php echo $collection_type ?>">
66 <div class="collection_remove dashicons dashicons-no"></div>
67
68 <h3 class='title'><a href="?page=maxbuttons-collections&action=edit&collection=social&collection_id=<?php echo $id ?>"><?php echo $name; ?></a>
69
70 <?php if ($button_count > 0): ?>
71 <span class="button-count">(<?php echo $button_count ?> <?php _e("Buttons","maxbuttons"); ?>)</span>
72 <?php endif; ?>
73 </h3>
74
75 <div class="collection-container">
76 <?php
77
78 $args = array("preview" => true,
79
80 );
81
82 $collection->display($args);
83
84 ?>
85 </div>
86 <p>[maxcollection id="<?php echo $id ?>"]</p>
87 <p><a href="?page=maxbuttons-collections&action=edit&collection=social&collection_id=<?php echo $id ?>"><?php _e("Edit","maxbuttons"); ?></a></p>
88 <!-- <p>[ Edit - Delete ] </p> -->
89
90 </div>
91 <?php
92 }
93
94 if (count($collections) == 0)
95 {
96 do_action("mb-display-collection-welcome");
97 }
98 ?>
99
100 </div> <!-- // collection-list -->
101 </div> <!-- // main -->
102 <div class="ad-wrap">
103 <?php do_action("mb-display-ads"); ?>
104 </div>
105
106 <?php
107 $admin->get_footer();
108