"; var_dump($lang_choices); die(""); /* Register policy */ - $register_choices = Array( + $register_choices = array( REGISTER_CLOSED => t("Closed"), REGISTER_APPROVE => t("Requires approval"), REGISTER_OPEN => t("Open") @@ -845,7 +872,7 @@ function admin_page_site(&$a) { SSL_POLICY_SELFSIGN => t("Self-signed certificate, use SSL for local links only (discouraged)") ); - if ($a->config['hostname'] == "") + if($a->config['hostname'] == "") $a->config['hostname'] = $a->get_hostname(); $diaspora_able = ($a->get_path() == ""); @@ -870,7 +897,7 @@ function admin_page_site(&$a) { '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$shortcut_icon' => array('shortcut_icon', t("Shortcut icon"), get_config('system','shortcut_icon'), t("Link to an icon that will be used for browsers.")), '$touch_icon' => array('touch_icon', t("Touch icon"), get_config('system','touch_icon'), t("Link to an icon that will be used for tablets and mobiles.")), - '$info' => array('info',t('Additional Info'), $info, sprintf(t('For public servers: you can add additional information here that will be listed at %s/siteinfo.'), get_server())), + '$info' => array('info',t('Additional Info'), $info, sprintf(t('For public servers: you can add additional information here that will be listed at %s/siteinfo.'), get_server())), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - change theme settings"), $theme_choices), '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile), @@ -880,8 +907,8 @@ function admin_page_site(&$a) { '$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")), '$singleuser' => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), - '$maximagelength' => array('maximagelength', t("Maximum image length"), get_config('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")), - '$jpegimagequality' => array('jpegimagequality', t("JPEG image quality"), get_config('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")), + '$maximagelength' => array('maximagelength', t("Maximum image length"), get_config('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")), + '$jpegimagequality' => array('jpegimagequality', t("JPEG image quality"), get_config('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")), '$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices), '$daily_registrations' => array('max_daily_registrations', t("Maximum Daily Registrations"), get_config('system', 'max_daily_registrations'), t("If registration is permitted above, this sets the maximum number of new user registrations to accept per day. If register is set to closed, this setting has no effect.")), @@ -897,7 +924,7 @@ function admin_page_site(&$a) { '$enotify_no_content' => array('enotify_no_content', t("Don't include post content in email notifications"), get_config('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")), '$private_addons' => array('private_addons', t("Disallow public access to addons listed in the apps menu."), get_config('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")), '$disable_embedded' => array('disable_embedded', t("Don't embed private images in posts"), get_config('system','disable_embedded'), t("Don't replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.")), - '$allow_users_remote_self' => array('allow_users_remote_self', t('Allow Users to set remote_self'), get_config('system','allow_users_remote_self'), t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')), + '$allow_users_remote_self' => array('allow_users_remote_self', t('Allow Users to set remote_self'), get_config('system','allow_users_remote_self'), t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')), '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")), '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")), '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")), @@ -905,12 +932,12 @@ function admin_page_site(&$a) { '$community_page_style' => array('community_page_style', t("Community Page Style"), get_config('system','community_page_style'), t("Type of community page to show. 'Global community' shows every public posting from an open distributed network that arrived on this server."), $community_page_style_choices), '$max_author_posts_community_page' => array('max_author_posts_community_page', t("Posts per user on community page"), get_config('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")), '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")), - '$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices), + '$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices), '$ostatus_not_able' => t("OStatus support can only be enabled if threading is enabled."), '$diaspora_able' => $diaspora_able, '$diaspora_not_able' => t("Diaspora support can't be enabled because Friendica was installed into a sub directory."), - '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")), - '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")), + '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")), + '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")), '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")), '$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""), '$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""), @@ -948,14 +975,14 @@ function admin_page_site(&$a) { '$rino' => array('rino', t("RINO Encryption"), intval(get_config('system','rino_encrypt')), t("Encryption layer between nodes."), array("Disabled", "RINO1 (deprecated)", "RINO2")), '$embedly' => array('embedly', t("Embedly API key"), get_config('system','embedly'), t("Embedly is used to fetch additional data for web pages. This is an optional parameter.")), - '$form_security_token' => get_form_security_token("admin_site") + '$form_security_token' => get_form_security_token("admin_site") )); } /** - * @brief generates admin panel subpage for DB syncronization + * @brief Generates admin panel subpage for DB syncronization * * This page checks if the database of friendica is in sync with the specs. * Should this not be the case, it attemps to sync the structure and notifies @@ -982,17 +1009,17 @@ function admin_page_dbsync(&$a) { if(($a->argc > 2) AND (intval($a->argv[2]) OR ($a->argv[2] === 'check'))) { require_once("include/dbstructure.php"); $retval = update_structure(false, true); - if (!$retval) { + if(!$retval) { $o .= sprintf(t("Database structure update %s was successfully applied."), DB_UPDATE_VERSION)."
". file_get_contents("addon/$plugin/README") .""; } $admin_form=""; - if (is_array($a->plugins_admin) && in_array($plugin, $a->plugins_admin)){ + if(is_array($a->plugins_admin) && in_array($plugin, $a->plugins_admin)) { @require_once("addon/$plugin/$plugin.php"); $func = $plugin.'_plugin_admin'; $func($a, $admin_form); @@ -1404,11 +1431,11 @@ function admin_page_plugins(&$a){ - /** + /* * List plugins */ - if (x($_GET,"a") && $_GET['a']=="r"){ + if(x($_GET,"a") && $_GET['a']=="r") { check_form_security_token_redirectOnErr($a->get_baseurl().'/admin/plugins', 'admin_themes', 't'); reload_plugins(); info("Plugins reloaded"); @@ -1416,23 +1443,23 @@ function admin_page_plugins(&$a){ } $plugins = array(); - $files = glob("addon/*/"); /* */ + $files = glob("addon/*/"); if($files) { foreach($files as $file) { - if (is_dir($file)){ + if(is_dir($file)) { list($tmp, $id)=array_map("trim", explode("/",$file)); $info = get_plugin_info($id); $show_plugin = true; // If the addon is unsupported, then only show it, when it is enabled - if ((strtolower($info["status"]) == "unsupported") AND !in_array($id, $a->plugins)) + if((strtolower($info["status"]) == "unsupported") AND !in_array($id, $a->plugins)) $show_plugin = false; // Override the above szenario, when the admin really wants to see outdated stuff - if (get_config("system", "show_unsupported_addons")) + if(get_config("system", "show_unsupported_addons")) $show_plugin = true; - if ($show_plugin) + if($show_plugin) $plugins[] = array($id, (in_array($id, $a->plugins)?"on":"off") , $info); } } @@ -1539,7 +1566,7 @@ function admin_page_themes(&$a){ $allowed_themes[] = trim($x); $themes = array(); - $files = glob('view/theme/*'); /* */ + $files = glob('view/theme/*'); if($files) { foreach($files as $file) { $f = basename($file); @@ -1547,7 +1574,7 @@ function admin_page_themes(&$a){ $is_supported = 1-(intval(file_exists($file . '/unsupported'))); $is_allowed = intval(in_array($f,$allowed_themes)); - if ($is_allowed OR $is_supported OR get_config("system", "show_unsupported_themes")) + if($is_allowed OR $is_supported OR get_config("system", "show_unsupported_themes")) $themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed); } } @@ -1557,18 +1584,18 @@ function admin_page_themes(&$a){ return ''; } - /** + /* * Single theme */ - if ($a->argc == 3){ + if($a->argc == 3) { $theme = $a->argv[2]; - if(! is_dir("view/theme/$theme")){ + if(! is_dir("view/theme/$theme")) { notice( t("Item not found.") ); return ''; } - if (x($_GET,"a") && $_GET['a']=="t"){ + if(x($_GET,"a") && $_GET['a']=="t") { check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't'); // Toggle theme status @@ -1592,22 +1619,22 @@ function admin_page_themes(&$a){ // display theme details require_once('library/markdown.php'); - if (theme_status($themes,$theme)) { + if(theme_status($themes,$theme)) { $status="on"; $action= t("Disable"); } else { $status="off"; $action= t("Enable"); } $readme=Null; - if (is_file("view/theme/$theme/README.md")){ + if(is_file("view/theme/$theme/README.md")) { $readme = file_get_contents("view/theme/$theme/README.md"); $readme = Markdown($readme); - } else if (is_file("view/theme/$theme/README")){ + } elseif(is_file("view/theme/$theme/README")) { $readme = "
". file_get_contents("view/theme/$theme/README") .""; } $admin_form=""; - if (is_file("view/theme/$theme/config.php")){ + if(is_file("view/theme/$theme/config.php")) { function __get_theme_admin_form(&$a, $theme) { $orig_theme = $a->theme; $orig_page = $a->page; @@ -1619,7 +1646,7 @@ function admin_page_themes(&$a){ $init = $theme."_init"; if(function_exists($init)) $init($a); - if(function_exists("theme_admin")){ + if(function_exists("theme_admin")) { $admin_form = theme_admin($a); } @@ -1660,11 +1687,11 @@ function admin_page_themes(&$a){ // reload active themes - if (x($_GET,"a") && $_GET['a']=="r"){ + if(x($_GET,"a") && $_GET['a']=="r") { check_form_security_token_redirectOnErr($a->get_baseurl().'/admin/themes', 'admin_themes', 't'); - if ($themes) { + if($themes) { foreach($themes as $th) { - if ($th['allowed']) { + if($th['allowed']) { uninstall_theme($th['name']); install_theme($th['name']); } @@ -1674,7 +1701,7 @@ function admin_page_themes(&$a){ goaway($a->get_baseurl().'/admin/themes'); } - /** + /* * List themes */ @@ -1705,17 +1732,17 @@ function admin_page_themes(&$a){ /** - * @brief prosesses data send by Logs admin page + * @brief Prosesses data send by Logs admin page + * * @param App $a */ - function admin_page_logs_post(&$a) { - if (x($_POST,"page_logs")) { + if(x($_POST,"page_logs")) { check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs'); - $logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : ''); - $debugging = ((x($_POST,'debugging')) ? true : false); - $loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0); + $logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : ''); + $debugging = ((x($_POST,'debugging')) ? true : false); + $loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0); set_config('system','logfile', $logfile); set_config('system','debugging', $debugging); @@ -1728,7 +1755,7 @@ function admin_page_logs_post(&$a) { } /** - * @brief generates admin panel subpage for configuration of the logs + * @brief Generates admin panel subpage for configuration of the logs * * This function take the view/templates/admin_logs.tpl file and generates a * page where admin can configure the logging of friendica. @@ -1745,7 +1772,7 @@ function admin_page_logs_post(&$a) { */ function admin_page_logs(&$a){ - $log_choices = Array( + $log_choices = array( LOGGER_NORMAL => 'Normal', LOGGER_TRACE => 'Trace', LOGGER_DEBUG => 'Debug', @@ -1763,10 +1790,10 @@ function admin_page_logs(&$a){ '$baseurl' => $a->get_baseurl(true), '$logname' => get_config('system','logfile'), - // name, label, value, help string, extra data... - '$debugging' => array('debugging', t("Enable Debugging"),get_config('system','debugging'), ""), - '$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")), - '$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices), + // name, label, value, help string, extra data... + '$debugging' => array('debugging', t("Enable Debugging"),get_config('system','debugging'), ""), + '$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")), + '$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices), '$form_security_token' => get_form_security_token("admin_logs"), '$phpheader' => t("PHP logging"), @@ -1776,7 +1803,7 @@ function admin_page_logs(&$a){ } /** - * @brief generates admin panel subpage to view the Friendica log + * @brief Generates admin panel subpage to view the Friendica log * * This function loads the template view/templates/admin_viewlogs.tpl to * display the systemlog content. The filename for the systemlog of friendica @@ -1809,8 +1836,7 @@ function admin_page_viewlogs(&$a){ else { $fstat = fstat($fp); $size = $fstat['size']; - if($size != 0) - { + if($size != 0) { if($size > 5000000 || $size < 0) $size = 5000000; $seek = fseek($fp,0-$size,SEEK_END); @@ -1830,3 +1856,87 @@ function admin_page_viewlogs(&$a){ '$logname' => get_config('system','logfile') )); } + +/** + * @brief Prosesses data send by the features admin page + * + * @param App $a + */ +function admin_page_features_post(&$a) { + + check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features'); + + logger('postvars: ' . print_r($_POST,true),LOGGER_DATA); + + $arr = array(); + $features = get_features(false); + + foreach($features as $fname => $fdata) { + foreach(array_slice($fdata,1) as $f) { + $feature = $f[0]; + $feature_state = 'feature_' . $feature; + $featurelock = 'featurelock_' . $feature; + + if(x($_POST[$feature_state])) + $val = intval($_POST['feature_' . $feature]); + else + $val = 0; + set_config('feature',$feature,$val); + + if(x($_POST[$featurelock])) + set_config('feature_lock',$feature,$val); + else + del_config('feature_lock',$feature); + } + } + + goaway($a->get_baseurl(true) . '/admin/features' ); + return; // NOTREACHED +} + +/** + * @brief Subpage for global additional feature management + * + * This functin generates the subpage 'Manage Additional Features' + * for the admin panel. At this page the admin can set preferences + * for the user settings of the 'additional features'. If needed this + * preferences can be locked through the admin. + * + * The returned string contains the HTML code of the subpage 'Manage + * Additional Features' + * + * @param App $a + * @return string + */ +function admin_page_features(&$a) { + + if((argc() > 1) && (argv(1) === 'features')) { + $arr = array(); + $features = get_features(false); + + foreach($features as $fname => $fdata) { + $arr[$fname] = array(); + $arr[$fname][0] = $fdata[0]; + foreach(array_slice($fdata,1) as $f) { + + $set = get_config('feature',$f[0]); + if($set === false) + $set = $f[3]; + $arr[$fname][1][] = array( + array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'),t('On'))), + array('featurelock_' .$f[0],sprintf( t('Lock feature %s'),$f[1]),(($f[4] !== false) ? "1" : ''),'',array(t('Off'),t('On'))) + ); + } + } + + $tpl = get_markup_template("admin_settings_features.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("admin_manage_features"), + '$title' => t('Manage Additional Features'), + '$features' => $arr, + '$submit' => t('Save Settings'), + )); + + return $o; + } +} diff --git a/mod/friendica.php b/mod/friendica.php index 9fa203f58d..aad5964baf 100644 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -29,10 +29,21 @@ function friendica_init(&$a) { $visible_plugins[] = $rr['name']; } + load_config('feature_lock'); + $locked_features = array(); + if(is_array($a->config['feature_lock']) && count($a->config['feature_lock'])) { + foreach($a->config['feature_lock'] as $k => $v) { + if($k === 'config_loaded') + continue; + $locked_features[$k] = intval($v); + } + } + $data = Array( 'version' => FRIENDICA_VERSION, 'url' => z_root(), 'plugins' => $visible_plugins, + 'locked_features' => $locked_features, 'register_policy' => $register_policy[$a->config['register_policy']], 'admin' => $admin, 'site_name' => $a->config['sitename'], diff --git a/mod/settings.php b/mod/settings.php index 02a6955a00..3efdbf6bde 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -43,57 +43,67 @@ function settings_init(&$a) { 'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''), 'accesskey' => 'o', ), - array( - 'label' => t('Additional features'), - 'url' => $a->get_baseurl(true).'/settings/features', - 'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''), - 'accesskey' => 't', - ), - array( - 'label' => t('Display'), - 'url' => $a->get_baseurl(true).'/settings/display', - 'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''), - 'accesskey' => 'i', - ), + ); - array( - 'label' => t('Social Networks'), - 'url' => $a->get_baseurl(true).'/settings/connectors', - 'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''), - 'accesskey' => 'w', - ), - array( - 'label' => t('Plugins'), - 'url' => $a->get_baseurl(true).'/settings/addon', - 'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''), - 'accesskey' => 'l', - ), - array( - 'label' => t('Delegations'), - 'url' => $a->get_baseurl(true).'/delegate', - 'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''), - 'accesskey' => 'd', - ), - array( - 'label' => t('Connected apps'), - 'url' => $a->get_baseurl(true) . '/settings/oauth', - 'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''), - 'accesskey' => 'b', - ), - array( - 'label' => t('Export personal data'), - 'url' => $a->get_baseurl(true) . '/uexport', - 'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''), - 'accesskey' => 'e', - ), - array( - 'label' => t('Remove account'), - 'url' => $a->get_baseurl(true) . '/removeme', - 'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''), - 'accesskey' => 'r', - ) + if(get_features()) { + $tabs[] = array( + 'label' => t('Additional features'), + 'url' => $a->get_baseurl(true).'/settings/features', + 'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''), + 'accesskey' => 't', + ); + } + + $tabs[] = array( + 'label' => t('Display'), + 'url' => $a->get_baseurl(true).'/settings/display', + 'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''), + 'accesskey' => 'i', + ); + + $tabs[] = array( + 'label' => t('Social Networks'), + 'url' => $a->get_baseurl(true).'/settings/connectors', + 'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''), + 'accesskey' => 'w', + ); + + $tabs[] = array( + 'label' => t('Plugins'), + 'url' => $a->get_baseurl(true).'/settings/addon', + 'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''), + 'accesskey' => 'l', + ); + + $tabs[] = array( + 'label' => t('Delegations'), + 'url' => $a->get_baseurl(true).'/delegate', + 'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''), + 'accesskey' => 'd', ); + $tabs[] = array( + 'label' => t('Connected apps'), + 'url' => $a->get_baseurl(true) . '/settings/oauth', + 'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''), + 'accesskey' => 'b', + ); + + $tabs[] = array( + 'label' => t('Export personal data'), + 'url' => $a->get_baseurl(true) . '/uexport', + 'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''), + 'accesskey' => 'e', + ); + + $tabs[] = array( + 'label' => t('Remove account'), + 'url' => $a->get_baseurl(true) . '/removeme', + 'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''), + 'accesskey' => 'r', + ); + + $tabtpl = get_markup_template("generic_links_widget.tpl"); $a->page['aside'] = replace_macros($tabtpl, array( '$title' => t('Settings'), @@ -622,7 +632,6 @@ function settings_post(&$a) { } -if(! function_exists('settings_content')) { function settings_content(&$a) { $o = ''; @@ -747,7 +756,7 @@ function settings_content(&$a) { $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(get_pconfig(local_user(),'feature',$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); + $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(feature_enabled(local_user(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); } } @@ -1287,5 +1296,5 @@ function settings_content(&$a) { return $o; -}} +} diff --git a/view/templates/admin_settings_features.tpl b/view/templates/admin_settings_features.tpl new file mode 100644 index 0000000000..abcc527d42 --- /dev/null +++ b/view/templates/admin_settings_features.tpl @@ -0,0 +1,21 @@ +