Update of /cvsroot/plog/plog/templates/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv4657/templates/admin
Modified Files:
resourcelist.template
Log Message:
the "add resource" link from the "new post" page should now generate the correct absolute link to the resource/album, depending on wheter we're using plain or search engine friendly urls or not.
Index: resourcelist.template
===================================================================
RCS file: /cvsroot/plog/plog/templates/admin/resourcelist.template,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** resourcelist.template 28 Dec 2003 22:28:48 -0000 1.3
--- resourcelist.template 29 Dec 2003 00:11:51 -0000 1.4
***************
*** 5,9 ****
<script type="text/javascript">
{literal}
! function addResourceLink( dest, blogId, type, resourceName, resourceDesc, preview ) {
var htmlCode = '';
if( type == 1 ) {
--- 5,9 ----
<script type="text/javascript">
{literal}
! function addResourceLink( dest, reqFormat, blogId, type, resourceName, resourceDesc, preview ) {
var htmlCode = '';
if( type == 1 ) {
***************
*** 12,26 ****
// inlined with the text
if( preview ) {
! htmlCode = '<a href="resserver.php?blogId='+blogId+'&resource='+resourceName+'">';
! htmlCode += '<img border="0" alt="'+resourceDesc+'" src="resserver.php?blogId='+blogId+'&resource='+resourceName+'&mode=preview" />';
! htmlCode += '</a>';
}
else {
! htmlCode = '<img alt="'+resourceDesc+'" src="resserver.php?blogId='+blogId+'&resource='+resourceName+'" />';
}
}
else {
// if not an image, there is not much we can do
! htmlCode = '<a title="'+resourceDesc+'" href="resserver.php?blogId='+blogId+'&resource='+resourceName+'">test</a>';
}
--- 12,39 ----
// inlined with the text
if( preview ) {
! if( reqFormat == 1 ) { // plain urls
! htmlCode = '<a href="{/literal}{$baseurl}{literal}/resserver.php?blogId='+blogId+'&resource='+resourceName+'">';
! htmlCode += '<img border="0" alt="'+resourceDesc+'" src="{/literal}{$baseurl}{literal}/resserver.php?blogId='+blogId+'&resource='+resourceName+'&mode=preview" />';
! htmlCode += '</a>';
! }
! else { // search engine friendly urls
! htmlCode = '<a href="{/literal}{$baseurl}{literal}/resource/'+blogId+'/'+resourceName+'">';
! htmlCode += '<img border="0" alt="'+resourceDesc+'" src="{/literal}{$baseurl}{literal}/resserver.php?blogId='+blogId+'&resource='+resourceName+'&mode=preview" />';
! htmlCode += '</a>';
! }
}
else {
! if( reqFormat == 1 )
! htmlCode = '<img alt="'+resourceDesc+'" src="{/literal}{$baseurl}{literal}/resserver.php?blogId='+blogId+'&resource='+resourceName+'" />';
! else
! htmlCode = '<img alt="'+resourceDesc+'" src="{/literal}{$baseurl}{literal}/resource/'+blogId+'/'+resourceName+'" />';
}
}
else {
// if not an image, there is not much we can do
! if( reqFormat == 1 )
! htmlCode = '<a title="'+resourceDesc+'" href="{/literal}{$baseurl}{literal}/resserver.php?blogId='+blogId+'&resource='+resourceName+'">test</a>';
! else
! htmlCode = '<a title="'+resourceDesc+'" href="{/literal}{$baseurl}{literal}/resource/'+blogId+'/'+resourceName+'">test</a>';
}
***************
*** 35,43 ****
}
! function addAlbumLink( dest, blogId, albumId, albumName, albumDesc ) {
var htmlCode = '';
// if not an image, there is not much we can do
! htmlCode = '<a title="'+albumDesc+'" href="index.php?op=ViewAlbum&blogId='+blogId+'&albumId='+albumId+'">'+albumName+'</a>';
// and now send the value to the text area where we are typing the post
--- 48,60 ----
}
! function addAlbumLink( dest, reqFormat, blogId, albumId, albumName, albumDesc ) {
var htmlCode = '';
// if not an image, there is not much we can do
!
! if( reqFormat == 1 )
! htmlCode = '<a title="'+albumDesc+'" href="{/literal}{$baseurl}{literal}/index.php?op=ViewAlbum&blogId='+blogId+'&albumId='+albumId+'">'+albumName+'</a>';
! else
! htmlCode = '<a title="'+albumDesc+'" href="{/literal}{$baseurl}{literal}/album/'+blogId+'/'+albumId+'">'+albumName+'</a>';
// and now send the value to the text area where we are typing the post
***************
*** 68,72 ****
</td>
<td align="right" valign="bottom">
! <a href="javascript:addAlbumLink({$destination},{$blog->getId()},{$resalbum->getId()},'{$resalbum->getName()}','{$resalbum->getDescription()}',false);">{$locale->tr("add_album")}</a><br/>
</td>
</tr>
--- 85,89 ----
</td>
<td align="right" valign="bottom">
! <a href="javascript:addAlbumLink({$destination},{$requestformat},{$blog->getId()},{$resalbum->getId()},'{$resalbum->getName()}','{$resalbum->getDescription()}',false);">{$locale->tr("add_album")}</a><br/>
</td>
</tr>
***************
*** 79,85 ****
</td>
<td align="right" valign="bottom">
! <a href="javascript:addResourceLink({$destination}, {$blog->getId()}, {$resource->getResourceType()}, '{$resource->getFileName()}', '{$resource->getDescription()}', false);">{$locale->tr("add_resource")}</a><br/>
{if $resource->hasPreview()}
! <a href="javascript:addResourceLink({$destination}, {$blog->getId()}, {$resource->getResourceType()}, '{$resource->getFileName()}', '{$resource->getDescription()}', true);">{$locale->tr("add_resource_preview")}</a><br/>
{/if}
</td>
--- 96,102 ----
</td>
<td align="right" valign="bottom">
! <a href="javascript:addResourceLink({$destination}, {$requestformat}, {$blog->getId()}, {$resource->getResourceType()}, '{$resource->getFileName()}', '{$resource->getDescription()}', false);">{$locale->tr("add_resource")}</a><br/>
{if $resource->hasPreview()}
! <a href="javascript:addResourceLink({$destination}, {$requestformat}, {$blog->getId()}, {$resource->getResourceType()}, '{$resource->getFileName()}', '{$resource->getDescription()}', true);">{$locale->tr("add_resource_preview")}</a><br/>
{/if}
</td>
|