<?php
/* SVN FILE: $Id: attaches.php 418 2008-05-18 07:53:16Z bb_yujiro $ */
/**
 * 添付ファイルの表示
 *
 * PHP versions 5
 *
 *  Hitsuji : Social Network Service <http://rakuto.net/rktSNS/>
 *  Copyright (c) 2007 Yujiro Takahashi
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @package         Hitsuji
 * @copyright       Copyright (c) 2007 Yujiro Takahashi
 * @link            http://rakuto.net/rktSNS/
 * @author          Yujiro Takahashi <yujiro@rakuto.net>
 * @version         $Revision: 418 $
 * @modifiedby      $LastChangedBy: bb_yujiro $
 * @lastmodified    $Date: 2008-05-18 16:53:16 +0900 (日, 18 5 2008) $
 * @license         http://opensource.org/licenses/mit-license.php The MIT License
 */

/**
 * 添付ファイルの表示
 *
 * @access public
 * @param integer   $ref_account
 * @return void
 **/
function hitsuji_attaches($id, $size='large')
{
    $javascript = array(
        'large'=> 'attaches.js',
        'small'=> 'smallAttaches.js',
    );

    $url = HTTP_ACTION.'private/attach/list/json/';

    /* プロフィール読み込み */
    $condition = array(
        'ref_account'=> $id
    );
    $max = RKT_DB::getRow('act_attach', $condition, 'count(*) as ct');
?>
								<iframe id="attachframe" name="attachframe" style="margin-top:8px;" width="500" height="26" frameborder="0" src="<?php e(HTTP_ACTION); ?>private/attach/upload/module/"></iframe>
								<div id="frm_attach" style="display:none;">
									<div><ul class="horizontal">
										<li style="width:240px; text-align:left"><a href="javascript:myAttach.prevAttach();"><img src="<?php e(BASE_URL); ?>resource/img/icons/resultset_previous.gif" width="16" height="16" alt="<<" align="top" /></a></li>
										<li style="width:240px; text-align:right"><a href="javascript:myAttach.nextAttach();"><img src="<?php e(BASE_URL); ?>resource/img/icons/resultset_next.gif" width="16" height="16" alt=">>" align="top" /></a></li>
									</ul></div>
									<div><ul class="horizontal" >
										<li><ul id="attachList" class="horizontal"></ul></li>
									</ul></div>
								</div>
								<script type="text/javascript" src="<?php e(BASE_URL); ?>resource/js/<?php e($javascript[$size]); ?>"></script>
<script type="text/javascript">
var myAttach = null;
var attachAction = '<?php e($url.US); ?>';
YAHOO.util.Event.onContentReady("attachList", function () {
	var node = YAHOO.util.Dom.get('attachList');
	if (node != null){
		myAttach = new Attach(<?php e($max['ct']); ?>, <?php e(LIMIT_JSON_ATTACH); ?>, '<?php e(BASE_URL); ?>', '<?php e(HTTP_ACTION); ?>', <?php e(PHOTO_SMALL_SIZE);?>);
		setAttach();
	}
});</script>
<?php
} // hitsuji_attaches
?>