コード例 #1
0
 function _exportUsercontent($exporter)
 {
     global $ID;
     // get user info
     $userinfo = getDwUserInfo($ID, $this);
     // no userinfo means there is n user space or user does not exists
     if ($userinfo === false) {
         $this->_exit("HTTP/1.0 404 Not Found");
     }
     $exporter->setParameters('Account: ' . $userinfo['name'], getAbsUrl(), getAbsUrl() . 'doku.php?', 'utf-8', $this->agentlink);
     // create user object
     //print_r($userinfo); die();
     $wikiuser = new SIOCDokuWikiUser($ID, normalizeUri($exporter->siocURL('user', $ID)), $userid, $userinfo['name'], $userinfo['mail']);
     /* TODO: avatar (using Gravatar) */
     /* TODO: creator_of */
     // add user to exporter
     $exporter->addObject($wikiuser);
     //print_r(headers_list());die();
     return $exporter;
 }
コード例 #2
0
 function getContent(&$exp)
 {
     $rdf = '<' . $this->_type . " rdf:about=\"" . normalizeUri(clean($this->_url, true)) . "\" >\n";
     if ($this->_title) {
         $rdf .= "\t<sioc:name>" . clean($this->_title) . "</sioc:name>\n";
     }
     if ($this->_has_parent) {
         $rdf .= "\t<sioc:has_parent rdf:resource=\"" . normalizeUri($exp->siocURL('container', $this->_has_parent)) . "\" />\n";
         // TODO: rdfs:label
     }
     foreach ($this->_posts as $article) {
         // TODO: test permission before?
         $rdf .= "\t<sioc:container_of rdf:resource=\"" . normalizeUri($exp->siocURL('post', $article['id'])) . "\"/>\n";
         // TODO: inluding title/name
     }
     foreach ($this->_subcontainers as $container) {
         $rdf .= "\t<sioc:parent_of rdf:resource=\"" . normalizeUri($exp->siocURL('container', $container['id'])) . "\"/>\n";
         // TODO: inluding title/name
     }
     $rdf .= "</" . $this->_type . ">\n";
     return $rdf;
 }