Overview

Packages

  • Folks
  • None

Classes

  • Folks
  • Folks_Activity_Form
  • Folks_Api
  • Folks_Application
  • Folks_Block_Activities
  • Folks_Block_Friends
  • Folks_Block_Know
  • Folks_Block_New
  • Folks_Block_Random
  • Folks_Block_Recent
  • Folks_Driver
  • Folks_Driver_sql
  • Folks_Friends
  • Folks_Friends_application
  • Folks_Friends_facebook
  • Folks_Friends_prefs
  • Folks_Friends_shared
  • Folks_Friends_sql
  • Folks_Login_Form
  • Folks_Notification
  • Folks_Notification_facebook
  • Folks_Notification_letter
  • Folks_Notification_mail
  • Folks_Notification_tickets
  • Folks_Search_Form
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Folks external application firends implementaton
  4:  *
  5:  * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
  6:  *
  7:  * See the enclosed file COPYING for license information (GPL). If you
  8:  * did not receive this file, see http://www.horde.org/licenses/gpl.
  9:  *
 10:  * @author  Duck <duck@obala.net>
 11:  * @package Folks
 12:  */
 13: class Folks_Friends_application extends Folks_Friends {
 14: 
 15:     /**
 16:      * Add user to a friend list
 17:      *
 18:      * @param string $friend   Friend's usersame
 19:      */
 20:     protected function _addFriend($friend)
 21:     {
 22:         if (!$GLOBALS['registry']->hasMethod('addFriend', $this->_params['app'])) {
 23:             return PEAR::raiseError(_("Unsupported"));
 24:         }
 25: 
 26:         return $GLOBALS['registry']->callByPackage(
 27:             $this->_params['app'], 'addFriend', array($friend));
 28:     }
 29: 
 30:     /**
 31:      * Remove user from a fiend list
 32:      *
 33:      * @param string $friend   Friend's usersame
 34:      */
 35:     public function removeFriend($friend)
 36:     {
 37:         if (!$GLOBALS['registry']->hasMethod('removeFriend', $this->_params['app'])) {
 38:             return PEAR::raiseError(_("Unsupported"));
 39:         }
 40: 
 41:         return $GLOBALS['registry']->callByPackage(
 42:             $this->_params['app'], 'removeFriend', array($friend));
 43:     }
 44: 
 45:     /**
 46:      * Get user friends
 47:      *
 48:      * @return array of users
 49:      */
 50:     public function getFriends()
 51:     {
 52:         if (!$GLOBALS['registry']->hasMethod('getFriends', $this->_params['app'])) {
 53:             return PEAR::raiseError(_("Unsupported"));
 54:         }
 55: 
 56:         return $GLOBALS['registry']->callByPackage(
 57:             $this->_params['app'], 'getFriends', array($this->_user));
 58:     }
 59: 
 60:     /**
 61:      * Get user blacklist
 62:      *
 63:      * @return array of users blacklist
 64:      */
 65:     public function getBlacklist()
 66:     {
 67:         if (!$GLOBALS['registry']->hasMethod('getBlacklist', $this->_params['app'])) {
 68:             return PEAR::raiseError(_("Unsupported"));
 69:         }
 70: 
 71:         return $GLOBALS['registry']->callByPackage(
 72:             $this->_params['app'], 'getBlacklist', array($this->_user));
 73:     }
 74: 
 75:     /**
 76:      * Add user to a blacklist list
 77:      *
 78:      * @param string $user   Usersame
 79:      */
 80:     protected function _addBlacklisted($user)
 81:     {
 82:         if (!$GLOBALS['registry']->hasMethod('addBlacklisted', $this->_params['app'])) {
 83:             return PEAR::raiseError(_("Unsupported"));
 84:         }
 85: 
 86:         return $GLOBALS['registry']->callByPackage(
 87:             $this->_params['app'], 'addBlacklisted', array($user));
 88:     }
 89: 
 90:     /**
 91:      * Add user to a blacklist list
 92:      *
 93:      * @param string $user   Usersame
 94:      */
 95:     public function removeBlacklisted($user)
 96:     {
 97:         if (!$GLOBALS['registry']->hasMethod('removeBlacklisted', $this->_params['app'])) {
 98:             return PEAR::raiseError(_("Unsupported"));
 99:         }
100: 
101:         return $GLOBALS['registry']->callByPackage(
102:             $this->_params['app'], 'removeBlacklisted', array($user));
103:     }
104: 
105:     /**
106:      * Get avaiable groups
107:      */
108:     protected function _getGroups()
109:     {
110:         if (!$GLOBALS['registry']->hasMethod('getGroups', $this->_params['app'])) {
111:             return array();
112:         }
113: 
114:         return $GLOBALS['registry']->callByPackage(
115:             $this->_params['app'], 'getGroups');
116:     }
117: }
118: 
API documentation generated by ApiGen