Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -258,4 +258,24 @@ class _browse extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=downloads&module=downloads&controller=browse&do=categories', 'front', 'downloads_categories' ), \IPS\Member::loggedIn()->language()->addToStack('download_categories') );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'browse' )->categories();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the viewing method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setMethod()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
$method = ( isset( \IPS\Request::i()->method ) ) ? \IPS\Request::i()->method : \IPS\Settings::i()->idm_default_view;
|
||||
|
||||
\IPS\Request::i()->setCookie( 'idm_category_view', $method, ( new \IPS\DateTime )->add( new \DateInterval( 'P1Y' ) ) );
|
||||
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
\IPS\Db::i()->replace( 'downloads_view_method', array( 'member_id' => \IPS\Member::loggedIn()->member_id, 'method' => $method ) );
|
||||
}
|
||||
\IPS\Output::i()->redirect( \IPS\downloads\Category::load( \IPS\Request::i()->id )->url() );
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class _pending extends \IPS\Content\Controller
|
||||
/**
|
||||
* [Content\Controller] Class
|
||||
*/
|
||||
protected static $contentModel = 'IPS\downloads\File\PendingVersion';
|
||||
protected static $contentModel = \IPS\downloads\File\PendingVersion::class;
|
||||
|
||||
/**
|
||||
* @brief Storage for loaded file
|
||||
@@ -55,7 +55,7 @@ class _pending extends \IPS\Content\Controller
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
|
||||
if ( !$this->version->canUnhide() )
|
||||
if ( !$this->version->canUnhide() AND !$this->version->canDelete())
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2D417/1', 404, '' );
|
||||
}
|
||||
@@ -167,4 +167,23 @@ class _pending extends \IPS\Content\Controller
|
||||
|
||||
return parent::moderate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to allow pending version approval for authors
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function delete()
|
||||
{
|
||||
if( !$this->version->canDelete())
|
||||
{
|
||||
\IPS\Output::i()->error( 'file_version_pending_cannot_delete', '2D417/4', 403, '' ); //TODO error code
|
||||
}
|
||||
/* Make sure the user confirmed the deletion */
|
||||
\IPS\Request::i()->confirmedDelete();
|
||||
|
||||
$this->version->delete();
|
||||
\IPS\Session::i()->modLog( 'modlog__action_deletedpending', array( (string) $this->file->url() => FALSE, $this->file->name => FALSE ), $this->file );
|
||||
\IPS\Output::i()->redirect( $this->file->url() , 'deleted');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user