| 1 |
<?php |
<?php |
| 2 |
// $Id: stock.module,v 1.21.2.3 2008/10/26 02:52:27 kbahey Exp $ |
// $Id: stock.module,v 1.21.2.4 2009/07/25 17:34:51 kbahey Exp $ |
| 3 |
// 6.4 fixes by beyond |
// 6.4 fixes by beyond |
| 4 |
|
|
| 5 |
/** |
/** |
| 102 |
|
|
| 103 |
// Display the stock page |
// Display the stock page |
| 104 |
function stock_page() { |
function stock_page() { |
| 105 |
return theme('stock_page', stock_contents('page')); |
drupal_add_css(drupal_get_path('module', 'stock') .'/stock.css'); |
| 106 |
|
return stock_contents('page'); |
| 107 |
} |
} |
| 108 |
|
|
| 109 |
function stock_block($op = 'list', $delta = 0) { |
function stock_block($op = 'list', $delta = 0) { |
| 119 |
case 0: |
case 0: |
| 120 |
$block['subject'] = t($title); |
$block['subject'] = t($title); |
| 121 |
if (user_access('use stock')) { |
if (user_access('use stock')) { |
| 122 |
$block['content'] = theme('stock_page', stock_contents('block')); |
drupal_add_css(drupal_get_path('module', 'stock') .'/stock.css'); |
| 123 |
|
$block['content'] = stock_contents('block'); |
| 124 |
} |
} |
| 125 |
else { |
else { |
| 126 |
$block['content'] = t('You do not have permission to access this feature'); |
$block['content'] = t('You do not have permission to access this feature'); |
| 134 |
|
|
| 135 |
// Display the form |
// Display the form |
| 136 |
function stock_form($symbols) { |
function stock_form($symbols) { |
| 137 |
$output .= drupal_get_form('stock_form_definition', $symbols); |
return drupal_get_form('stock_form_definition', $symbols); |
|
return $output; |
|
| 138 |
} |
} |
| 139 |
|
|
| 140 |
function stock_form_definition($form_state, $symbols) { |
function stock_form_definition($form_state, $symbols) { |
| 243 |
break; |
break; |
| 244 |
} |
} |
| 245 |
|
|
|
|
|
| 246 |
return $output; |
return $output; |
| 247 |
} |
} |
| 248 |
|
|
| 270 |
return theme('table', $headers, $rows); |
return theme('table', $headers, $rows); |
| 271 |
} |
} |
| 272 |
} |
} |
|
function stock_theme() { |
|
|
return array('stock_page' => array() ); |
|
|
} |
|
|
|
|
|
function theme_stock_page($output) { |
|
|
drupal_add_css(drupal_get_path('module', 'stock') .'/stock.css'); |
|
|
return $output; |
|
|
} |
|
| 273 |
|
|
| 274 |
function stock_get_headers($format = 'long') { |
function stock_get_headers($format = 'long') { |
| 275 |
// keys in these arrays must match the column names in the |
// keys in these arrays must match the column names in the |