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