Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

@@ -263,6 +263,11 @@ class _category extends \IPS\cms\Databases\Controller
{
$where = NULL;
}
if( \IPS\Request::i()->advanced_search_submitted )
{
\IPS\Request::i()->csrfKey = \IPS\Session::i()->csrfKey;
}
$table = new \IPS\Helpers\Table\Content( 'IPS\cms\Records' . \IPS\cms\Databases\Dispatcher::i()->databaseId, $category->url(), $where, $category, NULL, 'read', isset( \IPS\Request::i()->rss ) ? FALSE : TRUE );
$table->tableTemplate = array( \IPS\cms\Theme::i()->getTemplate( $category->_template_listing, 'cms', 'database' ), 'categoryTable' );
@@ -139,7 +139,16 @@ class _record extends \IPS\Content\Controller
$record->save();
$record->processAfterEdit( $values );
$fieldObjects = $fieldsClass::data( NULL, $record->category_id ? $category : NULL );
foreach( $fieldObjects as $id => $row )
{
if ( $row->type == 'Item' )
{
$record->processItemFieldData( $row );
}
}
\IPS\Output::i()->redirect( $record->url() );
}
}
@@ -214,14 +223,14 @@ class _record extends \IPS\Content\Controller
'author' => array(
'@type' => 'Person',
'name' => (string) \IPS\Member::load( $record->member_id )->name,
'image' => (string) \IPS\Member::load( $record->member_id )->get_photo()
'image' => (string) \IPS\Member::load( $record->member_id )->get_photo( TRUE, TRUE )
),
'publisher' => array(
'@id' => \IPS\Settings::i()->base_url . '#organization',
'member' => array(
'@type' => "Person",
'name' => \IPS\Member::load( $record->member_id )->name,
'image' => (string) \IPS\Member::load( $record->member_id )->get_photo(),
'image' => (string) \IPS\Member::load( $record->member_id )->get_photo( TRUE, TRUE ),
)
),
'interactionStatistic' => array(
@@ -258,7 +267,7 @@ class _record extends \IPS\Content\Controller
}
\IPS\Output::i()->jsonLd['article']['publisher']['logo'] = array(
'@type' => 'ImageObject',
'url' => $logo ? (string) $logo : (string) \IPS\Member::load( $record->member_id )->get_photo(),
'url' => $logo ? (string) $logo : (string) \IPS\Member::load( $record->member_id )->get_photo( TRUE, TRUE ),
);
/* Image is required */
@@ -283,7 +292,7 @@ class _record extends \IPS\Content\Controller
\IPS\Output::i()->jsonLd['article']['image'] = array(
'@type' => 'ImageObject',
'url' => \IPS\Member::load( $record->member_id )->get_photo(),
'url' => \IPS\Member::load( $record->member_id )->get_photo( TRUE, TRUE ),
'width' => $photoVars[0],
'height' => $photoVars[1]
);
@@ -30,23 +30,47 @@ class _builder extends \IPS\core\modules\front\system\widgets
*/
public function previewBlock()
{
if ( !\IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'blocks', 'block_manage' ) )
{
\IPS\Output::i()->error( 'no_module_permission', '3T419/1', 403, '' );
}
$output = "";
if ( \IPS\Request::i()->_key )
{
try
{
$key = \IPS\Request::i()->_key;
$data = \IPS\Data\Store::i()->$key;
unset( \IPS\Data\Store::i()->$key );
}
catch( \OutOfRangeException $e )
{
$data = array();
}
}
if ( isset( \IPS\Request::i()->block_plugin ) )
if ( isset( $data['block_plugin'] ) )
{
$block = new \IPS\cms\Blocks\Block;
$block->type = "plugin";
$block->plugin = \IPS\Request::i()->block_plugin;
$block->plugin_app = ( isset( \IPS\Request::i()->block_plugin_app ) ) ? \IPS\Request::i()->block_plugin_app : \IPS\Request::i()->block_app;
$block->plugin_plugin = \IPS\Request::i()->block_plugin_plugin;
$block->plugin = $data['block_plugin'];
$block->plugin_app = ( isset( $data['block_plugin_app'] ) ) ? $data['block_plugin_app'] : $data['block_app'];
if( isset( $data['block_plugin_plugin'] ) )
{
$block->plugin_plugin = $data['block_plugin_plugin'];
}
$block->key = md5( mt_rand() );
$params = array();
$block->content = NULL;
if ( isset( \IPS\Request::i()->_sending ) )
if ( isset( $data['_sending'] ) )
{
foreach( explode( ",", \IPS\Request::i()->_sending ) as $field )
foreach( explode( ",", $data['_sending'] ) as $field )
{
/* Multi-Selects will pass their parameters through as an array, so we need to make sure we check those properly to include all options. */
if ( mb_strstr( $field, '[]' ) !== FALSE )
@@ -59,15 +83,15 @@ class _builder extends \IPS\core\modules\front\system\widgets
$isArray = FALSE;
}
if ( $field and isset( \IPS\Request::i()->$field ) )
if ( $field and isset( $data[ $field ] ) )
{
if ( $field == 'block_content' )
{
$block->content = \IPS\Request::i()->$field;
$block->content = $data[ $field ];
if ( isset( \IPS\Request::i()->template_params ) )
if ( isset( $data['template_params'] ) )
{
$block->template_params = \IPS\Request::i()->template_params;
$block->template_params = $data['template_params'];
}
continue;
}
@@ -75,35 +99,35 @@ class _builder extends \IPS\core\modules\front\system\widgets
if( mb_strpos( $field, "widget_feed_container_" ) !== FALSE )
{
/* On means that the all checkbox is ticked */
$params[ 'widget_feed_container'] = \IPS\Request::i()->$field == 'on' ? 0 : ( \is_array( \IPS\Request::i()->$field ) ? \IPS\Request::i()->$field : explode( ',', \IPS\Request::i()->$field ) );
$params[ 'widget_feed_container'] = $data[ $field ] == 'on' ? 0 : ( \is_array( $data[ $field ] ) ? $data[ $field ] : explode( ',', $data[ $field ] ) );
continue;
}
/* We need to handle tags special */
if( $field == 'widget_feed_tags' )
{
$params[ $field ] = \IPS\Request::i()->$field ? explode( ',', \IPS\Request::i()->$field ) : array();
$params[ $field ] = $data[ $field ] ? explode( ',', $data[ $field ] ) : array();
continue;
}
/* We need to handle authors special */
if( $field == 'widget_feed_author' )
{
$params[ $field ] = \IPS\Request::i()->$field ? array( \IPS\Member::load( \IPS\Request::i()->$field, 'name' )->member_id ) : array();
$params[ $field ] = $data[ $field ] ? array( \IPS\Member::load( $data[ $field ], 'name' )->member_id ) : array();
continue;
}
/* Is it an array? */
if ( $isArray )
{
foreach( \IPS\Request::i()->$field AS $multi )
foreach( $data[ $field ] AS $multi )
{
$params[ $field ][] = $multi;
}
continue;
}
$params[ $field ] = \IPS\Request::i()->$field;
$params[ $field ] = $data[ $field ];
}
}
}
@@ -111,7 +135,7 @@ class _builder extends \IPS\core\modules\front\system\widgets
$block->plugin_config = json_encode( $params );
/* Template stuffs */
if ( \IPS\Request::i()->block_template_use_how == 'copy' )
if ( $data['block_template_use_how'] == 'copy' )
{
$block->widget()->template( array( $block, 'getTemplate' ) );
}
+34 -30
View File
@@ -63,43 +63,47 @@ class _page extends \IPS\Dispatcher\Controller
if ( \IPS\Request::i()->path == $page->full_path )
{
/* Did we have a trailing slash? */
if ( \IPS\Settings::i()->htaccess_mod_rewrite and mb_substr( \IPS\Request::i()->url()->data[ \IPS\Http\Url::COMPONENT_PATH ], -1 ) != '/' )
/* Are we using Friendly URL's at all? */
if ( \IPS\Settings::i()->use_friendly_urls )
{
$url = $page->url();
foreach( \IPS\Request::i()->url()->queryString as $k => $v )
/* Did we have a trailing slash? */
if ( \IPS\Settings::i()->htaccess_mod_rewrite and mb_substr( \IPS\Request::i()->url()->data[ \IPS\Http\Url::COMPONENT_PATH ], -1 ) != '/' )
{
$url = $url->setQueryString( $k, $v );
}
if ( ! empty( \IPS\Request::i()->url()->fragment ) )
{
$url = $url->setFragment( \IPS\Request::i()->url()->fragment );
}
\IPS\Output::i()->redirect( $url, NULL, 301 );
}
else if ( ! \IPS\Settings::i()->htaccess_mod_rewrite and ! mb_strstr( \IPS\Request::i()->url()->data[ \IPS\Http\Url::COMPONENT_QUERY ], $page->url()->data[ \IPS\Http\Url::COMPONENT_QUERY ] ) )
{
$url = $page->url();
foreach( \IPS\Request::i()->url()->queryString as $k => $v )
{
if ( mb_substr( $k, 0, 1 ) == '/' and mb_substr( $k, -1 ) != '/' )
$url = $page->url();
foreach( \IPS\Request::i()->url()->queryString as $k => $v )
{
$k .= '/';
$url = $url->setQueryString( $k, $v );
}
if ( ! empty( \IPS\Request::i()->url()->fragment ) )
{
$url = $url->setFragment( \IPS\Request::i()->url()->fragment );
}
\IPS\Output::i()->redirect( $url, NULL, 301 );
}
$url = $url->setQueryString( $k, $v );
if ( ! empty( \IPS\Request::i()->url()->fragment ) )
else if ( ! \IPS\Settings::i()->htaccess_mod_rewrite and ! mb_strstr( \IPS\Request::i()->url()->data[ \IPS\Http\Url::COMPONENT_QUERY ], $page->url()->data[ \IPS\Http\Url::COMPONENT_QUERY ] ) )
{
$url = $url->setFragment( \IPS\Request::i()->url()->fragment );
$url = $page->url();
foreach( \IPS\Request::i()->url()->queryString as $k => $v )
{
if ( mb_substr( $k, 0, 1 ) == '/' and mb_substr( $k, -1 ) != '/' )
{
$k .= '/';
}
}
$url = $url->setQueryString( $k, $v );
if ( ! empty( \IPS\Request::i()->url()->fragment ) )
{
$url = $url->setFragment( \IPS\Request::i()->url()->fragment );
}
\IPS\Output::i()->redirect( $url, NULL, 301 );
}
\IPS\Output::i()->redirect( $url, NULL, 301 );
}
/* Just viewing this page, no database categories or records */