diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 23:48:24 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 23:48:24 -0700 |
commit | 4dad3191f65512b04894377541c4a041221ed9a2 (patch) | |
tree | b5714e21f0a2a04a1af7f1252fff923dbf411aed /lib | |
parent | 2f3c4f8812d389df40cf62b8967cf3e359ad5663 (diff) | |
parent | 1b6b00a6d05ad646a9137a872af8d8fdeeaf260f (diff) |
Merge branch 'groupalias' into 0.8.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common.php | 2 | ||||
-rw-r--r-- | lib/groupeditform.php | 11 | ||||
-rw-r--r-- | lib/util.php | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/lib/common.php b/lib/common.php index 6bf4ad21f..b4e87445e 100644 --- a/lib/common.php +++ b/lib/common.php @@ -198,6 +198,8 @@ $config = 'user_quota' => 50000000, 'monthly_quota' => 15000000, ), + 'group' => + array('maxaliases' => 3), ); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options'); diff --git a/lib/groupeditform.php b/lib/groupeditform.php index ca674f3c8..7e8d6eea3 100644 --- a/lib/groupeditform.php +++ b/lib/groupeditform.php @@ -111,7 +111,6 @@ class GroupEditForm extends Form } } - /** * Name of the form * @@ -157,6 +156,16 @@ class GroupEditForm extends Form ($this->out->arg('location')) ? $this->out->arg('location') : $this->group->location, _('Location for the group, if any, like "City, State (or Region), Country"')); $this->out->elementEnd('li'); + if (common_config('group', 'maxaliases') > 0) { + $aliases = (empty($this->group)) ? array() : $this->group->getAliases(); + $this->out->elementStart('li'); + $this->out->input('aliases', _('Aliases'), + ($this->out->arg('aliases')) ? $this->out->arg('aliases') : + (!empty($aliases)) ? implode(' ', $aliases) : '', + sprintf(_('Extra nicknames for the group, comma- or space- separated, max %d'), + common_config('group', 'maxaliases')));; + $this->out->elementEnd('li'); + } $this->out->elementEnd('ul'); } diff --git a/lib/util.php b/lib/util.php index b3a94a5a0..49c6ae108 100644 --- a/lib/util.php +++ b/lib/util.php @@ -591,7 +591,7 @@ function common_at_link($sender_id, $nickname) function common_group_link($sender_id, $nickname) { $sender = Profile::staticGet($sender_id); - $group = User_group::staticGet('nickname', common_canonical_nickname($nickname)); + $group = User_group::getForNickname($nickname); if ($group && $sender->isMember($group)) { $attrs = array('href' => $group->permalink(), 'class' => 'url'); |