Cheetah
Public Member Functions | Public Attributes | List of all members
ChAvaModule Class Reference
Inheritance diagram for ChAvaModule:
ChWsbModule

Public Member Functions

 __construct (&$aModule)
 
 actionHome ()
 
 actionGetSiteAvatars ($iPage)
 
 actionSetSiteAvatar ($sImg)
 
 actionSetAvatar ($iProfileId, $sImg)
 
 actionSetAvatarCouple ($iProfileId, $sImg)
 
 _setAvatar ($iProfileId, $sImg, $isSetAvatarForCouple=false)
 
 actionRemoveAvatar ($iProfileId, $sImg)
 
 actionMemberThumb ($iProfileId)
 
 actionAdministration ()
 
 serviceSetImageForCropping ($iProfileId, $sOrigPath)
 
 serviceMakeAvatarFromImage ($sImg)
 
 serviceMakeAvatarFromImageUrl ($sImgUrl)
 
 serviceMakeAvatarFromSharedPhotoAuto ($iSharedPhotoId)
 
 serviceCropTool ($aParams)
 
 serviceDeleteProfileAvatars ($iProfileId)
 
 serviceJoin ($iMemID, $sStatusText)
 
 serviceGetSiteAvatars ($iPage)
 
 serviceManageAvatars ($iProfileId, $isAddJsCss=false)
 
 serviceGetMyAvatars ($iProfileId)
 
 serviceGetWallPost ($aEvent)
 
 serviceGetWallData ()
 
 onEventCreate ($iEntryId)
 
 onEventChanged ($iProfileId, $iEntryId, $iCoupleProfileId=0, $isTryToSuspend=true)
 
 onEventDeleted ($iEntryId, $aDataEntry=array())
 
 isAllowedAdd ($isPerformAction=false)
 
 isAllowedEdit ($aDataEntry, $isPerformAction=false)
 
 isAllowedDelete (&$aDataEntry, $isPerformAction=false)
 
 isAdmin ()
 
 _defineActions ()
 
 _removeAvatar ($iProfileId, $iAvatar)
 
 _addAvatar ($sFullPath, $isMove=false, $isUpdateProfile=true)
 
 _resizeImage ($sImageSrc, $sImageDst, $iWidth, $iHeight, $bSquareResize=false, $bJpegOutput=true)
 
 _uploadImage ($iProfileId=0)
 
 _makeAvatarFromSharedPhoto ($iSharedPhotoId)
 
 _cropAvatar ()
 
- Public Member Functions inherited from ChWsbModule
 __construct ($aModule)
 
 isLogged ()
 
 getUserId ()
 
 getUserPassword ()
 
 getTitleKey ($sUri)
 
 serviceGetBaseUrl ()
 

Public Attributes

 $_iProfileId
 
 $_aAllowedExt
 
- Public Attributes inherited from ChWsbModule
 $_aModule
 
 $_oDb
 
 $_oTemplate
 
 $_oConfig
 

Additional Inherited Members

- Static Public Member Functions inherited from ChWsbModule
static getInstance ($sClassName)
 
static getTitle ($sUri)
 

Detailed Description

Avatar module by Cheetah

This module allow user to crop avatar image from any photo. This is default module and Cheetah can not work properly without this module. 'Avatar' field in Profiles table is used to store current user avatar id. Avatar id is used to store avatar image, so it is easy to get avarat image if you know avatar id. You can get avatar image directly, using defines in include.php file. Refer to include.php file for all defines descriptions.

Example of using this module to get avatar images:

include_once (CH_DIRECTORY_PATH_MODULES . 'cheetah/avatar/include.php') echo CH_AVA_URL_USER_AVATARS . $aProfile['Avatar'] . CH_AVA_EXT; // avatar image echo CH_AVA_URL_USER_AVATARS . $aProfile['Avatar'] . 'i'. CH_AVA_EXT; // avatar icon

Profile's Wall: 'add avatar' and 'change avatar' events are displayed on profile's wall

Spy: no spy activity

Memberships/ACL: avatar upload - CH_AVATAR_UPLOAD avatar edit any - CH_AVATAR_EDIT_ANY avatar delete any - CH_AVATAR_DELETE_ANY

Service methods:

Set image for cropping.

See also
ChAvaModule::serviceSetImageForCropping ChWsbService::call('avatar', 'set_image_for_cropping', array($iProfileId, $sOrigPath));

Crop image html

See also
ChAvaModule::serviceCropTool ChWsbService::call('avatar', 'crop_tool', array($aParams));

Delete all profile's avatars

See also
ChAvaModule::serviceDeleteProfileAvatars ChWsbService::call('avatar', 'delete_profile_avatars', array($iProfileId));

After join redirection

See also
ChAvaModule::serviceJoin ChWsbService::call('avatar', 'join', array($iMemID, $sStatusText));

Site avatars html

See also
ChAvaModule::serviceGetSiteAvatars ChWsbService::call('avatar', 'get_site_avatars', array($iPage));

My avatars html

See also
ChAvaModule::serviceGetMyAvatars ChWsbService::call('avatar', 'get_my_avatars', array($iProfileId));

make avatar from particular image, also it makes the image square

See also
ChAvaModule::serviceMakeAvatarFromImage ChWsbService::call ('avatar', 'make_avatar_from_image', array ('/tmp/abc.jpg'));

make avatar from image url, also it makes the image square

See also
ChAvaModule::serviceMakeAvatarFromImageUrl ChWsbService::call ('avatar', 'make_avatar_from_image_url', array ('http://abc.com/123.jpg'));

Get image from photos module and make avbatar from it, also it makes it square

See also
ChAvaModule::serviceMakeAvatarFromSharedPhotoAuto ChWsbService::call ('avatar', 'make_avatar_from_shared_photo_auto', array (80));

Alerts: Alerts type/unit - 'ch_avatar' The following alerts are rised

add - new avatar is added $iObjectId - avatar id $iSenderId - avatar's owner

change - avatar was changed $iObjectId - avatar id $iSenderId - avatar's owner

delete - avatar was deleted $iObjectId - avatar id $iSenderId - avatar's owner

Definition at line 125 of file ChAvaModule.php.

Constructor & Destructor Documentation

◆ __construct()

ChAvaModule::__construct ( $aModule)

Definition at line 135 of file ChAvaModule.php.

Member Function Documentation

◆ _addAvatar()

ChAvaModule::_addAvatar (   $sFullPath,
  $isMove = false,
  $isUpdateProfile = true 
)

Definition at line 775 of file ChAvaModule.php.

◆ _cropAvatar()

ChAvaModule::_cropAvatar ( )

Definition at line 884 of file ChAvaModule.php.

◆ _defineActions()

ChAvaModule::_defineActions ( )

Definition at line 744 of file ChAvaModule.php.

◆ _makeAvatarFromSharedPhoto()

ChAvaModule::_makeAvatarFromSharedPhoto (   $iSharedPhotoId)

Definition at line 871 of file ChAvaModule.php.

◆ _removeAvatar()

ChAvaModule::_removeAvatar (   $iProfileId,
  $iAvatar 
)

Definition at line 751 of file ChAvaModule.php.

◆ _resizeImage()

ChAvaModule::_resizeImage (   $sImageSrc,
  $sImageDst,
  $iWidth,
  $iHeight,
  $bSquareResize = false,
  $bJpegOutput = true 
)

Definition at line 822 of file ChAvaModule.php.

◆ _setAvatar()

ChAvaModule::_setAvatar (   $iProfileId,
  $sImg,
  $isSetAvatarForCouple = false 
)

Definition at line 235 of file ChAvaModule.php.

◆ _uploadImage()

ChAvaModule::_uploadImage (   $iProfileId = 0)

Definition at line 833 of file ChAvaModule.php.

◆ actionAdministration()

ChAvaModule::actionAdministration ( )

Definition at line 307 of file ChAvaModule.php.

◆ actionGetSiteAvatars()

ChAvaModule::actionGetSiteAvatars (   $iPage)

Definition at line 195 of file ChAvaModule.php.

◆ actionHome()

ChAvaModule::actionHome ( )

Definition at line 142 of file ChAvaModule.php.

◆ actionMemberThumb()

ChAvaModule::actionMemberThumb (   $iProfileId)

Definition at line 302 of file ChAvaModule.php.

◆ actionRemoveAvatar()

ChAvaModule::actionRemoveAvatar (   $iProfileId,
  $sImg 
)

Definition at line 274 of file ChAvaModule.php.

◆ actionSetAvatar()

ChAvaModule::actionSetAvatar (   $iProfileId,
  $sImg 
)

Definition at line 225 of file ChAvaModule.php.

◆ actionSetAvatarCouple()

ChAvaModule::actionSetAvatarCouple (   $iProfileId,
  $sImg 
)

Definition at line 230 of file ChAvaModule.php.

◆ actionSetSiteAvatar()

ChAvaModule::actionSetSiteAvatar (   $sImg)

Definition at line 201 of file ChAvaModule.php.

◆ isAdmin()

ChAvaModule::isAdmin ( )

Definition at line 739 of file ChAvaModule.php.

◆ isAllowedAdd()

ChAvaModule::isAllowedAdd (   $isPerformAction = false)

Definition at line 714 of file ChAvaModule.php.

◆ isAllowedDelete()

ChAvaModule::isAllowedDelete ( $aDataEntry,
  $isPerformAction = false 
)

Definition at line 731 of file ChAvaModule.php.

◆ isAllowedEdit()

ChAvaModule::isAllowedEdit (   $aDataEntry,
  $isPerformAction = false 
)

Definition at line 723 of file ChAvaModule.php.

◆ onEventChanged()

ChAvaModule::onEventChanged (   $iProfileId,
  $iEntryId,
  $iCoupleProfileId = 0,
  $isTryToSuspend = true 
)

Definition at line 688 of file ChAvaModule.php.

◆ onEventCreate()

ChAvaModule::onEventCreate (   $iEntryId)

Definition at line 682 of file ChAvaModule.php.

◆ onEventDeleted()

ChAvaModule::onEventDeleted (   $iEntryId,
  $aDataEntry = array() 
)

Definition at line 704 of file ChAvaModule.php.

◆ serviceCropTool()

ChAvaModule::serviceCropTool (   $aParams)

Returns crop image html, it consists of image for cropping, cropping preview and descriptions

Parameters
$aParamsdir_image - image path url_image - image url
Returns
error message string of html string

Definition at line 440 of file ChAvaModule.php.

◆ serviceDeleteProfileAvatars()

ChAvaModule::serviceDeleteProfileAvatars (   $iProfileId)

Delete all profile's avatars

Parameters
$iProfileId- profile ID to delete avatar for
Returns
true on success, false on error

Definition at line 466 of file ChAvaModule.php.

◆ serviceGetMyAvatars()

ChAvaModule::serviceGetMyAvatars (   $iProfileId)

My avatars html

Parameters
$iProfileId- profile's ID to display avatars for
Returns
html with my avatars

Definition at line 573 of file ChAvaModule.php.

◆ serviceGetSiteAvatars()

ChAvaModule::serviceGetSiteAvatars (   $iPage)

Site avatars html

Parameters
$iPage- current page in site avatars
Returns
html with site avatars

Definition at line 509 of file ChAvaModule.php.

◆ serviceGetWallData()

ChAvaModule::serviceGetWallData ( )

Register 'add avatar' and 'change avatar' events for wall @returm array of parameters

Definition at line 660 of file ChAvaModule.php.

◆ serviceGetWallPost()

ChAvaModule::serviceGetWallPost (   $aEvent)

Html to display on profile wall, when user uploads new avatar

Parameters
$aEvent- wall event parameters
Returns
html to post on profile's wall

Definition at line 626 of file ChAvaModule.php.

◆ serviceJoin()

ChAvaModule::serviceJoin (   $iMemID,
  $sStatusText 
)

After join redirection This serice automatically log in joined user and redirects him to avatar copping page

Parameters
$iMemID- joined profile ID
$sStatusText- status text to display at the top of page, like 'join success'
Returns
false on error, 'EXIT' string on success

Definition at line 489 of file ChAvaModule.php.

◆ serviceMakeAvatarFromImage()

ChAvaModule::serviceMakeAvatarFromImage (   $sImg)

make avatar from particular image, also it makes it square

Parameters
$sImgpath to the image
Returns
true on success or false on error

Definition at line 373 of file ChAvaModule.php.

◆ serviceMakeAvatarFromImageUrl()

ChAvaModule::serviceMakeAvatarFromImageUrl (   $sImgUrl)

make avatar from image url, also it makes it square

Parameters
$sImgurl to the image
Returns
true on success or false on error

Definition at line 399 of file ChAvaModule.php.

◆ serviceMakeAvatarFromSharedPhotoAuto()

ChAvaModule::serviceMakeAvatarFromSharedPhotoAuto (   $iSharedPhotoId)

get image from photos module and make avatar from it also it makes it square

Parameters
$iSharedPhotoIdphoto id from photos module
Returns
true on success or false on error

Definition at line 421 of file ChAvaModule.php.

◆ serviceManageAvatars()

ChAvaModule::serviceManageAvatars (   $iProfileId,
  $isAddJsCss = false 
)

Definition at line 555 of file ChAvaModule.php.

◆ serviceSetImageForCropping()

ChAvaModule::serviceSetImageForCropping (   $iProfileId,
  $sOrigPath 
)

Set image for cropping. You can point image for cropping and then redirect to avatar module page, your image will be ready for cropping. You can use it in your module, if you want allow users to set any image from your module as avatar.

Parameters
$iProfileId- profile id to set avatar for
$sOrigPath- image path
Returns
true on succrss, false on error

Definition at line 359 of file ChAvaModule.php.

Member Data Documentation

◆ $_aAllowedExt

ChAvaModule::$_aAllowedExt
Initial value:
= array (
'jpg',
'jpeg',
'gif',
'png',
)

Definition at line 128 of file ChAvaModule.php.

◆ $_iProfileId

ChAvaModule::$_iProfileId

Definition at line 127 of file ChAvaModule.php.


The documentation for this class was generated from the following file: