t('None'), 'randomImage' => t('Random Image'), 'recentImage' => t('Newest Image'), 'viewedImage' => t('Most Viewed Image'), 'randomAlbum' => t('Random Album'), 'recentAlbum' => t('Newest Album'), 'viewedAlbum' => t('Most Viewed Album'), 'dailyImage' => t('Picture of the Day'), 'weeklyImage' => t('Picture of the Week'), 'monthlyImage' => t('Picture of the Month'), 'dailyAlbum' => t('Album of the Day'), 'weeklyAlbum' => t('Album of the Week'), 'monthlyAlbum' => t('Album of the Month')); switch ($op) { case 'list': $blocks[0]['info'] = t('Gallery Block'); $blocks[1]['info'] = t('Gallery Navigation'); $blocks[2]['info'] = t('Gallery Grid Block'); return $blocks; case 'view': if (!user_access('access gallery')) { return; } list ($success, $ret) = _gallery_init(true); if (!$success) { $err_msg = t('Unable to initialize embedded Gallery. You need to configure your embedded Gallery.', array('@link' => url('admin/settings/gallery'))); gallery_error($err_msg, $ret, TRUE); return; } switch ($delta) { // 0 = Image Block case 0: // Allow for multiple image types $param_blocks_array = variable_get('gallery_block_block', array('randomImage')); $params['blocks'] = is_array($param_blocks_array) ? implode('|', $param_blocks_array) : ""; $param_show_array = variable_get('gallery_block_show', array()); $params['show'] = is_array($param_show_array) ? implode('|', $param_show_array) : ""; $params['maxSize'] = variable_get('gallery_maxsize', 160); // Add frames and link target using g2_filter code from MichelleC $params['albumFrame'] = variable_get('gallery_album_frame', 'none'); $params['itemFrame'] = variable_get('gallery_item_frame', 'none'); $params['linkTarget'] = variable_get('gallery_link_target', ''); if (variable_get('gallery_item_id', '') != '') { $params['itemId'] = variable_get('gallery_item_id', ''); } $block = array(); list($ret, $content, $head) = GalleryEmbed::getImageBlock($params); if ($ret) { gallery_error(t('Unable to get Gallery image block'), $ret); return; } else { if ($content) { // If more than one image type selected then default the subject to 'Gallery' if (count(variable_get('gallery_block_block', 'randomImage')) > 1) { $block['subject'] = t('Gallery'); } else { $block['subject'] = $typeMap[$params['blocks']]; } $block['content'] = '
' . $current_image . ' | '; $col++; if ($col >= $num_cols) { $col = 0; $new_html .= '