Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

+63 -2
View File
@@ -117,6 +117,12 @@ PHP;
if ( mb_substr( $class, 0, 23 ) === 'IPS\cms\Records\Comment' and is_numeric( mb_substr( $class, 23, 1 ) ) )
{
$databaseId = intval( mb_substr( $class, 23 ) );
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
return false;
}
$data = <<<PHP
namespace IPS\cms\Records;
@@ -136,6 +142,12 @@ PHP;
if ( mb_substr( $class, 0, 22 ) === 'IPS\cms\Records\Review' and is_numeric( mb_substr( $class, 22, 1 ) ) )
{
$databaseId = intval( mb_substr( $class, 22 ) );
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
return false;
}
$data = <<<PHP
namespace IPS\cms\Records;
@@ -155,8 +167,7 @@ PHP;
if ( mb_substr( $class, 0, 18 ) === 'IPS\cms\Categories' and is_numeric( mb_substr( $class, 18, 1 ) ) )
{
$databaseId = intval( mb_substr( $class, 18 ) );
$databases = Databases::databases();
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
@@ -194,6 +205,12 @@ PHP;
if ( mb_substr( $class, 0, 32 ) === 'IPS\cms\Records\RecordsTopicSync' )
{
$databaseId = intval( mb_substr( $class, 32 ) );
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
return false;
}
$data = <<<PHP
namespace IPS\cms\Records;
@@ -218,6 +235,12 @@ PHP;
if ( mb_substr( $class, 0, 32 ) === 'IPS\cms\Records\CommentTopicSync' )
{
$databaseId = intval( mb_substr( $class, 32 ) );
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
return false;
}
$data = <<<PHP
namespace IPS\cms\Records;
@@ -236,18 +259,39 @@ PHP;
if ( mb_substr( $class, 0, 14 ) === 'IPS\cms\Fields' and is_numeric( mb_substr( $class, 14, 1 ) ) )
{
$databaseId = intval( mb_substr( $class, 14 ) );
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
return false;
}
eval( "namespace IPS\\cms; class Fields{$databaseId} extends Fields { public static ?int \$customDatabaseId = $databaseId; protected array \$caches = array( 'database_reciprocal_links', 'cms_fieldids_{$databaseId}' ); }" );
}
if ( mb_substr( $class, 0, 47 ) === 'IPS\cms\extensions\core\EditorLocations\Records' and is_numeric( mb_substr( $class, 47, 1 ) ) )
{
$databaseId = intval( mb_substr( $class, 47 ) );
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
return false;
}
eval( "namespace IPS\\cms\\extensions\\core\\EditorLocations; class Records{$databaseId} extends \\IPS\\cms\\extensions\\core\\EditorLocations\\Records { public static ?int \$customDatabaseId = $databaseId; public static bool \$buttonLocation = TRUE; }" );
}
if( mb_substr( $class, 0, 26 ) == 'IPS\cms\widgets\RecordFeed' )
{
$databaseId = intval( mb_substr( $class, 26 ) );
$databases = Databases::databases();
if ( ! isset( $databases[ $databaseId ] ) )
{
return false;
}
$data = <<<PHP
namespace IPS\cms\widgets;
class RecordFeed{$databaseId} extends RecordFeed {
@@ -779,4 +823,21 @@ HTML;
'activityTabs' => array()
);
}
/**
* Database check
*
* @return array Queries needed to correct database in the following format ( table => x, query = x );
*/
public function databaseCheck(): array
{
$response = parent::databaseCheck();
foreach( Databases::databases() as $db )
{
Databases::checkandFixDatabaseSchema( $db->_id );
}
return $response;
}
}
+56 -31
View File
@@ -94,7 +94,7 @@
</ul>
{{endif}}
<section class='ipsCmsEntries {{if !$database->featured_settings['pagination'] || $pagination['page'] === 1}}ipsCmsEntries--feature{{endif}} ipsCmsEntries--2'>
<section class='ipsCmsEntries {{if $pagination['page'] === 1}}ipsCmsEntries--feature{{endif}} ipsCmsEntries--2'>
{{if \count($articles)}}
{{foreach $articles as $id => $record}}
{{if $id === 0 && $pagination['page'] === 1}}
@@ -105,8 +105,8 @@
{{endforeach}}
{{endif}}
</section>
{{if $database->featured_settings['pagination'] and ( $pagination['pages'] > 1 )}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], $database->featured_settings['perpage'], TRUE, 'page'"}
{{if $pagination['pages'] > 1}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], ( $database->field_perpage ?? 25 ), TRUE, 'page'"}
{{endif}}]]></template>
<template template_key="database_category_2_column_image_feature_entry" template_title="entry" template_desc="" template_location="database" template_group="category_2_column_image_feature" template_params="$record, $database" template_app="" template_type="template"><![CDATA[<article class='ipsCmsEntries__item ipsBox {{if $record->hidden()}}ipsModerated{{endif}}'>
<div class="ipsCmsEntries__align">
@@ -212,8 +212,8 @@
{{endforeach}}
{{endif}}
</section>
{{if $database->featured_settings['pagination'] and ( $pagination['pages'] > 1 )}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], $database->featured_settings['perpage'], TRUE, 'page'"}
{{if $pagination['pages'] > 1 }}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], ( $database->field_perpage ?? 25 ), TRUE, 'page'"}
{{endif}}]]></template>
<template template_key="database_category_3_column_first_featured_entry" template_title="entry" template_desc="" template_location="database" template_group="category_3_column_first_featured" template_params="$record, $database, $id, $featured = TRUE" template_app="" template_type="template"><![CDATA[<article class='ipsCmsEntries__item ipsBox {{if $record->hidden()}}ipsModerated{{endif}} {{if $featured}}ipsCmsEntries__item--featured{{endif}}'>
<div class="ipsCmsEntries__align">
@@ -309,7 +309,7 @@
</ul>
{{endif}}
<section class='ipsCmsEntries {{if !$database->featured_settings['pagination'] || $pagination['page'] === 1}}ipsCmsEntries--feature{{endif}} ipsCmsEntries--3'>
<section class='ipsCmsEntries {{if $pagination['page'] === 1}}ipsCmsEntries--feature{{endif}} ipsCmsEntries--3'>
{{if \count($articles)}}
{{foreach $articles as $id => $record}}
{{if $id === 0 && $pagination['page'] === 1}}
@@ -320,8 +320,8 @@
{{endforeach}}
{{endif}}
</section>
{{if $database->featured_settings['pagination'] and ( $pagination['pages'] > 1 )}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], $database->featured_settings['perpage'], TRUE, 'page'"}
{{if $pagination['pages'] > 1}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], ( $database->field_perpage ?? 25 ), TRUE, 'page'"}
{{endif}}]]></template>
<template template_key="database_category_3_column_image_feature_entry" template_title="entry" template_desc="" template_location="database" template_group="category_3_column_image_feature" template_params="$record, $database" template_app="" template_type="template"><![CDATA[<article class='ipsCmsEntries__item ipsBox {{if $record->hidden()}}ipsModerated{{endif}}'>
<div class="ipsCmsEntries__align">
@@ -424,8 +424,8 @@
{{endforeach}}
{{endif}}
</section>
{{if $database->featured_settings['pagination'] and ( $pagination['pages'] > 1 )}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], $database->featured_settings['perpage'], TRUE, 'page'"}
{{if $pagination['pages'] > 1}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], ( $database->field_perpage ?? 25 ), TRUE, 'page'"}
{{endif}}]]></template>
<template template_key="database_category_articles_entry" template_title="entry" template_desc="" template_location="database" template_group="category_articles" template_params="$record, $database" template_app="" template_type="template"><![CDATA[<article class="ipsData__item {{if $record->hidden()}}ipsModerated{{endif}}" {{if $record->unread()}}data-ips-unread{{else}}data-ips-read{{endif}}>
<a href='{$record->url( "getPrefComment" )}' class="ipsLinkPanel" aria-hidden="true" tabindex="-1"><span>{wordbreak="$record->_title"}</span></a>
@@ -550,7 +550,7 @@
{{if $image = $category->primaryImage()}}
<img src="{$image->url}" alt="" loading="lazy">
{{else}}
<i></i>
<span class='ipsIcon ipsIcon--fa' aria-hidden="true"><i class="fa-ips"></i></span>
{{endif}}
</figure>
<div class="ipsData__content">
@@ -669,12 +669,23 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $comment->getVi
{{if !$comment->isAnonymous() and $comment->author()->canHaveAchievements() and \IPS\core\Achievements\Rank::show() and $rank = $comment->author()->rank()}}
{$rank->html( 'ipsAvatarStack__rank' )|raw}
{{endif}}
{{if $comment->author()->isOnline() AND ( !$comment->author()->isOnlineAnonymously() OR ( $comment->author()->isOnlineAnonymously() AND \IPS\Member::loggedIn()->isAdmin() ) )}}
<span class='ipsOnline' data-ipsTooltip title='{{if $comment->author()->isOnlineAnonymously()}}{lang="online_now_anon" sprintf="$comment->author()->name"}{{elseif $comment->author()->isOnline()}}{lang="online_now" sprintf="$comment->author()->name"}{{endif}}'></span>
{{endif}}
</div>
<div class='ipsPhotoPanel__text'>
<div class='ipsEntry__username'>
<h3>{template="userLink" app="core" group="global" params="$comment->author(), $comment->warningRef(), NULL, $comment->isAnonymous()"}</h3>
{{if !$comment->isAnonymous()}}
<span class='ipsEntry__group'>{expression="\IPS\Member\Group::load( $comment->author()->member_group_id )->formattedName" raw="true"}</span>
<span class='ipsEntry__group'>
{{if $comment->author()->modShowBadge()}}
<a href='{url="app=core&module=staffdirectory&controller=directory" seoTemplate="staffdirectory"}' class="ipsEntry__moderatorBadge" data-ipsTooltip title='{lang="member_is_moderator" sprintf="$comment->author()->name"}'>
{expression="\IPS\Member\Group::load( $comment->author()->member_group_id )->formattedName" raw="true"}
</a>
{{else}}
{expression="\IPS\Member\Group::load( $comment->author()->member_group_id )->formattedName" raw="true"}
{{endif}}
</span>
{{endif}}
{{if \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Anonymous' ) and $comment->isAnonymous() and \IPS\Member::loggedIn()->modPermission('can_view_anonymous_posters')}}
<a data-ipsHover data-ipsHover-width="370" data-ipsHover-onClick href="{$comment->url( 'reveal' )->csrf()}"><span class="ipsAnonymousIcon" data-ipsTooltip title='{lang="post_anonymously_reveal"}'></span></a>
@@ -814,16 +825,20 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $comment->getVi
<article id='elComment_{$comment->$idField}' class="ipsEntry js-ipsEntry ipsEntry--simple {{if $otherClasses}}{$otherClasses}{{endif}} {{if (\IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and $comment->isHighlighted()) or $comment->isFeatured()}}ipsEntry--popular{{endif}} {{if $comment->author()->hasHighlightedReplies()}}ipsEntry--highlighted{{endif}} {{if $comment->isIgnored()}}ipsHide{{endif}} {{if $comment->hidden() OR $item->hidden() == -2}}ipsModerated{{endif}}" {{if $comment->author()->hasHighlightedReplies()}}data-memberGroup="{$comment->author()->member_group_id}"{{endif}}>
{template="comment" group="display" location="database" app="cms" params="$item, $comment, $item::$formLangPrefix . 'comment', $item::$application, $item::$module, $itemClassSafe"}
</article>]]></template>
<template template_key="database_display_comments" template_title="comments" template_desc="" template_location="database" template_group="display" template_params="$record" template_app="" template_type="template"><![CDATA[<div data-controller='core.front.core.commentFeed, core.front.core.ignoredComments' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-commentsType='comments' data-baseURL='{$record->url()}' {{if $record->isLastPage()}}data-lastPage{{endif}} data-feedID='{$record->feedId}' id='comments'>
<template template_key="database_display_comments" template_title="comments" template_desc="" template_location="database" template_group="display" template_params="$record" template_app="" template_type="template"><![CDATA[<div data-controller='core.front.core.commentFeed, core.front.core.ignoredComments' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-commentsType='comments' data-baseURL='{$record->url()}' {{if $record->isLastPage()}}data-lastPage{{endif}} data-feedID='{$record->feedId}' id='comments' data-follow-area-id="records{$record::$customDatabaseId}-{$record->primary_id_field}">
{template="featuredComments" group="global" app="core" params="$record->featuredComments(), $record->url()->setQueryString('tab', 'comments')->setQueryString('recommended', 'comments'), 'recommended_replies', '__defart_comment', false"}
<div class='ipsButtonBar ipsButtonBar--top'>
{{if $record->commentPageCount() > 1}}
<div class='ipsButtonBar__pagination'>{$record->commentPagination( array('tab') )|raw}</div>
{{endif}}
<div class='ipsButtonBar__end'>{template="commentMultimodHeader" app="core" group="global" params="$record, '#comments'"}</div>
</div>
{{if $record->commentPageCount() > 1 OR \count( $record->commentMultimodActions())}}
<div class='ipsButtonBar ipsButtonBar--top'>
{{if $record->commentPageCount() > 1}}
<div class='ipsButtonBar__pagination'>{$record->commentPagination( array('tab') )|raw}</div>
{{endif}}
{{if \count( $record->commentMultimodActions() )}}
<div class='ipsButtonBar__end'>{template="commentMultimodHeader" app="core" group="global" params="$record, '#comments'"}</div>
{{endif}}
</div>
{{endif}}
<div data-role='commentFeed' data-controller='core.front.core.moderation'>
<form action="{$record->url()->csrf()->setQueryString( 'do', 'multimodComment' )->setPage('page',\IPS\Request::i()->page)}" method="post" data-ipsPageAction data-role='moderationTools'>
@@ -1038,7 +1053,7 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $comment->getVi
{{if $commentsAndReviews}}
<h2 class='ipsHide'>{lang="user_feedback"}</h2>
<div class='ipsBox ipsBox--commentsAndReviews ipsPull' id="replies">
<div class='ipsBox ipsBox--commentsAndReviews ipsBox--clip ipsPull' id="replies">
{$commentsAndReviews|raw}
</div>
{{endif}}
@@ -1052,7 +1067,7 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $comment->getVi
]]></template>
<template template_key="database_display_recordEditLine" template_title="recordEditLine" template_desc="" template_location="database" template_group="display" template_params="$record" template_app="" template_type="template"><![CDATA[
<p class='i-color_soft i-font-size_-1 ipsEdited' data-excludequote data-el='edited'>
<i class="fa-regular fa-pen-to-square i-margin-end_icon"></i> <strong class='i-font-weight_500'>{lang="date_edited" htmlsprintf="\IPS\DateTime::ts( $record->record_edit_time )->html(FALSE), htmlspecialchars( $record->record_edit_member_name, ENT_QUOTES | ENT_DISALLOWED, 'UTF-8', FALSE )"}</strong>
<i class="fa-solid fa-pen-to-square i-margin-end_icon"></i> <strong class='i-font-weight_500'>{lang="date_edited" htmlsprintf="\IPS\DateTime::ts( $record->record_edit_time )->html(FALSE), htmlspecialchars( $record->record_edit_member_name, ENT_QUOTES | ENT_DISALLOWED, 'UTF-8', FALSE )"}</strong>
{{if $record->record_edit_reason}}
<br>{$record->record_edit_reason}
{{endif}}
@@ -1082,7 +1097,15 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $review->getVie
<div class='ipsEntry__username'>
<h3>{template="userLink" app="core" group="global" params="$review->author(), $review->warningRef(), NULL, \IPS\IPS::classUsesTrait( $review, 'IPS\Content\Anonymous' ) AND $review->isAnonymous()"}</h3>
{{if \IPS\IPS::classUsesTrait( $review, 'IPS\Content\Anonymous' ) and !$review->isAnonymous()}}
<span class='ipsEntry__group'>{expression="\IPS\Member\Group::load( $review->author()->member_group_id )->formattedName" raw="true"}</span>
<span class='ipsEntry__group'>
{{if $review->author()->modShowBadge()}}
<a href='{url="app=core&module=staffdirectory&controller=directory" seoTemplate="staffdirectory"}' class="ipsEntry__moderatorBadge" data-ipsTooltip title='{lang="member_is_moderator" sprintf="$review->author()->name"}'>
{expression="\IPS\Member\Group::load( $review->author()->member_group_id )->formattedName" raw="true"}
</a>
{{else}}
{expression="\IPS\Member\Group::load( $review->author()->member_group_id )->formattedName" raw="true"}
{{endif}}
</span>
{{endif}}
</div>
<p class='ipsPhotoPanel__secondary'>
@@ -1267,7 +1290,7 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $review->getVie
{template="review" location="database" group="display" app="cms" params="$item, $review, $item::$formLangPrefix . 'review', $item::$application, $item::$module"}
</article>
{{endif}}]]></template>
<template template_key="database_display_reviews" template_title="reviews" template_desc="" template_location="database" template_group="display" template_params="$record" template_app="" template_type="template"><![CDATA[<div data-controller='core.front.core.commentFeed' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-commentsType='reviews' data-baseURL='{$record->url()}' {{if $record->isLastPage('reviews')}}data-lastPage{{endif}} data-feedID='{$record->reviewFeedId}' id='reviews'>
<template template_key="database_display_reviews" template_title="reviews" template_desc="" template_location="database" template_group="display" template_params="$record" template_app="" template_type="template"><![CDATA[<div data-controller='core.front.core.commentFeed' {{if settings.auto_polling_enabled}}data-autoPoll{{endif}} data-commentsType='reviews' data-baseURL='{$record->url()}' {{if $record->isLastPage('reviews')}}data-lastPage{{endif}} data-feedID='{$record->reviewFeedId}' id='reviews' data-follow-area-id="records{$record::$customDatabaseId}-{$record->primary_id_field}">
{{if $record->reviewForm()}}
<div class="ipsComposeAreaWrapper">
{{if $record->locked()}}
@@ -1687,7 +1710,7 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $review->getVie
<div class="ipsBox ipsPull i-margin-bottom_3">
<h2 class='ipsBox__header'>{lang="content_subcategories_title"}</h2>
<i-data>
<ol class="ipsData ipsData--table ipsData--category ipsData--database-listing">
<ol class="ipsData {{if $category::database()->display_settings['categories']['layout'] != 'custom'}}ipsData--{$category::database()->display_settings['categories']['layout']}{{else}}ipsData--table{{endif}} ipsData--category ipsData--database-listing">
{{foreach $category->children() as $cat}}
{template="categoryRow" group="category_index" location="database" app="cms" params="$cat"}
{{endforeach}}
@@ -1960,13 +1983,15 @@ data-view-tracking-data="{expression="base64_encode(json_encode( $review->getVie
{template="groupPostedBadges" group="global" app="core" location="front" params="$row->groupsPosted, 'topic_posted_in_groups'"}
{{endif}}
{{if $row::database()->options['reviews'] and $row->averageReviewRating() > 0}}
<ul class='ipsRating ipsRating_small'>
{{foreach range( 1, \IPS\Settings::i()->reviews_rating_out_of ) as $i}}
<li class='{{if $row->averageReviewRating() >= $i}}ipsRating_on{{else}}ipsRating_off{{endif}}'>
<i class='fa-solid fa-star'></i>
</li>
{{endforeach}}
</ul>
<div class="ipsRating ipsRating_small">
<ul>
{{foreach range( 1, \IPS\Settings::i()->reviews_rating_out_of ) as $i}}
<li class='{{if $row->averageReviewRating() >= $i}}ipsRating_on{{else}}ipsRating_off{{endif}}'>
<i class='fa-solid fa-star'></i>
</li>
{{endforeach}}
</ul>
</div>
{{elseif $row->container()->allow_rating and $row->rating_value > 0}}
{template="rating" group="global" location="front" app="core" params="'small', $row->rating_value, \IPS\Settings::i()->reviews_rating_out_of"}
{{endif}}
+25 -26
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="5000049" 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="5000074" 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="5000049" 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="5000074" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -84,10 +84,10 @@
initialize: function () {
this.on( 'click', 'details', this.loadNavigationItems );
var openSection = $( this.scope ).find( 'details[open]:first' );
if( openSection.length ){
this.loadNavigationItems( null, openSection );
}
let self = this;
$.each(self.scope.find('details[open]'), function(){
self.loadNavigationItems(null,this);
});
},
loadNavigationItems: function (e, details=null) {
@@ -115,7 +115,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="5000049" 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="5000074" javascript_position="1000150">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -160,7 +160,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="5000049" 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="5000074" javascript_position="1000150"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -236,7 +236,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="5000049" 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="5000074" javascript_position="1000150"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -371,7 +371,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="5000049" 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="5000074" javascript_position="1000200"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -408,7 +408,7 @@
// for these, several of the listing/display format options don't apply
if (typeSelector?.value?.match(/^(youtube|spotify|soundcloud)$/i)) {
form
.querySelectorAll("#field_display_listing_json_badge, #field_display_listing_badge_bgcolor, #field_display_listing_badge_color, #field_display_display_json_badge, #field_display_display_badge_bgcolor, #field_display_display_badge_color, #field_display_display_json_where")
.querySelectorAll("#field_display_listing_json_badge, #field_display_listing_badge_bgcolor, #field_display_listing_badge_color, #field_display_display_json_badge, #field_display_display_badge_bgcolor, #field_display_display_badge_color")
.forEach(el => {
e.detail.togglesOff.add(el);
e.detail.togglesOn.delete(el);
@@ -461,7 +461,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="5000049" 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="5000074" javascript_position="1000300"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1100,7 +1100,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="5000049" 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="5000074" javascript_position="1000250"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1135,7 +1135,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="5000049" 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="5000074" javascript_position="1000250"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1257,7 +1257,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="5000049" 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="5000074" javascript_position="1000100"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1369,7 +1369,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="5000049" 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="5000074" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1424,7 +1424,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="5000049" 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="5000074" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1474,7 +1474,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="5000049" 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="5000074" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -1546,7 +1546,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="5000049" 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="5000074" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -2507,7 +2507,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="5000049" 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="5000074" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -2799,7 +2799,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="5000049" 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="5000074" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -2968,7 +2968,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="5000049" 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="5000074" javascript_position="1000050">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
@@ -3013,7 +3013,7 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="5000049" 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="5000074" javascript_position="1000050"><![CDATA[ips.templates.set( 'templates.media.grid', "\
<ul class='ipsGrid ipsGrid--pages-media'>\
{{{contents}}}\
</ul>\
@@ -3030,7 +3030,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="5000049" 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="5000074" javascript_position="1000050"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
/* TEMPLATECEPTION */
ips.templates.set('templates.editor.newTab', " \
<a href='#' class='ipsTabs__tab' id='ipsTabs_elTemplateEditor_tabbar_tab_{{fileid}}' role='tab' aria-controls='ipsTabs_elTemplateEditor_tabbar_tab_{{fileid}}_panel' aria-selected='false' data-fileid='{{fileid}}' data-location='{{location}}'>{{title}} <span data-action='closeTab'><i class='fa-solid fa-xmark'></i></span></a>\
@@ -3080,8 +3080,7 @@ mustache
Debug.js
app.js</order>
<order app="global" path="/dev/js//library//jquery">jquery.js
jquery-migrate.js
jquery.transform.js</order>
jquery-migrate.js</order>
<order app="global" path="/dev/js//library//linkify">linkify.min.js
linkify-jquery.min.js</order>
</javascript>
+4 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="cms" version="5000049">
<app key="cms" version="5000074">
<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>
@@ -1110,6 +1110,9 @@
<word key="pagebuilderupload_urls" js="0">URLs</word>
<word key="pagebuilderupload_urls_desc" js="0">These must be ordered the same as the uploaded photos</word>
<word key="pagebuilderupload_height" js="0">Block Height</word>
<word key="pagebuilderupload_backdrop" js="0">Apply Backdrop</word>
<word key="pagebuilderupload_backdrop_desc" js="0">Use a backdrop behind the image so that it better stands out from the background</word>
<word key="pagebuilderupload_tab" js="0">Open links in new tab</word>
<word key="cms_download_db" js="1">Download Database</word>
<word key="cms_download_db_explain" js="1"><![CDATA[This will download a file with the database settings, templates, custom fields and categories which can be uploaded to another community.<br>Records are <em>not</em> included.]]></word>
<word key="index_as_categories" js="1">Show categories</word>
+19 -17
View File
@@ -83,7 +83,7 @@
</div>]]></template>
<template template_group="blocks" template_name="previewTemplateLink" template_data="$plugin" template_location="admin" template_app="cms"><![CDATA[<span data-role="viewTemplate" data-plugin="{$plugin}" class='ipsButton ipsButton--inherit ipsButton--tiny'>{lang="cms_block_view_template"}</span>]]></template>
<template template_group="blocks" template_name="rowHtml" template_data="$block" template_location="admin" template_app="cms"><![CDATA[{{if $block->category}}
<span class="ipsBadge ipsBadge--new">{lang="cms_block_list_key" sprintf="$block->key"}</span>
<span class="ipsBadge ipsBadge--new i-text-transform_none">{lang="cms_block_list_key" sprintf="$block->key"}</span>
{{if $pages = $block->getPages()}}
<div class="i-flex i-gap_1 i-flex-wrap_wrap i-margin-top_2 i-link-color_inherit">
<span class="i-color_soft">{lang="cms_block_list_pages"}</span>
@@ -139,8 +139,8 @@
<div class="ipsBox ipsBox--padding">{lang="cms_no_records_to_show" sprintf="\IPS\cms\Databases::load( \IPS\cms\Databases\Dispatcher::i()->databaseId )->recordWord()"}</div>
{{endif}}
</section>
{{if $database->featured_settings['pagination'] and ( $pagination['pages'] > 1 )}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], $database->featured_settings['perpage'], TRUE, 'page'"}
{{if $pagination['pages'] > 1}}
{template="pagination" app="core" location="global" group="global" params="$url, $pagination['pages'], $pagination['page'], ( $database->field_perpage ?? 25 ), TRUE, 'page'"}
{{endif}}]]></template>
<template template_group="databases" template_name="downloadDialog" template_data="$database" template_location="admin" template_app="cms"><![CDATA[<div class='ipsBox i-padding_3'>
<i class="fa-solid fa-download ipsAlert_icon"></i>
@@ -1168,7 +1168,7 @@
<li>
<a href="{$category->url()}" class='ipsSideMenu_item'>
<strong class='ipsSideMenu__text'>{$category->_title}</strong>
<span>{expression="\IPS\cms\Records::contentCount( $category )"}</span>
<span class="ipsSideMenu__count">{expression="\IPS\cms\Records::contentCount( $category )"}</span>
</a>
{{if $category->hasChildren()}}
<ul class="ipsSideMenu__list">
@@ -1182,7 +1182,7 @@
{{else}}
<a href="{$subcategory->url()}" class='ipsSideMenu_item'>
<span class='ipsSideMenu__text'>{$subcategory->_title}</span>
<span>{expression="\IPS\cms\Records::contentCount( $subcategory )"}</span>
<span class="ipsSideMenu__count">{expression="\IPS\cms\Records::contentCount( $subcategory )"}</span>
</a>
{{endif}}
</li>
@@ -1250,7 +1250,7 @@
<template template_group="widgets" template_name="folderNavigationItems" template_data="$items" template_location="front" template_app="cms"><![CDATA[{{foreach $items as $item}}
<a href='{$item->url()}'>{$item->_title}</a>
{{endforeach}}]]></template>
<template template_group="widgets" template_name="navigationLine" template_data="$container, $title=null, $currentContainer=null" template_location="front" template_app="cms"><![CDATA[<details {{if $container->_id == $currentContainer}}open{{endif}} data-container="{$container->_id}">
<template template_group="widgets" template_name="navigationLine" template_data="$container, $title=null, $currentContainer=null" template_location="front" template_app="cms"><![CDATA[<details {{if $currentContainer !== null and \in_array( $container->_id, $currentContainer )}}open{{endif}} data-container="{$container->_id}">
<summary>{{if $title}}{$title}{{else}}{$container->_title}{{endif}}</summary>
{{if $container->hasChildren( 'view', null, false )}}
{{foreach $container->children( 'view', null, false ) as $child}}
@@ -1261,11 +1261,11 @@
</details>]]></template>
<template template_group="widgets" template_name="pagebuilderoembed" template_data="$video, $layout='table', $isCarousel=false" template_location="front" template_app="cms"><![CDATA[<div class='i-margin-inline_auto'>{$video|raw}</div>]]></template>
<template template_group="widgets" template_name="pagebuildertext" template_data="$text, $layout='table', $isCarousel=false" template_location="front" template_app="cms"><![CDATA[<div>{$text|raw}</div>]]></template>
<template template_group="widgets" template_name="pagebuilderupload" template_data="$images, $captions, $urls, $maxHeight, $layout='table', $isCarousel=false" template_location="front" template_app="cms"><![CDATA[
<template template_group="widgets" template_name="pagebuilderupload" template_data="$images, $captions, $urls, $options, $layout='table', $isCarousel=false" template_location="front" template_app="cms"><![CDATA[
{{if ! \is_array( $images )}}
<figure class="ipsFigure ipsFigure--contain" {{if $maxHeight}}style="--_height: {$maxHeight}px;"{{endif}}>
<figure class="ipsFigure {{if !$options['showBackdrop']}}ipsFigure--transparent{{endif}} ipsFigure--contain" style="{{if $options['showBackdrop']}}--_backdrop: url('{$images}');{{endif}} {{if $options['maxHeight']}}--_height: {$options['maxHeight']}px;{{endif}}">
{{if isset( $urls[0] )}}
<a href="{$urls[0]}" class='ipsFigure__main' aria-label="{$captions[0]}">
<a href="{$urls[0]}" {{if $options['tab']}}target='_blank'{{endif}} class='ipsFigure__main' aria-label="{$captions[0]}">
{{else}}
<div class='ipsFigure__main'>
{{endif}}
@@ -1275,29 +1275,30 @@
{{else}}
</div>
{{endif}}
{{if isset( $captions[0] )}}
{{if !empty( $captions[0] )}}
<figcaption class="ipsFigure__footer i-text-align_center">{$captions[0]}</figcaption>
{{endif}}
</figure>
{{else}}
{{$carouselID = 'page-builder-image-widget_' . mt_rand();}}
<ul class='ipsCarousel ipsCarousel--page-builder-image-widget' id='{$carouselID}' tabindex="0">
<!-- Lazy loading isn't used here as it prevents the carousel arrows from showing -->
<ul class='ipsCarousel ipsCarousel--padding ipsCarousel--images ipsCarousel--page-builder-image-widget' id='{$carouselID}' tabindex="0">
{{foreach $images as $id => $image}}
<li>
<figure class='ipsFigure ipsFigure--contain' style="--_backdrop: url('{$image}'); {{if $maxHeight}}--_height: {$maxHeight}px;{{endif}}">
<figure class='ipsFigure {{if !$options['showBackdrop']}}ipsFigure--transparent{{endif}} ipsFigure--contain' style="{{if $options['showBackdrop']}}--_backdrop: url('{$image}');{{endif}} {{if $options['maxHeight']}}--_height: {$options['maxHeight']}px;{{endif}}">
{{if isset( $urls[ $id ] )}}
<a href="{$urls[ $id ]}" class='ipsFigure__main' aria-label="{$captions[0]}">
<a href="{$urls[ $id ]}" {{if $options['tab']}}target='_blank'{{endif}} class='ipsFigure__main' aria-label="{$captions[0]}">
{{else}}
<div class='ipsFigure__main'>
{{endif}}
<img src="{$image}" alt='' loading="lazy">
<img src="{$image}" alt=''>
{{if isset( $urls[ $id ] )}}
</a>
{{else}}
</div>
{{endif}}
{{if isset( $captions[ $id ] )}}
{{if !empty( $captions[ $id ] )}}
<figcaption class="ipsFigure__footer i-text-align_center">{$captions[ $id ]}</figcaption>
{{endif}}
</figure>
@@ -1728,10 +1729,12 @@
flex: 1 1 100%;
display: flex;
flex-direction: column;
container-type: size;
container-name: templateeditor;
}
#elTemplateEditor .CodeMirror{
height: 100%;
height: 100cqh;
}
#elTemplateEditor [data-role="editor"],
@@ -1857,7 +1860,6 @@ a.ipsCms_templateOptions {
.cTemplateList li.cTemplateList_inactiveBranch > a:not(.ipsCms_templateOptions)::before,
.cTemplateList li.cTemplateList_activeBranch > a:not(.ipsCms_templateOptions)::before {
font-family: var(--i-font-awesome);
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: auto;
font-weight: 900;
+33 -1
View File
@@ -586,6 +586,13 @@
"107785": "4.7.19",
"107786": "4.7.19",
"107787": "4.7.19",
"107795": "4.7.20 Beta 1",
"107796": "4.7.20 Beta 2",
"107797": "4.7.20 Beta 3",
"107798": "4.7.20 Beta 4",
"107799": "4.7.20 Beta 5",
"107800": "4.7.20",
"107801": "4.7.20",
"500001": "5.0.0 Alpha 1",
"500002": "5.0.0 Alpha 2",
"5000003": "5.0.0 Alpha 3",
@@ -634,5 +641,30 @@
"5000046": "5.0.0 Beta 14",
"5000047": "5.0.0 Beta 14.1",
"5000048": "5.0.0 Beta 14.2",
"5000049": "5.0.0"
"5000049": "5.0.0",
"5000050": "5.0.0",
"5000051": "5.0.0",
"5000052": "5.0.1",
"5000053": "5.0.1",
"5000054": "5.0.2",
"5000055": "5.0.2",
"5000056": "5.0.2",
"5000057": "5.0.3",
"5000058": "5.0.3",
"5000059": "5.0.3",
"5000060": "5.0.3",
"5000061": "5.0.4 Beta 1",
"5000062": "5.0.4 Beta 1",
"5000063": "5.0.4 Beta 1",
"5000064": "5.0.4 Beta 2",
"5000065": "5.0.4 Beta 3",
"5000066": "5.0.4",
"5000067": "5.0.5 Beta 1",
"5000068": "5.0.5 Beta 2",
"5000069": "5.0.5",
"5000070": "5.0.6 Beta 1",
"5000071": "5.0.6 Beta 2",
"5000072": "5.0.6 Beta 3",
"5000073": "5.0.6 Beta 4",
"5000074": "5.0.6"
}
@@ -42,7 +42,10 @@ class UpdateHtmlPages extends QueueAbstract
*/
public function preQueueData( array $data ): ?array
{
$data['count'] = (int) Db::i()->select( 'count(page_id)', 'cms_pages' )->first();
$data['count'] = (int) Db::i()->select( 'count(page_id)', 'cms_pages', [
[ 'page_type=?', 'html' ],
[ 'page_id in (?)', Db::i()->select( 'database_page_id', 'cms_databases', 'database_page_id > 0' ) ]
] )->first();
return $data;
}
@@ -59,7 +62,10 @@ class UpdateHtmlPages extends QueueAbstract
$limit = REBUILD_SLOW;
$rows = iterator_to_array(
new ActiveRecordIterator(
Db::i()->select( '*', 'cms_pages', null, 'page_id', array( $offset, $limit ) ),
Db::i()->select( '*', 'cms_pages', [
[ 'page_type=?', 'html' ],
[ 'page_id in (?)', Db::i()->select( 'database_page_id', 'cms_databases', 'database_page_id > 0' ) ]
], 'page_id', array( $offset, $limit ) ),
Page::class
)
);
@@ -67,43 +73,25 @@ class UpdateHtmlPages extends QueueAbstract
$lang = Lang::load( Lang::defaultLanguage() );
foreach( $rows as $row )
{
/* Builder pages need minor adjustment */
if( $row->type == 'builder' )
{
$row->ipb_wrapper = true;
}
else
{
/* Convert the page to a builder page with a single column */
$area = Area::create( 'col1', [
[
'title' => $lang->addToStack( 'block_Codemirror' ),
'config' => true,
'blank' => false,
'app' => 'cms',
'key' => 'Codemirror',
'unique' => mt_rand(),
'configuration' => [
'content' => $row->content
]
/* Convert the page to a builder page with a single column */
$area = Area::create( 'col1', [
[
'title' => $lang->addToStack( 'block_Codemirror' ),
'config' => true,
'blank' => false,
'app' => 'cms',
'key' => 'Codemirror',
'unique' => mt_rand(),
'configuration' => [
'content' => $row->content
]
], [ 'wrapBehavior' => 'stack' ] );
$row->saveArea( $area );
$row->type = 'builder';
$row->content = null;
if( $row->wrapper_template === null or $row->wrapper_template == '__none__')
{
$row->ipb_wrapper = true;
}
}
if( $row->template == 'page_builder__single_column__page_page_builder_single_column' or $row->template == 'page_builder__single_column__page_builder_single_column' )
{
$row->template = null;
}
]
], [ 'wrapBehavior' => 'stack' ] );
$row->saveArea( $area );
$row->type = 'builder';
$row->content = null;
$row->ipb_wrapper = true;
$row->save();
}
@@ -1559,7 +1559,6 @@ class databases extends Controller
}
$pageValues['page_folder_id'] = $pageValues['page_folder_id'] ?: 0;
$pageValues['page_name'] = $pageValues['page_name'] ?: $values['database_name'];
$pageValues['page_ipb_wrapper'] = true;
if( $currentPage = $current->page )
{
@@ -1740,7 +1739,7 @@ class databases extends Controller
foreach( Page::formElements( $current?->page ) as $name => $field )
{
if( !in_array( $name, [ 'tab_details', 'tab_content', 'page_content', 'page_ipb_wrapper', 'page_wrapper_template', 'page_theme', 'page_template' ] ) )
if( !in_array( $name, [ 'tab_details', 'page_theme', 'page_template', 'tab_content', 'page_content', 'page_ipb_wrapper', 'page_wrapper_template' ] ) )
{
if ( is_array( $field ) )
{
+39 -5
View File
@@ -19,12 +19,10 @@ use IPS\cms\Pages\Page;
use IPS\Data\Store;
use IPS\Db;
use IPS\Dispatcher;
use IPS\Helpers\Badge;
use IPS\Helpers\Badge\Icon;
use IPS\Helpers\Form;
use IPS\Helpers\Form\Radio;
use IPS\Helpers\Tree\Tree;
use IPS\Http\url;
use IPS\Http\Url;
use IPS\Member;
use IPS\Node\Controller;
use IPS\Node\Model;
@@ -166,7 +164,8 @@ class pages extends Controller
'primary' => true,
'icon' => 'plus-circle',
'title' => 'content_add_page',
'link' => Url::internal( 'app=cms&module=pages&controller=pages&subnode=1&do=form&subnode=1' )
'link' => Url::internal( 'app=cms&module=pages&controller=pages&subnode=1&do=add&subnode=1' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => Member::loggedIn()->language()->addToStack('content_add_page') )
);
}
}
@@ -218,6 +217,41 @@ FILE;
Output::i()->sendOutput( $htaccess, 200, 'application/x-htaccess', array( 'Content-Disposition' => 'attachment; filename=.htaccess' ) );
}
/**
* Page content form
*
* @return void
*/
protected function add() : void
{
Dispatcher::i()->checkAcpPermission( 'page_add' );
$form = new Form( 'form', 'next' );
$form->hiddenValues['parent'] = ( isset( Request::i()->parent ) ) ? Request::i()->parent : 0;
$form->add( new Radio(
'page_type',
NULL,
FALSE,
array( 'options' => array( 'builder' => 'page_type_builder', 'html' => 'page_type_manual' ),
'descriptions' => array( 'builder' => 'page_type_builder_desc', 'html' => 'page_type_manual_custom_desc' ) ),
NULL,
NULL,
NULL,
'page_type'
) );
if ( $values = $form->values() )
{
Output::i()->redirect( Url::internal( 'app=cms&module=pages&controller=pages&do=form&subnode=1&page_type=' . $values['page_type'] . '&parent=' . Request::i()->parent ) );
}
/* Display */
Output::i()->output .= Theme::i()->getTemplate( 'global', 'core', 'admin' )->block( Member::loggedIn()->language()->addToStack('content_add_page'), $form, FALSE );
Output::i()->title = Member::loggedIn()->language()->addToStack('content_add_page');
}
/**
* Add/Edit Form
*
@@ -346,7 +380,7 @@ FILE;
'sprintf' => array( Url::internal( "app=cms&module=databases&controller=databases&do=form&id=" . static::$pageToDatabaseMap[ $page->id ] ) )
) );
}
return Theme::i()->getTemplate( 'trees', 'core' )->row( $url, $page->id, $page->seo_name, false, $page->getButtons( \IPS\Http\Url::internal('app=cms&module=pages&controller=pages'), true ), Member::loggedIn()->language()->addToStack( 'num_views_with_number', NULL, array( 'pluralize' => array( $page->views ) ) ), 'file-text-o', NULL, FALSE, NULL, NULL, $badge, FALSE, FALSE, FALSE );
return Theme::i()->getTemplate( 'trees', 'core' )->row( $url, $page->id, $page->seo_name, false, $page->getButtons( Url::internal('app=cms&module=pages&controller=pages'), true ), Member::loggedIn()->language()->addToStack( 'num_views_with_number', NULL, array( 'pluralize' => array( $page->views ) ) ), 'file-text-o', NULL, FALSE, NULL, NULL, $badge, FALSE, FALSE, FALSE );
}
+24 -5
View File
@@ -15,6 +15,7 @@ namespace IPS\cms\modules\front\pages;
use IPS\cms\Categories;
use IPS\cms\Pages\Folder;
use IPS\cms\Pages\Page;
use IPS\cms\Records;
use IPS\Db;
use IPS\Patterns\ActiveRecordIterator;
use IPS\Theme;
@@ -47,12 +48,19 @@ class ajax extends \IPS\cms\modules\admin\pages\ajax
try
{
$folder = Folder::load( Request::i()->container );
$items = iterator_to_array(
new ActiveRecordIterator(
$items = [];
foreach( new ActiveRecordIterator(
Db::i()->select( '*', 'cms_pages', [ 'page_folder_id=?', $folder->id ] ),
Page::class
)
);
) as $item )
{
/* @var Page $item */
if( $item->canView() )
{
$items[] = $item;
}
}
Output::i()->sendOutput( Theme::i()->getTemplate( 'widgets', 'cms', 'front' )->folderNavigationItems( $items ) );
}
catch( OutOfRangeException ){}
@@ -64,7 +72,18 @@ class ajax extends \IPS\cms\modules\admin\pages\ajax
try
{
$container = $containerClass::load( Request::i()->container );
Output::i()->sendOutput( Theme::i()->getTemplate( 'widgets', 'cms', 'front' )->databaseNavigationItems( $container->getContentItems( null, null ) ) );
$items = [];
foreach( $container->getContentItems( null, null ) as $item )
{
/* Only show items that we can actually see, and if they're not pending deletion */
/* @var Records $item */
if( $item->canView() and $item->hidden() !== -2 )
{
$items[] = $item;
}
}
Output::i()->sendOutput( Theme::i()->getTemplate( 'widgets', 'cms', 'front' )->databaseNavigationItems( $items ) );
}
catch( OutOfRangeException ){}
}
@@ -56,6 +56,13 @@ class builder extends widgets
protected function saveOrder() : void
{
parent::saveOrder();
/* Skip for global areas */
if( isset( Request::i()->pageArea ) AND Request::i()->pageArea == Area::AREA_GLOBAL_FOOTER )
{
return;
}
$page = Page::load( Request::i()->pageID );
$page->postSaveArea();
}
@@ -119,6 +126,12 @@ class builder extends widgets
*/
public function getAreasFromDatabase( ?string $area=null ) : array
{
/* Global areas should always use the parent */
if( isset( Request::i()->pageArea ) AND Request::i()->pageArea == Area::AREA_GLOBAL_FOOTER )
{
return parent::getAreasFromDatabase( $area );
}
$page = Page::load( Request::i()->pageID );
return $page->getAreasFromDatabase( $area );
}
@@ -131,6 +144,13 @@ class builder extends widgets
*/
public function saveArea( Area $area ) : void
{
/* Global areas should always use the parent */
if( $area->id == Area::AREA_GLOBAL_FOOTER )
{
parent::saveArea( $area );
return;
}
$page = Page::load( Request::i()->pageID );
$page->saveArea( $area );
@@ -0,0 +1,23 @@
{
"id": 107795,
"name": "4.7.20 Beta 1",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,23 @@
{
"id": 107796,
"name": "4.7.20 Beta 2",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": true,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,7 @@
{
"added": [],
"edited": [
"RecordFeed"
],
"removed": []
}
@@ -0,0 +1,23 @@
{
"id": 107797,
"name": "4.7.20 Beta 3",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,23 @@
{
"id": 107798,
"name": "4.7.20 Beta 4",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,23 @@
{
"id": 107799,
"name": "4.7.20 Beta 5",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,23 @@
{
"id": 107800,
"name": "4.7.20",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,23 @@
{
"id": 107801,
"name": "4.7.20",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
+1 -1
View File
@@ -14,7 +14,7 @@
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": true
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
+1 -1
View File
@@ -14,7 +14,7 @@
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": true
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
@@ -0,0 +1,22 @@
{
"id": 5000050,
"name": "5.0.0",
"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": 5000051,
"name": "5.0.0",
"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": 5000052,
"name": "5.0.1",
"steps": {
"queries": false,
"lang": false,
"theme": true,
"themeeditor": false,
"javascript": true,
"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,14 @@
{
"files": {
"added": [],
"edited": [
"cms\/front\/controllers\/blocks\/ips.blocks.navigation.js"
],
"removed": []
},
"orders": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,20 @@
{
"html": {
"added": [],
"edited": [
"front\/widgets\/navigationLine",
"front\/widgets\/pagebuilderupload"
],
"removed": []
},
"css": {
"added": [],
"edited": [],
"removed": []
},
"resources": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,22 @@
{
"id": 5000053,
"name": "5.0.1",
"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": 5000054,
"name": "5.0.2",
"steps": {
"queries": false,
"lang": false,
"theme": true,
"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,21 @@
{
"html": {
"added": [],
"edited": [
"front\/clubs\/index"
],
"removed": []
},
"css": {
"added": [],
"edited": [
"admin\/templates\/templates.css"
],
"removed": []
},
"resources": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,22 @@
{
"id": 5000055,
"name": "5.0.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": 5000056,
"name": "5.0.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": 5000057,
"name": "5.0.3",
"steps": {
"queries": false,
"lang": true,
"theme": true,
"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,15 @@
{
"normal": {
"added": [
"pagebuilderupload_backdrop",
"pagebuilderupload_backdrop_desc"
],
"edited": [],
"removed": []
},
"js": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,19 @@
{
"html": {
"added": [],
"edited": [
"front\/widgets\/pagebuilderupload"
],
"removed": []
},
"css": {
"added": [],
"edited": [],
"removed": []
},
"resources": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,22 @@
{
"id": 5000058,
"name": "5.0.3",
"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": 5000059,
"name": "5.0.3",
"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": 5000060,
"name": "5.0.3",
"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": 5000061,
"name": "5.0.4 Beta 1",
"steps": {
"queries": false,
"lang": true,
"theme": true,
"themeeditor": false,
"javascript": true,
"emailTemplates": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": true
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,14 @@
{
"files": {
"added": [],
"edited": [
"cms\/admin\/controllers\/fields\/ips.fields.form.js"
],
"removed": []
},
"orders": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,14 @@
{
"normal": {
"added": [
"pagebuilderupload_tab"
],
"edited": [],
"removed": []
},
"js": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,19 @@
{
"html": {
"added": [],
"edited": [
"front\/widgets\/pagebuilderupload"
],
"removed": []
},
"css": {
"added": [],
"edited": [],
"removed": []
},
"resources": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,80 @@
<?php
/**
* @brief 5.0.4 Beta 1 Upgrade Code
* @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
* @subpackage Pages
* @since 04 Feb 2025
*/
namespace IPS\cms\setup\upg_5000061;
use IPS\Db;
use function defined;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 5.0.4 Beta 1 Upgrade Code
*/
class Upgrade
{
/**
* Minor cleanup on pages from v4
*
* @return bool|array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1() : bool|array
{
/* Clear out old invalid templates */
Db::i()->update( 'cms_pages', [ 'page_template' => null, 'page_ipb_wrapper' => 1 ], [ 'page_template=? or page_template=?', 'page_builder__single_column__page_page_builder_single_column', 'page_builder__single_column__page_builder_single_column' ] );
return TRUE;
}
/**
* Handle legacy database templates from v4; they're all broken
*
* @return bool|array
*/
public function step2() : bool|array
{
/* Lucky for us, v4 had a bug where editing a master template set the original_group to null.
We can use this to find any templates that were edited in v4 but not in v5. */
foreach( Db::i()->select( '*', 'cms_templates', [ 'template_master=? and template_user_edited=? and template_user_created=? and template_type=? and template_original_group is null', 0, 1, 0, 'template' ] ) as $row )
{
/* Add a prefix to the group and key so that it's clear this is a v4 backup */
Db::i()->update( 'cms_templates', [
'template_group' => 'v4_' . $row['template_group'],
'template_key' => $row['template_location'] . '_v4_' . $row['template_group'] . '_' . $row['template_title'],
], [ 'template_id=?', $row['template_id'] ] );
}
return true;
}
/**
* Force a rebuild of any custom CSS templates
*
* @return bool|array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3() : bool|array
{
/* We had a bug where CSS templates were not being parsed properly.
Clear these out so that we force a rebuild the next time the template is lodaed. */
Db::i()->update( 'cms_templates', [ 'template_file_object' => null ], [ 'template_type=?', 'css' ] );
Db::i()->update( 'cms_pages', [ 'page_js_css_objects' => null ] );
return TRUE;
}
// You can create as many additional methods (step2, step3, etc.) as is necessary.
// Each step will be executed in a new HTTP request
}
@@ -0,0 +1,22 @@
{
"id": 5000062,
"name": "5.0.4 Beta 1",
"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": 5000063,
"name": "5.0.4 Beta 1",
"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": 5000064,
"name": "5.0.4 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": 5000065,
"name": "5.0.4 Beta 3",
"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": true
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,44 @@
<?php
/**
* @brief 5.0.4 Beta 3 Upgrade Code
* @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
* @subpackage Pages
* @since 17 Mar 2025
*/
namespace IPS\cms\setup\upg_5000065;
use IPS\cms\Templates;
use function defined;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 5.0.4 Beta 3 Upgrade Code
*/
class Upgrade
{
/**
* Force a rebuild of compiled CSS
* so that any badly parsed files are recompiled
*
* @return bool|array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1() : bool|array
{
Templates::deleteCompiledFiles();
return TRUE;
}
// You can create as many additional methods (step2, step3, etc.) as is necessary.
// Each step will be executed in a new HTTP request
}
@@ -0,0 +1,22 @@
{
"id": 5000066,
"name": "5.0.4",
"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": 5000067,
"name": "5.0.5 Beta 1",
"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": 5000068,
"name": "5.0.5 Beta 2",
"steps": {
"queries": false,
"lang": false,
"theme": true,
"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,19 @@
{
"html": {
"added": [],
"edited": [
"admin\/blocks\/rowHtml"
],
"removed": []
},
"css": {
"added": [],
"edited": [],
"removed": []
},
"resources": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,22 @@
{
"id": 5000069,
"name": "5.0.5",
"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": 5000070,
"name": "5.0.6 Beta 1",
"steps": {
"queries": false,
"lang": false,
"theme": true,
"themeeditor": false,
"javascript": true,
"emailTemplates": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": true,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}
@@ -0,0 +1,14 @@
{
"files": {
"added": [],
"edited": [],
"removed": []
},
"orders": {
"added": [],
"edited": [
"global\/\/dev\/js\/\/library\/\/jquery"
],
"removed": []
}
}
@@ -0,0 +1,19 @@
{
"html": {
"added": [],
"edited": [],
"removed": []
},
"css": {
"added": [],
"edited": [
"admin\/templates\/templates.css"
],
"removed": []
},
"resources": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -0,0 +1,22 @@
{
"id": 5000071,
"name": "5.0.6 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": 5000072,
"name": "5.0.6 Beta 3",
"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": 5000073,
"name": "5.0.6 Beta 4",
"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": 5000074,
"name": "5.0.6",
"steps": {
"queries": false,
"lang": false,
"theme": true,
"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,19 @@
{
"html": {
"added": [],
"edited": [
"front\/widgets\/Categories"
],
"removed": []
},
"css": {
"added": [],
"edited": [],
"removed": []
},
"resources": {
"added": [],
"edited": [],
"removed": []
}
}
@@ -76,7 +76,6 @@ class Categories extends Model implements Permissions
ClubContainer
{
ClubContainer::clubAcpTitle as public _clubAcpTitle;
ClubContainer::clubForm as public _clubForm;
ClubContainer::_saveClubForm as public _saveClubFormParent;
ClubContainer::canBeAddedToClub as public _canBeAddedToClub;
}
@@ -361,11 +360,12 @@ class Categories extends Model implements Permissions
* @param Club $club
* @return void
*/
public function clubForm( Form $form, Club $club ): void
public function _clubForm( Form $form, Club $club ): void
{
$this->database_id = static::$customDatabaseId;
static::_clubForm( $form, $club );
$itemClass = static::$contentItemClass;
$form->add( new Text( 'club_node_name', $this->_id ? $this->_title : Member::loggedIn()->language()->addToStack( static::clubFrontTitle() ), TRUE, array( 'maxLength' => 255 ) ) );
if( $club->type != Club::TYPE_PUBLIC )
{
@@ -1618,9 +1618,9 @@ class Categories extends Model implements Permissions
/**
* [Node] Get number of unapproved content items
*
* @return int
* @return int|null
*/
protected function get__unapprovedItems() : int
protected function get__unapprovedItems() : ?int
{
return $this->records_queued;
}
@@ -1701,7 +1701,7 @@ class Categories extends Model implements Permissions
if ( $this->template_listing AND static::database()->use_categories )
{
$data = json_decode( $this->template_listing, true );
return ( $data['layout'] == 'custom' ) ? $data['template'] : 'listing';
return ( $data['layout'] == 'custom' and $data['template'] ) ? $data['template'] : 'listing';
}
return static::database()->template_listing;
@@ -905,7 +905,7 @@ class Databases extends Model implements Permissions
*/
public function get_template_form() : string
{
return $this->display_settings['form']['template'];
return $this->display_settings['form']['template'] ?? 'form';
}
/**
@@ -913,7 +913,7 @@ class Databases extends Model implements Permissions
*/
public function get_template_display() : string
{
return $this->display_settings['display']['template'];
return $this->display_settings['display']['template'] ?? 'display';
}
/**
@@ -921,7 +921,7 @@ class Databases extends Model implements Permissions
*/
public function get_template_listing() : string
{
return $this->display_settings['listing']['layout'] == 'custom' ? $this->display_settings['listing']['template'] : 'listing';
return ( $this->display_settings['listing']['layout'] == 'custom' and $this->display_settings['listing']['template'] ) ? $this->display_settings['listing']['template'] : 'listing';
}
/**
@@ -929,7 +929,7 @@ class Databases extends Model implements Permissions
*/
public function get_template_categories() : string
{
return $this->display_settings['categories']['layout'] == 'custom' ? $this->display_settings['categories']['template'] : 'category_index';
return ( $this->display_settings['categories']['layout'] == 'custom' and $this->display_settings['categories']['template'] ) ? $this->display_settings['categories']['template'] : 'category_index';
}
/**
@@ -939,7 +939,7 @@ class Databases extends Model implements Permissions
{
if( $this->display_settings['index']['type'] != 'categories' )
{
return $this->display_settings['index']['layout'] == 'custom' ? $this->display_settings['index']['template'] : 'category_articles';
return ( $this->display_settings['index']['layout'] == 'custom' and $this->display_settings['index']['template'] ) ? $this->display_settings['index']['template'] : 'category_articles';
}
return $this->template_categories;
@@ -1006,7 +1006,7 @@ class Databases extends Model implements Permissions
public function preLoadWords() : void
{
/* Skip this during installation / uninstallation as the words won't be loaded */
if ( !Dispatcher::hasInstance() or Dispatcher::i()->controllerLocation === 'setup' OR ( Dispatcher::i()->controllerLocation === 'admin' AND Dispatcher::i()->module->key === 'applications' ) )
if ( !Dispatcher::hasInstance() or Dispatcher::i()->controllerLocation === 'setup' OR ( Dispatcher::i()->controllerLocation === 'admin' and Dispatcher::i()->module and Dispatcher::i()->module->key === 'applications' ) )
{
$this->langLoaded = TRUE;
return;
+13 -9
View File
@@ -33,7 +33,6 @@ use IPS\Db\Exception as DbException;
use IPS\Dispatcher;
use IPS\Extensions\CustomFieldAbstract;
use IPS\File;
use IPS\File\FileSystem;
use IPS\GeoLocation;
use IPS\Helpers\Form;
use IPS\Helpers\Form\Codemirror;
@@ -1322,11 +1321,11 @@ class Fields extends CustomField implements Permissions
try
{
return Member::loggedIn()->language()->get( static::$langKey . '_' . $this->id );
return (string) Member::loggedIn()->language()->get( static::$langKey . '_' . $this->id ); # If the key doesn't exist, we populate with null
}
catch( UnderflowException $e )
{
return FALSE;
return '';
}
}
@@ -1900,9 +1899,9 @@ class Fields extends CustomField implements Permissions
'Upload' => array_merge( array( 'field_upload_is_image', 'field_upload_is_multiple', 'field_upload_thumb' ), $displayDefaults ),
'Url' => array_merge( array( 'field_default_value', 'field_unique' ), $displayDefaults ),
'YesNo' => array_merge( array( 'field_default_value' ), $displayDefaults ),
'Youtube' => array( 'media_params', 'media_display_listing_method', 'media_display_display_method', 'field_unique' ),
'Spotify' => array( 'media_params', 'media_display_listing_method', 'media_display_display_method', 'field_unique' ),
'Soundcloud'=> array( 'media_params', 'media_display_listing_method', 'media_display_display_method', 'field_unique' )
'Youtube' => array( 'media_params', 'media_display_listing_method', 'media_display_display_method', 'field_unique', 'field_display_display_json_where' ),
'Spotify' => array( 'media_params', 'media_display_listing_method', 'media_display_display_method', 'field_unique', 'field_display_display_json_where' ),
'Soundcloud'=> array( 'media_params', 'media_display_listing_method', 'media_display_display_method', 'field_unique', 'field_display_display_json_where' )
);
foreach ( $toggles as $k => $v )
@@ -2327,12 +2326,12 @@ class Fields extends CustomField implements Permissions
}, NULL, NULL, 'field_display_display_json_custom' ) );
/* Display where? */
$form->add( new Radio( 'field_display_display_json_where', ($displayJson['display']['where'] ?? 'top'), FALSE, array( 'options' => array( 'top' => 'cms_field_display_top', 'bottom' => 'cms_field_display_bottom' ) ), NULL, NULL, NULL, 'field_display_display_json_where' ) );
/* Media display */
$form->add( new Radio( 'media_display_display_method', $mediaDisplayDefault, FALSE, array( 'options' => $mediaListingOptions ), NULL, NULL, NULL, 'media_display_display_method' ) );
/* Display where? */
$form->add( new Radio( 'field_display_display_json_where', ($displayJson['display']['where'] ?? 'top'), FALSE, array( 'options' => array( 'top' => 'cms_field_display_top', 'bottom' => 'cms_field_display_bottom' ) ), NULL, NULL, NULL, 'field_display_display_json_where' ) );
$form->addSeparator();
$form->add( new YesNo( 'field_display_commentform', $this->id ? $this->display_commentform : 0, FALSE, array(), NULL, NULL, NULL, 'field_display_commentform' ) );
@@ -2745,6 +2744,11 @@ class Fields extends CustomField implements Permissions
{
$displayJson['listing']['method'] = $values['media_display_listing_method'];
$displayJson['display']['method'] = $values['media_display_display_method'];
if ( isset( $values['field_display_display_json_where'] ) )
{
$displayJson['display']['where'] = $values['field_display_display_json_where'];
}
}
else
{
+2 -1
View File
@@ -190,7 +190,8 @@ class Folder extends Model
$buttons['add_page'] = array(
'icon' => 'plus-circle',
'title' => 'content_add_page',
'link' => $url->setQueryString( array( 'subnode' => 1, 'do' => 'form', 'parent' => $this->_id ) )
'link' => $url->setQueryString( array( 'subnode' => 1, 'do' => 'add', 'parent' => $this->_id ) ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => Member::loggedIn()->language()->addToStack('content_add_page') )
);
}
+69 -34
View File
@@ -34,6 +34,7 @@ use IPS\Dispatcher\Front;
use IPS\File;
use IPS\Helpers\Form;
use IPS\Helpers\Form\CheckboxSet;
use IPS\Helpers\Form\Codemirror;
use IPS\Helpers\Form\Node;
use IPS\Helpers\Form\Radio;
use IPS\Helpers\Form\Select;
@@ -207,16 +208,6 @@ class Page extends Model implements Permissions
*/
public static array $defaultPage = array();
/**
* @brief Pre save flag
*/
const PRE_SAVE = 1;
/**
* @brief Post save flag
*/
const POST_SAVE = 2;
/**
* Set Default Values
*
@@ -626,6 +617,7 @@ class Page extends Model implements Permissions
*/
static public function formElements( ?Page $item=NULL ) : array
{
$pageType = Request::i()->page_type ?? $item?->type;
$return = array();
$return['tab_details'] = array( 'content_page_form_tab__details', NULL, NULL, 'ipsForm--horizontal' );
@@ -700,12 +692,7 @@ class Page extends Model implements Permissions
/* List of templates */
$return['page_wrapper_template'] = new Select( 'page_wrapper_template', ($item?->wrapper_template), null, array(
'options' => $wrapperTemplates
), 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' );
), null, NULL, Theme::i()->getTemplate( 'pages', 'cms', 'admin' )->previewTemplateLink(), 'page_wrapper_template' );
if ( count( Theme::themes() ) > 1 )
{
@@ -766,6 +753,30 @@ class Page extends Model implements Permissions
$return['page_includes_css'] = new CheckboxSet( 'page_includes_css', $item ? $item->css_includes : FALSE, FALSE, array( 'options' => $cssincludes, 'multiple' => true ), NULL, NULL, NULL, 'page_includes_css' );
}
}
if ( $pageType == 'html' )
{
$return['tab_content'] = array( 'content_page_form_tab__content', NULL, NULL, 'ipsForm_vertical' );
$tagSource = Url::internal( "app=cms&module=pages&controller=ajax&do=loadTags" );
if ( $item )
{
$tagSource = $tagSource->setQueryString( 'pageId', $item->id );
}
$return['page_content'] = new Codemirror( 'page_content', $item ? htmlentities( $item->content, ENT_DISALLOWED, 'UTF-8' ) : NULL, FALSE, array( 'tagSource' => $tagSource, 'height' => 600, 'codeMode' => true, 'codeModeAllowedLanguages' => [ 'txt', 'ipsphtml' ] ), function( $val )
{
/* Test */
try
{
Theme::checkTemplateSyntax( $val );
}
catch( LogicException $e )
{
throw new LogicException('cms_page_error_bad_syntax');
}
}, NULL, NULL, 'page_content' );
}
$return['tab_meta'] = array( 'content_page_form_tab__meta', NULL, NULL, 'ipsForm--horizontal ipsForm--page-meta' );
$return['page_title'] = new Text( 'page_title', $item ? $item->title : '', FALSE, array( 'maxLength' => 64 ), NULL, NULL, NULL, 'page_title' );
@@ -791,12 +802,13 @@ class Page extends Model implements Permissions
* Create a new page from a form. Pretty much what the function says.
*
* @param array $values Array of form values
* @param string|null $pageType Type of page. 'html' or 'builder'
* @return Page object
*/
static public function createFromForm( array $values ) : static
static public function createFromForm( array $values, ?string $pageType='builder' ) : static
{
$page = new self;
$page->type = 'builder';
$page->type = $pageType;
$page->save();
$page->saveForm( $page->formatFormValues( $values ) );
@@ -1375,16 +1387,17 @@ class Page extends Model implements Permissions
if ( isset( $buttons['edit'] ) )
{
$return['builder'] = array(
/* Builder pages open the page editor */
if( $this->type == 'builder' )
{
$return['builder'] = array(
'icon' => 'magic',
'title' => 'content_launch_page_builder',
'link' => $this->url()->setQueryString( array( '_blockManager' => 1 ) ),
'target' => '_blank'
);
}
if ( isset( $buttons['edit'] ) )
{
);
}
/* Is this a database page? We don't allow editing from here, use the database URL instead */
try
{
@@ -1416,7 +1429,7 @@ class Page extends Model implements Permissions
$return['edit'] = $buttons['edit'];
}
if ( Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'page_edit' ) )
if ( Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'page_edit' ) and !$this->default )
{
$return['default'] = array(
'icon' => $this->default ? 'star' : 'regular fa-star',
@@ -1462,6 +1475,16 @@ class Page extends Model implements Permissions
*/
public function form( Form &$form ) : void
{
/* Build form */
if ( ! $this->id )
{
$form->hiddenValues['page_type'] = $pageType = Request::i()->page_type;
}
else
{
$pageType = $this->type;
}
/* We shut off the main class and add it per-tab to allow the content field to look good */
$form->class = '';
@@ -1528,13 +1551,16 @@ class Page extends Model implements Permissions
$form->add( new CheckboxSet( 'menu_manager_access', '*', NULL, array( 'multiple' => TRUE, 'options' => $groups, 'unlimited' => '*', 'unlimitedLang' => 'everyone', 'impliedUnlimited' => TRUE ), NULL, NULL, NULL, 'menu_manager_access' ) );
}
if ( $this->id )
if( $pageType == 'builder' )
{
Output::i()->output .= Theme::i()->getTemplate( 'global', 'core', 'global' )->message( Member::loggedIn()->language()->addToStack('content_acp_page_builder_msg_edit', TRUE, array( 'sprintf' => array( $this->url() ) ) ), 'information', NULL, FALSE );
}
else
{
Output::i()->output .= Theme::i()->getTemplate( 'global', 'core', 'global' )->message( Member::loggedIn()->language()->addToStack('content_acp_page_builder_msg_new' ), 'information', NULL, FALSE );
if ( $this->id )
{
Output::i()->output .= Theme::i()->getTemplate( 'global', 'core', 'global' )->message( Member::loggedIn()->language()->addToStack('content_acp_page_builder_msg_edit', TRUE, array( 'sprintf' => array( $this->url() ) ) ), 'information', NULL, FALSE );
}
else
{
Output::i()->output .= Theme::i()->getTemplate( 'global', 'core', 'global' )->message( Member::loggedIn()->language()->addToStack('content_acp_page_builder_msg_new' ), 'information', NULL, FALSE );
}
}
if( $this->id )
@@ -1557,7 +1583,7 @@ class Page extends Model implements Permissions
if ( ! $this->id )
{
$this->type = 'builder';
$this->type = Request::i()->page_type ?? 'builder';
$this->save();
}
@@ -2072,7 +2098,7 @@ class Page extends Model implements Permissions
Output::i()->jsVars['pageID'] = $this->id;
/* Display */
if ( $this->ipb_wrapper )
if ( $this->ipb_wrapper or $this->type == 'builder' )
{
$nav = array();
Output::i()->title = $this->getHtmlTitle();
@@ -2089,6 +2115,9 @@ class Page extends Model implements Permissions
}
}
/* Load the global areas */
Output::i()->loadGlobalAreas();
/* Make sure we initialize the main area */
Output::i()->sidebar['widgets']['col1'] = [];
@@ -2138,7 +2167,8 @@ class Page extends Model implements Permissions
Output::i()->buildMetaTags();
/* Set up the content */
$content = Theme::i()->getTemplate( 'pages', 'cms' )->globalWrap( null, $content ?: $this->getPageContent(), $this );
$content = $content ?? $this->getPageContent();
//$content = Theme::i()->getTemplate( 'pages', 'cms' )->globalWrap( null, $content ?: $this->getPageContent(), $this );
/* Ensure MFA pop up shows */
$content .= ( Front::i()->checkMfa( TRUE ) ?: '' );
@@ -2170,6 +2200,11 @@ class Page extends Model implements Permissions
*/
protected function getPageContent() : string
{
if( $this->type == 'html' )
{
return $this->getHtmlContent();
}
$widgets = [];
foreach( Db::i()->select( '*', 'cms_page_widget_areas', [ 'area_page_id=?', $this->id ] ) as $item )
+1 -1
View File
@@ -113,6 +113,6 @@ class PageItem extends Item
*/
public function url( ?string $action=NULL ): Url
{
return Page::constructFromData( $this->_data )->url();
return Page::load( $this->id )->url();
}
}
+2 -2
View File
@@ -3594,7 +3594,7 @@ class Records extends Item implements
* @param array $where Where clause
* @param string|null $order MySQL ORDER BY clause (NULL to order by date)
* @param int|array|null $limit Limit clause
* @param string $permissionKey A key which has a value in the permission map (either of the container or of this class) matching a column ID in core_permission_index or NULL to ignore permissions
* @param string|null $permissionKey A key which has a value in the permission map (either of the container or of this class) matching a column ID in core_permission_index or NULL to ignore permissions
* @param int|bool|null $includeHiddenItems Include hidden items? NULL to detect if currently logged in member has permission, -1 to return public content only, TRUE to return unapproved content and FALSE to only return unapproved content the viewing member submitted
* @param int $queryFlags Select bitwise flags
* @param Member|null $member The member (NULL to use currently logged in member)
@@ -3611,7 +3611,7 @@ class Records extends Item implements
* @param array|null $location Array of item lat and long
* @return ActiveRecordIterator|int
*/
public static function getItemsWithPermission( array $where=array(), string $order=null, int|array|null $limit=10, string $permissionKey='read', int|bool|null $includeHiddenItems= Filter::FILTER_AUTOMATIC, int $queryFlags=0, Member $member=null, bool $joinContainer=FALSE, bool $joinComments=FALSE, bool $joinReviews=FALSE, bool $countOnly=FALSE, array|null $joins=null, bool|Model $skipPermission=FALSE, bool $joinTags=TRUE, bool $joinAuthor=TRUE, bool $joinLastCommenter=TRUE, bool $showMovedLinks=FALSE, array|null $location=null ): ActiveRecordIterator|int
public static function getItemsWithPermission( array $where=array(), string $order=null, int|array|null $limit=10, ?string $permissionKey='read', int|bool|null $includeHiddenItems= Filter::FILTER_AUTOMATIC, int $queryFlags=0, Member $member=null, bool $joinContainer=FALSE, bool $joinComments=FALSE, bool $joinReviews=FALSE, bool $countOnly=FALSE, array|null $joins=null, bool|Model $skipPermission=FALSE, bool $joinTags=TRUE, bool $joinAuthor=TRUE, bool $joinLastCommenter=TRUE, bool $showMovedLinks=FALSE, array|null $location=null ): ActiveRecordIterator|int
{
$where = static::getItemsWithPermissionWhere( $where, $permissionKey, $member, $joinContainer, $skipPermission );
return parent::getItemsWithPermission( $where, $order, $limit, $permissionKey, $includeHiddenItems, $queryFlags, $member, $joinContainer, $joinComments, $joinReviews, $countOnly, $joins, $skipPermission, $joinTags, $joinAuthor, $joinLastCommenter, $showMovedLinks );
@@ -1255,12 +1255,9 @@ class Templates extends ActiveRecord
$content = $this->content;
/* Build on demand */
if ( $this->type != 'js' and ( mb_stristr( $this->content, "{block=" ) or mb_stristr( $this->content, "{{if" ) or mb_stristr( $this->content, "{media=" ) ) )
if ( $this->type != 'js' )
{
$functionName = 'css_' . mt_rand();
Theme::makeProcessFunction( str_replace( '\\', '\\\\', $content ), $functionName );
$functionName = "IPS\Theme\\{$functionName}";
$content = $functionName();
$content = Theme::compileCustomCss( $content );
}
$this->file_object = (string) File::create( 'cms_Pages', $this->title, $content ?: ' ', 'page_objects', TRUE );
@@ -100,6 +100,21 @@ class DatabaseNavigation extends PermissionCache
$categories = $categoriesClass::load( $database->default_category );
}
return $this->output( $database, $categories, Dispatcher::i()->categoryId );
$categoryTree = [];
if( Dispatcher::i()->categoryId )
{
try
{
$current = $categoriesClass::load( Dispatcher::i()->categoryId );
while( $current )
{
$categoryTree[] = $current->_id;
$current = $current->parent();
}
}
catch ( OutOfRangeException $e ){}
}
return $this->output( $database, $categories, $categoryTree );
}
}
+12 -1
View File
@@ -119,6 +119,17 @@ class FolderNavigation extends Widget
)
);
return $this->output( $folders, $rootId, $pages, $this->configuration['block_nav_title'] ?? null, ( Page::$currentPage ? ( Page::$currentPage->folder_id ?: null ) : null ) );
/* Build a list of the container "ancestors" so that we can
automatically open to the current page */
$currentContainer = [];
if( Page::$currentPage )
{
foreach( Page::$currentPage->parents() as $parent )
{
$currentContainer[] = $parent->_id;
}
}
return $this->output( $folders, $rootId, $pages, $this->configuration['block_nav_title'] ?? null, ( count( $currentContainer ) ? $currentContainer : null ) );
}
}
@@ -41,6 +41,11 @@ class pagebuilderoembed extends StaticCache implements Builder
* @brief App
*/
public string $app = 'cms';
/**
* @var bool
*/
public bool $allowNoBox = true;
/**
* Specify widget configuration
@@ -38,6 +38,11 @@ class pagebuildertext extends StaticCache implements Builder
* @brief App
*/
public string $app = 'cms';
/**
* @var bool
*/
public bool $allowNoBox = true;
/**
* Specify widget configuration
+16 -27
View File
@@ -20,11 +20,9 @@ use IPS\Helpers\Form\Stack;
use IPS\Helpers\Form\Upload;
use IPS\Helpers\Form\YesNo;
use IPS\Widget\Builder;
use IPS\Widget\Customizable;
use IPS\Widget\StaticCache;
use function count;
use function defined;
use function str_ends_with;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
@@ -35,7 +33,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
/**
* pagebuilderupload Widget
*/
class pagebuilderupload extends StaticCache implements Builder, Customizable
class pagebuilderupload extends StaticCache implements Builder
{
/**
* @brief Widget Key
@@ -46,6 +44,11 @@ class pagebuilderupload extends StaticCache implements Builder, Customizable
* @brief App
*/
public string $app = 'cms';
/**
* @var bool
*/
public bool $allowNoBox = true;
@@ -88,12 +91,14 @@ class pagebuilderupload extends StaticCache implements Builder, Customizable
}
$form->add( new Upload( 'pagebuilderupload_upload', $images, FALSE, array( 'multiple' => true, 'storageExtension' => 'core_Attachment', 'allowStockPhotos' => TRUE, 'image' => true ) ) );
// $form->add( new YesNo( 'pagebuilderupload_slideshow', ( $this->configuration['pagebuilderupload_slideshow'] ?? FALSE ) ) );
$form->add( new Stack( 'pagebuilderupload_captions', $captions, FALSE, array( 'stackFieldType' => 'Text', 'removeEmptyValues' => false ) ) );
$form->add( new Stack( 'pagebuilderupload_urls', $urls, FALSE, array( 'stackFieldType' => 'Url', 'removeEmptyValues' => false ) ) );
$form->add( new YesNo( 'pagebuilderupload_tab', $this->configuration['pagebuilderupload_tab'] ?? false ) );
// This is now handled by the page builder
$form->add( new Number( 'pagebuilderupload_height', ( $this->configuration['pagebuilderupload_height'] ?? 300 ), FALSE, array( 'unlimited' => 0 ) ) );
$form->add( new YesNo( 'pagebuilderupload_backdrop', $this->configuration['pagebuilderupload_backdrop'] ?? true, false ) );
return $form;
}
@@ -150,8 +155,12 @@ class pagebuilderupload extends StaticCache implements Builder, Customizable
$images = array();
$captions = ( isset( $this->configuration['pagebuilderupload_captions'] ) ) ? $this->configuration['pagebuilderupload_captions'] : array();
$urls = ( isset( $this->configuration['pagebuilderupload_urls'] ) ) ? json_decode( $this->configuration['pagebuilderupload_urls'], TRUE ) : array();
// $autoPlay = ( isset( $this->configuration['pagebuilderupload_slideshow'] ) ) ? $this->configuration['pagebuilderupload_slideshow'] : FALSE;
$maxHeight = ( isset( $this->configuration['pagebuilderupload_height'] ) ) ? $this->configuration['pagebuilderupload_height'] : FALSE;
$options = [
'maxHeight' => $this->configuration['pagebuilderupload_height'] ?? false,
'showBackdrop' => $this->configuration['pagebuilderupload_backdrop'] ?? true,
'tab' => $this->configuration['pagebuilderupload_tab'] ?? false
];
if ( isset( $this->configuration['pagebuilderupload_upload'] ) )
{
@@ -160,29 +169,9 @@ class pagebuilderupload extends StaticCache implements Builder, Customizable
$images[] = (string) File::get( 'core_Attachment', $img )->url;
}
return $this->output( ( count( $images ) === 1 ? $images[0] : $images ), $captions, $urls, $maxHeight );
return $this->output( ( count( $images ) === 1 ? $images[0] : $images ), $captions, $urls, $options );
}
return '';
}
/**
* @return string[]
*/
public function getSupportedLayouts() : array
{
$layouts = parent::getSupportedLayouts();
/* Remove support for non-carousels; if we have tabs, there is way too much going on here */
$return = [];
foreach( $layouts as $k => $v )
{
if( str_ends_with( $v, '-carousel' ) )
{
$return[] = $v;
}
}
return $return;
}
}