| 1 |
<?php |
<?php |
| 2 |
// $Id: block.module,v 1.299.2.2 2008/04/09 21:11:45 goba Exp $ |
// $Id: block.module,v 1.299.2.3 2008/06/24 14:40:08 goba Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 298 |
return $blocks; |
return $blocks; |
| 299 |
} |
} |
| 300 |
|
|
| 301 |
|
/** |
| 302 |
|
* Returns information from database about a user-created (custom) block. |
| 303 |
|
* |
| 304 |
|
* @param $bid |
| 305 |
|
* ID of the block to get information for. |
| 306 |
|
* @return |
| 307 |
|
* Associative array of information stored in the database for this block. |
| 308 |
|
* Array keys: |
| 309 |
|
* - bid: Block ID. |
| 310 |
|
* - info: Block description. |
| 311 |
|
* - body: Block contents. |
| 312 |
|
* - format: Filter ID of the filter format for the body. |
| 313 |
|
*/ |
| 314 |
function block_box_get($bid) { |
function block_box_get($bid) { |
| 315 |
return db_fetch_array(db_query("SELECT * FROM {boxes} WHERE bid = %d", $bid)); |
return db_fetch_array(db_query("SELECT * FROM {boxes} WHERE bid = %d", $bid)); |
| 316 |
} |
} |
| 349 |
return $form; |
return $form; |
| 350 |
} |
} |
| 351 |
|
|
| 352 |
|
/** |
| 353 |
|
* Saves a user-created block in the database. |
| 354 |
|
* |
| 355 |
|
* @param $edit |
| 356 |
|
* Associative array of fields to save. Array keys: |
| 357 |
|
* - info: Block description. |
| 358 |
|
* - body: Block contents. |
| 359 |
|
* - format: Filter ID of the filter format for the body. |
| 360 |
|
* @param $delta |
| 361 |
|
* Block ID of the block to save. |
| 362 |
|
* @return |
| 363 |
|
* Always returns TRUE. |
| 364 |
|
*/ |
| 365 |
function block_box_save($edit, $delta) { |
function block_box_save($edit, $delta) { |
| 366 |
if (!filter_access($edit['format'])) { |
if (!filter_access($edit['format'])) { |
| 367 |
$edit['format'] = FILTER_FORMAT_DEFAULT; |
$edit['format'] = FILTER_FORMAT_DEFAULT; |