1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733:
<?php
class Inbound_Menus_Adminbar {
static $add_menu;
static $go_button;
static $inboundnow_menu_key;
static $inboundnow_menu_secondary_group_key;
static $load_forms;
static $load_landingpages;
static $load_callstoaction;
static $load_leads;
public static function init() {
if (!is_user_logged_in() || !is_admin_bar_showing() || !current_user_can('activate_plugins')) {
return;
}
self::$add_menu = true;
self::$go_button = '<input type="submit" value="' . __('GO', 'inbound-pro') . '" class="inbound-search-go" /></form>';
self::$inboundnow_menu_key = 'inbound-admin-bar';
self::$inboundnow_menu_secondary_group_key = 'inbound-secondary';
self::hooks();
}
public static function hooks() {
add_action('admin_bar_menu', array(__CLASS__, 'load_inboundnow_menu'), 98);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_callstoaction'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_landingpages'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_leads'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_mailer'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_automation'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_forms'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_manage_templates'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_settings'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_analytics'), 10);
add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_seo'), 10);
add_filter('inboundnow_menu_secondary', array(__CLASS__, 'load_support'), 10);
add_filter('inboundnow_menu_secondary', array(__CLASS__, 'load_inbound_hq'), 10);
add_filter('inboundnow_menu_secondary', array(__CLASS__, 'load_debug'), 10);
add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_js_css'));
}
public static function load_inboundnow_menu() {
global $wp_admin_bar;
$primary_menu_items = apply_filters('inboundnow_menu_primary', array());
$secondary_menu_items = apply_filters('inboundnow_menu_secondary', array());
$wp_admin_bar->add_menu(array(
'id' => self::$inboundnow_menu_key,
'title' => __(' Marketing', 'inbound-pro'),
'href' => "",
'meta' => array('class' => 'inbound-nav-marketing', 'title' => 'Inbound Marketing Admin')
));
foreach ($primary_menu_items as $id => $menu_item) {
$menu_item['id'] = $id;
if (!isset($menu_item['meta']['target'])) {
$menu_item['meta']['target'] = '_blank';
}
if ('_blank' === $menu_item['meta']['target']) {
if (!isset($menu_item['meta']['class'])) {
$menu_item['meta']['class'] = '';
}
$menu_item['meta']['class'] .= 'inbound-new-tab';
}
$wp_admin_bar->add_node($menu_item);
}
$wp_admin_bar->add_group(array(
'parent' => self::$inboundnow_menu_key,
'id' => self::$inboundnow_menu_secondary_group_key,
'meta' => array('class' => 'ab-sub-secondary')
));
foreach ($secondary_menu_items as $id => $menu_item) {
$menu_item['id'] = $id;
$menu_item['meta'] = (isset($menu_item['meta']) && is_array($menu_item['meta']) ) ? $menu_item['meta'] : array();
if (!isset($menu_item['meta']['target'])) {
$menu_item['meta']['target'] = '_blank';
}
if ( '_blank' === $menu_item['meta']['target']) {
if (!isset($menu_item['meta']['class'])) {
$menu_item['meta']['class'] = '';
}
$menu_item['meta']['class'] .= ' inbound-new-tab';
}
$wp_admin_bar->add_node($menu_item);
}
if (class_exists('Inbound_Pro_Plugin') && is_admin()) {
$args = array(
'id' => 'lead_search',
'title' => '<i class="fa fa-search" aria-hidden="true" style="font-family:FontAwesome;"></i>',
'href' => '#lead-search',
'meta' => array('class' => 'adminbar-leads-search')
);
$wp_admin_bar->add_node($args);
}
}
public static function load_leads($menu_items) {
if (!function_exists('wpleads_check_active')) {
return $menu_items;
}
$leads_key = 'inbound-leads';
self::$load_forms = true;
self::$load_leads = true;
$menu_items[$leads_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Leads', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=wp-lead'),
'meta' => array('target' => '', 'title' => _x('Manage Forms', 'inbound-pro'))
);
$leads_search_text = __('Search All Leads', 'inbound-pro');
$menu_items['inbound-leads-search'] = array(
'parent' => $leads_key,
'title' => '<form id="inbound-menu-form" method="get" action="' . admin_url('edit.php?post_type=wp-lead') . '" class=" " target="_blank">
<input id="search-inbound-menu" type="text" placeholder="' . $leads_search_text . '" onblur="this.value=(this.value==\'\') ? \'' . $leads_search_text . '\' : this.value;" onfocus="this.value=(this.value==\'' . $leads_search_text . '\') ? \'\' : this.value;" value="' . $leads_search_text . '" name="s" value="' . esc_attr('Search Leads', 'inbound-pro') . '" class="text inbound-search-input" />
<input type="hidden" name="post_type" value="wp-lead" />
<input type="hidden" name="post_status" value="all" />
' . self::$go_button,
'href' => false,
'meta' => array('target' => '', 'title' => _x('Search Leads', 'Translators: For the tooltip', 'inbound-pro'))
);
$menu_items['inbound-leads-view'] = array(
'parent' => $leads_key,
'title' => __('View All Leads', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=wp-lead'),
'meta' => array('target' => '', 'title' => __('View All Forms', 'inbound-pro'))
);
$menu_items['inbound-leads-list'] = array(
'parent' => $leads_key,
'title' => __('View Lead Lists', 'inbound-pro'),
'href' => admin_url('edit-tags.php?taxonomy=wplead_list_category&post_type=wp-lead'),
'meta' => array('target' => '', 'title' => __('View Lead Lists', 'inbound-pro'))
);
$menu_items['inbound-leads-add'] = array(
'parent' => $leads_key,
'title' => __('Create New Lead', 'inbound-pro'),
'href' => admin_url('post-new.php?post_type=wp-lead'),
'meta' => array('target' => '', 'title' => __('Add new lead', 'inbound-pro'))
);
return $menu_items;
}
public static function load_callstoaction($menu_items) {
if (!function_exists('cta_check_active')) {
return $menu_items;
}
$cta_key = 'inbound-cta';
self::$load_forms = true;
self::$load_callstoaction = true;
$menu_items[$cta_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Call to Actions', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=wp-call-to-action'),
'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
);
$menu_items['inbound-cta-view'] = array(
'parent' => $cta_key,
'title' => __('View Calls to Action List', 'inbound-pro'),
'href' => admin_url('post-new.php?post_type=wp-call-to-action'),
'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
);
$menu_items['inbound-cta-add'] = array(
'parent' => $cta_key,
'title' => __('Add New Call to Action', 'inbound-pro'),
'href' => admin_url('post-new.php?post_type=wp-call-to-action'),
'meta' => array('target' => '', 'title' => __('Add new call to action', 'inbound-pro'))
);
$menu_items['inbound-cta-categories'] = array(
'parent' => $cta_key,
'title' => __('Categories', 'inbound-pro'),
'href' => admin_url('edit-tags.php?taxonomy=wp_call_to_action_category&post_type=wp-call-to-action'),
'meta' => array('target' => '', 'title' => __('Landing Page Categories', 'inbound-pro'))
);
if (current_user_can('manage_options')) {
$menu_items['inbound-cta-settings'] = array(
'parent' => $cta_key,
'title' => __('Settings', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings'),
'meta' => array('target' => '', 'title' => __('Manage Call to Action Settings', 'inbound-pro'))
);
}
return $menu_items;
}
public static function load_landingpages($menu_items) {
if (!function_exists('lp_check_active')) {
return $menu_items;
}
$landing_pages_key = 'inbound-landingpages';
self::$load_forms = true;
self::$load_landingpages = true;
$menu_items[$landing_pages_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Landing Pages', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=landing-page'),
'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
);
$menu_items['inbound-landingpages-view'] = array(
'parent' => $landing_pages_key,
'title' => __('View Landing Pages List', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=landing-page'),
'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
);
$menu_items['inbound-landingpages-add'] = array(
'parent' => $landing_pages_key,
'title' => __('Add New Landing Page', 'inbound-pro'),
'href' => admin_url('post-new.php?post_type=landing-page'),
'meta' => array('target' => '', 'title' => __('Add new Landing Page', 'inbound-pro'))
);
$menu_items['inbound-landingpages-categories'] = array(
'parent' => $landing_pages_key,
'title' => __('Categories', 'inbound-pro'),
'href' => admin_url('edit-tags.php?taxonomy=landing_page_category&post_type=landing-page'),
'meta' => array('target' => '', 'title' => __('Landing Page Categories', 'inbound-pro'))
);
if (current_user_can('manage_options')) {
$menu_items['inbound-landingpages-settings'] = array(
'parent' => $landing_pages_key,
'title' => __('Settings', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=landing-page&page=lp_global_settings'),
'meta' => array('target' => '', 'title' => __('Manage Landing Page Settings', 'inbound-pro'))
);
}
return $menu_items;
}
public static function load_mailer($menu_items) {
if (!function_exists('mailer_check_active')) {
return $menu_items;
}
$mailer_key = 'mailer';
$menu_items[$mailer_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Email', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=inbound-email'),
'meta' => array('target' => '', 'title' => __('View All E-Mails', 'inbound-pro'))
);
$menu_items['mailer-view'] = array(
'parent' => $mailer_key,
'title' => __('View Email List', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=inbound-email'),
'meta' => array('target' => '', 'title' => __('View All E-Mails', 'inbound-pro'))
);
$menu_items['mailer-create'] = array(
'parent' => $mailer_key,
'title' => __('Create New eMail', 'inbound-pro'),
'href' => admin_url('post-new.php?post_type=inbound-email'),
'meta' => array('target' => '', 'title' => __('Create New E-Mail', 'inbound-pro'))
);
return $menu_items;
}
public static function load_automation($menu_items) {
if (!function_exists('inbound_automation_check_active')) {
return $menu_items;
}
$automation_key = 'automation';
$menu_items[$automation_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Automation', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=automation'),
'meta' => array('target' => '', 'title' => __('View All Rules', 'inbound-pro'))
);
$menu_items['automation-view'] = array(
'parent' => $automation_key,
'title' => __('View Rules', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=automation'),
'meta' => array('target' => '', 'title' => __('View All Rules', 'inbound-pro'))
);
$menu_items['automation-create'] = array(
'parent' => $automation_key,
'title' => __('Create New Rule', 'inbound-pro'),
'href' => admin_url('post-new.php?post_type=automation'),
'meta' => array('target' => '', 'title' => __('Create New Rule', 'inbound-pro'))
);
return $menu_items;
}
public static function load_forms($menu_items) {
if (!self::$load_forms) {
return $menu_items;
}
$forms_key = 'inbound-forms';
$menu_items[$forms_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Manage Forms', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=inbound-forms'),
'meta' => array('target' => '', 'title' => _x('Manage Forms', 'inbound-pro'))
);
$menu_items['inbound-forms-view'] = array(
'parent' => $forms_key,
'title' => __('View All Forms', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=inbound-forms'),
'meta' => array('target' => '', 'title' => __('View All Forms', 'inbound-pro'))
);
$forms = get_posts(array('post_type' => 'inbound-forms', 'post_status' => 'published'));
foreach ($forms as $form) {
$menu_items['inbound-form-' . $form->ID] = array(
'parent' => 'inbound-forms-view',
'title' => $form->post_title,
'href' => admin_url('post.php?post=' . $form->ID . '&action=edit'),
'meta' => array('target' => '_blank', 'title' => $form->post_title)
);
}
$menu_items['inbound-forms-add'] = array(
'parent' => $forms_key,
'title' => __('Create New Form', 'inbound-pro'),
'href' => admin_url('post-new.php?post_type=inbound-forms'),
'meta' => array('target' => '', 'title' => __('Add new call to action', 'inbound-pro'))
);
return $menu_items;
}
public static function load_manage_templates($menu_items) {
if (!isset(self::$load_landingpages) || !isset(self::$load_callstoaction)) {
return $menu_items;
}
$templates_key = 'inbound-templates';
$menu_items[$templates_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Manage Templates', 'inbound-pro'),
'href' => "",
'meta' => array('target' => '', 'title' => _x('Manage Templates', 'inbound-pro'))
);
$menu_items['inbound-gettemplates'] = array(
'parent' => $templates_key,
'title' => __('Download More Templates', 'inbound-pro'),
'href' => "http://www.inboundnow.com/market",
'meta' => array('target' => '', 'title' => __('Download More Templates', 'inbound-pro'))
);
if (isset(self::$load_landingpages)) {
$menu_items['inbound-landingpagetemplates'] = array(
'parent' => $templates_key,
'title' => __('Landing Page Templates', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=landing-page&page=lp_manage_templates'),
'meta' => array('target' => '', 'title' => __('Landing Page Templates', 'inbound-pro'))
);
}
if (isset(self::$load_callstoaction)) {
$menu_items['inbound-ctatemplates'] = array(
'parent' => $templates_key,
'title' => __('Call to Action Templates', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=wp-call-to-action&page=wp_cta_manage_templates'),
'meta' => array('target' => '', 'title' => __('Call to Action Templates', 'inbound-pro'))
);
}
return $menu_items;
}
public static function load_settings($menu_items) {
$settings_key = 'inbound-settings';
$menu_items[$settings_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Settings', 'inbound-pro'),
'href' => "",
'meta' => array('target' => '', 'title' => _x('Manage Settings', 'inbound-pro'))
);
if (defined('INBOUND_PRO_PATH')) {
$menu_items['inbound-now-settings'] = array(
'parent' => $settings_key,
'title' => __('Inbound Pro Settings', 'inbound-pro'),
'href' => admin_url('admin.php?page=inbound-pro'),
'meta' => array('target' => '', 'title' => __('Inbound Pro Settings', 'inbound-pro'))
);
$menu_items['inbound-now-extension-settings'] = array(
'parent' => $settings_key,
'title' => __('Extension Settings', 'inbound-pro'),
'href' => admin_url('admin.php?tab=inbound-pro-settings&page=inbound-pro'),
'meta' => array('target' => '', 'title' => __('Extension Settings', 'inbound-pro'))
);
}
if (self::$load_callstoaction) {
$menu_items['inbound-ctasettings'] = array(
'parent' => $settings_key,
'title' => __('Call to Action Settings', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings'),
'meta' => array('target' => '', 'title' => __('Call to Action Settings', 'inbound-pro'))
);
}
if (self::$load_landingpages) {
$menu_items['inbound-landingpagesettings'] = array(
'parent' => $settings_key,
'title' => __('Landing Page Settings', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=landing-page&page=lp_global_settings'),
'meta' => array('target' => '', 'title' => __('Landing Page Settings', 'inbound-pro'))
);
}
if (self::$load_leads) {
$menu_items['inbound-leadssettings'] = array(
'parent' => $settings_key,
'title' => __('Lead Settings', 'inbound-pro'),
'href' => admin_url('edit.php?post_type=wp-lead&page=wpleads_global_settings'),
'meta' => array('target' => '', 'title' => __('Lead Settings', 'inbound-pro'))
);
}
return $menu_items;
}
public static function load_analytics($menu_items) {
$analytics_key = 'inbound-analytics';
$menu_items[$analytics_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('Analytics (coming soon)', 'inbound-pro'),
'href' => '#',
'meta' => array('target' => '', 'title' => __('Analytics (coming soon)', 'inbound-pro'))
);
return $menu_items;
}
public static function load_seo($menu_items) {
$seo_key = 'inbound-seo';
if (function_exists('is_plugin_active') && is_plugin_active('wordpress-seo/wp-seo.php')) {
$menu_items[$seo_key] = array(
'parent' => self::$inboundnow_menu_key,
'title' => __('SEO by Yoast', 'inbound-pro'),
'href' => admin_url('admin.php?page=wpseo_dashboard'),
'meta' => array('target' => '', 'title' => __('Manage SEO Settings', 'inbound-pro'))
);
}
return $menu_items;
}
public static function load_support($secondary_menu_items) {
$support_key = 'inbound-support';
$secondary_menu_items[$support_key] = array(
'parent' => self::$inboundnow_menu_secondary_group_key,
'title' => __('Support Forum', 'inbound-pro'),
'href' => 'https://support.inboundnow.com/',
'meta' => array('target' => '_blank', 'title' => __('Support Forum', 'inbound-pro'))
);
$secondary_menu_items['inbound-docs'] = array(
'parent' => self::$inboundnow_menu_secondary_group_key,
'title' => __('Documentation', 'inbound-pro'),
'href' => 'http://docs.inboundnow.com/',
'meta' => array('title' => __('Documentation', 'inbound-pro'))
);
$search_docs_text = __('Search Docs', 'inbound-pro');
$secondary_menu_items['inbound-docs-searchform'] = array(
'parent' => self::$inboundnow_menu_secondary_group_key,
'title' => '<form method="get" id="inbound-menu-form" action="//www.inboundnow.com/support/search/?action=bbp-search-request" class=" " target="_blank">
<input id="search-inbound-menu" type="text" placeholder="' . $search_docs_text . '" onblur="this.value=(this.value==\'\') ? \'' . $search_docs_text . '\' : this.value;" onfocus="this.value=(this.value==\'' . $search_docs_text . '\') ? \'\' : this.value;" value="' . $search_docs_text . '" name="bbp_search" value="' . esc_attr('Search Docs', 'inbound-pro') . '" class="text inbound-search-input" />
<input type="hidden" name="post_type[]" value="docs" />
<input type="hidden" name="post_type[]" value="page" />' . self::$go_button,
'href' => false,
'meta' => array('target' => '', 'title' => _x('Search Docs', 'Translators: For the tooltip', 'inbound-pro'))
);
return $secondary_menu_items;
}
public static function load_inbound_hq($secondary_menu_items) {
$hq_key = 'inbound-hq';
$secondary_menu_items[$hq_key] = array(
'parent' => self::$inboundnow_menu_secondary_group_key,
'title' => __('Inbound Now Plugin HQ', 'inbound-pro'),
'href' => 'https://www.inboundnow.com/',
'meta' => array('title' => __('Inbound Now Plugin HQ', 'inbound-pro'))
);
$secondary_menu_items['inbound-sites-dev'] = array(
'parent' => $hq_key,
'title' => __('GitHub Repository Developer Center', 'inbound-pro'),
'href' => 'https://github.com/inboundnow',
'meta' => array('title' => __('GitHub Repository Developer Center', 'inbound-pro'))
);
$secondary_menu_items['inbound-sites-blog'] = array(
'parent' => $hq_key,
'title' => __('Official Blog', 'inbound-pro'),
'href' => 'https://www.inboundnow.com/blog/',
'meta' => array('title' => __('Official Blog', 'inbound-pro'))
);
$secondary_menu_items['inboundsitesaccount'] = array(
'parent' => $hq_key,
'title' => __('My Account', 'inbound-pro'),
'href' => 'https://www.inboundnow.com/marketplace/account/',
'meta' => array('title' => __('My Account', 'inbound-pro'))
);
$secondary_menu_items['inboundsitesaccount-history'] = array(
'parent' => 'inboundsitesaccount',
'title' => __('Purchase History', 'inbound-pro'),
'href' => 'https://www.inboundnow.com/marketplace/account/purchase-history/',
'meta' => array('title' => __('Purchase History', 'inbound-pro'))
);
return $secondary_menu_items;
}
public static function load_debug($secondary_menu_items) {
$debug_key = 'inbound-debug';
$secondary_menu_items[$debug_key] = array(
'parent' => self::$inboundnow_menu_secondary_group_key,
'title' => __('<span style="color:#fff;font-size: 13px;margin-top: -1px;display: inline-block;">Debug Tools</span>', 'inbound-pro'),
'href' => "#",
'meta' => ""
);
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$param = (preg_match("/\?/", $actual_link)) ? "&" : '?';
if (preg_match("/inbound-dequeue-scripts/", $actual_link)) {
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
} else {
$actual_link = $actual_link . $param . 'inbound-dequeue-scripts';
}
$actual_link_two = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$param_two = (preg_match("/\?/", $actual_link_two)) ? "&" : '?';
if (preg_match("/inbound_js/", $actual_link_two)) {
$actual_link_two = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
} else {
$actual_link_two = $actual_link_two . $param_two . 'inbound_js';
}
$secondary_menu_items['inbound-debug-checkjs'] = array(
'parent' => $debug_key,
'title' => __('Check for Javascript Errors', 'inbound-pro'),
'href' => $actual_link_two,
'meta' => array('title' => __('Click here to check javascript errors on this page', 'inbound-pro'))
);
$secondary_menu_items['inbound-debug-turnoffscripts'] = array(
'parent' => $debug_key,
'title' => __('Remove Javascript Errors', 'inbound-pro'),
'href' => $actual_link,
'meta' => array('title' => __('Click here to remove broken javascript to fix issues', 'inbound-pro'))
);
$secondary_menu_items['inbound-debug-force-shared-db-routines'] = array(
'parent' => $debug_key,
'title' => __('Force apply all shared database routines.', 'inbound-pro'),
'href' => admin_url('index.php?force_upgrade_routines=true'),
'meta' => array('title' => __('Click here to re-run all database upgrade routines. ', 'inbound-pro'))
);
return apply_filters('inbound_menu_debug', $secondary_menu_items, $debug_key);
}
public static function enqueue_js_css() {
if (!is_user_logged_in()) {
return;
}
wp_enqueue_style('inbound_menu', INBOUNDNOW_SHARED_URLPATH . 'assets/css/admin/wpadminbar.css');
}
}
add_action('init', array('Inbound_Menus_Adminbar', 'init'));