Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -83,7 +83,7 @@ class _Service extends \IPS\Node\Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch All Services
|
||||
* Fetch All Nodes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -102,6 +102,49 @@ class _Service extends \IPS\Node\Model
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch All Share Services
|
||||
*
|
||||
* @param \IPS\Http\Url $url URL to the content [optional - if omitted, some services will figure out on their own]
|
||||
* @param string $title Default text for the content, usually the title [optional - if omitted, some services will figure out on their own]
|
||||
* @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 )
|
||||
{
|
||||
$member = $member ?: \IPS\Member::loggedIn();
|
||||
$services = array();
|
||||
foreach( static::shareLinks() as $node )
|
||||
{
|
||||
if( $node->enabled and ( $node->groups === "*" or $member->inGroup( explode( ',', $node->groups ) ) ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$services[ $node->key ] = $node->getService( $url, $title );
|
||||
}
|
||||
catch ( \LogicException $e ) { }
|
||||
}
|
||||
}
|
||||
return $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get \IPS\Content\ShareServices class
|
||||
*
|
||||
* @param \IPS\Http\Url $url URL to the content [optional - if omitted, some services will figure out on their own]
|
||||
* @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 )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
throw new \LogicException;
|
||||
}
|
||||
|
||||
/**
|
||||
* [Node] Get buttons to display in tree
|
||||
|
||||
Reference in new issue
Block a user