Version 5.0.0 beta 2

This commit is contained in:
Neo committed 2025-12-19 16:39:01 -08:00
1 parent 15c7beabc5
commit f61b0da85d
181 files changed
+3182 -1533

No files matched your search

+13 -6
View File
@@ -390,12 +390,19 @@ class Application extends SystemApplication
continue;
}
$block = Widget::load( $this, 'RecordFeed' . $db->id, mt_rand(), array(), $widget['restrict'] );
$block->allowReuse = (boolean) $widget['allow_reuse'];
$block->menuStyle = $widget['menu_style'];
$block->allowCustomPadding = (bool) $widget['padding'];
$block->layouts = $block->getSupportedLayouts();
$blocks[] = $block;
try
{
$block = Widget::load( $this, 'RecordFeed' . $db->id, mt_rand(), array(), $widget['restrict'] );
$block->allowReuse = (boolean)$widget['allow_reuse'];
$block->menuStyle = $widget['menu_style'];
$block->allowCustomPadding = (bool)$widget['padding'];
$block->layouts = $block->getSupportedLayouts();
$blocks[] = $block;
}
catch ( Exception $e )
{
continue;
}
}
}
+9 -2
View File
@@ -110,7 +110,6 @@ class comments extends CommentController
{
throw new OutOfRangeException;
}
$this->class = 'IPS\cms\Records\Comment' . $database->id;
}
catch ( OutOfRangeException $e )
{
@@ -220,6 +219,14 @@ class comments extends CommentController
{
throw new Exception( 'INVALID_ID', '2T311/5', 403 );
}
if( $record->useForumComments() )
{
$this->class = 'IPS\cms\Records\CommentTopicSync' . $database->id;
}
else
{
$this->class = 'IPS\cms\Records\Comment' . $database->id;
}
/* Get author */
if ( $this->member )
@@ -242,7 +249,7 @@ class comments extends CommentController
}
else
{
if ( Request::i()->author === 0 )
if ( (int) Request::i()->author === 0 )
{
$author = new Member;
$author->name = Request::i()->author_name;
+1 -1
View File
@@ -281,7 +281,7 @@ class records extends ItemController
}
else
{
if ( Request::i()->author === 0 )
if ( (int) Request::i()->author === 0 )
{
$author = new Member;
$author->name = Request::i()->author_name;
+1 -1
View File
@@ -247,7 +247,7 @@ class reviews extends CommentController
}
else
{
if ( Request::i()->author === 0 )
if ( (int) Request::i()->author === 0 )
{
$author = new Member;
$author->name = Request::i()->author_name;
+2 -2
View File
@@ -1463,7 +1463,7 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $review->getVie
 
{lang="or"}
 
<input type="checkbox" role='checkbox' data-control="unlimited{{if $input->toggles AND \count( $input->toggles )}} toggle{{endif}}" name="{$input->name}_unlimited" id='{$input->name}_unlimited' value="{$input->options['unlimited']}" {{if $input->options['unlimited'] === $input->value}}checked aria-checked='true'{{endif}} {{if $input->options['disabled']}}disabled{{endif}} {{if $input->toggles AND \count( $input->toggles )}}{{if $input->toggleOn === FALSE}}data-togglesOff{{else}}data-togglesOn{{endif}}="{expression="implode( ',', $input->toggles )"}"{{endif}} aria-labelledby='label_{$input->name}_unlimited' class="ipsInput ipsInput--toggle">
<input type="checkbox" role='checkbox' data-control="unlimited{{if $input->toggles AND \count( $input->toggles )}} toggle{{endif}}" name="{$input->name}_unlimited" id='{$input->name}_unlimited' value="{$input->options['unlimited']}" {{if $input->options['unlimited'] === $input->value}}checked{{endif}} {{if $input->options['disabled']}}disabled{{endif}} {{if $input->toggles AND \count( $input->toggles )}}{{if $input->toggleOn === FALSE}}data-togglesOff{{else}}data-togglesOn{{endif}}="{expression="implode( ',', $input->toggles )"}"{{endif}} aria-labelledby='label_{$input->name}_unlimited' class="ipsInput ipsInput--toggle">
<label for='{$input->name}_unlimited' id='label_{$input->name}_unlimited' class='ipsField_unlimited'>{lang="never"}</label>
{{endif}}
</li>
@@ -1616,7 +1616,7 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $review->getVie
&nbsp;
{lang="or"}
&nbsp;
<input type="checkbox" role='checkbox' data-control="unlimited{{if \count( $input->toggles )}} toggle{{endif}}" name="{$input->name}_unlimited" id='{$input->name}_unlimited' value="{$input->options['unlimited']}" {{if $input->options['unlimited'] === $input->value}}checked aria-checked='true'{{endif}} {{if $input->options['disabled']}}disabled{{endif}} {{if \count( $input->toggles )}}{{if $input->toggleOn === FALSE}}data-togglesOff{{else}}data-togglesOn{{endif}}="{expression="implode( ',', $input->toggles )"}"{{endif}} aria-labelledby='label_{$input->name}_unlimited' class="ipsInput ipsInput--toggle">
<input type="checkbox" role='checkbox' data-control="unlimited{{if \count( $input->toggles )}} toggle{{endif}}" name="{$input->name}_unlimited" id='{$input->name}_unlimited' value="{$input->options['unlimited']}" {{if $input->options['unlimited'] === $input->value}}checked{{endif}} {{if $input->options['disabled']}}disabled{{endif}} {{if \count( $input->toggles )}}{{if $input->toggleOn === FALSE}}data-togglesOff{{else}}data-togglesOn{{endif}}="{expression="implode( ',', $input->toggles )"}"{{endif}} aria-labelledby='label_{$input->name}_unlimited' class="ipsInput ipsInput--toggle">
<label for='{$input->name}_unlimited' id='label_{$input->name}_unlimited' class='ipsField_unlimited'>{lang="never"}</label>
{{endif}}
</li>
+19 -19
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<javascript app="cms">
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/blocks" javascript_name="ips.blocks.form.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000100"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/blocks" javascript_name="ips.blocks.form.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000100"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -67,7 +67,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/blocks" javascript_name="ips.blocks.navigation.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000050"><![CDATA[/*
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/blocks" javascript_name="ips.blocks.navigation.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000050"><![CDATA[/*
+--------------------------------------------------------------------------
|
| =============================================
@@ -112,7 +112,7 @@
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000150">/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000150">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -157,7 +157,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000150"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000150"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -233,7 +233,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000150"><![CDATA[/**
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000150"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -368,7 +368,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000200"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000200"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -431,7 +431,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000300"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000300"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1071,7 +1071,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000250"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000250"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1106,7 +1106,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000250"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000250"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1228,7 +1228,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000100"><![CDATA[/**
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000100"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1340,7 +1340,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000100">/**
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1395,7 +1395,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000050">/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1445,7 +1445,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000050">/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1517,7 +1517,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000050"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -2478,7 +2478,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000050"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -2770,7 +2770,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000050"><![CDATA[/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -2939,7 +2939,7 @@
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="5000026" javascript_position="1000050">/**
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="5000028" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -2984,7 +2984,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="5000026" javascript_position="1000050"><![CDATA[ips.templates.set( 'templates.media.grid', "\
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="5000028" javascript_position="1000050"><![CDATA[ips.templates.set( 'templates.media.grid', "\
<ul class='ipsGrid ipsGrid--pages-media'>\
{{{contents}}}\
</ul>\
@@ -3001,7 +3001,7 @@ ips.templates.set( 'templates.media.noSearchResults', "\
{{#lang}}mediaNoResults{{/lang}}\
</div>\
");]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.templates.js" javascript_type="template" javascript_version="5000026" javascript_position="1000050"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.templates.js" javascript_type="template" javascript_version="5000028" javascript_position="1000050"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
/* TEMPLATECEPTION */
ips.templates.set('templates.editor.newTab', " \
<li data-fileid='{{fileid}}' data-location='{{location}}'>\
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="cms" version="5000026">
<app key="cms" version="5000028">
<word key="__app_cms" js="0">Pages</word>
<word key="menutab__cms" js="0">Pages</word>
<word key="menutab__cms_icon" js="0">file</word>
+3 -1
View File
@@ -593,5 +593,7 @@
"5000023": "5.0.0 Alpha 15",
"5000024": "5.0.0 Alpha 16",
"5000025": "5.0.0 Alpha 16",
"5000026": "5.0.0 Beta 1"
"5000026": "5.0.0 Beta 1",
"5000027": "5.0.0 Beta 2",
"5000028": "5.0.0 Beta 2"
}
@@ -416,6 +416,9 @@ class databases extends Controller
{
$name = NULL;
$desc = NULL;
$displaySettings = [
'index' => [ 'type' => 'categories', 'layout' => 'table' ]
];
if ( $xml->name == 'data' )
{
@@ -423,26 +426,60 @@ class databases extends Controller
$node = new SimpleXMLElement( $xml->readOuterXML() );
foreach( $node->attributes() as $k => $v )
{
$database->$k = (string) $v;
switch( $k )
{
case 'template_listing':
$displaySettings['listing'] = ( $v == 'listing' ) ? [ 'layout' => 'table', 'template' => null ] : [ 'layout' => 'custom', 'template' => (string) $v ];
break;
case 'template_display':
$displaySettings['display'] = [ 'layout' => 'custom', 'template' => (string) $v ];
break;
case 'template_form':
$displaySettings['form'] = [ 'layout' => 'custom', 'template' => (string) $v ];
break;
case 'template_categories':
$displaySettings['categories'] = ( $v == 'category_index' ) ? [ 'layout' => 'table', 'template' => null ] : [ 'layout' => 'custom', 'template' => (string) $v ];
break;
case 'template_featured':
break;
case 'cat_index_type':
if( $v )
{
$displaySettings['index'] = [ 'type' => 'all', 'layout' => 'grid' ];
}
break;
default:
$database->$k = (string) $v;
break;
}
}
/* Any kids of your own? */
foreach( $node->children() as $k => $v )
{
if ( $k === 'name' )
switch( $k )
{
$name = $v;
}
else if ( $k === 'description' )
{
$desc = $v;
}
else
{
$tryJson = json_decode( $v, TRUE );
$database->$k = ( $tryJson ) ?: (string) $v;
case 'name':
$name = $v;
break;
case 'description':
$desc = $v;
break;
case 'featured_settings':
$json = json_decode( $v, true );
if( isset( $json['featured'] ) and $json['featured'] )
{
$displaySettings['index']['type'] = 'featured';
}
break;
default:
$tryJson = json_decode( $v, TRUE );
$database->$k = ( $tryJson ) ?: (string) $v;
break;
}
}
$database->display_settings = $displaySettings;
Lang::saveCustom( 'cms', "content_db_" . $database->id, $name );
Lang::saveCustom( 'cms', "content_db_" . $database->id . '_desc', $desc );
@@ -650,8 +687,18 @@ class databases extends Controller
}
else
{
$attrs[ $k ] = ( $k == 'category_parent_id' ) ? (int) $v : (string) $v;
switch( $k )
{
case 'category_parent_id':
$attrs[ $k ] = (int) $v;
break;
case 'category_club_id': // always null because the club itself is not imported here
$attrs[ $k ] = null;
break;
default:
$attrs[ $k ] = (string) $v;
break;
}
}
}
@@ -697,6 +744,13 @@ class databases extends Controller
}
}
}
/* If the database does not have a default category yet, assign one */
if( !$database->use_categories and !$database->default_category )
{
$database->default_category = $category->id;
$database->save();
}
$cat_map = Store::i()->db_import_cat_map;
$parent_map = Store::i()->db_import_cat_parent_map;
@@ -809,7 +863,7 @@ class databases extends Controller
/* Done */
$data['next'] = $next;
return array( $data, Member::loggedIn()->language()->addToStack('cms_db_import_progress', FALSE, array( 'sprintf' => array( ucfirst( $data['next'] ) ) ) ) );
return array( $data, Member::loggedIn()->language()->addToStack('cms_db_import_progress', FALSE, array( 'sprintf' => array( ucfirst( $data['next'] ?? '' ) ) ) ) );
}
else
{
@@ -993,7 +1047,7 @@ class databases extends Controller
if ( array_key_exists( $k, $fieldSchema['columns'] ) AND ! in_array( $k, $removeFields ) AND ! in_array( $k, $textFields ) )
{
$xml->startAttribute( $k );
$xml->text( $v );
$xml->text( $v ?? '' );
$xml->endAttribute();
}
}
@@ -1040,7 +1094,7 @@ class databases extends Controller
if ( array_key_exists( $k, $categorySchema['columns'] ) AND ! in_array( $k, $removeFields ) AND ! in_array( $k, $textFields ) )
{
$xml->startAttribute( $k );
$xml->text( $v );
$xml->text( $v ?? '' );
$xml->endAttribute();
}
}
@@ -25,6 +25,7 @@ use IPS\Helpers\Form\Node;
use IPS\Helpers\Form\Upload;
use IPS\Helpers\Tree\Tree;
use IPS\Http\Url;
use IPS\Image;
use IPS\Member;
use IPS\Node\Controller;
use IPS\Output;
@@ -332,8 +333,10 @@ class media extends Controller
{
$form = new Form( 'form', 'upload' );
$form->class = 'ipsForm--vertical ipsForm--upload-items ipsForm_noLabels';
$form->add( new Upload( 'media_filename', NULL, FALSE, array( 'allowedFileTypes' => array_merge( File::$safeFileExtensions, static::$additionalAllowedMediaFileTypes ), 'obscure' => FALSE, 'storageExtension' => 'cms_Media', 'storageContainer' => 'pages_media', 'multiple' => true, 'minimize' => FALSE ), NULL, NULL, NULL, 'media_filename' ) );
$extensions = array_merge( File::$safeFileExtensions, static::$additionalAllowedMediaFileTypes, Image::supportedExtensions() );
sort( $extensions );
$form->add( new Upload( 'media_filename', NULL, FALSE, array( 'allowedFileTypes' => array_values( array_unique( $extensions ) ), 'obscure' => FALSE, 'storageExtension' => 'cms_Media', 'storageContainer' => 'pages_media', 'multiple' => true, 'minimize' => FALSE ), NULL, NULL, NULL, 'media_filename' ) );
if ( ! isset( Request::i()->media_parent ) and ! Request::i()->media_parent )
{
@@ -0,0 +1,22 @@
{
"id": 5000027,
"name": "5.0.0 Beta 2",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeeditor": false,
"javascript": false,
"emailTemplates": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,22 @@
{
"id": 5000028,
"name": "5.0.0 Beta 2",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeeditor": false,
"javascript": false,
"emailTemplates": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -1663,7 +1663,7 @@ class Categories extends Model implements Permissions
*/
public function get_display_settings() : ?array
{
if( $data = json_decode( $this->template_listing, true ) )
if( $this->template_listing and $data = json_decode( $this->template_listing, true ) )
{
return $data;
}
+1 -1
View File
@@ -1654,7 +1654,7 @@ class Fields extends CustomField implements Permissions
}
}
return $value;
return $value ?? '';
}
+10 -7
View File
@@ -42,9 +42,7 @@ use IPS\Helpers\Form\Translatable;
use IPS\Helpers\Form\YesNo;
use IPS\Http\Url;
use IPS\Http\Url\Friendly;
use IPS\IPS;
use IPS\Lang;
use IPS\Log;
use IPS\Member;
use IPS\Member\Group;
use IPS\Node\Model;
@@ -55,7 +53,6 @@ use IPS\Request;
use IPS\Settings;
use IPS\Task;
use IPS\Theme;
use IPS\Widget;
use IPS\Widget\Area;
use LogicException;
use OutOfBoundsException;
@@ -670,7 +667,7 @@ class Page extends Model implements Permissions
try
{
$test = Db::i()->select( '*', 'cms_pages', [ 'page_seo_name=? and page_id <> ? and page_folder_id=?', $val, ( $item ? (int) $item->_id : 0 ), Request::i()->page_folder_id ] )->first();
$test = Db::i()->select( '*', 'cms_pages', [ 'page_seo_name=? and page_id <> ? and page_folder_id=?', $val, ( (int)$item?->_id ), Request::i()->page_folder_id ] )->first();
throw new InvalidArgumentException( 'content_page_file_name_in_use' );
}
catch( UnderflowException )
@@ -695,6 +692,7 @@ class Page extends Model implements Permissions
$wrapperTemplates = array( '_none_' => Member::loggedIn()->language()->addToStack('cms_page_wrapper_template_none') );
foreach( Templates::getTemplates( Templates::RETURN_PAGE + Templates::RETURN_DATABASE_AND_IN_DEV ) as $id => $obj )
{
/* @var Templates $obj */
if ( $obj->isSuitableForCustomWrapper() )
{
$wrapperTemplates[ Templates::readableGroupName( $obj->group ) ][ $obj->group . '__' . $obj->title . '__' . $obj->key ] = Templates::readableGroupName( $obj->title );
@@ -702,9 +700,14 @@ class Page extends Model implements Permissions
}
/* List of templates */
$return['page_wrapper_template'] = new Select( 'page_wrapper_template', ($item?->wrapper_template), FALSE, array(
$return['page_wrapper_template'] = new Select( 'page_wrapper_template', ($item?->wrapper_template), null, array(
'options' => $wrapperTemplates
), NULL, NULL, Theme::i()->getTemplate( 'pages', 'cms', 'admin' )->previewTemplateLink(), 'page_wrapper_template' );
), function( $val ){
if( $val == '_none_' and !Request::i()->page_ipb_wrapper )
{
throw new InvalidArgumentException('form_required');
}
}, NULL, Theme::i()->getTemplate( 'pages', 'cms', 'admin' )->previewTemplateLink(), 'page_wrapper_template' );
if ( count( Theme::themes() ) > 1 )
{
@@ -1609,7 +1612,7 @@ class Page extends Model implements Permissions
$this->storeUrl();
}
$values['page_meta_image'] = ( $values['page_meta_image'] instanceof File ) ? (string) $values['page_meta_image'] : null;
$values['page_meta_image'] = ( isset( $values['page_meta_image'] ) and $values['page_meta_image'] instanceof File ) ? (string) $values['page_meta_image'] : null;
/* Menu stuffs */
if ( isset( $values['page_add_to_menu'] ) )
+1 -2
View File
@@ -3811,8 +3811,7 @@ class Records extends Item implements
*/
function getTopicContent(): mixed
{
$column = 'field_' . static::database()->field_content;
return $this->$column;
return Theme::i()->getTemplate( 'submit', 'cms', 'front' )->topic( $this );
}
/**
@@ -243,35 +243,29 @@ class Templates extends ActiveRecord
return $templates[ $id ];
}
}
try
{
return parent::load( $id, $idField, $extraWhereClause );
}
catch( OutOfRangeException $ex )
{
throw $ex;
}
return parent::load( $id, $idField, $extraWhereClause );
}
/**
* Make a group_name readable (Group Name)
*
* @param string $name Group name from the database
* @param string|null $name Group name from the database
* @return string
*/
public static function readableGroupName( string $name ) : string
public static function readableGroupName( ?string $name ) : string
{
if ( $name === 'js' )
switch( $name )
{
return 'JS';
case null:
return '';
case 'js':
return 'JS';
case 'css':
return 'CSS';
default:
return ucwords( str_replace( array( '-', '_' ), ' ', $name ) );
}
else if ( $name === 'css' )
{
return 'CSS';
}
return ucwords( str_replace( array( '-', '_' ), ' ', $name ) );
}
/**
+8
View File
@@ -26,6 +26,7 @@ use IPS\Member;
use IPS\Request;
use IPS\Settings;
use IPS\Theme;
use IPS\Widget\Polymorphic;
use OutOfRangeException;
use function count;
use function defined;
@@ -44,7 +45,14 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
* RecordFeed Widget
*/
class RecordFeed extends Widget
implements Polymorphic
{
public static function getBaseKey(): string
{
return "RecordFeed";
}
/**
* @brief Widget Key
*/