aboutsummaryrefslogtreecommitdiffstats
path: root/include/feedutils.php
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-11-04 10:18:34 +0100
committerGitHub <noreply@github.com>2017-11-04 10:18:34 +0100
commit39c194c5c32e49f461b8b42a3f4e411a3a5cde3c (patch)
tree8ca92c3e6e31166920b02913e89d580025bf6edf /include/feedutils.php
parent9dfb471c0bbf2978e528689f6c0885ff9abddc7d (diff)
parent1be98d7b7fea30a929d27e7aa0b1412da3276b2c (diff)
downloadvolse-hubzilla-39c194c5c32e49f461b8b42a3f4e411a3a5cde3c.tar.gz
volse-hubzilla-39c194c5c32e49f461b8b42a3f4e411a3a5cde3c.tar.bz2
volse-hubzilla-39c194c5c32e49f461b8b42a3f4e411a3a5cde3c.zip
Merge pull request #891 from dawnbreak/langlibs
Langlibs updates
Diffstat (limited to 'include/feedutils.php')
-rw-r--r--include/feedutils.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 217da8188..62fa4849a 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -1662,8 +1662,6 @@ function handle_feed($uid, $abook_id, $url) {
/**
* @brief Return a XML tag with author information.
*
- * @hooks \b atom_author Possibility to add further tags to returned XML string
- * * \e string The created XML tag as a string without closing tag
* @param string $tag The XML tag to create
* @param string $nick preferred username
* @param string $name displayed name of the author
@@ -1672,7 +1670,7 @@ function handle_feed($uid, $abook_id, $url) {
* @param int $w image width
* @param string $type profile photo mime type
* @param string $photo Fully qualified URL to a profile/avator photo
- * @return string
+ * @return string XML tag
*/
function atom_author($tag, $nick, $name, $uri, $h, $w, $type, $photo) {
$o = '';
@@ -1695,6 +1693,11 @@ function atom_author($tag, $nick, $name, $uri, $h, $w, $type, $photo) {
$o .= ' <poco:preferredUsername>' . $nick . '</poco:preferredUsername>' . "\r\n";
$o .= ' <poco:displayName>' . $name . '</poco:displayName>' . "\r\n";
+ /**
+ * @hooks atom_author
+ * Possibility to add further tags to returned XML string.
+ * * \e string The created XML tag as a string without closing tag
+ */
call_hooks('atom_author', $o);
$o .= "</$tag>\r\n";
@@ -1703,17 +1706,23 @@ function atom_author($tag, $nick, $name, $uri, $h, $w, $type, $photo) {
}
-function atom_render_author($tag,$xchan) {
+/**
+ * @brief Return an atom tag with author information from an xchan.
+ *
+ * @param string $tag
+ * @param array $xchan
+ * @return string
+ */
+function atom_render_author($tag, $xchan) {
-
- $nick = xmlify(substr($xchan['xchan_addr'],0,strpos($xchan['xchan_addr'],'@')));
+ $nick = xmlify(substr($xchan['xchan_addr'], 0, strpos($xchan['xchan_addr'], '@')));
$id = xmlify($xchan['xchan_url']);
$name = xmlify($xchan['xchan_name']);
$photo = xmlify($xchan['xchan_photo_l']);
$type = xmlify($xchan['xchan_photo_mimetype']);
$w = $h = 300;
- $o .= "<$tag>\r\n";
+ $o = "<$tag>\r\n";
$o .= " <as:object-type>http://activitystrea.ms/schema/1.0/person</as:object-type>\r\n";
$o .= " <id>$id</id>\r\n";
$o .= " <name>$nick</name>\r\n";
@@ -1724,13 +1733,16 @@ function atom_render_author($tag,$xchan) {
$o .= ' <poco:preferredUsername>' . $nick . '</poco:preferredUsername>' . "\r\n";
$o .= ' <poco:displayName>' . $name . '</poco:displayName>' . "\r\n";
+ /**
+ * @hooks atom_render_author
+ * Possibility to add further tags to returned XML string.
+ * * \e string The created XML tag as a string without closing tag
+ */
call_hooks('atom_render_author', $o);
$o .= "</$tag>\r\n";
return $o;
-
-
}
function compat_photos_list($s) {