]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
Merge pull request #636 from fabrixxm/installer/checkphpcli
[friendica.git] / mod / settings.php
index 09a45f832a44e0a4cd076095d52d54daa82f0aa2..8b3cebfa35dd642c6b21a27fe66d9f0116dd134f 100644 (file)
@@ -554,13 +554,7 @@ function settings_content(&$a) {
                
                if(($a->argc > 2) && ($a->argv[2] === 'add')) {
                        $tpl = get_markup_template("settings_oauth_edit.tpl");
-
-                       $includes = array(
-                               '$field_input' => 'field_input.tpl',
-                       );
-                       $includes = set_template_includes($a->theme['template_engine'], $includes);
-
-                       $o .= replace_macros($tpl, $includes + array(
+                       $o .= replace_macros($tpl, array(
                                '$form_security_token' => get_form_security_token("settings_oauth"),
                                '$title'        => t('Add application'),
                                '$submit'       => t('Submit'),
@@ -586,13 +580,7 @@ function settings_content(&$a) {
                        $app = $r[0];
                        
                        $tpl = get_markup_template("settings_oauth_edit.tpl");
-
-                       $includes = array(
-                               '$field_input' => 'field_input.tpl',
-                       );
-                       $includes = set_template_includes($a->theme['template_engine'], $includes);
-
-                       $o .= replace_macros($tpl, $includes + array(
+                       $o .= replace_macros($tpl, array(
                                '$form_security_token' => get_form_security_token("settings_oauth"),
                                '$title'        => t('Add application'),
                                '$submit'       => t('Update'),
@@ -675,13 +663,7 @@ function settings_content(&$a) {
 
 
                $tpl = get_markup_template("settings_features.tpl");
-
-               $includes = array(
-                       '$field_yesno'  => 'field_yesno.tpl',
-               );
-               $includes = set_template_includes($a->theme['template_engine'], $includes);
-
-               $o .= replace_macros($tpl, $includes + array(
+               $o .= replace_macros($tpl, array(
                        '$form_security_token' => get_form_security_token("settings_features"),
                        '$title'        => t('Additional Features'),
                        '$features' => $arr,
@@ -733,16 +715,7 @@ function settings_content(&$a) {
                }
        
 
-               $includes = array(
-                       '$field_checkbox' => 'field_checkbox.tpl',
-                       '$field_input' => 'field_input.tpl',
-                       '$field_select' => 'field_select.tpl',
-                       '$field_custom' => 'field_custom.tpl',
-                       '$field_password' => 'field_password.tpl',
-               );
-               $includes = set_template_includes($a->theme['template_engine'], $includes);
-
-               $o .= replace_macros($tpl, $includes + array(
+               $o .= replace_macros($tpl, array(
                        '$form_security_token' => get_form_security_token("settings_connectors"),
                        
                        '$title'        => t('Connector Settings'),
@@ -832,15 +805,7 @@ function settings_content(&$a) {
                }
                
                $tpl = get_markup_template("settings_display.tpl");
-
-               $includes = array(
-                       '$field_themeselect' => 'field_themeselect.tpl',
-                       '$field_checkbox' => 'field_checkbox.tpl',
-                       '$field_input' => 'field_input.tpl',
-               );
-               $includes = set_template_includes($a->theme['template_engine'], $includes);
-
-               $o = replace_macros($tpl, $includes + array(
+               $o = replace_macros($tpl, array(
                        '$ptitle'       => t('Display Settings'),
                        '$form_security_token' => get_form_security_token("settings_display"),
                        '$submit'       => t('Submit'),
@@ -926,13 +891,7 @@ function settings_content(&$a) {
 
 
        $pageset_tpl = get_markup_template('pagetypes.tpl');
-
-       $includes = array(
-               '$field_radio' => 'field_radio.tpl',
-       );
-       $includes = set_template_includes($a->theme['template_engine'], $includes);
-
-       $pagetype = replace_macros($pageset_tpl,$includes + array(
+       $pagetype = replace_macros($pageset_tpl, array(
                '$page_normal'  => array('page-flags', t('Normal Account Page'), PAGE_NORMAL, 
                                                                        t('This account is a normal personal profile'), 
                                                                        ($a->user['page-flags'] == PAGE_NORMAL)),
@@ -1053,17 +1012,26 @@ function settings_content(&$a) {
        require_once('include/group.php');
        $group_select = mini_group_select(local_user(),$a->user['def_gid']);
 
-       $includes = array(
-               '$field_password' => 'field_password.tpl',
-               '$field_input' => 'field_input.tpl',
-               '$field_custom' => 'field_custom.tpl',
-               '$field_checkbox' => 'field_checkbox.tpl',
-               '$field_yesno' => 'field_yesno.tpl',
-               '$field_intcheckbox' => 'field_intcheckbox.tpl',
-       );
-       $includes = set_template_includes($a->theme['template_engine'], $includes);
 
-       $o .= replace_macros($stpl,$includes + array(
+       // Private/public post links for the non-JS ACL form
+       $private_post = 1;
+       if($_REQUEST['public'])
+               $private_post = 0;
+
+       $query_str = $a->query_string;
+       if(strpos($query_str, 'public=1') !== false)
+               $query_str = str_replace(array('?public=1', '&public=1'), array('', ''), $query_str);
+
+       // I think $a->query_string may never have ? in it, but I could be wrong
+       // It looks like it's from the index.php?q=[etc] rewrite that the web
+       // server does, which converts any ? to &, e.g. suggest&ignore=61 for suggest?ignore=61
+       if(strpos($query_str, '?') === false)
+               $public_post_link = '?public=1';
+       else
+               $public_post_link = '&public=1';
+
+
+       $o .= replace_macros($stpl, array(
                '$ptitle'       => t('Account Settings'),
 
                '$submit'       => t('Submit'),
@@ -1097,6 +1065,17 @@ function settings_content(&$a) {
                '$blockwall'=> $blockwall, // array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
                '$blocktags'=> $blocktags, // array('blocktags', t('Allow friends to tag your posts:'), !$blocktags, ''),
 
+               // ACL permissions box
+               '$acl_data' => construct_acl_data($a, $a->user), // For non-Javascript ACL selector
+               '$group_perms' => t('Show to Groups'),
+               '$contact_perms' => t('Show to Contacts'),
+               '$private' => t('Default Private Post'),
+               '$public' => t('Default Public Post'),
+               '$is_private' => $private_post,
+               '$return_path' => $query_str,
+               '$public_link' => $public_post_link,
+               '$settings_perms' => t('Default Permissions for New Posts'),
+
                '$group_select' => $group_select,