| 1 |
<?php |
<?php |
| 2 |
// $Id: sidecontent.module,v 1.11.2.3 2006/10/22 19:43:50 MegaGrunt Exp $ |
// $Id: sidecontent.module,v 1.13.2.2 2007/07/03 22:55:25 MegaGrunt Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_perm(). |
* Implementation of hook_perm(). |
| 6 |
*/ |
*/ |
| 7 |
function sidecontent_perm() { |
function sidecontent_perm() { |
|
|
|
| 8 |
return array('access side content', 'create side content'); |
return array('access side content', 'create side content'); |
| 9 |
} |
} |
| 10 |
|
|
|
|
|
| 11 |
/** |
/** |
| 12 |
* Implementation of hook_block(). |
* Implementation of hook_block(). |
| 13 |
* |
* |
| 22 |
return $blocks; |
return $blocks; |
| 23 |
|
|
| 24 |
case 'configure': |
case 'configure': |
|
|
|
|
|
|
| 25 |
$form['sidecontent_print'] = array( |
$form['sidecontent_print'] = array( |
| 26 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 27 |
'#title' => t('Print view include'), |
'#title' => t('Print view include'), |
| 123 |
/** |
/** |
| 124 |
* Implementation of hook_form_alter. |
* Implementation of hook_form_alter. |
| 125 |
*/ |
*/ |
| 126 |
function sidecontent_form_alter($form_id, &$form) { |
function sidecontent_form_alter(&$form, &$form_state, $form_id) { |
| 127 |
|
|
| 128 |
// Alter the settings form. |
// Alter the settings form. |
| 129 |
if ($form_id == 'node_type_form') { |
if ($form_id == 'node_type_form') { |
| 165 |
$form['sidecontent']['sidecontent_title'] = array( |
$form['sidecontent']['sidecontent_title'] = array( |
| 166 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 167 |
'#title' => t('Side Content Title'), |
'#title' => t('Side Content Title'), |
| 168 |
'#default_value' => check_plain($node->sidecontent_title), |
'#default_value' => $node->sidecontent_title, |
| 169 |
'#description' => t("Leave blank to use default side content title: <em>%title</em>", array('%title' => $default_title)), |
'#description' => t("Leave blank to use default side content title: <em>%title</em>", array('%title' => $default_title)), |
| 170 |
'#size' => 50, |
'#size' => 50, |
| 171 |
'#maxlength' => 128 |
'#maxlength' => 128 |
| 172 |
); |
); |
| 173 |
|
|
|
$content_default = (empty($node->sidecontent)) ? '' : check_markup($node->sidecontent, $node->sidecontent_format); |
|
|
|
|
| 174 |
$form['sidecontent']['sidecontent'] = array( |
$form['sidecontent']['sidecontent'] = array( |
| 175 |
'#type' => 'textarea', |
'#type' => 'textarea', |
| 176 |
'#title' => t('Side Content Text'), |
'#title' => t('Side Content Text'), |
| 177 |
'#default_value' => $content_default, |
'#default_value' => $node->sidecontent, |
| 178 |
'#description' => t('Content to display in side block.'), |
'#description' => t('Content to display in side block.'), |
| 179 |
'#cols' => 60, |
'#cols' => 60, |
| 180 |
'#rows' => 20, |
'#rows' => 20, |