[pLog-svn] r5033 - plog/branches/lifetype-1.2/class/net
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Fri Mar 9 11:35:34 EST 2007
Author: oscar
Date: 2007-03-09 11:35:34 -0500 (Fri, 09 Mar 2007)
New Revision: 5033
Modified:
plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php
Log:
Added a missing method.
Modified: plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php 2007-03-09 13:18:26 UTC (rev 5032)
+++ plog/branches/lifetype-1.2/class/net/modrewriterequestgenerator.class.php 2007-03-09 16:35:34 UTC (rev 5033)
@@ -286,6 +286,30 @@
}
/**
+ * Returns the link to a resource
+ *
+ * @param album Generates the correct link to fetch a resource
+ */
+ function resourceLink( $resource )
+ {
+ $blogId = $this->_blogInfo->getId();
+ $ownerId = $resource->getOwnerId();
+
+ if ( $blogId != $ownerId ) {
+ $blogId = $ownerId;
+ $blogs =& new Blogs();
+ $blogInfo = $blogs->getBlogInfo($blogId);
+ $blogShortName = $blogInfo->getBlog();
+ } else {
+ $blogShortName = $this->_blogInfo->getBlog();
+ }
+
+ $resourceLink = $this->getBaseUrl().'/'.$blogId.'_'.StringUtils::text2url( $blogShortName ).'/resources/'.rawurlencode($resource->getFileName()).'.html';
+
+ return $resourceLink;
+ }
+
+ /**
* Given an album, generates a link to its parent. Must be implemented by child classes to generate
* a valid URL.
*
More information about the pLog-svn
mailing list