editor.php
4 years ago
manager.php
4 years ago
metabox.php
4 years ago
settings.php
4 years ago
whatsnew.php
4 years ago
settings.php
57 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->formStarts(); |
| 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->formEnds(); |
| 57 | } |