<?php
-function uexport_init(&$a){
- if(! local_user())
+function uexport_init(App $a) {
+ if (! local_user()) {
killme();
+ }
require_once("mod/settings.php");
- settings_init($a);
+ settings_init($a);
}
-function uexport_content(&$a){
+/// @TODO Change space -> tab where wanted
+function uexport_content(App $a) {
if ($a->argc > 1) {
header("Content-type: application/json");
$tpl = get_markup_template("uexport.tpl");
return replace_macros($tpl, array(
- '$baseurl' => $a->get_baseurl(),
+ '$baseurl' => App::get_baseurl(),
'$title' => t('Export personal data'),
'$options' => $options
));
function _uexport_multirow($query) {
$result = array();
$r = q($query);
-// if(count($r)) {
+// if (dbm::is_result($r)) {
if ($r){
foreach($r as $rr){
$p = array();
$output = array(
'version' => FRIENDICA_VERSION,
'schema' => DB_UPDATE_VERSION,
- 'baseurl' => $a->get_baseurl(),
+ 'baseurl' => App::get_baseurl(),
'user' => $user,
'contact' => $contact,
'profile' => $profile,
/**
* echoes account data and items as separated json, one per line
*/
-function uexport_all(&$a) {
+function uexport_all(App $a) {
uexport_account($a);
echo "\n";
$r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ",
intval(local_user())
);
- if(count($r))
+ if (dbm::is_result($r))
$total = $r[0]['total'];
// chunk the output to avoid exhausting memory
intval($x),
intval(500)
);
- /*if(count($r)) {
+ /*if (dbm::is_result($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$item[][$k] = $v;