function smart_show_console() { define('PLUGINS_FILE_PATH', dirname(dirname(__FILE__))); define('SM_PLUGIN_DIRNAME', plugins_url('', __FILE__)); define('IMG_URL', SM_PLUGIN_DIRNAME . '/images/'); define('SM_BETA_IMG_URL', SM_PLUGIN_DIRNAME . '/new/assets/images/'); if (WPSC_RUNNING === true) { $json_filename = IS_WPSC37 ? 'json37' : 'json38'; } else { if (WOO_RUNNING === true) { $json_filename = 'woo-json'; } } // define( 'JSON_URL', SM_PLUGIN_DIRNAME . "/sm/$json_filename.php" ); define('JSON_URL', $json_filename); define('ADMIN_URL', get_admin_url()); //defining the admin url define('ABS_WPSC_URL', WP_PLUGIN_DIR . '/wp-e-commerce'); define('WPSC_NAME', 'wp-e-commerce'); $latest_version = smart_get_latest_version(); $is_pro_updated = smart_is_pro_updated(); // if (isset( $_GET ['action'] ) && $_GET ['action'] == 'sm-settings') { // smart_settings_page(); // } else { $base_path = WP_PLUGIN_DIR . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__)) . 'sm/'; ?> <div class="wrap"> <div id="icon-smart-manager" class="icon32"><br /> </div> <style> div#TB_window { background: lightgrey; } </style> <?php if (SMPRO === true && function_exists('smart_support_ticket_content')) { smart_support_ticket_content(); } ?> <h2><?php echo 'Smart Manager '; echo SMPRO === true ? 'Pro' : 'Lite'; $before_plug_page = ''; $after_plug_page = ''; $plug_page = ''; ?> <span style="float:right; margin: -6px -21px -20px 0px;"> <!-- <a href="http://www.storeapps.org/?buy-now=742&coupon=sm-festive-40-2013&utm_source=SM&utm_medium=Lite&utm_campaign=Festive2013" target="_blank"> <img src="<?php echo IMG_URL . '40perc-off-sm-thanks2013.png'; ?> " alt="40peroff"> </a> --> <a href="http://www.storeapps.org/sm-in-app-promo" target="_blank"> <img src="<?php echo IMG_URL . 'sm-in-app-promo.png'; ?> " alt=""> </a> </span> <p class="wrap" style="font-size: 12px; margin: 18px -21px 0px 5px;"><span style="float: right; line-height: 17px;"> <?php if (SMPRO === true && !is_multisite()) { $before_plug_page .= '<a href="admin.php?page=smart-manager-'; $after_plug_page = '&action=sm-settings">Settings</a> | '; if (WPSC_RUNNING == true) { $plug_page = 'wpsc'; } elseif (WOO_RUNNING == true) { $plug_page = 'woo'; } } else { $before_plug_page = ''; $after_plug_page = ''; $plug_page = ''; } $sm_beta = ''; if (isset($_GET['page']) && ($_GET['page'] == "smart-manager-woo" || $_GET['page'] == "smart-manager-wpsc")) { $sm_beta = '<a href="' . admin_url('edit.php?post_type=' . $_GET['post_type'] . '&page=' . $_GET['page'] . '&sm_beta=1') . '" title="' . __('Try out Smart Manager Beta', SM_TEXT_DOMAIN) . '"> ' . __('Try out Smart Manager Beta', SM_TEXT_DOMAIN) . '</a> <sup style="vertical-align: super;color:red;">New</sup> | '; } if (SMPRO === true) { if (!wp_script_is('thickbox')) { if (!function_exists('add_thickbox')) { require_once ABSPATH . 'wp-includes/general-template.php'; } add_thickbox(); } $before_plug_page = '<a href="edit.php#TB_inline?max-height=420px&inlineId=smart_manager_post_query_form" title="Send your query" class="thickbox" id="support_link">Need Help?</a> | '; $before_plug_page = apply_filters('sm_before_plug_page', $before_plug_page); if (is_super_admin()) { $before_plug_page .= '<a href="options-general.php?page=smart-manager-settings">Settings</a> | '; } } // printf ( __ ( '%1s%2s%3s<a href="%4s" target=_storeapps>Docs</a>' , SM_TEXT_DOMAIN), $before_plug_page, $plug_page, $after_plug_page, "http://www.storeapps.org/support/documentation/" ); printf(__('%1s%2s<a href="%3s" target="_blank">Docs</a>', SM_TEXT_DOMAIN), $sm_beta, $before_plug_page, "http://www.storeapps.org/support/documentation/smart-manager"); ?> </span><?php _e('10x productivity gains with store administration. Quickly find and update products, orders and customers', SM_TEXT_DOMAIN); ?> </p> </h2> <h6 align="right"><?php if (!$is_pro_updated) { $admin_url = ADMIN_URL . "plugins.php"; $update_link = __('An upgrade for Smart Manager Pro', SM_TEXT_DOMAIN) . " " . $latest_version . " " . __('is available.', SM_TEXT_DOMAIN) . " " . "<a align='right' href={$admin_url}>" . __('Click to upgrade.', SM_TEXT_DOMAIN) . "</a>"; smart_display_notice($update_link); } ?> </h6> <!--<h6 align="right"> <?php if (SMPRO === true) { $sm_license_key = smart_get_license_key(); if ($sm_license_key == '') { if (!is_multisite()) { if (WPSC_RUNNING == true) { $plug_page = 'wpsc'; } elseif (WOO_RUNNING == true) { $plug_page = 'woo'; } smart_display_notice(__('Please enter your license key for automatic upgrades and support to get activated.', SM_TEXT_DOMAIN) . '<a href=admin.php?page=smart-manager-' . $plug_page . '&action=sm-settings>' . __('Enter License Key', SM_TEXT_DOMAIN) . '</a>'); } } } ?> </h6>--> </div> <?php if (SMPRO === false) { ?> <div id="message" class="updated fade" style="display:block !important;"> <!-- <span style="float:right; margin-top: -1px; margin-right: -15px"> <a href="http://www.storeapps.org/?buy-now=742&coupon=sm-festive-40-2013&utm_source=SM&utm_medium=Lite&utm_campaign=Festive2013" target="_blank"> <img src="<?php echo IMG_URL . '40perc-off-sm-thanks2013.png'; ?> " alt="40peroff"> </a> </span> --> <p><?php // printf( ('<b>' . __( 'Important:', SM_TEXT_DOMAIN ) . '</b> ' . __( 'Upgrading to Pro gives you powerful features like \'<i>Batch Update</i>\' , \'<i>Export CSV</i>\' , \'<i>Duplicate Products</i>\' & many more...', SM_TEXT_DOMAIN ) . " " . '<br /><a href="%1s" target=_storeapps>' . " " .__( 'Learn more about Pro version here', SM_TEXT_DOMAIN ) . '</a> ' . __( 'or take a', SM_TEXT_DOMAIN ) . " " . '<a href="%2s" target=_livedemo>' . " " . __( 'Live Demo here', SM_TEXT_DOMAIN ) . '</a>'), 'http://www.storeapps.org/product/smart-manager', 'http://demo.storeapps.org/?p=1' ); printf('<b>' . __('Important:', SM_TEXT_DOMAIN) . '</b> ' . __('Upgrade to Pro to get features like \'<i>Batch Update</i>\' , \'<i>Export CSV</i>\' , \'<i>Duplicate Products</i>\' & many more...', SM_TEXT_DOMAIN) . " " . '<br /><a href="%1s" target=_storeapps>' . " " . __('Learn more about Pro version', SM_TEXT_DOMAIN) . '</a> ' . __('or take a', SM_TEXT_DOMAIN) . " " . '<a href="%2s" target=_livedemo>' . " " . __('Live Demo', SM_TEXT_DOMAIN) . '</a>', 'http://www.storeapps.org/product/smart-manager', 'http://demo.storeapps.org/?demo=sm-woo'); ?> </p> </div> <?php } ?> <?php $error_message = ''; if (file_exists(WP_PLUGIN_DIR . '/wp-e-commerce/wp-shopping-cart.php') && file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) { if (is_plugin_active('wp-e-commerce/wp-shopping-cart.php')) { require_once WPSC_FILE_PATH . '/wp-shopping-cart.php'; // if (IS_WPSC37 || IS_WPSC38) { if (version_compare(WPSC_VERSION, '3.8', '>=')) { if (file_exists($base_path . 'manager-console.php')) { include_once $base_path . 'manager-console.php'; return; } else { $error_message = __("A required Smart Manager file is missing. Can't continue.", SM_TEXT_DOMAIN); } } else { $error_message = __('Smart Manager currently works only with WP e-Commerce 3.7 or above.', SM_TEXT_DOMAIN); } } else { if (is_plugin_active('woocommerce/woocommerce.php')) { if (IS_WOO13) { $error_message = __('Smart Manager currently works only with WooCommerce 1.4 or above.', SM_TEXT_DOMAIN); } else { if (file_exists($base_path . 'manager-console.php')) { include_once $base_path . 'manager-console.php'; return; } else { $error_message = __("A required Smart Manager file is missing. Can't continue.", SM_TEXT_DOMAIN); } } } else { $error_message = "<b>" . __('Smart Manager', SM_TEXT_DOMAIN) . "</b> " . __('add-on requires', SM_TEXT_DOMAIN) . " " . '<a href="http://www.storeapps.org/wpec/">' . __('WP e-Commerce', SM_TEXT_DOMAIN) . "</a>" . " " . __('plugin or', SM_TEXT_DOMAIN) . " " . '<a href="http://www.storeapps.org/woocommerce/">' . __('WooCommerce', SM_TEXT_DOMAIN) . "</a>" . " " . __('plugin. Please install and activate it.', SM_TEXT_DOMAIN); } } } else { if (file_exists(WP_PLUGIN_DIR . '/wp-e-commerce/wp-shopping-cart.php')) { if (is_plugin_active('wp-e-commerce/wp-shopping-cart.php')) { require_once WPSC_FILE_PATH . '/wp-shopping-cart.php'; if (IS_WPSC37 || IS_WPSC38) { if (file_exists($base_path . 'manager-console.php')) { include_once $base_path . 'manager-console.php'; return; } else { $error_message = __("A required Smart Manager file is missing. Can't continue.", SM_TEXT_DOMAIN); } } else { $error_message = __('Smart Manager currently works only with WP e-Commerce 3.7 or above.', SM_TEXT_DOMAIN); } } else { $error_message = __('WP e-Commerce plugin is not activated.', SM_TEXT_DOMAIN) . "<br/><b>" . _e('Smart Manager', SM_TEXT_DOMAIN) . "</b> " . _e('add-on requires WP e-Commerce plugin, please activate it.', SM_TEXT_DOMAIN); } } else { if (file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) { if (is_plugin_active('woocommerce/woocommerce.php')) { if (IS_WOO13) { $error_message = __('Smart Manager currently works only with WooCommerce 1.4 or above.', SM_TEXT_DOMAIN); } else { if (file_exists($base_path . 'manager-console.php')) { include_once $base_path . 'manager-console.php'; return; } else { $error_message = __("A required Smart Manager file is missing. Can't continue.", SM_TEXT_DOMAIN); } } } else { $error_message = __('WooCommerce plugin is not activated.', SM_TEXT_DOMAIN) . "<br/><b>" . __('Smart Manager', SM_TEXT_DOMAIN) . "</b> " . __('add-on requires WooCommerce plugin, please activate it.', SM_TEXT_DOMAIN); } } else { $error_message = "<b>" . __('Smart Manager', SM_TEXT_DOMAIN) . "</b> " . __('add-on requires', SM_TEXT_DOMAIN) . " " . '<a href="http://www.storeapps.org/wpec/">' . __('WP e-Commerce', SM_TEXT_DOMAIN) . "</a>" . " " . __('plugin or', SM_TEXT_DOMAIN) . " " . '<a href="http://www.storeapps.org/woocommerce/">' . __('WooCommerce', SM_TEXT_DOMAIN) . "</a>" . " " . __('plugin. Please install and activate it.', SM_TEXT_DOMAIN); } } } if ($error_message != '') { smart_display_err($error_message); ?> </p> </div> <?php } }
function show_console_beta() { global $wpdb; $latest_version = $this->get_latest_version(); $is_pro_updated = $this->is_pro_updated(); ?> <div class="wrap"> <div id="icon-smart-manager" class="icon32"><br /> </div> <style> div#TB_window { background: lightgrey; } </style> <?php if (SMPRO === true && function_exists('smart_support_ticket_content')) { smart_support_ticket_content(); } ?> <h2><?php echo 'Smart Manager <sup style="vertical-align:super;color:red;font-size:small;">Beta</sup>'; // echo (SMPRO === true) ? 'Pro' : 'Lite'; $plug_page = ''; $sm_promo_img_url = "http://www.storeapps.org/ads/sm-in-app.png?d=" . date("Ymd"); ?> <span style="float:right; margin: -6px -21px -20px 0px;"> <a href="http://www.storeapps.org/sm-in-app-promo" target="_blank"> <img src="<?php echo $sm_promo_img_url; ?> " alt=""> </a> </span> <p class="wrap" style="font-size: 12px; margin: 18px -21px 0px 5px;"><span style="float: right; line-height: 17px;"> <?php if (SMPRO === true && !is_multisite()) { $plug_page .= '<a href="admin.php?page=smart-manager&action=sm-settings">Settings</a> | '; } else { $plug_page = ''; } $sm_old = ''; if (isset($_GET['page']) && ($_GET['page'] == "smart-manager-woo" || $_GET['page'] == "smart-manager-wpsc")) { $sm_old = '<a href="' . admin_url('edit.php?post_type=product&page=' . $_GET['page']) . '" title="' . __('Switch back to Smart Manager', 'smart-manager') . '"> ' . __('Switch back to Smart Manager', 'smart-manager') . '</a> | '; } if (SMPRO === true) { if (!wp_script_is('thickbox')) { if (!function_exists('add_thickbox')) { require_once ABSPATH . 'wp-includes/general-template.php'; } add_thickbox(); } $before_plug_page = '<a href="edit.php#TB_inline?max-height=420px&inlineId=smart_manager_post_query_form" title="Send your query" class="thickbox" id="support_link">Need Help?</a> | '; $before_plug_page = apply_filters('sm_before_plug_page', $before_plug_page); if (is_super_admin()) { $before_plug_page .= '<a href="options-general.php?page=smart-manager-settings">Settings</a> | '; } } // printf ( __ ( '%1s%2s%3s<a href="%4s" target=_storeapps>Docs</a>' , 'smart-manager'), $before_plug_page, $plug_page, $after_plug_page, "http://www.storeapps.org/support/documentation/" ); printf(__('%1s%2s<a href="%3s" target="_blank">Docs</a>', 'smart-manager'), $sm_old, $before_plug_page, "http://www.storeapps.org/support/documentation/smart-manager"); ?> </span><?php _e('10x productivity gains with store administration. Quickly find and update products, orders and customers', 'smart-manager'); ?> </p> </h2> <h6 align="right"><?php if (!$is_pro_updated) { $admin_url = ADMIN_URL . "plugins.php"; $update_link = __('An upgrade for Smart Manager Pro', 'smart-manager') . " " . $latest_version . " " . __('is available.', 'smart-manager') . " " . "<a align='right' href={$admin_url}>" . __('Click to upgrade.', 'smart-manager') . "</a>"; $this->display_notice($update_link); } ?> </h6> <?php if (SMPRO === false && get_option('sm_in_app_promo') == 0) { ?> <div id="message" class="updated fade"> <p><?php printf('<b>' . __('Important:', 'smart-manager') . '</b> ' . __('Upgrade to Pro to get features like \'<i>Batch Update</i>\' , \'<i>Export CSV</i>\' , \'<i>Duplicate Products</i>\' & many more...', 'smart-manager') . " " . '<br /><a href="%1s" target=_storeapps>' . " " . __('Learn more about Pro version', 'smart-manager') . '</a> ' . __('or take a', 'smart-manager') . " " . '<a href="%2s" target=_livedemo>' . " " . __('Live Demo', 'smart-manager') . '</a>', 'http://www.storeapps.org/product/smart-manager', 'http://demo.storeapps.org/?demo=sm-woo'); ?> </p> </div> <?php } ?> <br /> <div id="sm_top_bar"></div> <table id="sm_editor_grid" ></table> <div id="sm_pagging_bar"></div> <div id="sm_beta_social_links" class="wrap"> <?php echo $this->add_social_links(); ?> </div> <?php }