Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
+18
-10
@@ -150,7 +150,7 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
* @param bool $countOnly Only return a count, instead of an iterator
|
||||
* @return \IPS\Patterns\ActiveRecordIterator|array|int
|
||||
*/
|
||||
public static function clubs( \IPS\Member $member = NULL, $limit, $sortOption, $mineOnly=FALSE, $filters=array(), $extraWhere=NULL, $countOnly=FALSE )
|
||||
public static function clubs( ?\IPS\Member $member, $limit, $sortOption, $mineOnly=FALSE, $filters=array(), $extraWhere=NULL, $countOnly=FALSE )
|
||||
{
|
||||
$where = array();
|
||||
$joins = array();
|
||||
@@ -487,7 +487,7 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
{
|
||||
if ( $field->allow_attachments AND !$new )
|
||||
{
|
||||
$field::$editorOptions = array_merge( $field::$editorOptions, array( 'attachIds' => array( $this->id, $field->id, NULL ) ) );
|
||||
$field::$editorOptions = array_merge( $field::$editorOptions, array( 'attachIds' => array( $this->id, $field->id, NULL ), 'autoSaveKey' => "clubs-field{$field->id}-{$this->id}" ) );
|
||||
}
|
||||
}
|
||||
$helper = $field->buildHelper( isset( $fieldValues["field_{$field->id}"] ) ? $fieldValues["field_{$field->id}"] : NULL );
|
||||
@@ -495,7 +495,7 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
{
|
||||
if ( $field->allow_attachments AND $new )
|
||||
{
|
||||
$field::$editorOptions = array_merge( $field::$editorOptions, array( 'attachIds' => array( NULL ) ) );
|
||||
$field::$editorOptions = array_merge( $field::$editorOptions, array( 'attachIds' => array( NULL ), 'autoSaveKey' => "clubs-field{$field->id}-new" ) );
|
||||
}
|
||||
}
|
||||
$form->add( $helper );
|
||||
@@ -1047,10 +1047,10 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
/**
|
||||
* Get members
|
||||
*
|
||||
* @param array $statuses The membership statuses to get
|
||||
* @param int $limit Number to get
|
||||
* @param string $order ORDER BY clause
|
||||
* @param int $returnType 0 = core_clubs_memberships rows, 1 = core_clubs_memberships plus \IPS\Member::columnsForPhoto(), 2 = full core_members rows, 3 = same as 1 but also getting name of adder/invitee, 4 = count only, 5 = same as 3 but also getting expire date
|
||||
* @param array $statuses The membership statuses to get
|
||||
* @param array|int $limit Rows to fetch or array( offset, limit )
|
||||
* @param string $order ORDER BY clause
|
||||
* @param int $returnType 0 = core_clubs_memberships rows, 1 = core_clubs_memberships plus \IPS\Member::columnsForPhoto(), 2 = full core_members rows, 3 = same as 1 but also getting name of adder/invitee, 4 = count only, 5 = same as 3 but also getting expire date
|
||||
* @return \IPS\Db\Select|int
|
||||
*/
|
||||
public function members( $statuses = array( 'member', 'moderator', 'leader' ), $limit = 25, $order = 'core_clubs_memberships.joined ASC', $returnType = 1 )
|
||||
@@ -1087,7 +1087,7 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
|
||||
$select = \IPS\Db::i()->select( $columns, 'core_clubs_memberships', array( array( 'club_id=?', $this->id ), array( \IPS\Db::i()->in( 'status', $statuses ) ) ), $order, $limit, NULL, NULL, \IPS\Db::SELECT_MULTIDIMENSIONAL_JOINS );
|
||||
}
|
||||
|
||||
|
||||
if ( $returnType === 1 or $returnType === 2 or $returnType === 3 or $returnType === 5 )
|
||||
{
|
||||
$select->join( 'core_members', 'core_members.member_id=core_clubs_memberships.member_id' );
|
||||
@@ -1102,7 +1102,7 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
$select->join( 'nexus_purchases', array( 'ps_app=? AND ps_type=? AND ps_member=core_clubs_memberships.member_id AND ps_item_id=? AND ps_cancelled=0', 'core', 'club', $this->id ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $select;
|
||||
}
|
||||
|
||||
@@ -1195,6 +1195,12 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/* Achievements */
|
||||
if( \in_array( $status, array( static::STATUS_MEMBER, static::STATUS_MODERATOR, static::STATUS_LEADER, static::STATUS_EXPIRED, static::STATUS_EXPIRED_MODERATOR ) ) )
|
||||
{
|
||||
$member->achievementAction( 'core', 'JoinClub', $this );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1661,6 +1667,8 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
{
|
||||
$page->delete( FALSE );
|
||||
}
|
||||
|
||||
$this->coverPhoto()->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2110,7 +2118,7 @@ class _Club extends \IPS\Patterns\ActiveRecord implements \IPS\Content\Embeddabl
|
||||
* @return void
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function acknowledgeRules( ?\IPS\Member $member = NULL ): void
|
||||
public function acknowledgeRules( ?\IPS\Member $member = NULL )
|
||||
{
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class _Page extends \IPS\Patterns\ActiveRecord
|
||||
* @param \IPS\Member\Club $club The club
|
||||
* @return void
|
||||
*/
|
||||
public function set_club( \IPS\Member\Club $club ): void
|
||||
public function set_club( \IPS\Member\Club $club )
|
||||
{
|
||||
$this->_data['club'] = $club->id;
|
||||
unset( static::$clubs[ $club->id ] );
|
||||
@@ -91,7 +91,7 @@ class _Page extends \IPS\Patterns\ActiveRecord
|
||||
* @param string $title The page title
|
||||
* @return void
|
||||
*/
|
||||
public function set_title( string $title ): void
|
||||
public function set_title( string $title )
|
||||
{
|
||||
$this->_data['title'] = $title;
|
||||
$this->_data['seo_title'] = \IPS\Http\Url\Friendly::seoTitle( $title );
|
||||
@@ -103,7 +103,7 @@ class _Page extends \IPS\Patterns\ActiveRecord
|
||||
* @param array|NULL $value The value to set
|
||||
* @return void
|
||||
*/
|
||||
public function set_can_view( ?array $value ): void
|
||||
public function set_can_view( ?array $value )
|
||||
{
|
||||
if ( \is_array( $value ) )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ class _Page extends \IPS\Patterns\ActiveRecord
|
||||
* @param \IPS\Member\Club\Page|NULL $current If we are editing, the current page.
|
||||
* @return void
|
||||
*/
|
||||
public static function form( \IPS\Helpers\Form $form, \IPS\Member\Club $club, ?\IPS\Member\Club\Page $current = NULL ): void
|
||||
public static function form( \IPS\Helpers\Form $form, \IPS\Member\Club $club, ?\IPS\Member\Club\Page $current = NULL )
|
||||
{
|
||||
$form->hiddenValues['page_club'] = $club->id;
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'club_page_title', ( $current ) ? $current->title : NULL, TRUE ) );
|
||||
@@ -165,7 +165,7 @@ class _Page extends \IPS\Patterns\ActiveRecord
|
||||
* @param $values array Values
|
||||
* @return void
|
||||
*/
|
||||
public function formatFormValues( array $values ): void
|
||||
public function formatFormValues( array $values )
|
||||
{
|
||||
$this->club = \IPS\Member\Club::load( $values['page_club'] );
|
||||
$this->title = $values['club_page_title'];
|
||||
|
||||
Reference in new issue
Block a user