aboutsummaryrefslogtreecommitdiff
path: root/src/phorkie/File.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-04-13 19:56:24 +0200
committerChristian Weiske <cweiske@cweiske.de>2012-04-13 19:56:24 +0200
commitd9f6b83ed6d8a4546e4119c64b639adda057d25e (patch)
tree80e8a3077c149929072a70d71d523fd3fce929e2 /src/phorkie/File.php
parent09b7728bd2beca1270922a38d79498e3c4fa0456 (diff)
downloadphorkie-d9f6b83ed6d8a4546e4119c64b639adda057d25e.tar.gz
phorkie-d9f6b83ed6d8a4546e4119c64b639adda057d25e.zip
first tool supported: xmllint
Diffstat (limited to 'src/phorkie/File.php')
-rw-r--r--src/phorkie/File.php16
1 files changed, 14 insertions, 2 deletions
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