AdminOptions.php
1 month ago
editor.php
1 month ago
manager.php
1 month ago
metabox.php
1 month ago
settings.php
1 month ago
whatsnew.php
1 month ago
settings.php
59 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | function tcmp_ui_track() { |
| 4 | global $tcmp; |
| 5 | |
| 6 | $track = tcmp_sqs( 'track', '' ); |
| 7 | if ( '' != $track ) { |
| 8 | $track = intval( $track ); |
| 9 | $tcmp->options->setTrackingEnable( $track ); |
| 10 | $tcmp->tracking->sendTracking( true ); |
| 11 | } |
| 12 | |
| 13 | $uri = TCMP_TAB_SETTINGS_URI . '&track='; |
| 14 | if ( $tcmp->options->isTrackingEnable() ) { |
| 15 | $uri .= '0'; |
| 16 | $tcmp->options->pushSuccessMessage( 'EnableAllowTrackingNotice', $uri ); |
| 17 | } else { |
| 18 | $uri .= '1'; |
| 19 | $tcmp->options->pushErrorMessage( 'DisableAllowTrackingNotice', $uri ); |
| 20 | } |
| 21 | $tcmp->options->writeMessages(); |
| 22 | } |
| 23 | function tcmp_ui_settings() { |
| 24 | global $tcmp; |
| 25 | |
| 26 | $tcmp->form->prefix = 'License'; |
| 27 | if ( $tcmp->check->nonce( 'tcmp_license' ) ) { |
| 28 | $options = $tcmp->options->getMetaboxPostTypes(); |
| 29 | foreach ( $options as $k => $v ) { |
| 30 | $v = tcmp_isqs( 'metabox_' . $k, 0 ); |
| 31 | $options[ $k ] = $v; |
| 32 | } |
| 33 | $tcmp->options->setMetaboxPostTypes( $options ); |
| 34 | |
| 35 | $tcmp->options->setHookPriority( $tcmp->utils->iqs( 'tcmpHookPriority', TCMP_HOOK_PRIORITY_DEFAULT ) ); |
| 36 | } |
| 37 | |
| 38 | $tcmp->form->form_starts(); |
| 39 | $tcmp->form->prefix = 'Priority'; |
| 40 | $tcmp->form->p( 'PrioritySection' ); |
| 41 | $tcmp->form->number( 'tcmpHookPriority', $tcmp->options->getHookPriority() ); |
| 42 | |
| 43 | $tcmp->form->prefix = 'License'; |
| 44 | $tcmp->form->p( 'MetaboxSection' ); |
| 45 | $metaboxes = $tcmp->options->getMetaboxPostTypes(); |
| 46 | |
| 47 | $types = $tcmp->utils->query( TCMP_QUERY_POST_TYPES ); |
| 48 | foreach ( $types as $v ) { |
| 49 | $v = $v['id']; |
| 50 | //$tcmp->form->tags=TRUE; |
| 51 | //$tcmp->form->premium=!in_array($v, array('post', 'page')); |
| 52 | $tcmp->form->checkbox( 'metabox_' . $v, $metaboxes[ $v ] ); |
| 53 | } |
| 54 | $tcmp->form->nonce( 'tcmp_license' ); |
| 55 | $tcmp->form->br(); |
| 56 | $tcmp->form->submit( 'Save' ); |
| 57 | $tcmp->form->form_ends(); |
| 58 | } |
| 59 |