This commit is contained in:
nobody 2022-01-25 15:25:39 -08:00
commit 907aa13e75
34 changed files with 635 additions and 635 deletions

View file

@ -316,7 +316,7 @@ class Apps
if ($config) {
$unset = ((get_config('system', $require[0]) == $require[1]) ? false : true);
} else {
$unset = ((local_channel() && feature_enabled(local_channel(), $require)) ? false : true);
$unset = ((local_channel() && Features::enabled(local_channel(), $require)) ? false : true);
}
if ($unset) {
unset($ret);
@ -558,7 +558,7 @@ class Apps
if ($config) {
$unset = ((get_config('system', $require[0]) === $require[1]) ? false : true);
} else {
$unset = (($channel_id && feature_enabled($channnel_id, $require)) ? false : true);
$unset = (($channel_id && Features::enabled($channnel_id, $require)) ? false : true);
}
if ($unset) {
return '';

571
Zotlabs/Lib/Features.php Normal file
View file

@ -0,0 +1,571 @@
<?php
namespace Zotlabs\Lib;
use App;
class Features {
public static function enabled($uid, $feature)
{
$x = get_config('feature_lock', $feature);
if ($x === false) {
$x = get_pconfig($uid, 'feature', $feature);
if ($x === false) {
$x = get_config('feature', $feature);
if ($x === false) {
$x = self::default($feature);
}
}
}
$arr = array('uid' => $uid, 'feature' => $feature, 'enabled' => $x);
call_hooks('feature_enabled', $arr);
return($arr['enabled']);
}
public static function get_default($feature)
{
$f = Features::get(false);
foreach ($f as $cat) {
foreach ($cat as $feat) {
if (is_array($feat) && $feat[0] === $feature) {
return $feat[3];
}
}
}
return false;
}
public static function level($feature, $def)
{
$x = get_config('feature_level', $feature);
if ($x !== false) {
return intval($x);
}
return $def;
}
public static function get($filtered = true, $level = (-1))
{
$account = App::get_account();
$arr = [
// General
'general' => [
t('General Features'),
[
'start_menu',
t('New Member Links'),
t('Display new member quick links menu'),
(($account && $account['account_created'] > datetime_convert('', '', 'now - 30 days')) ? true : false),
get_config('feature_lock', 'start_menu'),
self::level('start_menu', 1),
],
[
'advanced_profiles',
t('Advanced Profiles'),
t('Additional profile sections and selections'),
false,
get_config('feature_lock', 'advanced_profiles'),
self::level('advanced_profiles', 1),
],
// [
// 'profile_export',
// t('Profile Import/Export'),
// t('Save and load profile details across sites/channels'),
// false,
// get_config('feature_lock','profile_export'),
// self::level('profile_export',3),
// ],
// [
// 'webpages',
// t('Web Pages'),
// t('Provide managed web pages on your channel'),
// false,
// get_config('feature_lock','webpages'),
// self::level('webpages',3),
// ],
// [
// 'wiki',
// t('Wiki'),
// t('Provide a wiki for your channel'),
// false,
// get_config('feature_lock','wiki'),
// self::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'),
self::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'),
self::level('private_notes', 1),
],
// [
// 'cards',
// t('Cards'),
// t('Create personal planning cards'),
// false,
// get_config('feature_lock','cards'),
// self::level('cards',1),
// ],
[
'articles',
t('Articles'),
t('Create interactive articles'),
false,
get_config('feature_lock', 'articles'),
self::level('articles', 1),
],
// [
// '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'),
// self::level('nav_channel_select',3),
// ],
[
'photo_location',
t('Photo Location'),
t('If location data is available on uploaded photos, link this to a map.'),
false,
get_config('feature_lock', 'photo_location'),
self::level('photo_location', 2),
],
// [
// 'ajaxchat',
// t('Access Controlled Chatrooms'),
// t('Provide chatrooms and chat services with access control.'),
// true,
// get_config('feature_lock','ajaxchat'),
// self::level('ajaxchat',1),
// ],
// [
// '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'),
// self::level('smart_birthdays',2),
// ],
[
'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'),
self::level('event_tz_select', 2),
],
// [
// 'premium_channel',
// t('Premium Channel'),
// t('Allows you to set restrictions and terms on those that connect with your channel'),
// false,
// get_config('feature_lock','premium_channel'),
// self::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'),
self::level('advanced_dirsearch', 4),
],
[
'advanced_theming',
t('Advanced Theme and Layout Settings'),
t('Allows fine tuning of themes and page layouts'),
false,
get_config('feature_lock', 'advanced_theming'),
self::level('advanced_theming', 4),
],
],
'access_control' => [
t('Access Control and Permissions'),
[
'groups',
t('Privacy Groups'),
t('Enable management and selection of privacy groups'),
false,
get_config('feature_lock', 'groups'),
self::level('groups', 0),
],
// [
// 'multi_profiles',
// t('Multiple Profiles'),
// t('Ability to create multiple profiles'),
// false,
// get_config('feature_lock','multi_profiles'),
// self::level('multi_profiles',3),
// ],
[
'permcats',
t('Permission Categories'),
t('Create custom connection permission limits'),
true,
get_config('feature_lock','permcats'),
self::level('permcats',2),
],
// [
// 'oauth_clients',
// t('OAuth1 Clients'),
// t('Manage OAuth1 authenticatication tokens for mobile and remote apps.'),
// false,
// get_config('feature_lock','oauth_clients'),
// self::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'),
self::level('oauth2_clients', 1),
],
// [
// 'access_tokens',
// t('Access Tokens'),
// t('Create access tokens so that non-members can access private content.'),
// false,
// get_config('feature_lock','access_tokens'),
// self::level('access_tokens',2),
// ],
],
// 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'),
// self::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'),
// self::level('channel_sources',3),
// ],
[
'content_encrypt',
t('Browser Encryption'),
t('Provide optional browser-to-browser encryption of content with a shared secret key'),
true,
get_config('feature_lock', 'content_encrypt'),
self::level('content_encrypt', 3),
],
// [
// 'consensus_tools',
// t('Enable Voting Tools'),
// t('Provide a class of post which others can vote on'),
// false,
// get_config('feature_lock','consensus_tools'),
// self::level('consensus_tools',3),
// ],
// [
// 'disable_comments',
// t('Disable Comments'),
// t('Provide the option to disable comments for a post'),
// false,
// get_config('feature_lock','disable_comments'),
// self::level('disable_comments',2),
// ],
// [
// 'delayed_posting',
// t('Delayed Posting'),
// t('Allow posts to be published at a later date'),
// false,
// get_config('feature_lock','delayed_posting'),
// self::level('delayed_posting',2),
// ],
// [
// 'content_expire',
// t('Content Expiration'),
// t('Remove posts/comments and/or private messages at a future time'),
// false,
// get_config('feature_lock','content_expire'),
// self::level('content_expire',1),
// ],
[
'suppress_duplicates',
t('Suppress Duplicate Posts/Comments'),
t('Prevent posts with identical content to be published with less than two minutes in between submissions.'),
true,
get_config('feature_lock', 'suppress_duplicates'),
self::level('suppress_duplicates', 1),
],
[
'auto_save_draft',
t('Auto-save drafts of posts and comments'),
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'),
self::level('auto_save_draft', 1),
],
],
// Network Tools
'net_module' => [
t('Network and Stream Filtering'),
[
'archives',
t('Search by Date'),
t('Ability to select posts by date ranges'),
false,
get_config('feature_lock', 'archives'),
self::level('archives', 1),
],
[
'savedsearch',
t('Saved Searches'),
t('Save search terms for re-use'),
false,
get_config('feature_lock', 'savedsearch'),
self::level('savedsearch', 2),
],
[
'order_tab',
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'),
self::level('order_tab', 2),
],
[
'name_tab',
t('Contact Filter'),
t('Ability to display only posts of a selected contact'),
false,
get_config('feature_lock', 'name_tab'),
self::level('name_tab', 1),
],
[
'forums_tab',
t('Forum Filter'),
t('Ability to display only posts of a specific forum'),
false,
get_config('feature_lock', 'forums_tab'),
self::level('forums_tab', 1),
],
[
'personal_tab',
t('Personal Posts Filter'),
t('Ability to display only posts that you\'ve interacted on'),
false,
get_config('feature_lock', 'personal_tab'),
self::level('personal_tab', 1),
],
[
'affinity',
t('Affinity Tool'),
t('Filter stream activity by depth of relationships'),
false,
get_config('feature_lock', 'affinity'),
self::level('affinity', 1),
],
[
'suggest',
t('Suggest Channels'),
t('Show friend and connection suggestions'),
false,
get_config('feature_lock', 'suggest'),
self::level('suggest', 1),
],
[
'connfilter',
t('Connection Filtering'),
t('Filter incoming posts from connections based on keywords/content'),
false,
get_config('feature_lock', 'connfilter'),
self::level('connfilter', 3),
],
],
// Item tools
'tools' => [
t('Post/Comment Tools'),
[
'commtag',
t('Community Tagging'),
t('Ability to tag existing posts'),
false,
get_config('feature_lock', 'commtag'),
self::level('commtag', 1),
],
[
'categories',
t('Post Categories'),
t('Add categories to your posts'),
false,
get_config('feature_lock', 'categories'),
self::level('categories', 1),
],
[
'emojis',
t('Emoji Reactions'),
t('Add emoji reaction ability to posts'),
true,
get_config('feature_lock', 'emojis'),
self::level('emojis', 1),
],
[
'filing',
t('Saved Folders'),
t('Ability to file posts under folders'),
false,
get_config('feature_lock', 'filing'),
self::level('filing', 2),
],
[
'dislike',
t('Dislike Posts'),
t('Ability to dislike posts/comments'),
false,
get_config('feature_lock', 'dislike'),
self::level('dislike', 1),
],
// [
// 'star_posts',
// t('Star Posts'),
// t('Ability to mark special posts with a star indicator'),
// false,
// get_config('feature_lock','star_posts'),
// self::level('star_posts',1),
// ],
//
[
'tagadelic',
t('Tag Cloud'),
t('Provide a personal tag cloud on your channel page'),
false,
get_config('feature_lock', 'tagadelic'),
self::level('tagadelic', 2),
],
],
];
$x = [ 'features' => $arr, ];
call_hooks('get_features', $x);
$arr = $x['features'];
// removed any locked features and remove the entire category if this makes it empty
if ($filtered) {
$narr = [];
foreach ($arr as $k => $x) {
$narr[$k] = [ $arr[$k][0] ];
$has_items = false;
for ($y = 0; $y < count($arr[$k]); $y++) {
$disabled = false;
if (is_array($arr[$k][$y])) {
if ($arr[$k][$y][4] !== false) {
$disabled = true;
}
if (! $disabled) {
$has_items = true;
$narr[$k][$y] = $arr[$k][$y];
}
}
}
if (! $has_items) {
unset($narr[$k]);
}
}
} else {
$narr = $arr;
}
return $narr;
}
}

View file

@ -111,7 +111,7 @@ class Libprofile
$profile_fields_basic = Channel::get_profile_fields_basic();
$profile_fields_advanced = Channel::get_profile_fields_advanced();
$advanced = ((feature_enabled(local_channel(), 'advanced_profiles')) ? true : false);
$advanced = ((Features::enabled(local_channel(), 'advanced_profiles')) ? true : false);
if ($advanced) {
$fields = $profile_fields_advanced;
} else {
@ -199,7 +199,7 @@ class Libprofile
'entries' => [],
);
$multi_profiles = feature_enabled(local_channel(), 'multi_profiles');
$multi_profiles = Features::enabled(local_channel(), 'multi_profiles');
if ($multi_profiles) {
$ret['multi'] = 1;
$ret['edit'] = [z_root() . '/profiles', t('Edit Profiles'), '', t('Edit')];
@ -485,7 +485,7 @@ class Libprofile
$profile_fields_basic = Channel::get_profile_fields_basic();
$profile_fields_advanced = Channel::get_profile_fields_advanced();
$advanced = ((feature_enabled(App::$profile['profile_uid'], 'advanced_profiles')) ? true : false);
$advanced = ((Features::enabled(App::$profile['profile_uid'], 'advanced_profiles')) ? true : false);
if ($advanced) {
$fields = $profile_fields_advanced;
} else {

View file

@ -122,7 +122,7 @@ class Navbar {
// user menu
$nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), ((App::$nav_sel['raw_name'] == 'Profile') ? 'active' : ''), t('Your profile page'),'profile_nav_btn'];
if (feature_enabled(local_channel(), 'multi_profiles')) {
if (Features::enabled(local_channel(), 'multi_profiles')) {
$nav['usermenu'][] = ['profiles', t('Edit Profiles'), ((App::$nav_sel['raw_name'] == 'Profiles') ? 'active' : '') , t('Manage/Edit profiles'),'profiles_nav_btn'];
} else {
$nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'), ((App::$nav_sel['raw_name'] == 'Profiles') ? 'active' : ''), t('Edit your profile'),'profiles_nav_btn'];

View file

@ -465,10 +465,10 @@ class ThreadItem
'embed' => $embed,
'rawmid' => $item['mid'],
'plink' => get_plink($item),
'edpost' => $edpost, // ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
'edpost' => $edpost, // ((Features::enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
'star' => $star,
'tagger' => ((feature_enabled($conv->get_profile_owner(), 'commtag')) ? $tagger : ''),
'filer' => ((feature_enabled($conv->get_profile_owner(), 'filing')) ? $filer : ''),
'tagger' => ((Features::enabled($conv->get_profile_owner(), 'commtag')) ? $tagger : ''),
'filer' => ((Features::enabled($conv->get_profile_owner(), 'filing')) ? $filer : ''),
'pinned' => ($pinned ? t('Pinned post') : ''),
'pinnable' => (($this->is_toplevel() && local_channel() && $item['owner_xchan'] == $observer['xchan_hash'] && $allowed_type && $item['item_private'] == 0 && $item['item_delayed'] == 0) ? '1' : ''),
'pinme' => ($pinned ? t('Unpin this post') : t('Pin this post')),
@ -477,7 +477,7 @@ class ThreadItem
'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''),
'addtocal' => (($has_event && ! $item['resource_id']) ? t('Add to Calendar') : ''),
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(), 'multi_delete')) ? $multidrop : ''),
'multidrop' => ((Features::enabled($conv->get_profile_owner(), 'multi_delete')) ? $multidrop : ''),
'dropdown_extras' => $dropdown_extras,
// end toolbar buttons
@ -930,7 +930,7 @@ class ThreadItem
call_hooks('comment_buttons', $arr);
$comment_buttons = $arr['comment_buttons'];
$feature_auto_save_draft = ((feature_enabled($conv->get_profile_owner(), 'auto_save_draft')) ? "true" : "false");
$feature_auto_save_draft = ((Features::enabled($conv->get_profile_owner(), 'auto_save_draft')) ? "true" : "false");
$permanent_draft = ((intval($conv->get_profile_owner()) === intval(local_channel()) && Apps::system_app_installed($conv->get_profile_owner(), 'Drafts')) ? ('Save draft') : EMPTY_STR);

View file

@ -1012,7 +1012,7 @@ class Cdav extends Controller
$sources = rtrim($sources, ', ');
$first_day = feature_enabled(local_channel(), 'cal_first_day');
$first_day = Features::enabled(local_channel(), 'cal_first_day');
$first_day = (($first_day) ? $first_day : 0);
$title = ['title', t('Event title')];

View file

@ -732,7 +732,7 @@ class Connedit extends Controller
$unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication'), array(t('No'), t('Yes')));
$multiprofs = ((feature_enabled(local_channel(), 'multi_profiles')) ? true : false);
$multiprofs = ((Features::enabled(local_channel(), 'multi_profiles')) ? true : false);
if ($slide && !$multiprofs) {
$affinity = t('Set Friend Zoom');

View file

@ -71,7 +71,7 @@ class Embedphotos extends Controller
$output = EMPTY_STR;
if ($channel) {
$resolution = ((feature_enabled($channel['channel_id'], 'large_photos')) ? 1 : 2);
$resolution = ((Features::enabled($channel['channel_id'], 'large_photos')) ? 1 : 2);
$r = q(
"select mimetype, height, width, title from photo where resource_id = '%s' and $resolution = %d and uid = %d limit 1",
dbesc($resource),

View file

@ -534,7 +534,7 @@ class Events extends Controller
'$allow_gid' => acl2json($permissions['allow_gid']),
'$deny_cid' => acl2json($permissions['deny_cid']),
'$deny_gid' => acl2json($permissions['deny_gid']),
'$tz_choose' => feature_enabled(local_channel(), 'event_tz_select'),
'$tz_choose' => Features::enabled(local_channel(), 'event_tz_select'),
'$timezone' => array('timezone_select', t('Timezone:'), date_default_timezone_get(), '', get_timezones()),
'$lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'),

View file

@ -1131,7 +1131,7 @@ class Photos extends Controller
'lockstate' => $lockstate[0],
'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'),
'item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
'adult_enabled' => feature_enabled($owner_uid, 'adult_photo_flagging'),
'adult_enabled' => Features::enabled($owner_uid, 'adult_photo_flagging'),
'adult' => array('adult', t('Flag as adult in album view'), intval($ph[0]['is_nsfw']), ''),
'submit' => t('Submit'),
'delete' => t('Delete Photo'),

View file

@ -180,8 +180,8 @@ class Profiles extends Controller
killme();
}
if (((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(), 'multi_profiles')) {
if (feature_enabled(local_channel(), 'multi_profiles')) {
if (((argc() > 1) && (intval(argv(1)))) || !Features::enabled(local_channel(), 'multi_profiles')) {
if (Features::enabled(local_channel(), 'multi_profiles')) {
$id = argv(1);
} else {
$x = q(
@ -444,7 +444,7 @@ class Profiles extends Controller
$profile_fields_basic = Channel::get_profile_fields_basic();
$profile_fields_advanced = Channel::get_profile_fields_advanced();
$advanced = ((feature_enabled(local_channel(), 'advanced_profiles')) ? true : false);
$advanced = ((Features::enabled(local_channel(), 'advanced_profiles')) ? true : false);
if ($advanced) {
$fields = $profile_fields_advanced;
} else {
@ -683,8 +683,8 @@ class Profiles extends Controller
$profile_fields_basic = Channel::get_profile_fields_basic();
$profile_fields_advanced = Channel::get_profile_fields_advanced();
if (((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(), 'multi_profiles')) {
if (feature_enabled(local_channel(), 'multi_profiles')) {
if (((argc() > 1) && (intval(argv(1)))) || !Features::enabled(local_channel(), 'multi_profiles')) {
if (Features::enabled(local_channel(), 'multi_profiles')) {
$id = argv(1);
} else {
$x = q(
@ -712,7 +712,7 @@ class Profiles extends Controller
'$editselect' => $editselect,
));
$advanced = ((feature_enabled(local_channel(), 'advanced_profiles')) ? true : false);
$advanced = ((Features::enabled(local_channel(), 'advanced_profiles')) ? true : false);
if ($advanced) {
$fields = $profile_fields_advanced;
} else {
@ -760,7 +760,7 @@ class Profiles extends Controller
$tpl = get_markup_template("profile_edit.tpl");
$o .= replace_macros($tpl, array(
'$multi_profiles' => ((feature_enabled(local_channel(), 'multi_profiles')) ? true : false),
'$multi_profiles' => ((Features::enabled(local_channel(), 'multi_profiles')) ? true : false),
'$form_security_token' => get_form_security_token("profile_edit"),
'$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"),
'$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"),
@ -782,7 +782,7 @@ class Profiles extends Controller
'$location' => t('Location'),
'$relation' => t('Relationship'),
'$miscellaneous' => t('Miscellaneous'),
'$exportable' => feature_enabled(local_channel(), 'profile_export'),
'$exportable' => Features::enabled(local_channel(), 'profile_export'),
'$lbl_import' => t('Import profile from file'),
'$lbl_export' => t('Export profile to file'),
'$lbl_gender' => t('Your gender'),

View file

@ -661,7 +661,7 @@ class Channel
'$permdesc' => t("(click to open/close)"),
'$aclselect' => Libacl::populate($perm_defaults, false, PermissionDescription::fromDescription(t('Use my default audience setting for the type of object published'))),
'$profseltxt' => t('Profile to assign new connections'),
'$profselect' => ((feature_enabled(local_channel(), 'multi_profiles')) ? contact_profile_assign(get_pconfig(local_channel(), 'system', 'profile_assign', '')) : ''),
'$profselect' => ((Features::enabled(local_channel(), 'multi_profiles')) ? contact_profile_assign(get_pconfig(local_channel(), 'system', 'profile_assign', '')) : ''),
'$allow_cid' => acl2json($perm_defaults['allow_cid']),
'$allow_gid' => acl2json($perm_defaults['allow_gid']),

View file

@ -217,7 +217,7 @@ class Display
'$channel_menu' => ['channel_menu', t('Provide channel menu in navigation bar'), get_pconfig(local_channel(), 'system', 'channel_menu', get_config('system', 'channel_menu', 0)), t('Default: channel menu located in app menu'), $yes_no],
'$layout_editor' => t('System Page Layout Editor - (advanced)'),
'$theme_config' => $theme_config,
'$expert' => feature_enabled(local_channel(), 'advanced_theming'),
'$expert' => Features::enabled(local_channel(), 'advanced_theming'),
'$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(), 'system', 'channel_divmore_height')) ? get_pconfig(local_channel(), 'system', 'channel_divmore_height') : 400), t('click to expand content exceeding this height')),
'$stream_divmore_height' => array('stream_divmore_height', t('Stream page max height of content (in pixels)'), ((get_pconfig(local_channel(), 'system', 'stream_divmore_height')) ? get_pconfig(local_channel(), 'system', 'stream_divmore_height') : 400), t('click to expand content exceeding this height')),
'$indentpx' => ['indentpx', t('Indent threaded comments this many pixels from the parent'), intval(get_pconfig(local_channel(), 'system', 'thread_indent_px', get_config('system', 'thread_indent_px', 0))), t('0-20')],

View file

@ -44,7 +44,7 @@ class Featured
$settings_addons = t('No feature settings configured');
}
if (feature_enabled(local_channel(), 'affinity')) {
if (Features::enabled(local_channel(), 'affinity')) {
$cmax = intval(get_pconfig(local_channel(), 'affinity', 'cmax'));
$cmax = (($cmax) ? $cmax : 99);
$setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array(

View file

@ -12,7 +12,7 @@ class Features
{
check_form_security_token_redirectOnErr('/settings/features', 'settings_features');
$features = get_features(false);
$features = Features::get(false);
foreach ($features as $fname => $fdata) {
foreach (array_slice($fdata, 1) as $f) {
@ -35,21 +35,21 @@ class Features
$harr = [];
$all_features_raw = get_features(false);
$all_features_raw = Features::get(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" : '');
$harr[$f[0]] = ((intval(Features::enabled(local_channel(), $f[0]))) ? "1" : '');
}
}
$features = get_features(true);
$features = Features::get(true);
foreach ($features as $fname => $fdata) {
$arr[$fname] = [];
$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')));
$arr[$fname][1][] = array('feature_' . $f[0], $f[1], ((intval(Features::enabled(local_channel(), $f[0]))) ? "1" : ''), $f[2], array(t('Off'), t('On')));
unset($harr[$f[0]]);
}
}

View file

@ -11,7 +11,7 @@ class Network
{
check_form_security_token_redirectOnErr('/settings/network', 'settings_network');
$features = self::get_features();
$features = self::Features::get();
foreach ($features as $f) {
$k = $f[0];
@ -29,10 +29,10 @@ class Network
public function get()
{
$features = self::get_features();
$features = self::Features::get();
foreach ($features as $f) {
$arr[] = array('feature_' . $f[0], $f[1], ((intval(feature_enabled(local_channel(), $f[0]))) ? "1" : ''), $f[2], array(t('Off'), t('On')));
$arr[] = array('feature_' . $f[0], $f[1], ((intval(Features::enabled(local_channel(), $f[0]))) ? "1" : ''), $f[2], array(t('Off'), t('On')));
}
$tpl = get_markup_template("settings_module.tpl");
@ -49,7 +49,7 @@ class Network
return $o;
}
public function get_features()
public function Features::get()
{
$arr = [

View file

@ -16,7 +16,7 @@ class Sources extends Controller
return;
}
if (!feature_enabled(local_channel(), 'channel_sources')) {
if (!Features::enabled(local_channel(), 'channel_sources')) {
return;
}
@ -91,7 +91,7 @@ class Sources extends Controller
return EMPTY_STR;
}
if (!feature_enabled(local_channel(), 'channel_sources')) {
if (!Features::enabled(local_channel(), 'channel_sources')) {
return EMPTY_STR;
}

View file

@ -339,7 +339,7 @@ class Thing extends Controller
$o .= replace_macros(get_markup_template('thing_edit.tpl'), array(
'$thing_hdr' => t('Edit Thing'),
'$multiprof' => feature_enabled(local_channel(), 'multi_profiles'),
'$multiprof' => Features::enabled(local_channel(), 'multi_profiles'),
'$profile_lbl' => t('Select a profile'),
'$profile_select' => contact_profile_assign($r[0]['obj_page']),
'$verb_lbl' => $channel['channel_name'],
@ -398,7 +398,7 @@ class Thing extends Controller
$o .= replace_macros(get_markup_template('thing_input.tpl'), array(
'$thing_hdr' => t('Add Thing to your Profile'),
'$multiprof' => feature_enabled(local_channel(), 'multi_profiles'),
'$multiprof' => Features::enabled(local_channel(), 'multi_profiles'),
'$profile_lbl' => t('Select a profile'),
'$profile_select' => contact_profile_assign(''),
'$verb_lbl' => $channel['channel_name'],

View file

@ -212,7 +212,7 @@ class Activity_filter
];
}
if (feature_enabled(local_channel(), 'filing')) {
if (Features::enabled(local_channel(), 'filing')) {
$terms = q(
"select distinct term from term where uid = %d and ttype = %d order by term asc",
intval(local_channel()),

View file

@ -19,7 +19,7 @@ class Archive
$uid = App::$profile_uid;
if (!feature_enabled($uid, 'archives')) {
if (!Features::enabled($uid, 'archives')) {
return '';
}

View file

@ -11,7 +11,7 @@ class Bookmarkedchats
public function widget($arr)
{
if (!feature_enabled(App::$profile['profile_uid'], 'ajaxchat')) {
if (!Features::enabled(App::$profile['profile_uid'], 'ajaxchat')) {
return '';
}

View file

@ -24,7 +24,7 @@ class Findpeople
}
}
$advanced_search = ((local_channel() && feature_enabled(local_channel(), 'advanced_dirsearch')) ? t('Advanced') : false);
$advanced_search = ((local_channel() && Features::enabled(local_channel(), 'advanced_dirsearch')) ? t('Advanced') : false);
return replace_macros(get_markup_template('peoplefind.tpl'), array(
'$findpeople' => t('Find Channels'),

View file

@ -25,7 +25,7 @@ class Newmember
}
// @fixme
if (!feature_enabled(local_channel(), 'start_menu')) {
if (!Features::enabled(local_channel(), 'start_menu')) {
return EMPTY_STR;
}

View file

@ -11,7 +11,7 @@ class Savedsearch
public function widget($arr)
{
if ((!local_channel()) || (!feature_enabled(local_channel(), 'savedsearch'))) {
if ((!local_channel()) || (!Features::enabled(local_channel(), 'savedsearch'))) {
return '';
}

View file

@ -82,7 +82,7 @@ class Settings_menu
'selected' => ''
);
// if(feature_enabled(local_channel(),'oauth_clients')) {
// if(Features::enabled(local_channel(),'oauth_clients')) {
// $tabs[] = array(
// 'label' => t('OAuth1 apps'),
// 'url' => z_root() . '/settings/oauth',
@ -98,7 +98,7 @@ class Settings_menu
);
}
// if(feature_enabled(local_channel(),'access_tokens')) {
// if(Features::enabled(local_channel(),'access_tokens')) {
// $tabs[] = array(
// 'label' => t('Guest Access Tokens'),
// 'url' => z_root() . '/settings/tokens',
@ -123,7 +123,7 @@ class Settings_menu
// );
// }
// if(feature_enabled(local_channel(),'channel_sources')) {
// if(Features::enabled(local_channel(),'channel_sources')) {
// $tabs[] = array(
// 'label' => t('Channel Sources'),
// 'url' => z_root() . '/sources',

View file

@ -11,7 +11,7 @@ class Suggestedchats
public function widget($arr)
{
if (!feature_enabled(App::$profile['profile_uid'], 'ajaxchat')) {
if (!Features::enabled(App::$profile['profile_uid'], 'ajaxchat')) {
return '';
}

View file

@ -55,7 +55,6 @@ require_once('include/text.php');
require_once('include/datetime.php');
require_once('include/language.php');
require_once('include/permissions.php');
require_once('include/features.php');
require_once('include/taxonomy.php');
require_once('include/connections.php');
require_once('include/zid.php');

View file

@ -102,7 +102,7 @@ event_created
event_store_event
event_updated
extend_cookie
feature_enabled
Features::enabled
feature_settings
feature_settings_post
federated_transports
@ -118,7 +118,7 @@ get_all_perms
get_base_apps
get_best_language
get_default_export_sections
get_features
Features::get
get_profile_photo
get_role_perms
get_system_apps

View file

@ -497,7 +497,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$page_dropping = ((local_channel() && local_channel() == $profile_owner) ? true : false);
if (! feature_enabled($profile_owner, 'multi_delete')) {
if (! Features::enabled($profile_owner, 'multi_delete')) {
$page_dropping = false;
}
@ -699,7 +699,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'owner_photo' => $owner_photo,
'plink' => get_plink($item, false),
'edpost' => false,
'star' => ((feature_enabled(local_channel(), 'star_posts')) ? $star : ''),
'star' => ((Features::enabled(local_channel(), 'star_posts')) ? $star : ''),
'drop' => $drop,
'vote' => $likebuttons,
'like' => '',
@ -1267,7 +1267,7 @@ function z_status_editor($x, $popup = false)
$reset = ((x($x, 'reset')) ? $x['reset'] : '');
$feature_auto_save_draft = ((feature_enabled($x['profile_uid'], 'auto_save_draft')) ? "true" : "false");
$feature_auto_save_draft = ((Features::enabled($x['profile_uid'], 'auto_save_draft')) ? "true" : "false");
$tpl = get_markup_template('jot-header.tpl');
@ -2025,7 +2025,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null)
}
if ($p['chat'] && feature_enabled($uid, 'ajaxchat')) {
if ($p['chat'] && Features::enabled($uid, 'ajaxchat')) {
$has_chats = Chatroom::list_count($uid);
if ($has_chats) {
$tabs[] = array(
@ -2053,7 +2053,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null)
);
}
if (feature_enabled($uid, 'cards')) {
if (Features::enabled($uid, 'cards')) {
$tabs[] = array(
'label' => t('Cards'),
'url' => z_root() . '/cards/' . $nickname,
@ -2064,7 +2064,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null)
);
}
if (feature_enabled($uid, 'articles')) {
if (Features::enabled($uid, 'articles')) {
$tabs[] = array(
'label' => t('articles'),
'url' => z_root() . '/articles/' . $nickname,
@ -2075,7 +2075,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null)
);
}
if ($has_webpages && feature_enabled($uid, 'webpages')) {
if ($has_webpages && Features::enabled($uid, 'webpages')) {
$tabs[] = array(
'label' => t('Webpages'),
'url' => z_root() . '/page/' . $nickname . '/home',
@ -2088,7 +2088,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null)
if ($p['view_wiki']) {
if (feature_enabled($uid, 'wiki')) {
if (Features::enabled($uid, 'wiki')) {
$tabs[] = array(
'label' => t('Wikis'),
'url' => z_root() . '/wiki/' . $nickname,

View file

@ -591,7 +591,7 @@ function update_birthdays()
'event_xchan' => $rr['xchan_hash'],
'dtstart' => datetime_convert('UTC', 'UTC', $rr['abook_dob']),
'dtend' => datetime_convert('UTC', 'UTC', $rr['abook_dob'] . ' + 1 day '),
'adjust' => intval(feature_enabled($rr['abook_channel'], 'smart_birthdays')),
'adjust' => intval(Features::enabled($rr['abook_channel'], 'smart_birthdays')),
'summary' => sprintf(t('%1$s\'s birthday'), $rr['xchan_name']),
'description' => sprintf(t('Happy Birthday %1$s'), '[zrl=' . $rr['xchan_url'] . ']' . $rr['xchan_name'] . '[/zrl]'),
'etype' => 'birthday',

View file

@ -1,569 +0,0 @@
<?php
/** @file */
/*
* Features management
*/
function feature_enabled($uid, $feature)
{
$x = get_config('feature_lock', $feature);
if ($x === false) {
$x = get_pconfig($uid, 'feature', $feature);
if ($x === false) {
$x = get_config('feature', $feature);
if ($x === false) {
$x = get_feature_default($feature);
}
}
}
$arr = array('uid' => $uid, 'feature' => $feature, 'enabled' => $x);
call_hooks('feature_enabled', $arr);
return($arr['enabled']);
}
function get_feature_default($feature)
{
$f = get_features(false);
foreach ($f as $cat) {
foreach ($cat as $feat) {
if (is_array($feat) && $feat[0] === $feature) {
return $feat[3];
}
}
}
return false;
}
function feature_level($feature, $def)
{
$x = get_config('feature_level', $feature);
if ($x !== false) {
return intval($x);
}
return $def;
}
function get_features($filtered = true, $level = (-1))
{
$account = App::get_account();
$arr = [
// General
'general' => [
t('General Features'),
[
'start_menu',
t('New Member Links'),
t('Display new member quick links menu'),
(($account && $account['account_created'] > datetime_convert('', '', 'now - 30 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'),
false,
get_config('feature_lock', 'advanced_profiles'),
feature_level('advanced_profiles', 1),
],
// [
// '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),
// ],
// [
// '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),
],
// [
// 'cards',
// t('Cards'),
// t('Create personal planning cards'),
// false,
// get_config('feature_lock','cards'),
// feature_level('cards',1),
// ],
[
'articles',
t('Articles'),
t('Create interactive articles'),
false,
get_config('feature_lock', 'articles'),
feature_level('articles', 1),
],
// [
// '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'),
// feature_level('nav_channel_select',3),
// ],
[
'photo_location',
t('Photo Location'),
t('If location data is available on uploaded photos, link this to a map.'),
false,
get_config('feature_lock', 'photo_location'),
feature_level('photo_location', 2),
],
// [
// 'ajaxchat',
// t('Access Controlled Chatrooms'),
// t('Provide chatrooms and chat services with access control.'),
// true,
// get_config('feature_lock','ajaxchat'),
// feature_level('ajaxchat',1),
// ],
// [
// '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),
// ],
[
'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'),
feature_level('event_tz_select', 2),
],
// [
// 'premium_channel',
// t('Premium Channel'),
// t('Allows you to set restrictions and terms on those that connect with your channel'),
// 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),
],
[
'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),
],
],
'access_control' => [
t('Access Control and Permissions'),
[
'groups',
t('Privacy Groups'),
t('Enable management and selection of privacy groups'),
false,
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),
// ],
[
'permcats',
t('Permission Categories'),
t('Create custom connection permission limits'),
true,
get_config('feature_lock','permcats'),
feature_level('permcats',2),
],
// [
// '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),
],
// [
// 'access_tokens',
// t('Access Tokens'),
// t('Create access tokens so that non-members can access private content.'),
// false,
// get_config('feature_lock','access_tokens'),
// feature_level('access_tokens',2),
// ],
],
// 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('Browser Encryption'),
t('Provide optional browser-to-browser encryption of content with a shared secret key'),
true,
get_config('feature_lock', 'content_encrypt'),
feature_level('content_encrypt', 3),
],
// [
// 'consensus_tools',
// t('Enable Voting Tools'),
// t('Provide a class of post which others can vote on'),
// false,
// get_config('feature_lock','consensus_tools'),
// feature_level('consensus_tools',3),
// ],
// [
// 'disable_comments',
// t('Disable Comments'),
// t('Provide the option to disable comments for a post'),
// false,
// get_config('feature_lock','disable_comments'),
// feature_level('disable_comments',2),
// ],
// [
// 'delayed_posting',
// t('Delayed Posting'),
// t('Allow posts to be published at a later date'),
// false,
// get_config('feature_lock','delayed_posting'),
// feature_level('delayed_posting',2),
// ],
// [
// 'content_expire',
// t('Content Expiration'),
// t('Remove posts/comments and/or private messages at a future time'),
// false,
// get_config('feature_lock','content_expire'),
// feature_level('content_expire',1),
// ],
[
'suppress_duplicates',
t('Suppress Duplicate Posts/Comments'),
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),
],
[
'auto_save_draft',
t('Auto-save drafts of posts and comments'),
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),
],
],
// Network Tools
'net_module' => [
t('Network and Stream Filtering'),
[
'archives',
t('Search by Date'),
t('Ability to select posts by date ranges'),
false,
get_config('feature_lock', 'archives'),
feature_level('archives', 1),
],
[
'savedsearch',
t('Saved Searches'),
t('Save search terms for re-use'),
false,
get_config('feature_lock', 'savedsearch'),
feature_level('savedsearch', 2),
],
[
'order_tab',
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),
],
[
'name_tab',
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),
],
[
'forums_tab',
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),
],
[
'personal_tab',
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),
],
[
'affinity',
t('Affinity Tool'),
t('Filter stream activity by depth of relationships'),
false,
get_config('feature_lock', 'affinity'),
feature_level('affinity', 1),
],
[
'suggest',
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),
],
],
// Item tools
'tools' => [
t('Post/Comment Tools'),
[
'commtag',
t('Community Tagging'),
t('Ability to tag existing posts'),
false,
get_config('feature_lock', 'commtag'),
feature_level('commtag', 1),
],
[
'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),
],
[
'filing',
t('Saved Folders'),
t('Ability to file posts under folders'),
false,
get_config('feature_lock', 'filing'),
feature_level('filing', 2),
],
[
'dislike',
t('Dislike Posts'),
t('Ability to dislike posts/comments'),
false,
get_config('feature_lock', 'dislike'),
feature_level('dislike', 1),
],
// [
// 'star_posts',
// t('Star Posts'),
// t('Ability to mark special posts with a star indicator'),
// false,
// get_config('feature_lock','star_posts'),
// feature_level('star_posts',1),
// ],
//
[
'tagadelic',
t('Tag Cloud'),
t('Provide a personal tag cloud on your channel page'),
false,
get_config('feature_lock', 'tagadelic'),
feature_level('tagadelic', 2),
],
],
];
$x = [ 'features' => $arr, ];
call_hooks('get_features', $x);
$arr = $x['features'];
// removed any locked features and remove the entire category if this makes it empty
if ($filtered) {
$narr = [];
foreach ($arr as $k => $x) {
$narr[$k] = [ $arr[$k][0] ];
$has_items = false;
for ($y = 0; $y < count($arr[$k]); $y++) {
$disabled = false;
if (is_array($arr[$k][$y])) {
if ($arr[$k][$y][4] !== false) {
$disabled = true;
}
if (! $disabled) {
$has_items = true;
$narr[$k][$y] = $arr[$k][$y];
}
}
}
if (! $has_items) {
unset($narr[$k]);
}
}
} else {
$narr = $arr;
}
return $narr;
}

View file

@ -1048,7 +1048,7 @@ function search($s, $id = 'search-box', $url = '/search', $save = false)
'$action_url' => z_root() . $url,
'$search_label' => t('Search'),
'$save_label' => t('Save'),
'$savedsearch' => feature_enabled(local_channel(), 'savedsearch')
'$savedsearch' => Features::enabled(local_channel(), 'savedsearch')
));
}
@ -1061,7 +1061,7 @@ function searchbox($s, $id = 'search-box', $url = '/search', $save = false)
'$action_url' => z_root() . '/' . $url,
'$search_label' => t('Search'),
'$save_label' => t('Save'),
'$savedsearch' => ($save && feature_enabled(local_channel(), 'savedsearch'))
'$savedsearch' => ($save && Features::enabled(local_channel(), 'savedsearch'))
));
}

View file

@ -161,7 +161,6 @@ CREATE TABLE IF NOT EXISTS `atoken` (
KEY `atoken_guid` (`atoken_guid`),
KEY `atoken_aid` (`atoken_aid`),
KEY `atoken_uid` (`atoken_uid`),
KEY `atoken_uid_2` (`atoken_uid`),
KEY `atoken_name` (`atoken_name`),
KEY `atoken_token` (`atoken_token`),
KEY `atoken_expires` (`atoken_expires`)

View file

@ -87,7 +87,7 @@ class RedbasicConfig {
function form($arr) {
if(feature_enabled(local_channel(),'advanced_theming'))
if(Features::enabled(local_channel(),'advanced_theming'))
$expert = 1;