aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-05 15:26:01 -0800
committerfriendica <info@friendica.com>2012-11-05 15:26:01 -0800
commit4f1170b65618f6455f6432a8b90152fe45d4eeea (patch)
tree388cc5d4fb0de500fc72033945bf60b84483e542
parent2752b58f3323a15b964f6518b7720cb81ccf1b0e (diff)
downloadvolse-hubzilla-4f1170b65618f6455f6432a8b90152fe45d4eeea.tar.gz
volse-hubzilla-4f1170b65618f6455f6432a8b90152fe45d4eeea.tar.bz2
volse-hubzilla-4f1170b65618f6455f6432a8b90152fe45d4eeea.zip
change permission settings from radio buttons to select boxes
-rw-r--r--include/permissions.php22
-rw-r--r--mod/settings.php20
-rw-r--r--version.inc2
-rw-r--r--view/css/mod_settings.css17
-rw-r--r--view/tpl/settings.tpl11
5 files changed, 28 insertions, 44 deletions
diff --git a/include/permissions.php b/include/permissions.php
index aa32e4c1b..048019a35 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -4,19 +4,19 @@
function get_perms() {
$global_perms = array(
// Read only permissions
- 'view_stream' => array('channel_r_stream', intval(PERMS_R_STREAM), true, t('Who can view your "public" stream and posts')),
- 'view_profile' => array('channel_r_profile', intval(PERMS_R_PROFILE), true, t('Who can view your "public" channel profile')),
- 'view_photos' => array('channel_r_photos', intval(PERMS_R_PHOTOS), true, t('Who can view your "public" photo albums')),
- 'view_contacts' => array('channel_r_abook', intval(PERMS_R_ABOOK), true, t('Who can view your "public" address book')),
+ 'view_stream' => array('channel_r_stream', intval(PERMS_R_STREAM), true, t('Who can view your "public" stream and posts'), ''),
+ 'view_profile' => array('channel_r_profile', intval(PERMS_R_PROFILE), true, t('Who can view your "public" channel profile'), ''),
+ 'view_photos' => array('channel_r_photos', intval(PERMS_R_PHOTOS), true, t('Who can view your "public" photo albums'), ''),
+ 'view_contacts' => array('channel_r_abook', intval(PERMS_R_ABOOK), true, t('Who can view your "public" address book'), ''),
// Write permissions
- 'send_stream' => array('channel_w_stream', intval(PERMS_W_STREAM), false, t('Who can send you their channel stream and posts')),
- 'post_wall' => array('channel_w_wall', intval(PERMS_W_WALL), false, t('Who can post on your channel page')),
- 'post_comments' => array('channel_w_comment', intval(PERMS_W_COMMENT), false, t('Who can comment on your posts')),
- 'post_mail' => array('channel_w_mail', intval(PERMS_W_MAIL), false, t('Who can send you private mail messages')),
- 'post_photos' => array('channel_w_photos', intval(PERMS_W_PHOTOS), false, t('Who can post photos to your photo albums')),
- 'tag_deliver' => array('channel_w_tagwall', intval(PERMS_W_TAGWALL), false, t('Who can forward to all your channel contacts via post tags')),
- 'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false, t('Who can chat with you (when available)')),
+ 'send_stream' => array('channel_w_stream', intval(PERMS_W_STREAM), false, t('Who can send you their channel stream and posts'), ''),
+ 'post_wall' => array('channel_w_wall', intval(PERMS_W_WALL), false, t('Who can post on your channel page'), ''),
+ 'post_comments' => array('channel_w_comment', intval(PERMS_W_COMMENT), false, t('Who can comment on your posts'), ''),
+ 'post_mail' => array('channel_w_mail', intval(PERMS_W_MAIL), false, t('Who can send you private mail messages'), ''),
+ 'post_photos' => array('channel_w_photos', intval(PERMS_W_PHOTOS), false, t('Who can post photos to your photo albums'), ''),
+ 'tag_deliver' => array('channel_w_tagwall', intval(PERMS_W_TAGWALL), false, t('Who can forward to all your channel contacts via post tags'), t('Advanced - useful for creating group forum channels')),
+ 'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false, t('Who can chat with you (when available)'), t('Requires compatible chat plugin')),
);
return $global_perms;
}
diff --git a/mod/settings.php b/mod/settings.php
index a78f25015..e275ae9f5 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -765,7 +765,7 @@ function settings_content(&$a) {
$permiss = array();
- $perm_cats = array(
+ $perm_opts = array(
array( t('Nobody except yourself'), 0),
array( t('Only those you specifically allow'), PERMS_SPECIFIC),
array( t('Anybody in your address book'), PERMS_CONTACTS),
@@ -776,23 +776,17 @@ function settings_content(&$a) {
foreach($global_perms as $k => $perm) {
-
- $permiss[$k] = array(
- 'key' => $k,
- 'label' => $perm[3],
- 'fields' => array()
- );
- $column = $perm[0];
- foreach($perm_cats as $cat) {
- if((! $perm[2]) && $cat[1] == PERMS_PUBLIC)
+ $options = array();
+ foreach($perm_opts as $opt) {
+ if((! $perm[2]) && $opt[1] == PERMS_PUBLIC)
continue;
- $permiss[$k]['fields'][] = array( $column, $cat[0], $cat[1], '', (($channel[$column] == $cat[1]) ? '1' : ''));
+ $options[$opt[1]] = $opt[0];
}
-
+ $permiss[] = array($k,$perm[3],$channel[$perm[0]],$perm[4],$options);
}
-logger('permiss: ' . print_r($permiss,true));
+// logger('permiss: ' . print_r($permiss,true));
diff --git a/version.inc b/version.inc
index 986400c00..64f7f27fb 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2012-11-04.128
+2012-11-05.129
diff --git a/view/css/mod_settings.css b/view/css/mod_settings.css
index ed8b83107..3d78124fe 100644
--- a/view/css/mod_settings.css
+++ b/view/css/mod_settings.css
@@ -1,17 +1,8 @@
-.settings-permission-label {
- margin-top: 10px;
- font-weight: bold;
- margin-bottom: 10px;
-}
#settings-permissions-wrapper .field {
- margin-left: 15px;
- padding-bottom: 0px;
- margin-bottom: 0px;
+ margin-bottom: 10px;
}
#settings-permissions-wrapper .field label{
- width: 200px;
-}
-#settings-permissions-wrapper .field input{
- text-align: left;
- width: 50px;
+ width: 350px;
+ font-weight: bold;
}
+
diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl
index b250a361e..a759e356a 100644
--- a/view/tpl/settings.tpl
+++ b/view/tpl/settings.tpl
@@ -39,16 +39,15 @@ $nickname_block
<div id="settings-permissions-wrapper">
{{ for $permiss_arr as $permit }}
-<div id="settings-perms-$permit.key" class="settings-permission-label">$permit.label</div>
-{{ for $permit.fields as $radio }}
-
- {{inc field_radio.tpl with $field=$radio }}{{endinc}}
-
-{{ endfor }}
+{{inc field_select.tpl with $field=$permit }}{{endinc}}
{{ endfor }}
</div>
+<div class="settings-submit-wrapper" >
+<input type="submit" name="submit" class="settings-submit" value="$submit" />
+</div>
+