Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

+30 -10
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Table Builder using an \IPS\Content\Item class datasource
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 16 Jul 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\Helpers\Table;
@@ -56,7 +55,7 @@ class _Content extends Table
/**
* @brief Honor the pinned flag for sorting. Will be set to false in stream-like views
*/
protected $honorPinned = TRUE;
public $honorPinned = TRUE;
/**
* @brief Show moved links in the result set. This is desirable in controller generated views but not streams or widgets, etc.
@@ -139,7 +138,7 @@ class _Content extends Table
$this->where[] = array( $class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnMap['container'] . '=?', $container->_id );
$this->sortDirection = ( $this->sortDirection !== NULL ) ? $this->sortDirection : $container->_sortOrder;
if ( !$this->sortBy and $container->_sortBy !== NULL )
if ( !$this->sortBy and ! empty( $container->_sortBy ) )
{
$this->sortBy = $class::$databaseTable . '.' . $class::$databasePrefix . $container->_sortBy;
}
@@ -154,9 +153,24 @@ class _Content extends Table
}
/* Set breadcrumb */
foreach ( $container->parents() as $parent )
if ( \IPS\IPS::classUsesTrait( $container, 'IPS\Content\ClubContainer' ) and $club = $container->club() )
{
\IPS\Output::i()->breadcrumb[] = array( $parent->url(), $parent->_title );
\IPS\core\FrontNavigation::$clubTabActive = TRUE;
\IPS\Output::i()->breadcrumb = array();
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=core&module=clubs&controller=directory', 'front', 'clubs_list' ), \IPS\Member::loggedIn()->language()->addToStack('module__core_clubs') );
\IPS\Output::i()->breadcrumb[] = array( $club->url(), $club->name );
if ( \IPS\Settings::i()->clubs_header == 'sidebar' )
{
\IPS\Output::i()->sidebar['contextual'] = \IPS\Theme::i()->getTemplate( 'clubs', 'core' )->header( $club, $container, 'sidebar' );
}
}
else
{
foreach ( $container->parents() as $parent )
{
\IPS\Output::i()->breadcrumb[] = array( $parent->url(), $parent->_title );
}
}
\IPS\Output::i()->breadcrumb[] = array( NULL, $container->_title );
@@ -485,6 +499,11 @@ class _Content extends Table
*/
protected function multimod()
{
if ( $this->noModerate )
{
return;
}
\IPS\Session::i()->csrfCheck();
/* Basic check that we selected something */
@@ -518,7 +537,8 @@ class _Content extends Table
catch( \OutOfBoundsException $e ) { }
return false;
}
},
'clubs' => TRUE
) ) );
if ( isset( $class::$databaseColumnMap['moved_to'] ) )
{
+5 -6
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Table Builder using an array datasource
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 18 Feb 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\Helpers\Table;
@@ -125,7 +124,7 @@ class _Custom extends Table
/* Limit */
if ( $this->limit and $this->count > $this->limit )
{
$rows = array_slice( $rows, ( $this->limit * ( $this->page - 1 ) ), $this->limit );
$rows = array_slice( $rows, ( $this->limit * ( $this->page - 1 ) ), $this->limit, TRUE );
}
/* Apply parsers */
+21 -14
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Table Builder using a database table datasource
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 18 Feb 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\Helpers\Table;
@@ -151,6 +150,10 @@ class _Db extends Table
{
$where[] = $clause;
}
else
{
unset( $advancedSearchValues[ $k ] );
}
break;
case SEARCH_CONTAINS_TEXT:
@@ -173,6 +176,11 @@ class _Db extends Table
case SEARCH_DATE_RANGE:
$timezone = ( \IPS\Member::loggedIn()->timezone ? new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) : NULL );
if( !$v['start'] AND !$v['end'] )
{
unset( $advancedSearchValues[ $k ] );
}
if ( $v['start'] )
{
if( !( $v['start'] instanceof \IPS\DateTime ) )
@@ -205,9 +213,13 @@ class _Db extends Table
break;
case SEARCH_MEMBER:
if( $v instanceof \IPS\Member )
if ( $v )
{
$where[] = array( "{$k}=?", $v->member_id );
$where[] = array( "{$k}=?", ( $v instanceof \IPS\Member ) ? $v->member_id : $v );
}
else
{
unset( $advancedSearchValues[ $k ] );
}
break;
@@ -312,7 +324,7 @@ class _Db extends Table
$count = $count->first();
/* Now get column headers */
$query = \IPS\Db::i()->select( $this->onlySelected ? implode( ', ', $selects ) : '*', $this->table, $where, NULL, array( 0, 1 ), $this->group );
$query = \IPS\Db::i()->select( $this->onlySelected ? implode( ', ', $selects ) : '*', $this->table, NULL, NULL, array( 0, 1 ) );
if ( count( $this->joins ) )
{
@@ -321,11 +333,6 @@ class _Db extends Table
$query->join( $join['from'], ( isset( $join['where'] ) ? $join['where'] : null ), ( isset( $join['type'] ) ) ? $join['type'] : 'LEFT' );
}
}
if ( $this->index )
{
$query->forceIndex( $this->index );
}
try
{
@@ -403,7 +410,7 @@ class _Db extends Table
$row[ $k ] = isset( $_row[ $k ] ) ? $_row[ $k ] : NULL;
}
if( !empty( $advancedSearchValues ) )
if( !empty( $advancedSearchValues ) AND !isset( \IPS\Request::i()->noColumn ) )
{
foreach ( $advancedSearchValues as $k => $v )
{
+31 -8
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Table Builder
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 18 Feb 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\Helpers\Table;
@@ -86,6 +85,11 @@ abstract class _Table
*/
public $showAdvancedSearch = TRUE;
/**
* @brief Whether to use the placeholder loading style with this table
*/
public $dummyLoading = FALSE;
/**
* @brief Fields to enable advanced sarch on
* @note Keys are the field names. Values are a IPS\Helpers\Table\SEARCH_* constant
@@ -113,6 +117,11 @@ abstract class _Table
*/
protected $paginationKey = 'page';
/**
* @brief Use simple pagination
*/
public $simplePagination = FALSE;
/**
* @brief Table resort parameter
*/
@@ -149,9 +158,14 @@ abstract class _Table
public $mainColumn = NULL;
/**
* @brief Additional CSS classes to apply to columns
* @brief Additional CSS classes to apply to the table
*/
public $classes = array();
/**
* @brief Additional CSS classes to apply to individual columns
*/
public $rowClasses = array();
/**
* @brief Buttons to show on the "root row"
@@ -502,7 +516,16 @@ abstract class _Table
$resortKey = $this->resortKey;
if( \IPS\Request::i()->isAjax() and \IPS\Request::i()->$resortKey )
{
\IPS\Output::i()->json( array( 'rows' => call_user_func( $this->rowsTemplate, $this, $headers, $rows, $this->mainColumn, $this->rootButtons, array() ), 'pagination' => \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $this->baseUrl, $this->pages, $this->page, $this->limit, TRUE, $this->paginationKey ), 'extraHtml' => $this->extraHtml ) );
if ( count( $rows ) )
{
$rowHtml = call_user_func( $this->rowsTemplate, $this, $headers, $rows, $this->mainColumn, $this->rootButtons, array() );
}
else
{
$rowHtml = \IPS\Theme::i()->getTemplate( 'tables', 'core', 'front' )->noRows();
}
\IPS\Output::i()->json( array( 'rows' => $rowHtml, 'pagination' => \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $this->baseUrl, $this->pages, $this->page, $this->limit, TRUE, $this->paginationKey, $this->simplePagination ), 'extraHtml' => $this->extraHtml ) );
}
/* Otherwise, show the full table */
else
@@ -608,7 +631,7 @@ abstract class _Table
}
else
{
if( !empty( $advancedSearchValues ) )
if( !empty( $advancedSearchValues ) AND !isset( \IPS\Request::i()->noColumn ) )
{
$headers = array_combine( $this->include, $this->include );