~ubuntu-branches/ubuntu/lucid/gallery2/lucid

« back to all changes in this revision

Viewing changes to modules/customfield/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
20
20
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
21
21
 */
22
22
/**
23
 
 * @version $Revision: 1.4 $ $Date: 2005/08/23 03:49:36 $
 
23
 * @version $Revision: 1.5 $ $Date: 2006/01/10 04:39:36 $
24
24
 * @package CustomField
25
25
 * @author Alan Harder <alan.harder@sun.com>
26
26
 */
29
29
     */
30
30
    function callback($params, &$smarty, $callback, $userId=null) {
31
31
        global $gallery;
32
 
        GalleryCoreApi::relativeRequireOnce('modules/customfield/classes/CustomFieldHelper.class');
 
32
        GalleryCoreApi::requireOnce('modules/customfield/classes/CustomFieldHelper.class');
33
33
 
34
34
        switch ($callback) {
35
35
        case 'LoadCustomFields':
36
36
            list ($ret, $item) = GalleryCoreApi::loadEntitiesById($params['itemId']);
37
 
            if ($ret->isError()) {
 
37
            if ($ret) {
38
38
                return $ret->wrap(__FILE__, __LINE__);
39
39
            }
40
40
            list ($ret, $fields) = CustomFieldHelper::fetchFieldValues(array($item), 'detail');
41
 
            if ($ret->isError()) {
 
41
            if ($ret) {
42
42
                return $ret->wrap(__FILE__, __LINE__);
43
43
            }
44
44
 
46
46
            $block['customfield']['LoadCustomFields']['fields'] = 
47
47
                isset($fields[$item->getId()]) ? $fields[$item->getId()] : array();
48
48
 
49
 
            return GalleryStatus::success();
 
49
            return null;
50
50
        }
51
51
 
52
 
        return GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
 
52
        return GalleryCoreApi::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
53
53
    }
54
54
}
55
55
?>