/[drupal]/contributions/modules/uc_node_checkout/uc_node_checkout.module
ViewVC logotype

Diff of /contributions/modules/uc_node_checkout/uc_node_checkout.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8.2.5, Thu Jul 30 15:28:29 2009 UTC revision 1.8.2.6, Thu Jul 30 15:58:42 2009 UTC
# Line 1  Line 1 
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
# Line 109  function uc_node_checkout_help($path, $a Line 109  function uc_node_checkout_help($path, $a
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),
# Line 215  function uc_node_checkout_form_alter(&$f Line 215  function uc_node_checkout_form_alter(&$f
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 {
# Line 677  function uc_node_checkout_order($op, &$a Line 684  function uc_node_checkout_order($op, &$a
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.

Legend:
Removed from v.1.8.2.5  
changed lines
  Added in v.1.8.2.6

  ViewVC Help
Powered by ViewVC 1.1.2