Source for file attachment_browser.php
Documentation is available at attachment_browser.php
* @author spider <spider@steelsun.com>
require_once("../kernel/setup_inc.php");
global $gBitSmarty, $gContent, $gBitUser, $gBitSystem, $gLibertySystem;
// we just want information about a single attachment
if (isset ($_REQUEST['attachment_id']) && is_numeric($_REQUEST['attachment_id'])){
// this is a hack to make it compatible with existing tpls for now
$attachment = $gContent->getAttachment($_REQUEST['attachment_id']);
$ret[$attachment['attachment_id']] = $attachment;
$gContent->mStorage = $userAttachments;
$gBitSmarty->assign('gContent', $gContent);
// we want a list of user attachments
'page' => @BitBase::verifyId( $_REQUEST['pgnPage'] ) ? $_REQUEST['pgnPage'] : NULL,
'load_attached_to' => true,
$userAttachments = $gBitUser->getUserAttachments( $listHash );
// Fake the storage assignment for edit_storage_list.tpl
$gContent->mStorage = $userAttachments;
$gBitSmarty->assign('gContent', $gContent);
$offset = @BitBase::verifyId( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : 0;
$gBitSmarty->assign( 'curPage', $pgnPage = @BitBase::verifyId( $_REQUEST['pgnPage'] ) ? $_REQUEST['pgnPage'] : 1 );
$offset = ( $pgnPage - 1 ) * $gBitSystem->getConfig( 'max_records' );
$numPages = ceil( $listHash['cant'] / $gBitSystem->getConfig( 'max_records' ) );
$gBitSmarty->assign( 'cant', $listHash['cant'] );
$gBitSmarty->assign( 'numPages', $numPages );
|