]> git.mxchange.org Git - friendica.git/commitdiff
api/statusnet/config.xml
authorFriendika <info@friendika.com>
Fri, 29 Jul 2011 04:56:56 +0000 (21:56 -0700)
committerFriendika <info@friendika.com>
Fri, 29 Jul 2011 04:56:56 +0000 (21:56 -0700)
include/api.php
view/api_config_xml.tpl [new file with mode: 0644]
view/apiconfig.tpl [deleted file]

index 4e5ea43bdb567d8e09569997a2d7ac3114ded469..d7c0124d716a47c077ee276671161e34eb587175 100644 (file)
 
        }
        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 (file)
index 0000000..3281e59
--- /dev/null
@@ -0,0 +1,66 @@
+<config>
+ <site>
+  <name>$config.site.name</name>
+  <server>$config.site.server</server>
+  <theme>default</theme>
+  <path></path>
+  <logo>$config.site.logo</logo>
+
+  <fancy>true</fancy>
+  <language>en</language>
+  <email>$config.site.email</email>
+  <broughtby></broughtby>
+  <broughtbyurl></broughtbyurl>
+  <timezone>UTC</timezone>
+  <closed>$config.site.closed</closed>
+
+  <inviteonly>false</inviteonly>
+  <private>$config.site.private</private>
+  <textlimit>$config.site.textlimit</textlimit>
+  <ssl>$config.site.ssl</ssl>
+  <sslserver>$config.site.sslserver</sslserver>
+  <shorturllength>30</shorturllength>
+
+</site>
+ <license>
+  <type>cc</type>
+  <owner></owner>
+  <url>http://creativecommons.org/licenses/by/3.0/</url>
+  <title>Creative Commons Attribution 3.0</title>
+  <image>http://i.creativecommons.org/l/by/3.0/80x15.png</image>
+
+</license>
+ <nickname>
+  <featured></featured>
+</nickname>
+ <profile>
+  <biolimit></biolimit>
+</profile>
+ <group>
+  <desclimit></desclimit>
+</group>
+ <notice>
+
+  <contentlimit></contentlimit>
+</notice>
+ <throttle>
+  <enabled>false</enabled>
+  <count>20</count>
+  <timespan>600</timespan>
+</throttle>
+ <xmpp>
+
+  <enabled>false</enabled>
+  <server>INVALID SERVER</server>
+  <port>5222</port>
+  <user>update</user>
+</xmpp>
+ <integration>
+  <source>StatusNet</source>
+
+</integration>
+ <attachments>
+  <uploads>false</uploads>
+  <file_quota>0</file_quota>
+</attachments>
+</config>
diff --git a/view/apiconfig.tpl b/view/apiconfig.tpl
deleted file mode 100644 (file)
index 71ab241..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<config>
- <site>
-  <name>$sitedesc</name>
-  <server>$sitename</server>
-  <theme>default</theme>
-  <path></path>
-  <logo>$sitelogo</logo>
-
-  <fancy>true</fancy>
-  <language>en</language>
-  <email>$adminemail</email>
-  <broughtby></broughtby>
-  <broughtbyurl></broughtbyurl>
-  <timezone>UTC</timezone>
-  <closed>$siteclosed</closed>
-
-  <inviteonly>false</inviteonly>
-  <private>$siteprivate</private>
-  <textlimit>$textlimit</textlimit>
-  <ssl>$has_ssl</ssl>
-  <sslserver>$ssl_server</sslserver>
-  <shorturllength>30</shorturllength>
-
-</site>
- <license>
-  <type>cc</type>
-  <owner></owner>
-  <url>http://creativecommons.org/licenses/by/3.0/</url>
-  <title>Creative Commons Attribution 3.0</title>
-  <image>http://i.creativecommons.org/l/by/3.0/80x15.png</image>
-
-</license>
- <nickname>
-  <featured></featured>
-</nickname>
- <profile>
-  <biolimit></biolimit>
-</profile>
- <group>
-  <desclimit></desclimit>
-</group>
- <notice>
-
-  <contentlimit></contentlimit>
-</notice>
- <throttle>
-  <enabled>false</enabled>
-  <count>20</count>
-  <timespan>600</timespan>
-</throttle>
- <xmpp>
-
-  <enabled>false</enabled>
-  <server>INVALID SERVER</server>
-  <port>5222</port>
-  <user>update</user>
-</xmpp>
- <integration>
-  <source>StatusNet</source>
-
-</integration>
- <attachments>
-  <uploads>false</uploads>
-  <file_quota>0</file_quota>
-</attachments>
-</config>