From d9f6b83ed6d8a4546e4119c64b639adda057d25e Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 13 Apr 2012 19:56:24 +0200 Subject: first tool supported: xmllint --- src/phorkie/File.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/phorkie/File.php') diff --git a/src/phorkie/File.php b/src/phorkie/File.php index 87c3851..869aa80 100644 --- a/src/phorkie/File.php +++ b/src/phorkie/File.php @@ -75,14 +75,17 @@ class File * * @param string $type Link type. Supported are: * - "raw" - * - "display" + * - "tool" + * @param string $option * * @return string */ - public function getLink($type) + public function getLink($type, $option = null) { if ($type == 'raw') { return '/' . $this->repo->id . '/raw/' . $this->getFilename(); + } else if ($type == 'tool') { + return '/' . $this->repo->id . '/tool/' . $option . '/' . $this->getFilename(); } throw new Exception('Unknown type'); } @@ -95,6 +98,15 @@ class File } return $GLOBALS['phorkie']['languages'][$ext]['mime']; } + + /** + * @return array Array of Tool_Info objects + */ + public function getToolInfos() + { + $tm = new Tool_Manager(); + return $tm->getSuitable($this); + } } ?> \ No newline at end of file -- cgit v1.2.3