Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\widgets;
|
||||
|
||||
/* 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;
|
||||
@@ -45,10 +45,7 @@ class _clubs extends \IPS\Widget
|
||||
*/
|
||||
public function configuration( &$form=null )
|
||||
{
|
||||
if ( $form === null )
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
}
|
||||
$form = parent::configuration( $form );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'widget_feed_title', isset( $this->configuration['language_key'] ) ? NULL : \IPS\Member::loggedIn()->language()->addToStack( 'my_clubs' ), FALSE, array( 'app' => 'core', 'key' => ( isset( $this->configuration['language_key'] ) ? $this->configuration['language_key'] : NULL ) ) ) );
|
||||
|
||||
@@ -121,7 +118,7 @@ class _clubs extends \IPS\Widget
|
||||
{
|
||||
case 'Checkbox':
|
||||
case 'YesNo':
|
||||
if ( count( $values[ 'field_' . $field->id ] ) === 1 )
|
||||
if ( \count( $values[ 'field_' . $field->id ] ) === 1 )
|
||||
{
|
||||
$values['filters'][ $field->id ] = array_pop( $values[ 'field_' . $field->id ] );
|
||||
}
|
||||
@@ -132,7 +129,7 @@ class _clubs extends \IPS\Widget
|
||||
case 'Radio':
|
||||
case 'Select':
|
||||
$options = json_decode( $field->extra, TRUE );
|
||||
if ( count( $values[ 'field_' . $field->id ] ) > 0 and count( $values[ 'field_' . $field->id ] ) < count( $options ) )
|
||||
if ( \count( $values[ 'field_' . $field->id ] ) > 0 and \count( $values[ 'field_' . $field->id ] ) < \count( $options ) )
|
||||
{
|
||||
$values['filters'][ $field->id ] = array();
|
||||
foreach ( $values[ 'field_' . $field->id ] as $v )
|
||||
@@ -158,16 +155,26 @@ class _clubs extends \IPS\Widget
|
||||
{
|
||||
if ( \IPS\Settings::i()->clubs and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'clubs', 'front' ) ) )
|
||||
{
|
||||
$clubs = \IPS\Member\Club::clubs(
|
||||
$clubsCount = \IPS\Member\Club::clubs(
|
||||
\IPS\Member::loggedIn(),
|
||||
isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 10,
|
||||
isset( $this->configuration['sort_by'] ) ? $this->configuration['sort_by'] : 'last_activity',
|
||||
!isset( $this->configuration['club_filter_type'] ) or $this->configuration['club_filter_type'] == 'mine',
|
||||
isset( $this->configuration['filters'] ) ? $this->configuration['filters'] : array()
|
||||
isset( $this->configuration['filters'] ) ? $this->configuration['filters'] : array(),
|
||||
NULL,
|
||||
TRUE
|
||||
);
|
||||
|
||||
if ( is_object( $clubs ) AND $clubs->count( TRUE ) )
|
||||
if ( $clubsCount )
|
||||
{
|
||||
$clubs = \IPS\Member\Club::clubs(
|
||||
\IPS\Member::loggedIn(),
|
||||
isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 10,
|
||||
isset( $this->configuration['sort_by'] ) ? $this->configuration['sort_by'] : 'last_activity',
|
||||
!isset( $this->configuration['club_filter_type'] ) or $this->configuration['club_filter_type'] == 'mine',
|
||||
isset( $this->configuration['filters'] ) ? $this->configuration['filters'] : array()
|
||||
);
|
||||
|
||||
return $this->output(
|
||||
$clubs,
|
||||
isset( $this->configuration['language_key'] ) ? \IPS\Member::loggedIn()->language()->addToStack( $this->configuration['language_key'], FALSE, array( 'escape' => TRUE ) ) : \IPS\Member::loggedIn()->language()->addToStack( 'my_clubs' ),
|
||||
|
||||
Reference in new issue
Block a user