From 79b825be4ce37a1b5b2fe968da1f625df0729545 Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Tue, 2 Feb 2010 22:02:22 +0000 Subject: use ->getTitle() method instead of ->mInfo.title in templates to allow for cleaner polymorphism --- image_lookup_inc.php | 4 ++-- templates/edit_gallery.tpl | 6 +++--- templates/edit_image.tpl | 8 ++++---- templates/edit_image_inc.tpl | 6 +++--- templates/image_order.tpl | 4 ++-- templates/view_gallery_files_inc.tpl | 4 ++-- templates/view_gallery_images_inc.tpl | 16 ++++++++-------- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/image_lookup_inc.php b/image_lookup_inc.php index dcc2b47..59eb5a2 100644 --- a/image_lookup_inc.php +++ b/image_lookup_inc.php @@ -1,6 +1,6 @@ load(); + // nothing to do. ::lookup will do a full load } else { $gContent = new FisheyeImage(); $imageId = NULL; diff --git a/templates/edit_gallery.tpl b/templates/edit_gallery.tpl index 4642352..2968d09 100644 --- a/templates/edit_gallery.tpl +++ b/templates/edit_gallery.tpl @@ -17,8 +17,8 @@ function updateGalleryPagination() {

- {if $gContent->mInfo.title} - {tr}Edit Gallery{/tr}: {$gContent->mInfo.title|escape} + {if $gContent->getTitle()} + {tr}Edit Gallery{/tr}: {$gContent->getTitle()|escape} {else} {tr}Create Image Gallery{/tr} {/if} @@ -37,7 +37,7 @@ function updateGalleryPagination() {
{formlabel label="Title" for="gallery-title" mandatory="y"} {forminput} - + {/forminput}
diff --git a/templates/edit_image.tpl b/templates/edit_image.tpl index 416f6f0..18782f8 100644 --- a/templates/edit_image.tpl +++ b/templates/edit_image.tpl @@ -2,7 +2,7 @@
-

{if $gContent->mInfo.image_id}{tr}Edit Image{/tr}: {$gContent->mInfo.title|escape} {else}{tr}Add New Image{/tr} {/if}

+

{if $gContent->mInfo.image_id}{tr}Edit Image{/tr}: {$gContent->getTitle()|escape} {else}{tr}Add New Image{/tr} {/if}

@@ -21,7 +21,7 @@ {formlabel label="Current Image"} {forminput} {if $gContent->mInfo.storage_path} - {$gContent->mInfo.title|escape} + {$gContent->getTitle()|escape}
{if $gContent->mInfo.width && $gContent->mInfo.height} @@ -31,7 +31,7 @@ {/if} {else} - {$gContent->mInfo.title|escape} + {$gContent->getTitle()|escape} {/if} {/forminput}
@@ -39,7 +39,7 @@
{formlabel label="Title" for="image-title"} {forminput} - + {/forminput}
diff --git a/templates/edit_image_inc.tpl b/templates/edit_image_inc.tpl index 7508032..5b44c75 100644 --- a/templates/edit_image_inc.tpl +++ b/templates/edit_image_inc.tpl @@ -7,7 +7,7 @@
{formlabel label="Title" for="image-title"} {forminput} - + {/forminput}
@@ -22,7 +22,7 @@ {formlabel label="Current Image"} {forminput} {if $gContent->mInfo.storage_path} - {$gContent->mInfo.title|escape} + {$gContent->getTitle()|escape}
{if $gContent->mInfo.width && $gContent->mInfo.height} @@ -32,7 +32,7 @@ {/if} {else} - {$gContent->mInfo.title|escape} + {$gContent->getTitle()|escape} {/if} {/forminput}
diff --git a/templates/image_order.tpl b/templates/image_order.tpl index db27568..1ef9af3 100644 --- a/templates/image_order.tpl +++ b/templates/image_order.tpl @@ -1,7 +1,7 @@ {strip}
-

{tr}Gallery Images{/tr}: {$gContent->mInfo.title|escape}

+

{tr}Gallery Images{/tr}: {$gContent->getTitle()|escape}

@@ -36,7 +36,7 @@ {counter name=imageCount print=false} - {$galItem->mInfo.title|escape} + {$galItem->getTitle()|escape} diff --git a/templates/view_gallery_files_inc.tpl b/templates/view_gallery_files_inc.tpl index a217339..b35f56b 100644 --- a/templates/view_gallery_files_inc.tpl +++ b/templates/view_gallery_files_inc.tpl @@ -27,13 +27,13 @@ {assign var=item_id value=$gContent->mItems[ix]->mImageId} - {$gContent->mItems[ix]->mInfo.title|escape|default:'image'} + {$gContent->mItems[ix]->getTitle()|escape|default:'image'} {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_titles' )} -

{$gContent->mItems[ix]->mInfo.title|escape}

+

{$gContent->mItems[ix]->getTitle()|escape}

{/if} {$gContent->mItems[ix]->mStorage.$item_id.filename} diff --git a/templates/view_gallery_images_inc.tpl b/templates/view_gallery_images_inc.tpl index ed2f7ba..67f8281 100644 --- a/templates/view_gallery_images_inc.tpl +++ b/templates/view_gallery_images_inc.tpl @@ -10,7 +10,7 @@ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$galItem->mInfo type=mini} {include file=$gLibertySystem->getMimeTemplate('inline',$galItem->mInfo.attachment_plugin_guid) attachment=$galItem->getPreviewHash()} {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_titles' )} -

{$galItem->mInfo.title|escape}

+

{$galItem->getTitle()|escape}

{/if} {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_descriptions' )}

{$galItem->mInfo.data|escape}

@@ -62,19 +62,19 @@
{/if} {/if} - {$galItem->mInfo.title|escape} + {$galItem->getTitle()|escape} {if $gBitSystem->isFeatureActive( 'site_fancy_zoom' )} {/if} {else} - {$galItem->mInfo.title|escape|default:'image'} + {$galItem->getTitle()|escape|default:'image'} {/if} {/if} -

{$galItem->mInfo.title|escape}

+

{$galItem->getTitle()|escape}

{if $gBitSystem->isFeatureActive( 'fisheye_item_list_desc' ) && $galItem->mInfo.data} {$galItem->mInfo.parsed_data} {/if} @@ -85,7 +85,7 @@ {if $gBitSystem->isFeatureActive( 'fisheye_item_list_name' )} {if $br}
{/if} {if $gBitUser->hasPermission( 'p_treasury_view_item' )} - + {/if} {$galItem->mInfo.filename} ({$galItem->mInfo.mime_type}) {if $gBitUser->hasPermission( 'p_treasury_view_item' )} @@ -124,7 +124,7 @@ {biticon ipackage="icons" iname="emblem-downloads" iexplain="Download File"} {/if} {if $gBitUser->hasPermission( 'p_treasury_view_item' )} - {biticon ipackage="icons" iname="document-open" iexplain="View File"} + {biticon ipackage="icons" iname="document-open" iexplain="View File"} {/if} {if $gContent->isOwner( $galItem->mInfo ) || $gBitUser->isAdmin()} {biticon ipackage="icons" iname="accessories-text-editor" iexplain="Edit File"} @@ -150,10 +150,10 @@ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$galItem->mInfo type=mini} {box class="box `$galItem->mInfo.content_type_guid`"} {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_titles' )} -

{$galItem->mInfo.title|escape}

+

{$galItem->getTitle()|escape}

{/if} - {$galItem->mInfo.title|escape|default:'image'} + {$galItem->getTitle()|escape|default:'image'} {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_descriptions' )}

{$galItem->mInfo.data|escape}

-- cgit v1.3