Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Browse the gallery
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Gallery
|
||||
* @since 04 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -41,6 +41,9 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
static::$contentModel = 'IPS\gallery\Album';
|
||||
}
|
||||
|
||||
/* Gallery uses caption for title */
|
||||
\IPS\Member::loggedIn()->language()->words[ "sort_title" ] = \IPS\Member::loggedIn()->language()->addToStack( "album_sort_caption", FALSE );
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_browse.js', 'gallery' ) );
|
||||
parent::execute();
|
||||
}
|
||||
@@ -78,7 +81,17 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$category = \IPS\gallery\Category::loadAndCheckPerms( \IPS\Request::i()->category, 'view' );
|
||||
|
||||
\IPS\Output::i()->rssFeeds[ \IPS\Member::loggedIn()->language()->addToStack( 'gallery_rss_title_container', FALSE, array( 'sprintf' => array( $category->_title ) ) ) ] = \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=rss&category=' . $category->id, 'front', 'gallery_rss' );
|
||||
/* If we cannot view images and there's a custom error, show it now */
|
||||
if( !$category->can( 'read' ) AND \IPS\Member::loggedIn()->language()->checkKeyExists( "gallery_category_{$category->id}_permerror" ) )
|
||||
{
|
||||
\IPS\Output::i()->error( "gallery_category_{$category->id}_permerror", '1G189/B', 403, '' );
|
||||
}
|
||||
|
||||
/* Add RSS feed */
|
||||
if ( \IPS\Settings::i()->gallery_rss_enabled )
|
||||
{
|
||||
\IPS\Output::i()->rssFeeds[ \IPS\Member::loggedIn()->language()->addToStack( 'gallery_rss_title_container', FALSE, array( 'sprintf' => array( $category->_title ) ) ) ] = \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=rss&category=' . $category->id, 'front', 'gallery_rss' );
|
||||
}
|
||||
|
||||
$this->_category( $category );
|
||||
}
|
||||
@@ -93,8 +106,11 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$album = \IPS\gallery\Album::loadAndCheckPerms( \IPS\Request::i()->album, 'view' );
|
||||
|
||||
\IPS\Output::i()->rssFeeds[ \IPS\Member::loggedIn()->language()->addToStack( 'gallery_rss_title_container', FALSE, array( 'sprintf' => array( $album->_title ) ) ) ] = \IPS\Http\Url::internal( 'app=gallery&module=gallery&controller=browse&do=rss&album=' . $album->id, 'front', 'gallery_rss' );
|
||||
|
||||
/* Add RSS feed */
|
||||
if ( \IPS\Settings::i()->gallery_rss_enabled )
|
||||
{
|
||||
\IPS\Output::i()->rssFeeds[\IPS\Member::loggedIn()->language()->addToStack('gallery_rss_title_container', FALSE, array('sprintf' => array($album->_title)))] = \IPS\Http\Url::internal('app=gallery&module=gallery&controller=browse&do=rss&album=' . $album->id, 'front', 'gallery_rss');
|
||||
}
|
||||
$this->_album( $album );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
@@ -204,7 +220,7 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( 'category' ) ) ) ) ] = array( 'type' => 'gallery_image', 'nodes' => $category->_id );
|
||||
\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 );
|
||||
}
|
||||
|
||||
@@ -227,6 +243,13 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
$table = new \IPS\gallery\Image\Table( 'IPS\gallery\Image', $album->url(), array( array( 'image_album_id=?', $album->id ) ), $album->category() );
|
||||
$table->limit = 50;
|
||||
$table->sortBy = \IPS\Request::i()->sortby ? $table->sortBy : $album->_sortBy;
|
||||
|
||||
/* Make sure captions are sorted in the right order */
|
||||
if ( $table->sortBy == "title" )
|
||||
{
|
||||
$table->sortDirection = "asc";
|
||||
}
|
||||
|
||||
$table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'browse' ), 'imageTable' );
|
||||
$table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'browse' ), $this->getTableRowsTemplate() );
|
||||
$table->title = \IPS\Member::loggedIn()->language()->pluralize( \IPS\Member::loggedIn()->language()->get('num_images'), array( $album->count_imgs ) );
|
||||
@@ -294,7 +317,15 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function getImages()
|
||||
{
|
||||
$startingPoint = \IPS\gallery\Image::load( \IPS\Request::i()->image );
|
||||
try
|
||||
{
|
||||
$startingPoint = \IPS\gallery\Image::load( \IPS\Request::i()->image );
|
||||
}
|
||||
catch ( \OutOfRangeException $e)
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/C', 404, '' );
|
||||
}
|
||||
|
||||
$count = intval( \IPS\Request::i()->count );
|
||||
|
||||
if( \IPS\Request::i()->direction == 'next' )
|
||||
@@ -397,8 +428,6 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->error( 'node_error', '2G189/4', 403, '' );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Build form */
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->class .= 'ipsForm_vertical';
|
||||
|
||||
Reference in new issue
Block a user