diff options
author | RedMatrix <info@friendica.com> | 2015-01-02 12:10:50 +1100 |
---|---|---|
committer | RedMatrix <info@friendica.com> | 2015-01-02 12:10:50 +1100 |
commit | 817b54688e8cea4c7671a8326ce4cf815e1b62d6 (patch) | |
tree | b1e398a186c77fa99b67dc6a99195713582fc4a4 /include/permissions.php | |
parent | db811ca975e6880ff6540a61c216e7e2432ea75e (diff) | |
parent | 85e76773a04995884e798a89cc285f48377bcb62 (diff) | |
download | volse-hubzilla-817b54688e8cea4c7671a8326ce4cf815e1b62d6.tar.gz volse-hubzilla-817b54688e8cea4c7671a8326ce4cf815e1b62d6.tar.bz2 volse-hubzilla-817b54688e8cea4c7671a8326ce4cf815e1b62d6.zip |
Merge pull request #805 from pafcu/moretpl
Move some HTML out to templates
Diffstat (limited to 'include/permissions.php')
-rw-r--r-- | include/permissions.php | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/include/permissions.php b/include/permissions.php index 9e60223fb..ccbde1a7c 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -800,38 +800,18 @@ function get_role_perms($role) { } /** - * @brief Creates a HTML select field with all available roles. + * @brief Returns a list or roles, grouped by type * * @param string $current The current role - * @return string Returns the complete HTML code for this privacy-role-select field. + * @return string Returns an array of roles, grouped by type */ -function role_selector($current) { - - if(! $current) - $current = 'custom'; - +function get_roles() { $roles = array( - 'social' => array( t('Social Networking'), - array('social' => t('Mostly Public'), 'social_restricted' => t('Restricted'), 'social_private' => t('Private'))), - 'forum' => array( t('Community Forum'), - array('forum' => t('Mostly Public'), 'forum_restricted' => t('Restricted'), 'forum_private' => t('Private'))), - 'feed' => array( t('Feed Republish'), - array('feed' => t('Mostly Public'), 'feed_restricted' => t('Restricted'))), - 'special' => array( t('Special Purpose'), - array('soapbox' => t('Celebrity/Soapbox'), 'repository' => t('Group Repository'))), - 'other' => array( t('Other'), - array('custom' => t('Custom/Expert Mode')))); - - $o = '<select name="permissions_role" id="privacy-role-select">'; - foreach($roles as $k => $v) { - $o .= '<optgroup label="'. htmlspecialchars($v[0]) . '">'; - foreach($v[1] as $kk => $vv) { - $selected = (($kk === $current) ? ' selected="selected"' : ''); - $o .= '<option value="' . $kk . '"' . $selected . '>' . htmlspecialchars($vv) . '</option>'; - } - $o .= '</optgroup>'; - } - $o .= '</select>'; + t('Social Networking') => array('social' => t('Mostly Public'), 'social_restricted' => t('Restricted'), 'social_private' => t('Private')), + t('Community Forum') => array('forum' => t('Mostly Public'), 'forum_restricted' => t('Restricted'), 'forum_private' => t('Private')), + t('Feed Republish') => array('feed' => t('Mostly Public'), 'feed_restricted' => t('Restricted')), + t('Special Purpose') => array('soapbox' => t('Celebrity/Soapbox'), 'repository' => t('Group Repository')), + t('Other') => array('custom' => t('Custom/Expert Mode'))); - return $o; + return $roles; } |