Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -11,7 +11,7 @@
namespace IPS\core\StaffDirectory;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -132,12 +132,12 @@ class _User extends \IPS\Node\Model
$form->add( new \IPS\Helpers\Form\Translatable( 'leader_custom_title', NULL, FALSE, array( 'app' => 'core', 'key' => ( $this->id ? "core_staff_directory_title_{$this->id}" : NULL ) ), NULL, NULL, NULL, 'leader_custom_title' ) );
$form->add( new \IPS\Helpers\Form\Translatable( 'leader_custom_bio', NULL, FALSE, array(
'app' => 'core',
'key' => ( $this->id ? "core_staff_directory_bio_{$this->id}" : NULL ),
'key' => ( $this->id ) ? "core_staff_directory_bio_{$this->id}" : NULL,
'editor' => array(
'app' => 'core',
'key' => 'Staffdirectory',
'autoSaveKey' => ( $this->id ? ( 'leader-' . $this->id ) : ( 'leader-' . 999999999 ) ),
'attachIds' => ( $this->id ? array( $this->id ) : NULL )
'autoSaveKey' => ( $this->id ) ? "leader-{$this->id}" : 'leader-new',
'attachIds' => ( $this->id ) ? array( $this->id, NULL, NULL ) : NULL
),
), NULL, NULL, NULL, 'leader_custom_bio_id' ) );
}
@@ -172,13 +172,19 @@ class _User extends \IPS\Node\Model
$this->type = $values['leader_type'];
$this->type_id = $values['type_id'];
}
/* Is this a new entry? */
if ( !$this->id )
{
$this->save();
\IPS\File::claimAttachments( 'leader-new', $this->id, NULL, NULL, TRUE );
$values['position'] = ( \IPS\Db::i()->select( 'MAX(leader_position)', 'core_leaders' )->first() + 1 );
}
else
{
\IPS\File::claimAttachments( "leader-{$this->id}", $this->id, NULL, NULL, TRUE );
}
$toUnset = array();
@@ -217,7 +223,7 @@ class _User extends \IPS\Node\Model
}
}
if( count( $toUnset ) )
if( \count( $toUnset ) )
{
foreach( $toUnset as $_key )
{
@@ -227,20 +233,6 @@ class _User extends \IPS\Node\Model
return $values;
}
/**
* Process created object AFTER the object has been created
*
* @param \IPS\Content\Comment|NULL $comment The first comment
* @param array $values Values from form
* @return void
*/
public function postSaveForm( $values )
{
parent::postSaveForm( $values );
\IPS\File::claimAttachments( 'leader-' . 999999999, $this->id );
}
/**
* [Node] Get Node Title