Location: PHPKode > projects > Anahita Social Engine > dependencies/plg_system_socialengine/socialengine/uikit/avatar/actions.php
<?php

class AnUikitAvatarActions
{	
	/**
	 * Add the action to manipulate an actor's avatar. The actor must be mixed with AnUikitActionMixin before calling this method
	 * @param $actor AnModelActor Object
	 */
	public function add(AnModelActor $actor)
	{
		if ( !$actor->getAcl()->canUpdateAvatar() )
			return false;
		
		$actions = array();
				
		$oid 	 = $actor->id;
		
		AnUikitTemplate::stylesheet('media/plg_socialengine/uikit/upload/upload.css',  array('overwrite_path'=>'css/com_socialengine'));
		AnUikitTemplate::script('media/plg_socialengine/uikit/upload/upload.js',	     array('overwrite_path'=>'js/com_socialengine'));		
		AnUikitTemplate::script('media/plg_socialengine/uikit/avatar.js',array('overwrite_path'=>'js/com_socialengine'));						

		$actions[] = AnUikitHtmlTag::link(JText::_('AN-SE-AVATAR-UPDATE-AVATAR'),'index.php?option='.$actor->application->component.'&view=avatar&action=select&oid='.$oid)->setId('an-se-update-profile-avatar');
		$actions[] = AnUikitHtmlTag::link(JText::_('AN-SE-AVATAR-REMOVE-AVATAR'),'index.php?option='.$actor->application->component.'&view=avatar&action=delete&oid='.$oid)->setId('an-se-remove-profile-avatar');
				
		$actor->addAction( $actions );
		$actor = KFactory::get('lib.anahita.uikit.actor')->toJson($actor);
		print "<script>";
		print "new Uikit.ActorAvatar({$actor});";
		print "</script>";
		
	}
}
Return current item: Anahita Social Engine