~ubuntu-branches/ubuntu/hardy/gallery2/hardy-security

« back to all changes in this revision

Viewing changes to modules/cart/Callbacks.inc

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2006-04-16 16:42:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060416164235-8uy0u4bfjdxpge2o
Tags: 2.1.1-1
* New upstream release (Closes: #362936)
  + Bugfixes for Postgres7 (Closes: #359000, #362152)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * $RCSfile: Callbacks.inc,v $
4
4
 *
5
5
 * Gallery - a web based photo album viewer and editor
6
 
 * Copyright (C) 2000-2005 Bharat Mediratta
 
6
 * Copyright (C) 2000-2006 Bharat Mediratta
7
7
 *
8
8
 * This program is free software; you can redistribute it and/or modify
9
9
 * it under the terms of the GNU General Public License as published by
19
19
 * along with this program; if not, write to the Free Software
20
20
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
21
21
 */
 
22
/**
 
23
 * @version $Revision: 1.6 $ $Date: 2006/01/10 04:38:59 $
 
24
 * @package Cart
 
25
 * @author Bharat Mediratta <bharat@menalto.com>
 
26
 */
22
27
class CartCallbacks {
23
28
    /**
24
29
     */
28
33
        switch($callback) {
29
34
        case 'LoadCart':
30
35
            /* The cart contents' count */
31
 
            GalleryCoreApi::relativeRequireOnce('modules/cart/classes/CartHelper.class');
 
36
            GalleryCoreApi::requireOnce('modules/cart/classes/CartHelper.class');
32
37
            list ($ret, $cartItemIds) = CartHelper::fetchCartItemCounts();
33
 
            if ($ret->isError()) {
 
38
            if ($ret) {
34
39
                return $ret->wrap(__FILE__, __LINE__);
35
40
            }
36
41
 
44
49
            $block['cart']['ShowCart']['unique'] = $unique;
45
50
            $block['cart']['ShowCart']['total'] = $total;
46
51
 
47
 
            return GalleryStatus::success();
 
52
            return null;
48
53
        }
49
54
 
50
 
        return GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
 
55
        return GalleryCoreApi::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
51
56
    }
52
57
}
53
58
?>