From f47d582736ddf24528dd514850d4bed76783f589 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 28 Jul 2011 21:56:56 -0700 Subject: api/statusnet/config.xml --- include/api.php | 27 ++++++++++++++++++++ view/api_config_xml.tpl | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ view/apiconfig.tpl | 67 ------------------------------------------------- 3 files changed, 93 insertions(+), 67 deletions(-) create mode 100644 view/api_config_xml.tpl delete mode 100644 view/apiconfig.tpl diff --git a/include/api.php b/include/api.php index 4e5ea43bd..d7c0124d7 100644 --- a/include/api.php +++ b/include/api.php @@ -550,3 +550,30 @@ } api_register_func('api/account/rate_limit_status','api_account_rate_limit_status',true); + + + function api_statusnet_config(&$a,$type) { + $name = $a->config['sitename']; + $server = $a->get_hostname(); + $logo = $a->get_baseurl() . '/images/friendika-64.png'; + $email = $a->config['admin_email']; + $closed = (($a->config['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false'); + $private = (($a->config['system']['block_public']) ? 'true' : 'false'); + $textlimit = (($a->config['max_import_size']) ? $a->config['max_import_size'] : '200000'); + $ssl = (($a->config['system']['have_ssl']) ? 'true' : 'false'); + $sslserver = (($ssl === 'true') ? str_replace('http:','https:',$a->get_baseurl()) : ''); + + $config = array( + 'site' => array('name' => $name,'server' => $server, 'theme' => 'default', 'path' => '', + 'logo' => $logo, 'fancy' => 'true', 'language' => 'en', 'email' => $email, 'broughtby' => '', + 'broughtbyurl' => '', 'timezone' => 'UTC', 'closed' => $closed, 'inviteonly' => 'false', + 'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl, + 'shorturllength' => '30' + ), + ); + + return api_apply_template('config', $type, array('$config' => $config)); + + } + api_register_func('api/statusnet/config','api_statusnet_config',true); + diff --git a/view/api_config_xml.tpl b/view/api_config_xml.tpl new file mode 100644 index 000000000..3281e59dd --- /dev/null +++ b/view/api_config_xml.tpl @@ -0,0 +1,66 @@ + + + $config.site.name + $config.site.server + default + + $config.site.logo + + true + en + $config.site.email + + + UTC + $config.site.closed + + false + $config.site.private + $config.site.textlimit + $config.site.ssl + $config.site.sslserver + 30 + + + + cc + + http://creativecommons.org/licenses/by/3.0/ + Creative Commons Attribution 3.0 + http://i.creativecommons.org/l/by/3.0/80x15.png + + + + + + + + + + + + + + + + + false + 20 + 600 + + + + false + INVALID SERVER + 5222 + update + + + StatusNet + + + + false + 0 + + diff --git a/view/apiconfig.tpl b/view/apiconfig.tpl deleted file mode 100644 index 71ab241ce..000000000 --- a/view/apiconfig.tpl +++ /dev/null @@ -1,67 +0,0 @@ - - - - $sitedesc - $sitename - default - - $sitelogo - - true - en - $adminemail - - - UTC - $siteclosed - - false - $siteprivate - $textlimit - $has_ssl - $ssl_server - 30 - - - - cc - - http://creativecommons.org/licenses/by/3.0/ - Creative Commons Attribution 3.0 - http://i.creativecommons.org/l/by/3.0/80x15.png - - - - - - - - - - - - - - - - - false - 20 - 600 - - - - false - INVALID SERVER - 5222 - update - - - StatusNet - - - - false - 0 - - -- cgit v1.2.3