|
|
XML |
1 2 3 4 5 6 7 8 9 |
<?xml version="1.0" encoding="UTF-8"?> <data xmlns="http://www.web-produktion.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.web-produktion.com/XSD/report.xsd"> <import> <type> <name>demo</name> <!-- objectType name --> <classfile>lib/data/demo/DemoReportObjectType.class.php</classfile> <!-- objectType file and file path --> </type> </import> </data> |
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/report/object/ReportObjectType.class.php');
require_once(WCF_DIR.'lib/data/demo/DemoReportObject.class.php');
/**
* @author Jean-Marc Licht
* @copyright (c) 2011 by Jean-Marc Licht
* @package com.web-produktion.report.demo
*/
class DemoReportObjectType implements ReportObjectType {
/**
* @see ReportObjectType::getObjectByID()
*/
public function getObjectByID($objectID) {
if (is_array($objectID)) {
$demo = array();
$sql = "SELECT *
FROM wcf".WCF_N."_report_demo
WHERE demoID IN (".implode(',', $objectID).")";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
$demo[$row['demoID']] = new DemoReportObject(null, $row);
}
return (count($demo) > 0 ? $demo : null);
}
else {
// get object
$demo = new DemoReportObject($objectID);
if (!$demo->demoID) return null;
// return object
return $demo;
}
}
}
?>
|
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/report/object/ReportObject.class.php');
require_once(WCF_DIR.'lib/data/demo/ViewableDemo.class.php');
/**
* @author Jean-Marc Licht
* @copyright (c) 2011 by Jean-Marc Licht
* @package com.web-produktion.report.demo
*/
class DemoReportObject extends ViewableDemo implements ReportObject {
/**
* @see ReportObject::getTitle()
*/
public function getTitle() {
return $this->subject;
}
/**
* @see ReportObject::getUserID()
*/
public function getUserID() {
return $this->userID;
}
/**
* @see ReportObject::getUsername()
*/
public function getUsername() {
return $this->username;
}
/**
* @see ReportObject::getURL()
*/
public function getURL() {
return 'index.php?page=Demo';
}
/**
* @see ReportObject::getLanguage()
*/
public function getLanguage() {
return 'wcf.report.demo.add';
}
}
|
|
|
Template-Quelltext |
1 2 3 |
{if MODULE_REPORT && $this->user->getPermission('user.message.canReport')} <li><a href="index.php?form=Report&objectID={@$demo->demoID}&objectType=demo{@SID_ARG_2ND}" title="{lang}wcf.demo.button.report{/lang}"><img src="{icon}reportS.png{/icon}" alt="" /> <span>{lang}wcf.demo.button.report{/lang}</span></a></li> {/if} |
Forensoftware: Burning Board® 3.1.7, entwickelt von WoltLab® GmbH