diff --git a/idx-broker-platinum/idx/help.php b/idx-broker-platinum/idx/help.php new file mode 100755 index 000000000..3d5784372 --- /dev/null +++ b/idx-broker-platinum/idx/help.php @@ -0,0 +1,123 @@ +add_settings_help_tabs(); + } + } + + public function add_wrappers_help() + { + if (!empty($_GET['post_type']) && $_GET['post_type'] === 'idx-wrapper') { + $this->add_settings_help_tabs(); + } + } + + public $tabs = array( + // The assoc key represents the ID + // It is NOT allowed to contain spaces + 'idx_api_key' => array( + 'title' => 'API Key' + , 'content' => ' + API Key +
• The API key can be found in your IDX Control Panel under Home > API Control. +
• For more information, see this article. + ', + ), + 'idx_create_wrapper' => array( + 'title' => 'Create Wrapper' + , 'content' => ' + Create Wrapper - Wrappers set the overall styling of your IDX Broker pages. +
• Create new page wrappers by entering a unique page name and selecting Update. +
• These pages are added to your Wrappers menu, not your WordPress pages. +
• For more information, see this article. + ', + ), + 'idx_pages' => array( + 'title' => 'IDX Pages' + , 'content' => ' + IDX Pages - Integrating IDX Pages into your website. +
• We recommend linking to IDX pages from your navigation by adding IDX Pages to your menus. +
• You can add pages under the IDX Pages category under Appearance > Menus or Appearance > Customize > Menus. +
• For more information, see this article. + ', + ), + 'idx_apply_wrapper' => array( + 'title' => 'Apply Wrapper' + , 'content' => ' + Apply Wrapper - You may create many wrappers and use different ones for each category or page. +
• To apply a new wrapper within WordPress, edit the Wrapper page from the IDX Broker/Wrappers menu. +
• In edit mode select where to apply the wrapper in the upper right of the screen. +
• For more information, see this article. + ', + ), + 'idx_shortcodes' => array( + 'title' => 'IDX Shortcodes' + , 'content' => ' + Insert Shortcode - Insert IDX Broker content in any page or post. +
• Select the Insert IDX Shortcode button +
• System and Saved Links add an external link to IDX Broker pages +
• Widgets add widget content into your page. +
• Omnibar adds a property listing search bar to any of your pages +
• For more information, see this article. + ', + ), + ); + + public function add_pages_help_tabs() + { + $id = 'idx_shortcodes'; + $data = $this->tabs['idx_shortcodes']; + $screen = get_current_screen(); + $screen->add_help_tab(array( + 'id' => $id + , 'title' => __($data['title'], 'idxbroker') + // Use the content only if you want to add something + // static on every help tab. Example: Another title inside the tab + , 'callback' => array($this, "prepare"), + )); + } + + public function add_settings_help_tabs() + { + $tabs = $this->tabs; + foreach ($tabs as $id => $data) { + $screen = get_current_screen(); + $screen->add_help_tab(array( + 'id' => $id + , 'title' => __($data['title'], 'idxbroker') + // Use the content only if you want to add something + // static on every help tab. Example: Another title inside the tab + , 'callback' => array($this, 'prepare'), + )); + $screen->set_help_sidebar( + '

IDX Control Panel

' . + '

IDX Plugin Knowledgebase

' . + '

IDX Support

' + ); + } + } + + public function prepare($screen, $tab) + { + printf( + '

%s

', + __( + $tab['callback'][0]->tabs[$tab['id']]['content'], + 'idxbroker' + ) + ); + } +} diff --git a/idx-broker-platinum/idx/initiate-plugin.php b/idx-broker-platinum/idx/initiate-plugin.php index d7e8093b2..ad04d618a 100755 --- a/idx-broker-platinum/idx/initiate-plugin.php +++ b/idx-broker-platinum/idx/initiate-plugin.php @@ -32,6 +32,7 @@ public function __construct() new Shortcodes\Register_Impress_Shortcodes(); new Widgets\Omnibar\Create_Omnibar(); new Shortcodes\Shortcode_Ui(); + new Help(); } const IDX_API_DEFAULT_VERSION = '1.2.0'; @@ -174,7 +175,6 @@ public function idx_inject_script_and_style($page) if ('toplevel_page_idx-broker' !== $page) { return; } - add_action('admin_notices', array($this, 'idx_instructions')); wp_enqueue_script('idxjs', plugins_url('../assets/js/idx-broker.js', __FILE__), 'jquery'); wp_enqueue_style('idxcss', plugins_url('../assets/css/idx-broker.css', __FILE__)); } @@ -190,12 +190,4 @@ public function idx_broker_platinum_admin_page() include plugin_dir_path(__FILE__) . 'views/admin.php'; } - public function idx_instructions() - { - echo '
'; - echo '

'; - echo 'Not sure how to integrate IDX content? See this knowledgebase article.'; - echo '

'; - echo '
'; - } } diff --git a/idx-broker-platinum/idx/views/admin.php b/idx-broker-platinum/idx/views/admin.php index 184a39c96..16948332c 100755 --- a/idx-broker-platinum/idx/views/admin.php +++ b/idx-broker-platinum/idx/views/admin.php @@ -33,26 +33,19 @@
- -

IDX Broker® Plugin Settings

+

IMPress for IDX Broker® Settings

- +

-
You will find your API Key under Home > API Control in your IDX Control Panel.
@@ -74,7 +67,7 @@
-

Set up the Global Wrapperhelp

+

Create the Global Wrapperhelp

Setting this up will match the IDX pages to your website design automatically every few hours.
Example: Properties