Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief Share Links Node
* @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
* @since 12 Jun 2013
* @version SVN_VERSION_NUMBER
*/
@@ -48,6 +48,11 @@ class _Service extends \IPS\Node\Model
*/
protected static $databaseIdFields = array( 'share_key' );
/**
* @brief [ActiveRecord] Multiton Map
*/
protected static $multitonMap = array();
/**
* @brief [Node] Order Database Column
*/
@@ -111,7 +116,7 @@ class _Service extends \IPS\Node\Model
* @param \IPS\Member|NULL $member Member the links will display to or NULL for currently logged in member
* @return array
*/
public static function getAllServices( \IPS\Http\Url $url, $title, \IPS\Member $member = NULL )
public static function getAllServices( \IPS\Http\Url $url, $title, \IPS\Member $member = NULL, \IPS\Content $item = NULL )
{
$member = $member ?: \IPS\Member::loggedIn();
$services = array();
@@ -121,7 +126,7 @@ class _Service extends \IPS\Node\Model
{
try
{
$services[ $node->key ] = $node->getService( $url, $title );
$services[ $node->key ] = $node->getService( $url, $title, $item );
}
catch ( \LogicException $e ) { }
}
@@ -136,12 +141,12 @@ class _Service extends \IPS\Node\Model
* @param string $title Default text for the content, usually the title [optional - if omitted, some services will figure out on their own]
* @return array
*/
public function getService( \IPS\Http\Url $url, $title )
public function getService( \IPS\Http\Url $url, $title, $item )
{
if( file_exists( \IPS\ROOT_PATH . '/system/Content/ShareServices/' . ucwords( $this->key ) . '.php' ) )
{
$className = "IPS\\Content\\ShareServices\\" . ucwords( $this->key );
return new $className( $url, $title );
return new $className( $url, $title, $item );
}
throw new \LogicException;
}
@@ -202,12 +207,7 @@ class _Service extends \IPS\Node\Model
/* Find the service and see if it has any additional settings... */
$className = "\\IPS\\Content\\ShareServices\\" . ucwords( $this->key );
$className::modifyForm( $form );
if ( $className::canAutoshare() )
{
$form->add( new \IPS\Helpers\Form\Checkbox( 'share_autoshare', $this->autoshare, false ) );
}
$className::modifyForm( $form, $this );
}
/**
@@ -220,6 +220,21 @@ class _Service extends \IPS\Node\Model
{
if( count( $values ) )
{
if ( isset( $values[ 'share_autoshare_' . ucwords( $this->key ) ] ) )
{
$values['share_autoshare'] = $values[ 'share_autoshare_' . ucwords( $this->key ) ];
unset( $values[ 'share_autoshare_' . ucwords( $this->key ) ] );
$loginHandlers = \IPS\Login::handlers(TRUE);
if ( isset( $loginHandlers[ ucwords( $this->key ) ] ) )
{
$settings = $loginHandlers[ ucwords( $this->key ) ]->settings;
$settings['autoshare'] = $values['share_autoshare'];
$loginHandlers[ ucwords( $this->key ) ]->settings = json_encode( $settings );
$loginHandlers[ ucwords( $this->key ) ]->save();
}
}
foreach ( $values as $k => $v )
{
if( !in_array( $k, array( 'share_title', 'share_groups', 'share_autoshare' ) ) )