HomeHelpTrac

Ignore:
Timestamp:
07/22/09 23:57:13 (3 years ago)
Author:
Alexander Trofimov
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc/BxDolXMLRPCImages.php

    r11465 r11678  
    1515            return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 
    1616 
    17         return parent::_getFilesInCategory ('shared_photo', $iIdProfile, $sCat); 
     17        return parent::_getFilesInCategory ('photos', $iIdProfile, $sCat); 
    1818    } 
    1919 
     
    2323            return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 
    2424 
    25         if (BxDolService::call('bx_photos', 'remove_file', array($iImageId))) 
     25        if (BxDolService::call('photos', 'remove_object', array($iImageId))) 
    2626            return new xmlrpcval ("ok"); 
    2727        return new xmlrpcval ("fail"); 
     
    3232        if (!($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 
    3333            return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 
    34 /* 
    35         if (BxDolService::call('shared_photo', 'make_thumbnail', array($iImageId), 'Main')) 
    36             return new xmlrpcval ("ok");*/ 
     34 
     35        if (BxDolService::call('avatar', 'make_avatar_from_shared_photo_auto', array($iImageId))) 
     36            return new xmlrpcval ("ok"); 
    3737        return new xmlrpcval ("fail"); 
    3838    } 
     
    5656    } 
    5757 
    58     function uploadImage ($sUser, $sPwd, $aCats, $binImageData, $iDataLength, $sTitle, $sTags, $sDesc) 
     58    function uploadImage ($sUser, $sPwd, $mixedAlbum, $binImageData, $iDataLength, $sTitle, $sTags, $sDesc) 
    5959    { 
    6060        if (!($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 
     
    7676        // upload 
    7777         
    78         $sProfileCat = BxDolService::call('bx_photos', 'get_profile_cat', array()); 
     78        $aAlbum = array (); 
     79        if (is_array($mixedAlbum) && count($mixedAlbum) && $mixedAlbum[0]) 
     80            $aAlbum = $mixedAlbum; 
     81        elseif (is_string($mixedAlbum) && $mixedAlbum) 
     82            $aAlbum = array ($mixedAlbum); 
     83        else 
     84            $aAlbum = 'TODO: use getAlbumDefaultName';  
    7985 
    8086        $aFileInfo = array(); 
     
    8288        $aFileInfo['medDesc'] = process_db_input(htmlspecialchars_adv($sDesc)); 
    8389        $aFileInfo['medTags'] = process_db_input(htmlspecialchars_adv($sTags)); 
    84         $aFileInfo['Categories'] = is_array($aCats) && count($aCats) ? $aCats : array($sProfileCat);  
     90        $aFileInfo['Categories'] = array (); 
     91        $aFileInfo['album'] = is_array($mixedAlbum) && count($mixedAlbum) ? $mixedAlbum : array($mixedAlbum);  
    8592         
    8693        $isUpdateThumb = (int)db_value("SELECT `Avatar` FROM `Profiles` WHERE `ID` = '$iId' LIMIT 1") ? false : true; 
    8794 
    8895        //Todo .. I can`t perform updating of omages by avatars. possible later 
    89         if (BxDolService::call('bx_photos', 'perform_photo_upload', array($sTmpFilename, $aFileInfo, $isUpdateThumb), 'Uploader')) 
     96        if (BxDolService::call('photos', 'perform_photo_upload', array($sTmpFilename, $aFileInfo, $isUpdateThumb), 'Uploader')) 
    9097            return new xmlrpcval ("ok"); 
    9198        else 
Note: See TracChangeset for help on using the changeset viewer.