Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -22,7 +22,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* Recent comments widget
|
||||
*/
|
||||
class _recentComments extends \IPS\Widget\PermissionCache
|
||||
class _recentComments extends \IPS\Content\WidgetComment
|
||||
{
|
||||
/**
|
||||
* @brief Widget Key
|
||||
@@ -40,32 +40,7 @@ class _recentComments extends \IPS\Widget\PermissionCache
|
||||
public $plugin = '';
|
||||
|
||||
/**
|
||||
* Specify widget configuration
|
||||
*
|
||||
* @param null|\IPS\Helpers\Form $form Form object
|
||||
* @return \IPS\Helpers\Form
|
||||
* Class
|
||||
*/
|
||||
public function configuration( &$form=null )
|
||||
{
|
||||
if ( $form === null )
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'number_to_show', isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 5, TRUE ) );
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a widget
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$comments = \IPS\gallery\Image\Comment::getItemsWithPermission( array(), NULL, isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 5 );
|
||||
|
||||
return ( count( $comments ) ) ? $this->output( $comments ) : '';
|
||||
}
|
||||
protected static $class = 'IPS\gallery\Image\Comment';
|
||||
}
|
||||
Reference in new issue
Block a user