dlike.install in Drupal like (Flag counter) 7
Same filename and directory in other branches
Install file for dlike.module
File
dlike.installView source
<?php
// $Id$
/**
* @file
* Install file for dlike.module
*/
/**
* Implementation of hook_enable().
* Sets module weight.
*/
function dlike_enable() {
$flag_weight = db_select('system', 's')
->fields('s', array(
'weight',
))
->condition('name', 'flag')
->execute()
->fetchField();
db_update('system')
->fields(array(
'weight' => $flag_weight + 1,
))
->condition('name', basename(__FILE__, '.install'))
->execute();
}
/**
* Implementation of hook_uninstall().
*/
function dlike_uninstall() {
db_query("DELETE FROM {variable} WHERE name like '%dlike-%'");
}
Functions
Name![]() |
Description |
---|---|
dlike_enable | Implementation of hook_enable(). Sets module weight. |
dlike_uninstall | Implementation of hook_uninstall(). |