Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. /**
  4. * ExpressionEngine - by EllisLab
  5. *
  6. * @package ExpressionEngine
  7. * @author ExpressionEngine Dev Team
  8. * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
  9. * @license http://expressionengine.com/user_guide/license.html
  10. * @link http://expressionengine.com
  11. * @since Version 2.0
  12. * @filesource
  13. */
  14.  
  15. // ------------------------------------------------------------------------
  16.  
  17. /**
  18. * Contact Notify Extension
  19. *
  20. * @package ExpressionEngine
  21. * @subpackage Addons
  22. * @category Extension
  23. * @author James Seavers
  24. * @link http://www.symphonyonline.co.uk
  25. */
  26.  
  27. class Contact_notify_ext {
  28.  
  29. public $settings = array();
  30. public $description = 'Notifies when an entry is created in contact request channel after changing some data';
  31. public $docs_url = '';
  32. public $name = 'Contact Notify';
  33. public $settings_exist = 'n';
  34. public $version = '1.0';
  35.  
  36. private $EE;
  37.  
  38. private $recipient = 'me@gmail.com';
  39.  
  40. /**
  41. * Constructor
  42. *
  43. * @param mixed Settings array or empty string if none exist.
  44. */
  45. public function __construct($settings = '')
  46. {
  47. $this->EE =& get_instance();
  48. $this->settings = $settings;
  49. }// ----------------------------------------------------------------------
  50.  
  51. /**
  52. * Activate Extension
  53. *
  54. * This function enters the extension into the exp_extensions table
  55. *
  56. * @see http://codeigniter.com/user_guide/database/index.html for
  57. * more information on the db class.
  58. *
  59. * @return void
  60. */
  61. public function activate_extension()
  62. {
  63. // Setup custom settings in this array.
  64. $this->settings = array();
  65.  
  66. $data = array(
  67. 'class' => __CLASS__,
  68. 'method' => 'change_data',
  69. 'hook' => 'entry_submission_ready',
  70. 'settings' => serialize($this->settings),
  71. 'version' => $this->version,
  72. 'enabled' => 'y'
  73. );
  74.  
  75. $this->EE->db->insert('extensions', $data);
  76.  
  77. }
  78.  
  79. // ----------------------------------------------------------------------
  80.  
  81. /**
  82. * change_data
  83. *
  84. * @param
  85. * @return
  86. */
  87. public function change_data($meta, &$data, $autosave=false)
  88. {
  89. $data['field_id_60'] = 'test';
  90. }
  91.  
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement