]> git.mxchange.org Git - friendica.git/commitdiff
account/profile/contacts export
authorFriendika <info@friendika.com>
Tue, 22 Mar 2011 10:07:46 +0000 (03:07 -0700)
committerFriendika <info@friendika.com>
Tue, 22 Mar 2011 10:07:46 +0000 (03:07 -0700)
mod/settings.php
mod/uexport.php [new file with mode: 0644]
view/de/settings.tpl
view/en/settings.tpl
view/fr/settings.tpl
view/it/settings.tpl
view/sv/settings.tpl
view/theme/duepuntozero/style.css
view/theme/loozah/style.css

index 6a2733d7c9fc6a40075d8fea29e39e44e1c91d24..b20f4d11b88a5ed2b3d4dd5c20ca9c5af97240b1 100644 (file)
@@ -5,6 +5,7 @@ function settings_init(&$a) {
        if(local_user()) {
                profile_load($a,$a->user['nickname']);
        }
+
 }
 
 
@@ -341,9 +342,13 @@ function settings_content(&$a) {
 
        $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
 
+       $uexport = '<div id="uexport-link"><a href="uexport" >' . t('Export Personal Data') . '</a></div>';
+
+
        $o .= replace_macros($stpl,array(
                '$baseurl' => $a->get_baseurl(),
                '$oidhtml' => $oidhtml,
+               '$uexport' => $uexport,
                '$uid' => local_user(),
                '$username' => $username,
                '$openid' => $openid,
diff --git a/mod/uexport.php b/mod/uexport.php
new file mode 100644 (file)
index 0000000..423c3a8
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+function uexport_init(&$a) {
+
+       if(! local_user())
+               killme();
+
+       $user = array();
+       $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
+               local_user()
+       );
+       if(count($r)) {
+               foreach($r as $rr)
+                       foreach($rr as $k => $v)
+                               $user[$k] = $v;
+
+       }
+       $contact = array();
+       $r = q("SELECT * FROM `contact` WHERE `uid` = %d ",
+               local_user()
+       );
+       if(count($r)) {
+               foreach($r as $rr)
+                       foreach($rr as $k => $v)
+                               $contact[][$k] = $v;
+
+       }
+
+       $profile = array();
+       $r = q("SELECT * FROM `profile` WHERE `uid` = %d ",
+               local_user()
+       );
+       if(count($r)) {
+               foreach($r as $rr)
+                       foreach($rr as $k => $v)
+                               $profile[][$k] = $v;
+       }
+
+
+
+       $output = array('user' => $user, 'contact' => $contact, 'profile' => $profile);
+
+       header("Content-type: text/json");
+       echo str_replace('\\/','/',json_encode($output));
+
+       killme();
+
+}
\ No newline at end of file
index 5f700ff8bd1ff7c3b4c7e142b490079e52b1ed94..170939991e15b3741af2a04322ec21d57b084f39 100644 (file)
@@ -2,6 +2,8 @@
 
 <div id="plugin-settings-link"><a href="settings/addon">Plugin Einstellungen</a></div>
 
+$uexport
+
 $nickname_block
 
 
index 45060e1c47c4dc410695894cbdb623f773150904..134fffaf92b55f56d78e7f59360736dce07bb4a1 100644 (file)
@@ -2,6 +2,8 @@
 
 <div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
 
+$uexport
+
 $nickname_block
 
 
index e0334842a2241043dc72470284eed413a45d2c14..9846219ed7ea80b66d8cc8db652fc76b5a77e4c4 100644 (file)
@@ -2,6 +2,8 @@
 
 <div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
 
+$uexport
+
 $nickname_block
 
 
index d1e25da81cb8ca8474bd9ff7ded92e09bc8aa977..6679e28fe35b61a57f5b8dcd7e1bbb2627e05562 100644 (file)
@@ -2,6 +2,7 @@
 
 <div id="plugin-settings-link"><a href="settings/addon">Impostazioni Plugin</a></div>
 
+$uexport
 
 $nickname_block
 
index d5b8d5b3f1ec97ec0f5bea05364d663b8f6d9a02..2601f485136b04a6b429d8f27533f8832e8e17a8 100644 (file)
@@ -2,6 +2,8 @@
 
 <div id="plugin-settings-link"><a href="settings/addon">Plugin Settings</a></div>
 
+$uexport
+
 $nickname_block
 
 
index eda3cbf275808a7a06c4561b34ac9ca4357208b2..758ab9699d87ad853745722bc5eb05bc89ed2a58 100644 (file)
@@ -372,6 +372,7 @@ input#dfrn-url {
 }
 
 #settings-nick-wrapper {
+       margin-top: 20px;
        margin-bottom: 30px;
 }
 
@@ -2044,8 +2045,8 @@ a.mail-list-link {
 }
 
 
-#plugin-settings-link, #account-settings-link {
-       margin-bottom: 25px;
+#plugin-settings-link, #account-settings-link, #uexport-link {
+       margin-bottom: 10px;
 }
 
 /* end from defautlt */
index 4a092c6d291eabac5b28e56e933f09dda30c6e6b..4d2ca6d636871ef59da49dbcdb55808f21728aa3 100644 (file)
@@ -505,7 +505,7 @@ input#dfrn-url {
 }
 
 #settings-nick-wrapper {
-       margin-bottom: 30px;
+       margin-bottom: 15px;
 }
 
 #settings-expire-end {
@@ -608,7 +608,7 @@ input#dfrn-url {
 }
 
 #settings-nick {
-       margin-bottom: 50px;
+       margin-bottom: 30px;
 }
 
 #cropimage-wrapper, #cropimage-preview-wrapper {
@@ -2079,8 +2079,8 @@ a.mail-list-link {
 }
 
 
-#plugin-settings-link, #account-settings-link {
-       margin-bottom: 25px;
+#plugin-settings-link, #account-settings-link, #uexport-link {
+       margin-bottom: 10px;
 }