Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

@@ -825,7 +825,7 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
if( $club->type == 'closed' )
{
$form->add( new \IPS\Helpers\Form\YesNo( 'club_node_public', $this->id ? $this->isPublic() : FALSE ) );
$form->add( new \IPS\Helpers\Form\Radio( 'club_node_public', $this->id ? $this->isPublic() : 0, TRUE, array( 'options' => array( '0' => 'club_node_public_no', '1' => 'club_node_public_view', '2' => 'club_node_public_participate' ) ) ) );
}
}
@@ -902,4 +902,41 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
break;
}
}
/**
* Get the member's view method
*
* @return string
*/
public static function getMemberView()
{
$method = ( isset( \IPS\Request::i()->cookie['idm_category_view'] ) ) ? \IPS\Request::i()->cookie['idm_category_view'] : NULL;
$chooseable = \IPS\Settings::i()->idm_default_view_choose;
if ( ! $chooseable or !\IPS\Member::loggedIn()->member_id )
{
return \IPS\Settings::i()->idm_default_view;
}
if ( ! $method )
{
try
{
$method = \IPS\Db::i()->select( 'method', 'downloads_view_method', array( 'member_id=?', \IPS\Member::loggedIn()->member_id ) )->first();
}
catch( \UnderFlowException $e )
{
$method = \IPS\Settings::i()->idm_default_view;
}
/* Attempt to set the cookie again */
\IPS\Request::i()->setCookie( 'idm_category_view', $method, ( new \IPS\DateTime )->add( new \DateInterval( 'P1Y' ) ) );
}
if ( ! $method or !$chooseable )
{
$method = \IPS\Settings::i()->idm_default_view;
}
return $method;
}
}