diff options
Diffstat (limited to 'include/features.php')
-rw-r--r-- | include/features.php | 455 |
1 files changed, 175 insertions, 280 deletions
diff --git a/include/features.php b/include/features.php index 03f50c9a4..ccf3c5faf 100644 --- a/include/features.php +++ b/include/features.php @@ -44,265 +44,160 @@ function feature_level($feature,$def) { return $def; } +function process_module_features_get($uid, $features) { + unset($features[0]); + foreach($features as $f) { + $arr[] = array('feature_' . $f[0],$f[1],((intval(feature_enabled($uid, $f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); + } + return $arr; +} + +function process_module_features_post($uid, $features, $post_arr) { + unset($features[0]); + foreach($features as $f) { + $k = $f[0]; + if(array_key_exists("feature_$k",$post_arr)) + set_pconfig($uid,'feature',$k, (string) $post_arr["feature_$k"]); + else + set_pconfig($uid,'feature', $k, ''); + } + if($post_arr['rpath']) + goaway($post_arr['rpath']); +} + function get_features($filtered = true, $level = (-1)) { $account = \App::get_account(); $arr = [ - // General - 'general' => [ + 'calendar' => [ - t('General Features'), + t('CalDAV'), [ - 'start_menu', - t('New Member Links'), - t('Display new member quick links menu'), - (($account['account_created'] > datetime_convert('','','now - 60 days')) ? true : false), - get_config('feature_lock','start_menu'), - feature_level('start_menu',1), - ], - - [ - 'advanced_profiles', - t('Advanced Profiles'), - t('Additional profile sections and selections'), + 'cal_first_day', + t('Start calendar week on Monday'), + t('Default is Sunday'), false, - get_config('feature_lock','advanced_profiles'), - feature_level('advanced_profiles',1), - ], + get_config('feature_lock','cal_first_day') + ] - [ - 'profile_export', - t('Profile Import/Export'), - t('Save and load profile details across sites/channels'), - false, - get_config('feature_lock','profile_export'), - feature_level('profile_export',3), - ], + ], - [ - 'webpages', - t('Web Pages'), - t('Provide managed web pages on your channel'), - false, - get_config('feature_lock','webpages'), - feature_level('webpages',3), - ], + 'channel_home' => [ - [ - 'wiki', - t('Wiki'), - t('Provide a wiki for your channel'), - false, - get_config('feature_lock','wiki'), - feature_level('wiki',2), - ], -/* - [ - 'hide_rating', - t('Hide Rating'), - t('Hide the rating buttons on your channel and profile pages. Note: People can still rate you somewhere else.'), - false, - get_config('feature_lock','hide_rating'), - feature_level('hide_rating',3), - ], -*/ - [ - 'private_notes', - t('Private Notes'), - t('Enables a tool to store notes and reminders (note: not encrypted)'), - false, - get_config('feature_lock','private_notes'), - feature_level('private_notes',1), - ], + t('Channel Home'), [ - 'cards', - t('Cards'), - t('Create personal planning cards'), + 'tagadelic', + t('Tag Cloud'), + t('Provide a personal tag cloud on your channel page'), false, - get_config('feature_lock','cards'), - feature_level('cards',1), - ], + get_config('feature_lock','tagadelic'), + ] + ], + 'connections' => [ - [ - 'articles', - t('Articles'), - t('Create interactive articles'), - false, - get_config('feature_lock','articles'), - feature_level('articles',1), - ], + t('Connections'), [ - 'nav_channel_select', - t('Navigation Channel Select'), - t('Change channels directly from within the navigation dropdown menu'), + 'connfilter', + t('Connection Filtering'), + t('Filter incoming posts from connections based on keywords/content'), false, - get_config('feature_lock','nav_channel_select'), - feature_level('nav_channel_select',3), - ], + get_config('feature_lock','connfilter') + ] + ], + + 'conversation' => [ + + t('Conversation'), [ - 'photo_location', - t('Photo Location'), - t('If location data is available on uploaded photos, link this to a map.'), + 'commtag', + t('Community Tagging'), + t('Ability to tag existing posts'), false, - get_config('feature_lock','photo_location'), - feature_level('photo_location',2), + get_config('feature_lock','commtag'), ], [ - 'ajaxchat', - t('Access Controlled Chatrooms'), - t('Provide chatrooms and chat services with access control.'), + 'emojis', + t('Emoji Reactions'), + t('Add emoji reaction ability to posts'), true, - get_config('feature_lock','ajaxchat'), - feature_level('ajaxchat',1), + get_config('feature_lock','emojis'), ], - [ - 'smart_birthdays', - t('Smart Birthdays'), - t('Make birthday events timezone aware in case your friends are scattered across the planet.'), - true, - get_config('feature_lock','smart_birthdays'), - feature_level('smart_birthdays',2), + 'filing', + t('Saved Folders'), + t('Ability to file posts under folders'), + false, + get_config('feature_lock','filing'), ], [ - 'event_tz_select', - t('Event Timezone Selection'), - t('Allow event creation in timezones other than your own.'), + 'dislike', + t('Dislike Posts'), + t('Ability to dislike posts/comments'), false, - get_config('feature_lock','event_tz_select'), - feature_level('event_tz_select',2), + get_config('feature_lock','dislike'), ], - [ - 'premium_channel', - t('Premium Channel'), - t('Allows you to set restrictions and terms on those that connect with your channel'), + 'star_posts', + t('Star Posts'), + t('Ability to mark special posts with a star indicator'), false, - get_config('feature_lock','premium_channel'), - feature_level('premium_channel',4), - ], - - [ - 'advanced_dirsearch', - t('Advanced Directory Search'), - t('Allows creation of complex directory search queries'), - false, - get_config('feature_lock','advanced_dirsearch'), - feature_level('advanced_dirsearch',4), - ], + get_config('feature_lock','star_posts'), + ] - [ - 'advanced_theming', - t('Advanced Theme and Layout Settings'), - t('Allows fine tuning of themes and page layouts'), - false, - get_config('feature_lock','advanced_theming'), - feature_level('advanced_theming',4), - ], ], + 'directory' => [ - 'access_control' => [ - t('Access Control and Permissions'), - - [ - 'groups', - t('Privacy Groups'), - t('Enable management and selection of privacy groups'), - true, - get_config('feature_lock','groups'), - feature_level('groups',0), - ], - - [ - 'multi_profiles', - t('Multiple Profiles'), - t('Ability to create multiple profiles'), - false, - get_config('feature_lock','multi_profiles'), - feature_level('multi_profiles',3), - ], - + t('Directory'), [ - 'permcats', - t('Permission Categories'), - t('Create custom connection permission limits'), + 'advanced_dirsearch', + t('Advanced Directory Search'), + t('Allows creation of complex directory search queries'), false, - get_config('feature_lock','permcats'), - feature_level('permcats',2), - ], + get_config('feature_lock','advanced_dirsearch'), + ] - [ - 'oauth_clients', - t('OAuth1 Clients'), - t('Manage OAuth1 authenticatication tokens for mobile and remote apps.'), - false, - get_config('feature_lock','oauth_clients'), - feature_level('oauth_clients',1), - ], + ], - [ - 'oauth2_clients', - t('OAuth2 Clients'), - t('Manage OAuth2 authenticatication tokens for mobile and remote apps.'), - false, - get_config('feature_lock','oauth2_clients'), - feature_level('oauth2_clients',1), - ], + 'editor' => [ + + t('Editor'), [ - 'access_tokens', - t('Access Tokens'), - t('Create access tokens so that non-members can access private content.'), + 'categories', + t('Post Categories'), + t('Add categories to your posts'), false, - get_config('feature_lock','access_tokens'), - feature_level('access_tokens',2), + get_config('feature_lock','categories'), + feature_level('categories',1), ], - ], - - // Post composition - 'composition' => [ - - t('Post Composition Features'), - [ 'large_photos', t('Large Photos'), t('Include large (1024px) photo thumbnails in posts. If not enabled, use small (640px) photo thumbnails'), false, get_config('feature_lock','large_photos'), - feature_level('large_photos',1), ], [ - 'channel_sources', - t('Channel Sources'), - t('Automatically import channel content from other channels or feeds'), - false, - get_config('feature_lock','channel_sources'), - feature_level('channel_sources',3), - ], - - [ 'content_encrypt', t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key'), false, get_config('feature_lock','content_encrypt'), - feature_level('content_encrypt',3), ], [ @@ -311,7 +206,6 @@ function get_features($filtered = true, $level = (-1)) { t('Provide a class of post which others can vote on'), false, get_config('feature_lock','consensus_tools'), - feature_level('consensus_tools',3), ], [ @@ -320,7 +214,6 @@ function get_features($filtered = true, $level = (-1)) { t('Provide the option to disable comments for a post'), false, get_config('feature_lock','disable_comments'), - feature_level('disable_comments',2), ], [ @@ -329,7 +222,6 @@ function get_features($filtered = true, $level = (-1)) { t('Allow posts to be published at a later date'), false, get_config('feature_lock','delayed_posting'), - feature_level('delayed_posting',2), ], [ @@ -338,7 +230,6 @@ function get_features($filtered = true, $level = (-1)) { t('Remove posts/comments and/or private messages at a future time'), false, get_config('feature_lock','content_expire'), - feature_level('content_expire',1), ], [ @@ -347,7 +238,6 @@ function get_features($filtered = true, $level = (-1)) { t('Prevent posts with identical content to be published with less than two minutes in between submissions.'), true, get_config('feature_lock','suppress_duplicates'), - feature_level('suppress_duplicates',1), ], [ @@ -356,33 +246,72 @@ function get_features($filtered = true, $level = (-1)) { t('Automatically saves post and comment drafts in local browser storage to help prevent accidental loss of compositions'), true, get_config('feature_lock','auto_save_draft'), - feature_level('auto_save_draft',1), + ] + + ], + + 'events' => [ + + t('Events'), + + [ + 'events_cal_first_day', + t('Start calendar week on Monday'), + t('Default is Sunday'), + false, + get_config('feature_lock','events_cal_first_day') + ], + + [ + 'smart_birthdays', + t('Smart Birthdays'), + t('Make birthday events timezone aware in case your friends are scattered across the planet.'), + true, + get_config('feature_lock','smart_birthdays'), ], + [ + 'event_tz_select', + t('Event Timezone Selection'), + t('Allow event creation in timezones other than your own.'), + false, + get_config('feature_lock','event_tz_select'), + ] + + ], + + 'manage' => [ + + t('Manage'), + + [ + 'nav_channel_select', + t('Navigation Channel Select'), + t('Change channels directly from within the navigation dropdown menu'), + false, + get_config('feature_lock','nav_channel_select'), + ] + ], - // Network Tools - 'net_module' => [ + 'network' => [ - t('Network and Stream Filtering'), + t('Network'), [ 'archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, - get_config('feature_lock','archives'), - feature_level('archives',1), + get_config('feature_lock','archives') ], - [ 'savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, - get_config('feature_lock','savedsearch'), - feature_level('savedsearch',2), + get_config('feature_lock','savedsearch') ], [ @@ -390,8 +319,7 @@ function get_features($filtered = true, $level = (-1)) { t('Alternate Stream Order'), t('Ability to order the stream by last post date, last comment date or unthreaded activities'), false, - get_config('feature_lock','order_tab'), - feature_level('order_tab',2), + get_config('feature_lock','order_tab') ], [ @@ -399,8 +327,7 @@ function get_features($filtered = true, $level = (-1)) { t('Contact Filter'), t('Ability to display only posts of a selected contact'), false, - get_config('feature_lock','name_tab'), - feature_level('name_tab',1), + get_config('feature_lock','name_tab') ], [ @@ -408,8 +335,7 @@ function get_features($filtered = true, $level = (-1)) { t('Forum Filter'), t('Ability to display only posts of a specific forum'), false, - get_config('feature_lock','forums_tab'), - feature_level('forums_tab',1), + get_config('feature_lock','forums_tab') ], [ @@ -417,8 +343,7 @@ function get_features($filtered = true, $level = (-1)) { t('Personal Posts Filter'), t('Ability to display only posts that you\'ve interacted on'), false, - get_config('feature_lock','personal_tab'), - feature_level('personal_tab',1), + get_config('feature_lock','personal_tab') ], [ @@ -426,8 +351,7 @@ function get_features($filtered = true, $level = (-1)) { t('Affinity Tool'), t('Filter stream activity by depth of relationships'), false, - get_config('feature_lock','affinity'), - feature_level('affinity',1), + get_config('feature_lock','affinity') ], [ @@ -435,90 +359,56 @@ function get_features($filtered = true, $level = (-1)) { t('Suggest Channels'), t('Show friend and connection suggestions'), false, - get_config('feature_lock','suggest'), - feature_level('suggest',1), - ], - - [ - 'connfilter', - t('Connection Filtering'), - t('Filter incoming posts from connections based on keywords/content'), - false, - get_config('feature_lock','connfilter'), - feature_level('connfilter',3), - ], - + get_config('feature_lock','suggest') + ] ], - // Item tools - 'tools' => [ + 'photos' => [ - t('Post/Comment Tools'), + t('Photos'), [ - 'commtag', - t('Community Tagging'), - t('Ability to tag existing posts'), + 'photo_location', + t('Photo Location'), + t('If location data is available on uploaded photos, link this to a map.'), false, - get_config('feature_lock','commtag'), - feature_level('commtag',1), - ], + get_config('feature_lock','photo_location'), + ] - [ - 'categories', - t('Post Categories'), - t('Add categories to your posts'), - false, - get_config('feature_lock','categories'), - feature_level('categories',1), - ], + ], - [ - 'emojis', - t('Emoji Reactions'), - t('Add emoji reaction ability to posts'), - true, - get_config('feature_lock','emojis'), - feature_level('emojis',1), - ], + 'profiles' => [ - [ - 'filing', - t('Saved Folders'), - t('Ability to file posts under folders'), - false, - get_config('feature_lock','filing'), - feature_level('filing',2), - ], + t('Profiles'), [ - 'dislike', - t('Dislike Posts'), - t('Ability to dislike posts/comments'), + 'advanced_profiles', + t('Advanced Profiles'), + t('Additional profile sections and selections'), false, - get_config('feature_lock','dislike'), - feature_level('dislike',1), + get_config('feature_lock','advanced_profiles') ], [ - 'star_posts', - t('Star Posts'), - t('Ability to mark special posts with a star indicator'), + 'profile_export', + t('Profile Import/Export'), + t('Save and load profile details across sites/channels'), false, - get_config('feature_lock','star_posts'), - feature_level('star_posts',1), + get_config('feature_lock','profile_export') ], [ - 'tagadelic', - t('Tag Cloud'), - t('Provide a personal tag cloud on your channel page'), - false, - get_config('feature_lock','tagadelic'), - feature_level('tagadelic',2), - ], - ], + 'multi_profiles', + t('Multiple Profiles'), + t('Ability to create multiple profiles'), + false, + get_config('feature_lock','multi_profiles') + ] + + ] + + ]; $x = [ 'features' => $arr, ]; @@ -561,3 +451,8 @@ function get_features($filtered = true, $level = (-1)) { return $narr; } + +function get_module_features($module) { + $features = get_features(false); + return $features[$module]; +} |