Advertisement
Guest User

Untitled

a guest
Dec 7th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <?php
  2.  
  3. if ( !class_exists( 'ubam_oto' ) ) {
  4. class ubam_oto
  5. {
  6. var $optionsName = 'ubam_oto_options';
  7. var $localizationDomain = "ubam_oto";
  8. var $thispluginurl = '';
  9. var $thispluginpath = '';
  10. var $options = array( );
  11. function ubam_oto( )
  12. {
  13. $locale = get_locale();
  14. $mo = dirname( __FILE__ ) . "/languages/" . $this->localizationDomain . "-" . $locale . ".mo";
  15. load_textdomain( $this->localizationDomain, $mo );
  16. $this->thispluginurl = PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
  17. $this->thispluginpath = PLUGIN_PATH . '/' . dirname( plugin_basename( __FILE__ ) ) . '/';
  18. $this->getOptions();
  19. add_action( "admin_menu", array(
  20. &$this,
  21. "admin_menu_link"
  22. ) );
  23. add_action( "init", array(
  24. &$this,
  25. "ubam_oto_handler"
  26. ) );
  27. }
  28. function getOptions( )
  29. {
  30. if ( !$theOptions = get_option( $this->optionsName ) ) {
  31. $theOptions = array(
  32. 'default' => 'options'
  33. );
  34. update_option( $this->optionsName, $theOptions );
  35. }
  36. $this->options = $theOptions;
  37. }
  38. function saveAdminOptions( )
  39. {
  40. return update_option( $this->optionsName, $this->options );
  41. }
  42. function admin_menu_link( )
  43. {
  44. add_options_page( 'One-Time Offer', 'One-Time Offer', 'manage_options', 'one-time-offer.php', array(
  45. &$this,
  46. 'admin_options_page'
  47. ) );
  48. add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array(
  49. &$this,
  50. 'filter_plugin_actions'
  51. ), 10, 2 );
  52. }
  53. function filter_plugin_actions( $links, $file )
  54. {
  55. $settings_link = '<a href="options-general.php?page=' . basename( __FILE__ ) . '">' . __( 'Settings' ) . '</a>';
  56. array_unshift( $links, $settings_link );
  57. return $links;
  58. }
  59. .............................................................
  60. ..................................
  61. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement