-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 in WP/idx-broker-plugin from feature/WP-46 to …
…release/2.0.0 * commit '6550982c96cace6aee8e9db4af70e414236dac41': Add bullets to all tabs and add help to Wrappers UI as well per QA's request. Add IDX Pages tab to the Help Section. Add API Key Tab. Add links to kb articles and remove notification from settings page. Add Help information to settings page and when editing a page.
- Loading branch information
Showing
3 changed files
with
127 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?php | ||
namespace IDX; | ||
|
||
class Help | ||
{ | ||
public function __construct() | ||
{ | ||
add_action('load-post.php', array($this, 'add_pages_help_tabs'), 20); | ||
add_action('load-post-new.php', array($this, 'add_pages_help_tabs'), 20); | ||
add_action('load-edit.php', array($this, 'add_wrappers_help'), 20); | ||
add_action('current_screen', array($this, 'settings_help')); | ||
} | ||
|
||
public function settings_help() | ||
{ | ||
if (!empty($_GET['page']) && $_GET['page'] === 'idx-broker') { | ||
$this->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' => ' | ||
<strong>API Key</strong> | ||
<br>• The API key can be found in your <a href="https://middleware.idxbroker.com/mgmt/apikey.php" target="_blank">IDX Control Panel</a> under Home > API Control. | ||
<br>• For more information, see <a href="http://support.idxbroker.com/customer/en/portal/articles/1911631-api-key-control?b_id=10433" target="_blank">this article</a>. | ||
', | ||
), | ||
'idx_create_wrapper' => array( | ||
'title' => 'Create Wrapper' | ||
, 'content' => ' | ||
<strong>Create Wrapper</strong> - Wrappers set the overall styling of your IDX Broker pages. | ||
<br>• Create new page wrappers by entering a unique page name and selecting Update. | ||
<br>• These pages are added to your Wrappers menu, not your WordPress pages. | ||
<br>• For more information, see <a href="http://support.idxbroker.com/customer/en/portal/articles/1919274-automatically-create-wordpress-dynamic-wrapper" target="_blank">this article</a>. | ||
', | ||
), | ||
'idx_pages' => array( | ||
'title' => 'IDX Pages' | ||
, 'content' => ' | ||
<strong>IDX Pages</strong> - Integrating IDX Pages into your website. | ||
<br>• We recommend linking to IDX pages from your navigation by adding IDX Pages to your menus. | ||
<br>• You can add pages under the IDX Pages category under Appearance > Menus or Appearance > Customize > Menus. | ||
<br>• For more information, see <a href="http://support.idxbroker.com/customer/en/portal/articles/1917460-wordpress-plugin" target="_blank">this article</a>. | ||
', | ||
), | ||
'idx_apply_wrapper' => array( | ||
'title' => 'Apply Wrapper' | ||
, 'content' => ' | ||
<strong>Apply Wrapper</strong> - You may create many wrappers and use different ones for each category or page. | ||
<br>• To apply a new wrapper within WordPress, edit the Wrapper page from the IDX Broker/Wrappers menu. | ||
<br>• In edit mode select where to apply the wrapper in the upper right of the screen. | ||
<br>• For more information, see <a href="http://support.idxbroker.com/customer/en/portal/articles/1919274-automatically-create-wordpress-dynamic-wrapper" target="_blank">this article</a>. | ||
', | ||
), | ||
'idx_shortcodes' => array( | ||
'title' => 'IDX Shortcodes' | ||
, 'content' => ' | ||
<strong>Insert Shortcode</strong> - Insert IDX Broker content in any page or post. | ||
<br>• Select the Insert IDX Shortcode button | ||
<br>• System and Saved Links add an external link to IDX Broker pages | ||
<br>• Widgets add widget content into your page. | ||
<br>• Omnibar adds a property listing search bar to any of your pages | ||
<br>• For more information, see <a href="http://support.idxbroker.com/customer/en/portal/articles/1917460-wordpress-plugin" target="_blank">this article</a>. | ||
', | ||
), | ||
); | ||
|
||
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( | ||
'<p><a href="https://middleware.idxbroker.com/mgmt/login.php" target="_blank">IDX Control Panel</a></p>' . | ||
'<p><a href="http://support.idxbroker.com/customer/en/portal/topics/784215-wordpress/articles" target="_blank">IDX Plugin Knowledgebase</a></p>' . | ||
'<p><a href="http://support.idxbroker.com" target="_blank">IDX Support</a></p>' | ||
); | ||
} | ||
} | ||
|
||
public function prepare($screen, $tab) | ||
{ | ||
printf( | ||
'<p>%s</p>', | ||
__( | ||
$tab['callback'][0]->tabs[$tab['id']]['content'], | ||
'idxbroker' | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters