Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- /**
- * ExpressionEngine - by EllisLab
- *
- * @package ExpressionEngine
- * @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
- * @license http://expressionengine.com/user_guide/license.html
- * @link http://expressionengine.com
- * @since Version 2.0
- * @filesource
- */
- // ------------------------------------------------------------------------
- /**
- * Contact Notify Extension
- *
- * @package ExpressionEngine
- * @subpackage Addons
- * @category Extension
- * @author James Seavers
- * @link http://www.symphonyonline.co.uk
- */
- class Contact_notify_ext {
- public $settings = array();
- public $description = 'Notifies when an entry is created in contact request channel after changing some data';
- public $docs_url = '';
- public $name = 'Contact Notify';
- public $settings_exist = 'n';
- public $version = '1.0';
- private $EE;
- private $recipient = 'me@gmail.com';
- /**
- * Constructor
- *
- * @param mixed Settings array or empty string if none exist.
- */
- public function __construct($settings = '')
- {
- $this->EE =& get_instance();
- $this->settings = $settings;
- }// ----------------------------------------------------------------------
- /**
- * Activate Extension
- *
- * This function enters the extension into the exp_extensions table
- *
- * @see http://codeigniter.com/user_guide/database/index.html for
- * more information on the db class.
- *
- * @return void
- */
- public function activate_extension()
- {
- // Setup custom settings in this array.
- $this->settings = array();
- $data = array(
- 'class' => __CLASS__,
- 'method' => 'change_data',
- 'hook' => 'entry_submission_ready',
- 'settings' => serialize($this->settings),
- 'version' => $this->version,
- 'enabled' => 'y'
- );
- $this->EE->db->insert('extensions', $data);
- }
- // ----------------------------------------------------------------------
- /**
- * change_data
- *
- * @param
- * @return
- */
- public function change_data($meta, &$data, $autosave=false)
- {
- $data['field_id_60'] = 'test';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement