function editor_getPacks() { $packs = parent::editor_getPacks(); // Collect packs from dynamic amount of dirs $path = MB()->get_plugin_path() . "assets/packs/"; $packs = array_merge($packs, $this->getSocialPacks($path)); return $packs; }
<?php global $page_title; $page_title = __("Social Share", "maxbuttons"); $admin = MB()->getClass("admin"); //$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>"; $admin->get_header(array("tabs_active" => true, "title" => $page_title, "title_action" => $action)); $collections = maxCollections::getCollections(); $maxCol = new maxCollection(); ?> <a class="page-title-action " href="<?php echo admin_url(); ?> admin.php?page=maxbuttons-collections&action=edit&collection=social"> <?php _e("Add New", "maxbuttons"); ?> </a> <?php do_action("mb_display_notices"); ?> <span class="remove_action_title" style="display:none"><?php _e("Removing this collection", "maxbuttons"); ?> </span> <span class="remove_action_text" style="display:none"><?php _e("Are you sure you want to permanently delete this collection?", "maxbuttons"); ?> </span>
static function getCollectionByID($id) { $collection = new maxCollection(); $results = $collection->get_meta($id, 'collection_type'); if (count($results) == 1) { $type = $results["collection_type"]; $usecol = self::getCollection($type); $usecol->set($id); return $usecol; } return false; }