aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-09-27 14:56:47 +0200
committerMario Vavti <mario@mariovavti.com>2018-09-27 14:56:47 +0200
commit6b23c3e1796b818ce893ed919f2e2bdd000c83fb (patch)
tree441348d1cbeb31e461af1090af713e73f88aae49 /Zotlabs
parentbdf6289b323c26329087eb21911576239e0b6216 (diff)
downloadvolse-hubzilla-6b23c3e1796b818ce893ed919f2e2bdd000c83fb.tar.gz
volse-hubzilla-6b23c3e1796b818ce893ed919f2e2bdd000c83fb.tar.bz2
volse-hubzilla-6b23c3e1796b818ce893ed919f2e2bdd000c83fb.zip
implement conversation tools (settings/conversation), remove additional features from the settings menu and get rid of skill levels
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/ThreadItem.php7
-rw-r--r--Zotlabs/Module/Settings/Conversation.php60
-rw-r--r--Zotlabs/Module/Settings/Features.php35
-rw-r--r--Zotlabs/Widget/Settings_menu.php8
4 files changed, 66 insertions, 44 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index f8a7366f8..ac24806a6 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -259,7 +259,7 @@ class ThreadItem {
$forged = ((($item['sig']) && (! intval($item['item_verified']))) ? t('Message signature incorrect') : '');
$unverified = '' ; // (($this->is_wall_to_wall() && (! intval($item['item_verified']))) ? t('Message cannot be verified') : '');
-
+ $settings = '';
// FIXME - check this permission
if($conv->get_profile_owner() == local_channel()) {
@@ -267,6 +267,8 @@ class ThreadItem {
'tagit' => t("Add Tag"),
'classtagger' => "",
);
+
+ $settings = t('Conversation Tools');
}
$has_bookmarks = false;
@@ -436,7 +438,8 @@ class ThreadItem {
'preview_lbl' => t('This is an unsaved preview'),
'wait' => t('Please wait'),
'submid' => str_replace(['+','='], ['',''], base64_encode($item['mid'])),
- 'thread_level' => $thread_level
+ 'thread_level' => $thread_level,
+ 'settings' => $settings
);
$arr = array('item' => $item, 'output' => $tmp_item);
diff --git a/Zotlabs/Module/Settings/Conversation.php b/Zotlabs/Module/Settings/Conversation.php
new file mode 100644
index 000000000..43e59a3c2
--- /dev/null
+++ b/Zotlabs/Module/Settings/Conversation.php
@@ -0,0 +1,60 @@
+<?php
+
+namespace Zotlabs\Module\Settings;
+
+
+class Conversation {
+
+ function post() {
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ check_form_security_token_redirectOnErr('/settings/' . $module, 'settings_' . $module);
+
+ $features = get_module_features($module);
+
+ process_module_features_post(local_channel(), $features, $_POST);
+
+ build_sync_packet();
+
+ if($_POST['aj']) {
+ if($_POST['auto_update'] == 1)
+ info(t('Settings saved.') . EOL);
+ else
+ info(t('Settings saved. Reload page please.') . EOL);
+
+ killme();
+ }
+ else {
+ return;
+ }
+ }
+
+ function get() {
+
+ $aj = ((isset($_GET['aj'])) ? true : false);
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ $features = get_module_features($module);
+
+ $tpl = (($aj) ? get_markup_template("settings_module_ajax.tpl") : get_markup_template("settings_module.tpl"));
+
+ $o .= replace_macros($tpl, array(
+ '$action_url' => 'settings/' . $module,
+ '$form_security_token' => get_form_security_token('settings_' . $module),
+ '$title' => t('Conversation Settings'),
+ '$features' => process_module_features_get(local_channel(), $features),
+ '$submit' => t('Submit')
+ ));
+
+ if($aj) {
+ echo $o;
+ killme();
+ }
+ else {
+ return $o;
+ }
+ }
+
+}
diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Settings/Features.php
index 888032c28..6a3ab104b 100644
--- a/Zotlabs/Module/Settings/Features.php
+++ b/Zotlabs/Module/Settings/Features.php
@@ -26,44 +26,14 @@ class Features {
function get() {
$arr = [];
- $harr = [];
- if(intval($_REQUEST['techlevel']))
- $level = intval($_REQUEST['techlevel']);
- else {
- $level = get_account_techlevel();
- }
-
- if(! intval($level)) {
- notice( t('Permission denied.') . EOL);
- return;
- }
-
- $techlevels = \Zotlabs\Lib\Techlevels::levels();
-
- // This page isn't accessible at techlevel 0
-
- unset($techlevels[0]);
-
- $def_techlevel = (($level > 0) ? $level : 1);
- $techlock = get_config('system','techlevel_lock');
-
- $all_features_raw = get_features(false);
-
- foreach($all_features_raw as $fname => $fdata) {
- foreach(array_slice($fdata,1) as $f) {
- $harr[$f[0]] = ((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : '');
- }
- }
-
- $features = get_features(true,$level);
+ $features = get_features(false);
foreach($features as $fname => $fdata) {
$arr[$fname] = array();
$arr[$fname][0] = $fdata[0];
foreach(array_slice($fdata,1) as $f) {
$arr[$fname][1][] = array('feature_' . $f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
- unset($harr[$f[0]]);
}
}
@@ -71,10 +41,7 @@ class Features {
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_features"),
'$title' => t('Additional Features'),
- '$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience and additional features consistent with your comfort level'), $techlevels ],
- '$techlock' => $techlock,
'$features' => $arr,
- '$hiddens' => $harr,
'$baseurl' => z_root(),
'$submit' => t('Submit'),
));
diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php
index ecf93ec78..92f615452 100644
--- a/Zotlabs/Widget/Settings_menu.php
+++ b/Zotlabs/Widget/Settings_menu.php
@@ -45,14 +45,6 @@ class Settings_menu {
);
- if(get_account_techlevel() > 0 && get_features()) {
- $tabs[] = array(
- 'label' => t('Additional features'),
- 'url' => z_root().'/settings/features',
- 'selected' => ((argv(1) === 'features') ? 'active' : ''),
- );
- }
-
$tabs[] = array(
'label' => t('Addon settings'),
'url' => z_root().'/settings/featured',