Sunday, June 19, 2016

Create Logic Hook When plugin install

<?php
/**
 * Created Ankit Garg
 * Website www.ankitgarg.co.in
 * Mail: engankit30@gmail.com
 * Yahoo/Skype: ankitgarg306
 * Date: 06/14/16
 * Time: 4:05 PM
 * File manifest.php.
 */


$manifest = array(
    array(
        'acceptable_sugar_versions' => array(),
    ),
    array(
        'acceptable_sugar_flavors' => array(
            'CE',
            'PRO',
            'ENT',
        ),
    ),
    'readme' => '',
    'key' => 'IDEA',
    'author' => 'ideadunes',
    'description' => 'Idea Signature',
    'icon' => '',
    'is_uninstallable' => true,
    'name' => 'IDEA_signature',
    'published_date' => '2013-11-21 00:00:00',
    'type' => 'module',
    'version' => '1.0',
    'remove_tables' => 'prompt',
);

$installdefs = array(
        'id' => 'idea_signature',
        'copy' => array(
            0 => array(
                'from' => '<basepath>/Files/custom/modules/Users/idea_sign.php',
                'to' => 'custom/modules/Users/idea_sign.php',
            ),
1 => array(
                'from' => '<basepath>/Files/custom/Extension/modules/Administration/Ext/Administration/ideasignature.php',
                'to' => 'custom/Extension/modules/Administration/Ext/Administration/ideasignature.php',
            ),
2 => array(
                'from' => '<basepath>/Files/custom/modules/Administration/idea_signature.php',
                'to' => 'custom/modules/Administration/idea_signature.php',
            ),
3 => array(
                'from' => '<basepath>/Files/custom/modules/Administration/idea_signature.tpl',
                'to' => 'custom/modules/Administration/idea_signature.tpl',
            ),
),
        'logic_hooks' => array(
            array(
                'module' => 'Users',
                'hook' => 'after_save',
                'order' => 99,
                'description' => 'Create Signature',
                'file' => 'custom/modules/Users/idea_sign.php',
                'class' => 'UserSign',
                'function' => 'CreateSign',
            ),
        ),
    );

No comments:

Post a Comment