diff options
| author | Lester Caine <lester@lsces.co.uk> | 2010-06-03 07:03:58 +0000 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2010-06-03 07:03:58 +0000 |
| commit | 06dd17507b2fac05e404627b2b8fdff372d33fe4 (patch) | |
| tree | e52104305285f892aa3085f549ae4ae84d17787e | |
| parent | 2825e3b018bedb6be9c16003545a74285be28a26 (diff) | |
| download | fisheye-CVS_HEAD.tar.gz fisheye-CVS_HEAD.tar.bz2 fisheye-CVS_HEAD.zip | |
Moved to itags package. Need to be made package agnostic so they can work with attachments directly.CVS_HEAD
| -rw-r--r-- | templates/view_image_tagged.tpl | 67 | ||||
| -rw-r--r-- | view_image_tagged.php | 101 |
2 files changed, 0 insertions, 168 deletions
diff --git a/templates/view_image_tagged.tpl b/templates/view_image_tagged.tpl deleted file mode 100644 index 88eef5f..0000000 --- a/templates/view_image_tagged.tpl +++ /dev/null @@ -1,67 +0,0 @@ -{strip} -<div class="display fisheye"> - {if !$liberty_preview} - <div class="floaticon"> - {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='icon' serviceHash=$gContent->mInfo} - {if $gContent->hasUpdatePermission()} - <a title="{tr}Edit{/tr}" href="{$smarty.const.FISHEYE_PKG_URL}edit_image.php?image_id={$gContent->mImageId}">{biticon ipackage="icons" iname="accessories-text-editor" iexplain="Edit Image"}</a> - <a title="{tr}Delete{/tr}" href="{$smarty.const.FISHEYE_PKG_URL}edit_image.php?image_id={$gContent->mImageId}&delete=1">{biticon ipackage="icons" iname="edit-delete" iexplain="Delete Image"}</a> - {/if} - </div> - {/if} - - {formfeedback hash=$feedback} - - <div class="header"> - <h1>{$gContent->getTitle()|default:$gContent->mInfo.filename|escape}</h1> - </div> - - <div class="body"> - <div id="taggingArea"> - <img src="{$gContent->mInfo.source_url}" /> - {if $mode == 'edit' } - <div id="drag" class="ui-widget-content"></div> - {else} - {if $gContent->mInfo.tags } - {foreach from=$gContent->mInfo.tags item=resTags key=itemContentId} - <div class=tag style="position:absolute;width:{$resTags.tag_width}px;height:{$resTags.tag_height}px;top:{$resTags.tag_top}px;left:{$resTags.tag_left}px;"> - {$resTags.description} - </div> - {/foreach} - {/if} - {/if} - </div> - - {if $mode == 'edit' } - <div id="formArea"> - <form method=post> - <input type=hidden name=save value=yes> - <input type=hidden name=pic value="{$gContent->getTitle()|default}"> - <input type=hidden name=width id=width> - <input type=hidden name=height id=height> - <input type=hidden name=top id=top> - <input type=hidden name=left id=left> - Description : <input type=text name=description> - <input type=submit value=save> - </form> - {foreach from=$gContent->mInfo.tags item=resTags key=itemContentId} - Tag # {$resTags.comment_id} - {$resTags.description} <a href="view_image_tagged.php?image_id={$gContent->mImageId}&delete={$resTags.comment_id}">Delete</a><br /> - {/foreach} - <a href="view_image_tagged.php?image_id={$gContent->mImageId}">Go to view mode</a> - </div>] - {else} - <div id="formArea"> - <a href="view_image_tagged.php?image_id={$gContent->mImageId}&mode=edit">Go to edit mode</a> - </div> - {/if} - - </div> - - {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo} - - {if $gGallery && $gGallery->getPreference('allow_comments') eq 'y'} - {include file="bitpackage:liberty/comments.tpl"} - {/if} - -</div> <!-- end .fisheye --> -{/strip} diff --git a/view_image_tagged.php b/view_image_tagged.php deleted file mode 100644 index 09ea246..0000000 --- a/view_image_tagged.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * @version $Header: /cvsroot/bitweaver/_bit_fisheye/Attic/view_image_tagged.php,v 1.5 2010/05/13 23:09:37 lsces Exp $ - * @package fisheye - * @subpackage functions - */ - -/** - * required setup - */ -require_once( '../kernel/setup_inc.php' ); - -require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php'); -require_once( FISHEYE_PKG_PATH.'FisheyeImage.php'); - -global $gBitSystem, $gDebug; - -if( !empty( $_REQUEST['size'] ) ) { - // nuke old values if set - $_COOKIE['fisheyeviewsize'] = NULL; - setcookie( 'fisheyeviewsize', $_REQUEST['size'], 0, $gBitSystem->getConfig( 'cookie_path', BIT_ROOT_URL ), $gBitSystem->getConfig( 'cookie_domain', '.'.$_SERVER['SERVER_NAME'] ) ); -} - -include_once( FISHEYE_PKG_PATH.'image_lookup_inc.php' ); -//vd($gContent); -if( !empty( $_REQUEST['mode'] ) ) { - if ( !empty( $_REQUEST['save'] ) and $_REQUEST['save'] == 'yes' ) { - // save tag record - if( $gContent->verifyId( $_REQUEST['image_id'] ) ) { - $gContent->mDb->StartTrans(); - $storeComment = new LibertyComment( @BitBase::verifyId( $_REQUEST['comment_id'] ) ? $_REQUEST['comment_id'] : NULL ); - if ( $gContent->verifyId( $storeComment->mCommentId ) ) { - $gContent->mDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_attachment_tags` WHERE `content_id`=? and `comment_id`=?", array( $gContent->mContentId, $storeComment->mCommentId ) ); - } - $_REQUEST['content_id'] = $gContent->mContentId; - $_REQUEST['comments_parent_id'] = $gContent->mContentId; - $_REQUEST['comment_title'] = $_REQUEST['description']; - $_REQUEST['comment_data'] = $_REQUEST['description']; - if( $storeComment->storeComment( $_REQUEST )) { - // store successful - $storeComment->loadComment(); - $gContent->mDb->query( "INSERT INTO `".BIT_DB_PREFIX."liberty_attachment_tags` ( `attachment_id`, `comment_id`, `tag_top`, `tag_left`, `tag_width`, `tag_height` ) - VALUES ( ?, ?, ?, ?, ?, ? )", - array( $gContent->mContentId, $storeComment->mCommentId, $_REQUEST['top'], $_REQUEST['left'], $_REQUEST['width'], $_REQUEST['height'] ) ); - } - - $gContent->mDb->CompleteTrans(); - } - } - $gBitSmarty->assign( 'mode', $_REQUEST['mode'] ); -} - -if( !empty( $_REQUEST['delete'] ) ) { - // delete tag record -} - -$tagSql = "SELECT lat.`comment_id` as tag_no, lc.`title` as description, lat.* - FROM `".BIT_DB_PREFIX."liberty_attachment_tags` lat - JOIN `".BIT_DB_PREFIX."liberty_comments` lcm ON lcm.`comment_id` = lat.`comment_id` - JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.`content_id` = lcm.`content_id` - WHERE lat.`attachment_id` = ?"; -$gContent->mInfo['tags'] = $gContent->mDb->getAssoc( $tagSql, array( $gContent->mContentId ) ); -//vd($gContent->mContentId); -global $gHideModules; -$gHideModules = $gBitSystem->isFeatureActive( 'fisheye_image_hide_modules' ); - -if( is_object( $gGallery ) && $gGallery->isCommentable() ) { - $commentsParentId = $gContent->mContentId; - $comments_vars = Array('fisheyeimage'); - $comments_prefix_var='fisheyeimage:'; - $comments_object_var='fisheyeimage'; - $comments_return_url = $_SERVER['PHP_SELF']."?image_id=".$gContent->mImageId; - include_once( LIBERTY_PKG_PATH.'comments_inc.php' ); -} - -$gContent->addHit(); - -$gBitThemes->loadCss( UTIL_PKG_PATH.'javascript/libs/jquery/themes/base/ui.all.css', TRUE ); -$gBitThemes->loadCss( THEMES_PKG_PATH.'css/imagetag.css', TRUE ); -$gBitThemes->loadAjax( 'jquery' ); -$gBitThemes->loadJavascript( UTIL_PKG_PATH.'javascript/libs/jquery/full/ui/jquery.ui.all.js', FALSE, 500, FALSE ); -$gBitThemes->loadJavascript( LIBERTY_PKG_PATH.'scripts/imagetag.js', FALSE, 500, FALSE ); - -// this will let LibertyMime know that we want to display the original image -$gContent->mInfo['image_file']['original'] = TRUE; - -if( !$gContent->isValid() ) { - $gBitSystem->setHttpStatus( 404 ); - $gBitSystem->fatalError( tra( "No image exists with the given ID" ) ,'error.tpl', '' ); -} - -$displayHash = array( 'perm_name' => 'p_fisheye_view' ); -$gContent->invokeServices( 'content_display_function', $displayHash ); - -// Get the proper thumbnail size to display on this page -if( empty( $_REQUEST['size'] )) { - $_REQUEST['size'] = 'original'; -} - -$gBitSystem->setBrowserTitle( $gContent->getTitle() ); -$gBitSystem->display( 'bitpackage:fisheye/view_image_tagged.tpl' , NULL, array( 'display_mode' => 'display' ));?>
\ No newline at end of file |
