Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Browse the gallery
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @subpackage Gallery
|
||||
* @since 04 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\gallery\modules\front\gallery;
|
||||
@@ -22,7 +21,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* Browse the gallery
|
||||
*/
|
||||
class _browse extends \IPS\Dispatcher\Controller
|
||||
class _browse extends \IPS\Content\Controller
|
||||
{
|
||||
/**
|
||||
* [Content\Controller] Class
|
||||
@@ -38,7 +37,8 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if( isset( \IPS\Request::i()->album ) )
|
||||
{
|
||||
static::$contentModel = 'IPS\gallery\Album';
|
||||
\IPS\Request::i()->id = \IPS\Request::i()->album;
|
||||
static::$contentModel = ( isset( \IPS\Request::i()->do ) ) ? 'IPS\gallery\Album\Item' : 'IPS\gallery\Album';
|
||||
}
|
||||
|
||||
/* Gallery uses caption for title */
|
||||
@@ -182,13 +182,14 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
$albums->classes = array( 'ipsDataList_large' );
|
||||
$albums = ( $category->hasAlbums() ) ? (string) $albums : NULL;
|
||||
}
|
||||
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ), \IPS\Dispatcher::i()->module->_title );
|
||||
|
||||
if( !count( \IPS\gallery\Image::getItemsWithPermission( array( array( 'image_category_id=? AND image_album_id=?', $category->_id, 0 ) ) ) ) )
|
||||
{
|
||||
$table = ( $category->childrenCount() or $albums ) ? '' : \IPS\Theme::i()->getTemplate( 'browse' )->noImages( $category );
|
||||
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ), \IPS\Dispatcher::i()->module->_title );
|
||||
$parents = iterator_to_array( $category->parents() );
|
||||
if ( count( $parents ) )
|
||||
{
|
||||
@@ -220,6 +221,20 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( $club = $category->club() )
|
||||
{
|
||||
\IPS\core\FrontNavigation::$clubTabActive = TRUE;
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=core&module=clubs&controller=directory', 'front', 'clubs_list' ), \IPS\Member::loggedIn()->language()->addToStack('module__core_clubs') );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $club->url(), $club->name );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $category->url(), $category->_title );
|
||||
|
||||
if ( \IPS\Settings::i()->clubs_header == 'sidebar' )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate( 'clubs', 'core' )->header( $club, $category, 'sidebar' );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item_categories' ) ] = array( 'type' => 'gallery_image', 'nodes' => $category->_id );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->category( $category, $albums, (string) $table );
|
||||
}
|
||||
@@ -265,28 +280,74 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
unset( $table->sortOptions['rating'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Load the item */
|
||||
$asItem = $album->asItem();
|
||||
|
||||
/* Sort out comments and reviews */
|
||||
$tabs = $asItem->commentReviewTabs();
|
||||
$_tabs = array_keys( $tabs );
|
||||
$tab = isset( \IPS\Request::i()->tab ) ? \IPS\Request::i()->tab : array_shift( $_tabs );
|
||||
$activeTabContents = $asItem->commentReviews( $tab );
|
||||
|
||||
if ( count( $tabs ) > 1 )
|
||||
{
|
||||
$commentsAndReviews = count( $tabs ) ? \IPS\Theme::i()->getTemplate( 'global', 'core' )->tabs( $tabs, $tab, $activeTabContents, $album->url(), 'tab', FALSE, TRUE ) : NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$commentsAndReviews = $activeTabContents;
|
||||
}
|
||||
|
||||
/* Fetching comments/reviews */
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->output = $activeTabContents;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Online User Location */
|
||||
$permissions = $album->category()->permissions();
|
||||
\IPS\Session::i()->setLocation( $album->url(), explode( ",", $permissions['perm_view'] ), 'loc_gallery_viewing_album', array( $album->_title => FALSE ) );
|
||||
|
||||
/* Output */
|
||||
\IPS\Output::i()->title = $album->_title;
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ), \IPS\Dispatcher::i()->module->_title );
|
||||
$parents = iterator_to_array( $album->category()->parents() );
|
||||
if ( count( $parents ) )
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
|
||||
if ( $club = $album->category()->club() )
|
||||
{
|
||||
foreach( $parents AS $parent )
|
||||
\IPS\core\FrontNavigation::$clubTabActive = TRUE;
|
||||
\IPS\Output::i()->breadcrumb = array();
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=core&module=clubs&controller=directory', 'front', 'clubs_list' ), \IPS\Member::loggedIn()->language()->addToStack('module__core_clubs') );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $club->url(), $club->name );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $album->category()->url(), $album->category()->_title );
|
||||
|
||||
if ( \IPS\Settings::i()->clubs_header == 'sidebar' )
|
||||
{
|
||||
\IPS\Output::i()->breadcrumb[] = array( $parent->url(), $parent->_title );
|
||||
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate( 'clubs', 'core' )->header( $club, $album->category(), 'sidebar' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse', 'front', 'gallery' ), \IPS\Dispatcher::i()->module->_title );
|
||||
$parents = iterator_to_array( $album->category()->parents() );
|
||||
if ( count( $parents ) )
|
||||
{
|
||||
foreach( $parents AS $parent )
|
||||
{
|
||||
\IPS\Output::i()->breadcrumb[] = array( $parent->url(), $parent->_title );
|
||||
}
|
||||
}
|
||||
\IPS\Output::i()->breadcrumb[] = array( $album->category()->url(), $album->category()->_title );
|
||||
}
|
||||
|
||||
if( $album->coverPhoto('medium') )
|
||||
{
|
||||
\IPS\Output::i()->metaTags['og:image'] = $album->coverPhoto('medium');
|
||||
}
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( $album->category()->url(), $album->category()->_title );
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, $album->_title );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->album( $album, (string) $table );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->album( $album, (string) $table, $commentsAndReviews );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user