/** * fisheye_get_default_gallery_id */ function fisheye_get_default_gallery_id($pUserId, $pNewName) { global $gBitUser; $gal = new FisheyeGallery(); $getHash = array('user_id' => $pUserId, 'max_records' => 1, 'sort_mode' => 'created_desc', 'show_empty' => TRUE); $upList = $gal->getList($getHash); if (!empty($upList)) { $ret = key($upList); } else { // if( $gBitUser->hasPermission( 'p_fisheye_create' ) ) { $galleryHash = array('title' => $pNewName); if ($gal->store($galleryHash)) { $ret = $gal->mGalleryId; } /* } else { $getHash = array( 'max_records' => 1, 'sort_mode' => 'created_desc' ); $upList = $gal->getList( $getHash ); if( !empty( $upList ) ) { $ret = key( $upList ); } */ } global $gContent; if ($ret && (!is_object($gContent) || !$gContent->isValid())) { $gContent = new FisheyeGallery($ret); $gContent->load(); } return $ret; }
*/ /** * required setup */ require_once '../kernel/setup_inc.php'; require_once FISHEYE_PKG_PATH . 'FisheyeGallery.php'; global $gBitSystem, $gBitSmarty, $gFisheyeGallery; //$gBitSystem->verifyPermission( 'p_fisheye_list_galleries' ); $gFisheyeGallery = new FisheyeGallery(); /* Get a list of galleries which matches the input parameters (default is to list every gallery in the system) */ $_REQUEST['root_only'] = TRUE; /* Process the input parameters this page accepts */ if (!empty($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) { if ($_REQUEST['user_id'] == $gBitUser->mUserId) { $_REQUEST['show_empty'] = TRUE; } $gBitSmarty->assignByRef('gQueryUserId', $_REQUEST['user_id']); $template = 'user_galleries.tpl'; } else { $template = 'list_galleries.tpl'; } $_REQUEST['thumbnail_size'] = $gBitSystem->getConfig('fisheye_list_thumbnail_size', 'small'); $galleryList = $gFisheyeGallery->getList($_REQUEST); $gFisheyeGallery->invokeServices('content_list_function', $_REQUEST); // Pagination Data $gBitSmarty->assignByRef('listInfo', $_REQUEST['listInfo']); $gBitSmarty->assign('galleryList', $galleryList); // Display the template $gDefaultCenter = "bitpackage:fisheye/{$template}"; $gBitSmarty->assignByRef('gDefaultCenter', $gDefaultCenter); $gBitSystem->display('bitpackage:kernel/dynamic.tpl', 'List Galleries', array('display_mode' => 'list'));
/** * This is not in use yet. would be good if this could be updated directly from the db */ function getGalleryListMenu($pParentId = NULL) { global $gBitSystem, $gFisheyeGallery; require_once FISHEYE_PKG_PATH . 'FisheyeGallery.php'; $gFisheyeGallery = new FisheyeGallery(); $hash['root_only'] = TRUE; $hash['get_thumbnails'] = FALSE; $galleryList = $gFisheyeGallery->getList($hash); foreach ($galleryList as $key => $gal) { $itemHash['item_id'] = 'gl' . $key; $itemHash['parent_id'] = $pParentId; $itemHash['title'] = $gal['title']; $itemHash['rsrc'] = $gal['content_id']; $itemHash['rsrc_type'] = 'content_id'; $ret['gl' . $key] = $itemHash; } return $ret; }
$listHash['contain_item'] = $module_params['contain_item']; } if (!empty($module_params['sort_mode'])) { $listHash['sort_mode'] = $module_params['sort_mode']; } else { $listHash['sort_mode'] = 'created_desc'; } if (!empty($module_params['nav_bar'])) { $gBitSmarty->assign('navBar', $module_params['nav_bar']); } else { $gBitSmarty->assign('navBar', true); } if (!empty($module_params['max_records'])) { $listHash['max_records'] = $module_params['max_records']; } $galleryList = $gFisheyeGallery->getList($listHash); // support for div/ul/li listing of galleries $gBitSmarty->assignByRef('galleryList', $galleryList); /* Process the input parameters this page accepts */ if (!empty($gQueryUser) && $gQueryUser->isRegistered()) { $gBitSmarty->assignByRef('gQueryUserId', $gQueryUser->mUserId); $template = 'user_galleries.tpl'; } else { $template = 'list_galleries.tpl'; } if (!empty($_REQUEST['offset']) && is_numeric($_REQUEST['offset'])) { $gBitSmarty->assignByRef('iMaxRows', $iMaxRows); } if (!empty($_REQUEST['sort_mode'])) { $gBitSmarty->assignByRef('iSortMode', $_REQUEST['sort_mode']); }