| 1 |
<?php // $Id: flexiblock.module,v 1.4 2005/07/25 21:46:15 djnz Exp $ |
<?php // $Id: flexiblock.module,v 1.5 2005/07/27 22:54:32 djnz Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 62 |
<p>Blocks are the boxes in the left and right side bars of the web site. They are made available by modules or created manually.</p> |
<p>Blocks are the boxes in the left and right side bars of the web site. They are made available by modules or created manually.</p> |
| 63 |
<p>Only enabled blocks are shown. You can position the blocks by deciding which side of the page they will show up on (sidebar) and in which order they appear (weight).</p> |
<p>Only enabled blocks are shown. You can position the blocks by deciding which side of the page they will show up on (sidebar) and in which order they appear (weight).</p> |
| 64 |
<p>If you want certain blocks to disable themselves temporarily during high server loads, check the 'Throttle' box. You can configure the auto-throttle on the <a href=\"%throttle\">throttle configuration page</a> after having enabled the throttle module.</p> |
<p>If you want certain blocks to disable themselves temporarily during high server loads, check the 'Throttle' box. You can configure the auto-throttle on the <a href=\"%throttle\">throttle configuration page</a> after having enabled the throttle module.</p> |
| 65 |
<p>Themes that support flexiblocks use the regions in the 'location' column. Legacy themes use the settings in the 'Sidebar' column.</p> |
<p>Themes that support flexiblock use the regions in the 'location' column. Legacy themes use the settings in the 'Sidebar' column.</p> |
| 66 |
", array('%throttle' => url('admin/settings/throttle'))); |
", array('%throttle' => url('admin/settings/throttle'))); |
| 67 |
} |
} |
| 68 |
} |
} |
| 80 |
function flexiblock_menu($may_cache) { |
function flexiblock_menu($may_cache) { |
| 81 |
$items = array(); |
$items = array(); |
| 82 |
if ($may_cache) { |
if ($may_cache) { |
| 83 |
$items[] = array('path' => 'admin/flexiblock', 'title' => t('flexiblocks'), |
$items[] = array('path' => 'admin/flexiblock', 'title' => t('flexiblock'), |
| 84 |
'access' => user_access('administer blocks'), |
'access' => user_access('administer blocks'), |
| 85 |
'callback' => 'flexiblock_admin'); |
'callback' => 'flexiblock_admin'); |
| 86 |
$items[] = array('path' => 'admin/flexiblock/list', 'title' => t('list'), |
$items[] = array('path' => 'admin/flexiblock/list', 'title' => t('list'), |
| 87 |
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); |
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10); |
| 88 |
$items[] = array('path' => 'admin/flexiblock/configure', 'title' => t('configure block'), |
$items[] = array('path' => 'admin/flexiblock/debug', 'title' => t('debug'), |
| 89 |
'access' => user_access('administer blocks'), |
'access' => user_access('administer blocks'), |
| 90 |
'callback' => 'flexiblock_admin_configure', |
'callback' => 'flexiblock_admin_debug', |
| 91 |
'type' => MENU_CALLBACK); |
'type' => MENU_CALLBACK); |
| 92 |
} |
} |
| 93 |
|
|
| 202 |
return t('The flexiblock settings have been updated.'); |
return t('The flexiblock settings have been updated.'); |
| 203 |
} |
} |
| 204 |
|
|
| 205 |
|
/** |
| 206 |
|
* Display information to help debugging. |
| 207 |
|
*/ |
| 208 |
|
function flexiblock_admin_debug() { |
| 209 |
|
ob_start(); |
| 210 |
|
echo "\nDefault mapping\n"; |
| 211 |
|
print_r(variable_get('flexiblock_mapping', array())); |
| 212 |
|
echo "\nCurrent mapping\n"; |
| 213 |
|
print_r(_flexiblock_get_mapping()); |
| 214 |
|
echo "\nFlexiblock block list\n"; |
| 215 |
|
print_r(theme_flexiblock_blocks()); |
| 216 |
|
echo "\nLegacy block list\n"; |
| 217 |
|
print_r(block_list('all')); |
| 218 |
|
$content = '<pre>'.htmlspecialchars(ob_get_clean()).'</pre>'; |
| 219 |
|
print theme('page', $content); |
| 220 |
|
} |
| 221 |
|
|
| 222 |
|
|
| 223 |
// PRIVATE FUNCTIONS ******************************************************************* |
// PRIVATE FUNCTIONS ******************************************************************* |
| 224 |
|
|