item-fields.php
4 years ago
layout-settings.php
4 years ago
post-source.php
4 years ago
sc-settings.php
4 years ago
settings.php
4 years ago
style.php
4 years ago
settings.php
88 lines
| 1 | <?php |
| 2 | |
| 3 | use RT\ThePostGrid\Helpers\Fns; |
| 4 | use RT\ThePostGrid\Helpers\Options; |
| 5 | |
| 6 | ?> |
| 7 | <div class="wrap rttpg-wrapper"> |
| 8 | <div id="upf-icon-edit-pages" class="icon32 icon32-posts-page"><br/></div> |
| 9 | <h2><?php _e( 'The Post Grid Settings', 'the-post-grid' ); ?></h2> |
| 10 | <h3><?php _e( 'General settings', 'the-post-grid' ); ?> |
| 11 | <a style="margin-left: 15px; font-size: 15px;" |
| 12 | href="https://www.radiustheme.com/docs/the-post-grid/" |
| 13 | target="_blank"><?php _e( 'Documentation', 'the-post-grid' ) ?></a> |
| 14 | </h3> |
| 15 | |
| 16 | <div class="rt-setting-wrapper"> |
| 17 | <div class="rt-response"></div> |
| 18 | <form id="rt-tpg-settings-form"> |
| 19 | <?php |
| 20 | $settings = get_option( rtTPG()->options['settings'] ); |
| 21 | $last_tab = isset( $settings['_tpg_last_active_tab'] ) ? trim( $settings['_tpg_last_active_tab'] ) : 'common-settings'; |
| 22 | $html = null; |
| 23 | $html .= '<div id="settings-tabs" class="rt-tabs rt-tab-container">'; |
| 24 | |
| 25 | $html .= '<ul class="tab-nav rt-tab-nav">'; |
| 26 | $html .= sprintf( |
| 27 | '<li%s><a href="#common-settings">%s</a></li> |
| 28 | <li%s><a href="#popup-fields">%s</a></li> |
| 29 | <li%s><a href="#social-share">%s</a></li> |
| 30 | <li%s><a href="#custom-script">%s</a></li> |
| 31 | <li%s><a href="#other-settings">%s</a></li>', |
| 32 | $last_tab == "common-settings" ? ' class="active"' : '', |
| 33 | __( 'Common Settings', 'the-post-grid' ), |
| 34 | $last_tab == "popup-fields" ? ' class="active"' : '', |
| 35 | __( 'PopUp field selection', 'the-post-grid' ), |
| 36 | $last_tab == "social-share" ? ' class="active"' : '', |
| 37 | __( 'Social Share', 'the-post-grid' ), |
| 38 | $last_tab == "custom-script" ? ' class="active"' : '', |
| 39 | __( 'Custom Script', 'the-post-grid' ), |
| 40 | $last_tab == "other-settings" ? ' class="active"' : '', |
| 41 | __( 'Other Settings', 'the-post-grid' ) |
| 42 | ); |
| 43 | |
| 44 | ob_start(); |
| 45 | do_action( 'tpg_settings_tab_title', $last_tab ); |
| 46 | $html .= ob_get_clean(); |
| 47 | |
| 48 | $html .= '</ul>'; |
| 49 | |
| 50 | $html .= sprintf( '<div id="common-settings" class="rt-tab-content"%s>', $last_tab == "common-settings" ? ' style="display:block"' : '' ); |
| 51 | $html .= Fns::rtFieldGenerator( Options::rtTPGSettingsCommonSettingsFields() ); |
| 52 | $html .= '</div>'; |
| 53 | |
| 54 | $html .= sprintf( '<div id="popup-fields" class="rt-tab-content"%s>', $last_tab == "popup-fields" ? ' style="display:block"' : '' ); |
| 55 | $html .= Fns::rtFieldGenerator( Options::rtTpgSettingsDetailFieldSelection() ); |
| 56 | $html .= '</div>'; |
| 57 | |
| 58 | $html .= sprintf( '<div id="social-share" class="rt-tab-content"%s>', $last_tab == "social-share" ? ' style="display:block"' : '' ); |
| 59 | $html .= Fns::rtFieldGenerator( Options::rtTPGSettingsSocialShareFields() ); |
| 60 | $html .= '</div>'; |
| 61 | |
| 62 | $html .= sprintf( '<div id="custom-script" class="rt-tab-content"%s>', $last_tab == "custom-script" ? ' style="display:block"' : '' ); |
| 63 | $html .= Fns::rtFieldGenerator( Options::rtTPGSettingsCustomScriptFields() ); |
| 64 | $html .= '</div>'; |
| 65 | |
| 66 | $html .= sprintf( '<div id="other-settings" class="rt-tab-content"%s>', $last_tab == "other-settings" ? ' style="display:block"' : '' ); |
| 67 | $html .= Fns::rtFieldGenerator( Options::rtTPGSettingsOtherSettingsFields() ); |
| 68 | $html .= '</div>'; |
| 69 | |
| 70 | ob_start(); |
| 71 | do_action( 'tpg_settings_tab_content', $last_tab ); |
| 72 | $html .= ob_get_clean(); |
| 73 | |
| 74 | $html .= sprintf( '<input type="hidden" id="_tpg_last_active_tab" name="_tpg_last_active_tab" value="%s"/>', $last_tab ); |
| 75 | $html .= '</div>'; |
| 76 | |
| 77 | echo $html; |
| 78 | ?> |
| 79 | <p class="submit-wrap"><input type="submit" name="submit" class="button button-primary rtSaveButton" |
| 80 | value="Save Changes"></p> |
| 81 | |
| 82 | <?php wp_nonce_field( rtTPG()->nonceText(), rtTPG()->nonceId() ); ?> |
| 83 | </form> |
| 84 | |
| 85 | <div class="rt-response"></div> |
| 86 | </div> |
| 87 | </div> |
| 88 |