| 1 |
<?php |
<?php |
| 2 |
// $Id: uc_node_checkout.module,v 1.8.2.4 2009/01/30 16:59:04 rszrama Exp $ |
// $Id: uc_node_checkout.module,v 1.8.2.5 2009/07/30 15:28:29 rszrama Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 109 |
function uc_node_checkout_theme() { |
function uc_node_checkout_theme() { |
| 110 |
return array( |
return array( |
| 111 |
'uc_cart_click_to_edit' => array( |
'uc_cart_click_to_edit' => array( |
| 112 |
'arguments' => array(), |
'arguments' => array($link = ''), |
| 113 |
), |
), |
| 114 |
'uc_node_cart_teaser' => array( |
'uc_node_cart_teaser' => array( |
| 115 |
'arguments' => array('node' => NULL), |
'arguments' => array('node' => NULL), |
| 215 |
if (isset($item->checkout_node)) { |
if (isset($item->checkout_node)) { |
| 216 |
$node = $item->checkout_node; |
$node = $item->checkout_node; |
| 217 |
|
|
| 218 |
// Update the title if the based on user access. |
// Update the title if configured based on user access. |
| 219 |
if (variable_get('uc_node_checkout_cart_titles', TRUE)) { |
if (variable_get('uc_node_checkout_cart_titles', TRUE) || variable_get('uc_node_checkout_click_to_edit', TRUE)) { |
| 220 |
if (node_access('update', $node)) { |
if (node_access('update', $node)) { |
| 221 |
$title = l($item->title, 'node/'. $node->nid .'/edit', array('query' => 'destination=cart')); |
if (variable_get('uc_node_checkout_cart_titles', TRUE)) { |
| 222 |
|
$title = l($item->title, 'node/'. $node->nid .'/edit', array('query' => 'destination=cart')); |
| 223 |
|
$click = t('(click to edit)'); |
| 224 |
|
} |
| 225 |
|
else { |
| 226 |
|
$title = $form['items'][$i]['title']['#value']; |
| 227 |
|
$click = ' - '. l(t('edit'), 'node/'. $node->nid .'/edit', array('query' => 'destination=cart')); |
| 228 |
|
} |
| 229 |
|
|
| 230 |
// Add the click to edit link to the title if necessary. |
// Add the click to edit link to the title if necessary. |
| 231 |
if (variable_get('uc_node_checkout_click_to_edit', TRUE)) { |
if (variable_get('uc_node_checkout_click_to_edit', TRUE)) { |
| 232 |
$title .= ' '. theme('uc_cart_click_to_edit'); |
$title .= ' '. theme('uc_cart_click_to_edit', $click); |
| 233 |
} |
} |
| 234 |
} |
} |
| 235 |
else { |
else { |
| 684 |
} |
} |
| 685 |
|
|
| 686 |
// Themes a click to edit link by node checkout products in a customer's cart. |
// Themes a click to edit link by node checkout products in a customer's cart. |
| 687 |
function theme_uc_cart_click_to_edit() { |
function theme_uc_cart_click_to_edit($link) { |
| 688 |
return '<span class="node-checkout-edit">'. t('(click to edit)') .'</span>'; |
return '<span class="node-checkout-edit">'. $link .'</span>'; |
| 689 |
} |
} |
| 690 |
|
|
| 691 |
// Themes a cart teaser for a node checkout product in the shopping cart. |
// Themes a cart teaser for a node checkout product in the shopping cart. |