1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13: class Folks_Friends_application extends Folks_Friends {
14:
15: 16: 17: 18: 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: 32: 33: 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: 47: 48: 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: 62: 63: 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: 77: 78: 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: 92: 93: 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: 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: