[pLog-svn] r5259 - in plog/branches/lifetype-1.2: class/net templates/admin/chooser
mark at devel.lifetype.net
mark at devel.lifetype.net
Tue Apr 3 03:36:31 EDT 2007
Author: mark
Date: 2007-04-03 03:36:30 -0400 (Tue, 03 Apr 2007)
New Revision: 5259
Modified:
plog/branches/lifetype-1.2/class/net/baserequestgenerator.class.php
plog/branches/lifetype-1.2/templates/admin/chooser/resourcelist.template
Log:
Add three private methods to baserequestgenerator.class.php to get a native file name url without rawurlencode(). It can avoid IE double encoding problem when insert CJK file name into TinyMCE.
Modified: plog/branches/lifetype-1.2/class/net/baserequestgenerator.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/net/baserequestgenerator.class.php 2007-04-02 18:36:26 UTC (rev 5258)
+++ plog/branches/lifetype-1.2/class/net/baserequestgenerator.class.php 2007-04-03 07:36:30 UTC (rev 5259)
@@ -540,7 +540,43 @@
$resourceLink = $this->getResourcesBaseUrl().$blogId."/".rawurlencode($resource->getOriginalSizeFileName());
return $resourceLink;
}
+
+ /**
+ * Returns the link to a resource preview with raw file name, for TinyMCE use only
+ *
+ * @param album Generates the correct link to fetch a resource preview
+ */
+ function rawResourcePreviewLink( $resource )
+ {
+ $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+ $resourceLink = $this->getResourcesBaseUrl().$blogId."/previews/".$resource->getPreviewFileName();
+ return $resourceLink;
+ }
+ /**
+ * Returns the link to a resource preview with raw file name, for TinyMCE use only
+ *
+ * @param album Generates the correct link to fetch a resource preview
+ */
+ function rawResourceMediumSizePreviewLink( $resource )
+ {
+ $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+ $resourceLink = $this->getResourcesBaseUrl().$blogId."/previews-med/".$resource->getMediumSizePreviewFileName();
+ return $resourceLink;
+ }
+
+ /**
+ * Returns the link to a resource with raw file name, for TinyMCE use only
+ *
+ * @param resource Generates the correct link to fetch a resource
+ */
+ function rawResourceDownloadLink( $resource )
+ {
+ $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+ $resourceLink = $this->getResourcesBaseUrl().$blogId."/".$resource->getOriginalSizeFileName();
+ return $resourceLink;
+ }
+
/**
* whether we should generate valid xhtml requests or not
* (used for example when sending out messages, as some email clients will
Modified: plog/branches/lifetype-1.2/templates/admin/chooser/resourcelist.template
===================================================================
--- plog/branches/lifetype-1.2/templates/admin/chooser/resourcelist.template 2007-04-02 18:36:26 UTC (rev 5258)
+++ plog/branches/lifetype-1.2/templates/admin/chooser/resourcelist.template 2007-04-03 07:36:30 UTC (rev 5259)
@@ -121,9 +121,9 @@
<td>
{assign var=resourceId value=$resource->getId()}
{assign var=resourceLink value=$url->resourceLink($resource)}
- {assign var=resourceDownloadLink value=$url->resourceDownloadLink($resource)}
- {assign var=resourceMediumSizePreviewLink value=$url->resourceMediumSizePreviewLink($resource)}
- {assign var=resourcePreviewLink value=$url->resourcePreviewLink($resource)}
+ {assign var=resourceDownloadLink value=$url->rawResourceDownloadLink($resource)}
+ {assign var=resourceMediumSizePreviewLink value=$url->rawResourceMediumSizePreviewLink($resource)}
+ {assign var=resourcePreviewLink value=$url->rawResourcePreviewLink($resource)}
{assign var=resourceName value=$resource->getFileName()}
{assign var=resourceDesc value=$resource->getDescription()}
{assign var=resourceType value=$resource->getResourceType()}
More information about the pLog-svn
mailing list