summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-03 22:08:03 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-03 22:08:03 +0000
commitc81af2d586f5f03df62b38b7365ebb5b2deeeda0 (patch)
treec493b2605d72771e3fc52c5f0c7fac1b6dceb30c /modules
parent0e161b661e2e87d11415093cc33803faf27d7182 (diff)
downloadbrdo-c81af2d586f5f03df62b38b7365ebb5b2deeeda0.tar.gz
brdo-c81af2d586f5f03df62b38b7365ebb5b2deeeda0.tar.bz2
- Patch #554992 by Davy Van Den Bremt, jhodgdon | Dries: added documentation.
Diffstat (limited to 'modules')
-rw-r--r--modules/block/block.module26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/block/block.module b/modules/block/block.module
index 14488fe1e..00b85cb07 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -342,6 +342,19 @@ function _block_rehash() {
return $blocks;
}
+/**
+ * Returns information from database about a user-created (custom) block.
+ *
+ * @param $bid
+ * ID of the block to get information for.
+ * @return
+ * Associative array of information stored in the database for this block.
+ * Array keys:
+ * - bid: Block ID.
+ * - info: Block description.
+ * - body: Block contents.
+ * - format: Filter ID of the filter format for the body.
+ */
function block_custom_block_get($bid) {
return db_query("SELECT * FROM {block_custom} WHERE bid = :bid", array(':bid' => $bid))->fetchAssoc();
}
@@ -379,6 +392,19 @@ function block_custom_block_form($edit = array()) {
return $form;
}
+/**
+ * Saves a user-created block in the database.
+ *
+ * @param $edit
+ * Associative array of fields to save. Array keys:
+ * - info: Block description.
+ * - body: Block contents.
+ * - format: Filter ID of the filter format for the body.
+ * @param $delta
+ * Block ID of the block to save.
+ * @return
+ * Always returns TRUE.
+ */
function block_custom_block_save($edit, $delta) {
db_update('block_custom')
->fields(array(