commons_wiki.install in Drupal Commons 6.2
File
modules/features/commons_wiki/commons_wiki.installView source
<?php
/**
* Implementation of hook_install()
*/
function commons_wiki_install() {
// No Longer call freelinking module as its no longer supported.
commons_wiki_add_flag();
commons_wiki_add_taxonomy();
}
/**
* Add the bookmark flag to wiki nodes
*/
function commons_wiki_add_flag() {
$fid = db_result(db_query("SELECT fid FROM {flags} WHERE name = '%s'", 'bookmarks'));
if ($fid) {
$check_sql = "SELECT fid FROM {flag_types} WHERE type = 'wiki' AND fid = %d";
if (!db_result(db_query($check_sql, $fid))) {
$flag = new stdClass();
$flag->fid = $fid;
$flag->type = 'wiki';
drupal_write_record('flag_types', $flag);
}
}
}
/**
* Add taxonomy to wiki nodes
*/
function commons_wiki_add_taxonomy() {
$taxonomy = new stdClass();
$taxonomy->vid = variable_get('commons_tags_vid', 1);
$taxonomy->type = 'wiki';
drupal_write_record('vocabulary_node_types', $taxonomy);
}
Functions
Name | Description |
---|---|
commons_wiki_add_flag | Add the bookmark flag to wiki nodes |
commons_wiki_add_taxonomy | Add taxonomy to wiki nodes |
commons_wiki_install | Implementation of hook_install() |