| 1 |
<?php |
<?php |
| 2 |
// $Id: fasttoggle.module,v 1.8.2.6 2008/11/08 11:09:20 timcn Exp $ |
// $Id: fasttoggle.module,v 1.8.2.7 2008/11/08 11:24:54 timcn Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 371 |
/** |
/** |
| 372 |
* Returns an array with labels for a given setting. |
* Returns an array with labels for a given setting. |
| 373 |
*/ |
*/ |
| 374 |
function _fasttoggle_get_label($label) { |
function _fasttoggle_get_label($label, $style = NULL) { |
| 375 |
static $labels; |
static $labels = array(); |
| 376 |
|
|
| 377 |
if ($labels == NULL) { |
if (!isset($style)) { |
| 378 |
$style = variable_get('fasttoggle_label_style', FASTTOGGLE_LABEL_STATUS); |
$style = variable_get('fasttoggle_label_style', FASTTOGGLE_LABEL_STATUS); |
| 379 |
$labels = module_invoke_all('fasttoggle_labels', $style); |
} |
| 380 |
|
|
| 381 |
|
if (!isset($lables[$style])) { |
| 382 |
|
$lables[$style] = module_invoke_all('fasttoggle_labels', $style); |
| 383 |
|
|
| 384 |
// Allow custom labels in settings.php. |
// Allow custom labels in settings.php. |
| 385 |
if ($style == FASTTOGGLE_LABEL_CUSTOM) { |
if ($style == FASTTOGGLE_LABEL_CUSTOM) { |
| 386 |
$labels = array_merge($labels, variable_get('fasttoggle_labels', array())); |
$lables[$style] = array_merge($lables[$style], variable_get('fasttoggle_labels', array())); |
| 387 |
} |
} |
| 388 |
} |
} |
| 389 |
|
|
| 390 |
return $labels[$label]; |
return $lables[$style][$label]; |
| 391 |
} |
} |
| 392 |
|
|
| 393 |
|
|