aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-14 08:42:02 +1100
committerfriendica <info@friendica.com>2014-02-14 08:42:02 +1100
commitff7c7170671e8699ca15d25af0320b8a92c7fef2 (patch)
treed846825a260e4681c6361ec04c47701cfd9c749f
parent5cedc324eb290e32f547e23799ec3e09fc30c496 (diff)
parentd7546c7a638214f53219d342300ef659668a4975 (diff)
downloadvolse-hubzilla-ff7c7170671e8699ca15d25af0320b8a92c7fef2.tar.gz
volse-hubzilla-ff7c7170671e8699ca15d25af0320b8a92c7fef2.tar.bz2
volse-hubzilla-ff7c7170671e8699ca15d25af0320b8a92c7fef2.zip
Merge pull request #313 from git-marijus/master
This makes advanced privacy settings adjustable in expert mode only. Als...
-rw-r--r--mod/settings.php2
-rw-r--r--view/css/mod_settings.css15
-rw-r--r--view/tpl/field_select_disabled.tpl7
-rwxr-xr-xview/tpl/settings.tpl34
4 files changed, 38 insertions, 20 deletions
diff --git a/mod/settings.php b/mod/settings.php
index 506141a1f..ec758bc90 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -977,6 +977,8 @@ function settings_content(&$a) {
'$h_advn' => t('Advanced Account/Page Type Settings'),
'$h_descadvn' => t('Change the behaviour of this account for special situations'),
'$pagetype' => $pagetype,
+ '$expert' => feature_enabled(local_user(),'expert'),
+ '$hint' => t('Please enable expert mode (in Settings > Additional features) to adjust!'),
));
diff --git a/view/css/mod_settings.css b/view/css/mod_settings.css
index 2049d9bc6..0d3dd36fe 100644
--- a/view/css/mod_settings.css
+++ b/view/css/mod_settings.css
@@ -1,20 +1,19 @@
-#settings-permissions-wrapper, #settings-perm-advanced {
- opacity: 0.3;
- filter:alpha(opacity=30);
+#settings-permissions-wrapper {
+ margin-top: 15px;
}
-#settings-permissions-wrapper:hover, #settings-perm-advanced:hover {
- opacity: 1.0;
- filter:alpha(opacity=100);
+#settings-perm-advanced {
+ margin-top: 15px;
}
-#settings-perm-advanced {
+.settings-common-perms {
margin-top: 15px;
}
#settings-permissions-wrapper .field {
margin-bottom: 10px;
}
+
#settings-permissions-wrapper .field label{
width: 350px;
}
@@ -28,8 +27,6 @@
margin-bottom: 45px;
}
-
-
#settings-notifications label {
margin-left: 20px;
}
diff --git a/view/tpl/field_select_disabled.tpl b/view/tpl/field_select_disabled.tpl
new file mode 100644
index 000000000..f0090cf98
--- /dev/null
+++ b/view/tpl/field_select_disabled.tpl
@@ -0,0 +1,7 @@
+ <div class='field select'>
+ <label style="font-weight: normal;" for='id_{{$field.0}}'>{{$field.1}}</label>
+ <select disabled="true" name='{{$field.0}}' id='id_{{$field.0}}'>
+ {{foreach $field.4 as $opt=>$val}}<option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>{{/foreach}}
+ </select>
+ <span class='field_help'>{{$field.3}}</span>
+ </div>
diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl
index c4b89a543..808078413 100755
--- a/view/tpl/settings.tpl
+++ b/view/tpl/settings.tpl
@@ -16,7 +16,7 @@
{{include file="field_checkbox.tpl" field=$adult}}
<div class="settings-submit-wrapper" >
-<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
+<input type="submit" name="submit" class="settings-submit" value="{{$submit}}"{{if !$expert}} onclick="$('select').prop('disabled', false);"{{/if}} />
</div>
@@ -34,20 +34,31 @@
</ul>
-<h3 id="settings-perm-advanced">{{$lbl_p2macro}}</h3>
+<button type="button" class="btn btn-xs btn-warning" data-toggle="collapse" data-target="#settings-permissions-wrapper">{{$lbl_p2macro}}</button>
+
+
+
+<div class="collapse well" id="settings-permissions-wrapper">
+{{if !$expert}}
+ <div class="alert alert-info">{{$hint}}</div>
+{{/if}}
-<div id="settings-permissions-wrapper">
{{foreach $permiss_arr as $permit}}
-{{include file="field_select.tpl" field=$permit}}
+ {{if $expert}}
+ {{include file="field_select.tpl" field=$permit}}
+ {{else}}
+ {{include file="field_select_disabled.tpl" field=$permit}}
+ {{/if}}
{{/foreach}}
-</div>
+{{if $expert}}
+ <div class="settings-submit-wrapper" >
+ <input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
+ </div>
+{{/if}}
-<div class="settings-submit-wrapper" >
-<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
</div>
-
-
+<div class="settings-common-perms">
{{$profile_in_dir}}
{{$suggestme}}
@@ -55,6 +66,7 @@
{{include file="field_input.tpl" field=$maxreq}}
{{include file="field_input.tpl" field=$cntunkmail}}
+</div>
<div id="settings-default-perms" class="settings-default-perms" >
<a href="#profile-jot-acl-wrapper" id="settings-default-perms-menu" >{{$permissions}} {{$permdesc}}</a>
@@ -77,7 +89,7 @@
<div class="settings-submit-wrapper" >
-<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
+<input type="submit" name="submit" class="settings-submit" value="{{$submit}}"{{if !$expert}} onclick="$('select').prop('disabled', false);"{{/if}} />
</div>
@@ -108,7 +120,7 @@
</div>
<div class="settings-submit-wrapper" >
-<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
+<input type="submit" name="submit" class="settings-submit" value="{{$submit}}"{{if !$expert}} onclick="$('select').prop('disabled', false);"{{/if}} />
</div>
</div>