Version 4.2.0

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

No files matched your search

+7 -8
View File
@@ -2,8 +2,8 @@
/**
* @brief Content Application Class
* @author <a href=''>Invision Power Services, Inc.</a>
* @copyright (c) 2014 Invision Power Services, Inc.
* @package IPS Community Suite
* @copyright (c) Invision Power Services, Inc.
* @package Invision Community
* @subpackage Content
* @since 13 Jan 2014
* @version
@@ -41,7 +41,6 @@ spl_autoload_register( function( $class )
public static \$databaseTable = 'cms_custom_database_{$databaseId}';
public static \$title = '{$titleLang}';
public static \$module = 'records{$databaseId}';
public static \$reputationType = 'record_id_{$databaseId}';
public static \$includeInSearch = {$includeInSearch};
public static \$databaseColumnMap = array(
'author' => 'member_id',
@@ -70,7 +69,8 @@ spl_autoload_register( function( $class )
'last_review' => 'record_last_review',
'last_review_by' => 'record_last_review_by',
'last_review_name' => 'record_last_review_name',
'updated' => 'record_last_comment'
'updated' => 'record_last_comment',
'meta_data' => 'record_meta_data'
);
public static \$pagePath;
}
@@ -91,7 +91,6 @@ EOF;
public static \$customDatabaseId = $databaseId;
public static \$itemClass = 'IPS\cms\Records{$databaseId}';
public static \$title = 'content_record_comments_title_{$databaseId}';
public static \$reputationType = 'comment_id_{$databaseId}';
}
EOF;
eval( $data );
@@ -322,7 +321,7 @@ class _Application extends \IPS\Application
/* Add in permissions */
$groups = array();
foreach( \IPS\Db::i()->select( 'g_id', 'core_groups', array( 'g_access_cp=1' ) ) as $row )
foreach( \IPS\Db::i()->select( 'row_id', 'core_admin_permission_rows', array( 'row_id_type=?', 'group' ) ) as $row )
{
$groups[] = $row;
}
@@ -395,7 +394,7 @@ Create brand new sections of your community using features like blocks, database
pulling in data from other areas of your community.</p>
<p>Create custom pages in your community using our drag'n'drop, WYSIWYG editor.
Build blocks that pull in all kinds of data from throughout your community to create dynamic pages,
or use one of the ready-made widgets we include with the IPS Community Suite.</p>
or use one of the ready-made widgets we include with the Invision Community.</p>
<p><br></p>
<p><a href="{$link}">View our Pages documentation</a></p>
EOF;
@@ -555,7 +554,7 @@ EOF;
$xml->text( "Invision Power Services, Inc" );
$xml->endAttribute();
$xml->startAttribute('author_url');
$xml->text( "http://www.invisionpower.com" );
$xml->text( "https://www.invisioncommunity.com" );
$xml->endAttribute();
/* Templates */
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Pages Database Comments Comments API
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 10 Dec 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\api;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Database Records API
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 9 Dec 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\api;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Pages Database Reviews API
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 10 Dec 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\api;
@@ -43,6 +43,7 @@
"categories_manage": "categories_manage",
"categories_add": "categories_add",
"categories_edit": "categories_edit",
"categories_massManageContent": "categories_massManageContent",
"categories_delete": "categories_delete"
},
"records": {
File diff suppressed because it is too large. Load diff
+14
View File
@@ -737,6 +737,20 @@
],
"zerofill": false
},
"record_meta_data": {
"name": "record_meta_data",
"type": "BIT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
+4 -4
View File
@@ -31,12 +31,12 @@
"type": "C",
"class": "\\IPS\\Lang"
},
"websiteUrl": {
"type": "S",
"class": "\\IPS\\Theme\\class_core_front_global"
},
"Output": {
"type": "C",
"class": "\\IPS\\Output"
},
"topics": {
"type": "S",
"class": "\\IPS\\Theme\\class_forums_front_topics"
}
}
+108 -61
View File
@@ -1,8 +1,8 @@
<?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="101099" javascript_position="1000050"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/blocks" javascript_name="ips.blocks.form.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.blocks.form.js
*
@@ -142,9 +142,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="101099" javascript_position="1000100">/**
* IPS Community Suite 4
* (c) 2014 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.databases.download.js - Present an alert to the user asking them if they want to build the app first
*
@@ -187,9 +187,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="101099" javascript_position="1000100">/**
* IPS Community Suite 4
* (c) 2014 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.databases.form.js
*
@@ -250,9 +250,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="101099" javascript_position="1000050"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="102002" javascript_position="1000050"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.external.communication.js - External communication widget - sends messages to the parent window
*
@@ -385,9 +385,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="101099" javascript_position="1000150">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="102002" javascript_position="1000150">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.fields.form.js
*
@@ -422,9 +422,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="101099" javascript_position="1000200"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="102002" javascript_position="1000200"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.media.main.js - Main media controller
*
@@ -451,6 +451,7 @@
this.on( 'click', '[data-action="deleteSelected"]', this.deleteSelected );
this.on( 'keydown', '[data-role="mediaSearch"]', this.searchKeyPress );
this.on( 'submitDialog', '[data-role="uploadButton"]', this.dialogSubmitted );
this.on( window, 'resize', this.resizePanels );
this.setup();
},
@@ -470,6 +471,25 @@
this.scope.find('[data-role="uploadButton"]').attr('href', this._uploadURL + '&media_parent=0' );
this.scope.find('[data-role="folderButton"]').attr('href', this._newFolderURL + '&media_parent=0' );
this.resizePanels();
},
/**
* Resize panels
*
* @returns {void}
*/
resizePanels: function () {
var windowHeight = $( window ).height();
this.scope.find('#elMedia_sidebar, #elMedia_fileList, #elMedia_searchResults').each( function () {
var top = $( this ).offset().top;
$( this ).css({
height: ( windowHeight - top ) + 'px'
});
});
},
/**
@@ -990,9 +1010,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="101099" javascript_position="1000250"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="102002" javascript_position="1000250"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.pages.embed.js - Pages embed dialog
*
@@ -1036,9 +1056,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="101099" javascript_position="1000250"><![CDATA[/**
* IPS Community Suite 4
* (c) 2014 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="102002" javascript_position="1000250"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.pages.form.js - Page Form Stuff That I Can't Be Bothered To Type Out Here
*
@@ -1129,9 +1149,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="101099" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2014 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.databases.form.js
*
@@ -1241,9 +1261,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="101099" javascript_position="1000100">/**
* IPS Community Suite 4
* (c) 2014 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="102002" javascript_position="1000100">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.databases.revisions.js
*
@@ -1296,9 +1316,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="101099" javascript_position="1000300">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="102002" javascript_position="1000300">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.templates.addForm.js - Controller for the 'add' form in the template editor
*
@@ -1346,9 +1366,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="101099" javascript_position="1000300">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="102002" javascript_position="1000300">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.templates.conflict.js - Templates: Parent controller for the template conflict manager
*
@@ -1418,9 +1438,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="101099" javascript_position="1000300"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="102002" javascript_position="1000300"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.templates.fileEditor.js - Templates: controller for the tabbed file editor
*
@@ -1457,6 +1477,8 @@
this.on( 'openDialog', this.openedDialog );
this.on( 'menuItemSelected', this.menuSelected );
var debounce = _.debounce( _.bind( this._recalculatePanelWrapper, this ), 100 );
this.on( window, 'resize', debounce );
// Other setup
this.setup();
@@ -2229,10 +2251,6 @@
// Get height of the tab bar
var tabHeight = this._tabBar.outerHeight();
if( tabHeight == this._currentHeight ){
return;
}
// Set the top value of the panel
this._tabContent.css( { top: tabHeight + 'px' } );
@@ -2277,13 +2295,18 @@
* @returns {number}
*/
_getTabContentHeight: function () {
return this._tabContent.outerHeight();
var tabContentTop = this._tabContent.offset().top;
var windowHeight = $( window ).height();
var infoHeight = this.scope.find('#elTemplateEditor_info').outerHeight();
this._panelHeight = windowHeight - tabContentTop - infoHeight - 31;
return this._panelHeight;
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="101099" javascript_position="1000300"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="102002" javascript_position="1000300"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.templates.fileList.js - Templates: controller for the file listing component of the template manager
*
@@ -2311,6 +2334,9 @@
this.on( document, 'addedFile.templates', this.refreshFileList );
this.on( document, 'deletedFile.templates', this.refreshFileList );
var debounce = _.debounce( _.bind( this.resizeFileList, this ), 100 );
this.on( window, 'resize', debounce );
// Other setup
this.setup();
},
@@ -2323,8 +2349,27 @@
setup: function () {
this._tabBar = this.scope.find('#elTemplateEditor_typeTabs');
this._tabContent = this.scope.find('#elTemplateEditor_fileList');
this.resizeFileList();
},
/**
* Resizes the file list to full height
*
* @returns {void}
*/
resizeFileList: function () {
// Get height of parts we want to exclude
var fileListTop = this._tabContent.offset().top;
var infoHeight = this.scope.find('#elTemplateEditor_info').height();
var browserHeight = $( window ).height();
var fileListNewTop = browserHeight - fileListTop - infoHeight - 30;
this._tabContent.css({
height: fileListNewTop + 'px'
});
},
/**
* Something has changed in the file list, so we refresh it and try and remember
* the position we were at. If a new file ID is provided, we'll also select it.
@@ -2601,9 +2646,9 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="101099" javascript_position="1000300">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="102002" javascript_position="1000300">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.templates.main.js - Templates: Parent controller for the template editor
* Simply manages showing the loading thingy based on events coming from within
@@ -2642,9 +2687,9 @@
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="101099" javascript_position="1000300">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="102002" javascript_position="1000300">/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.templates.variablesDialog.js - Controller for the variables dialog
*
@@ -2680,9 +2725,9 @@
}
});
}(jQuery, _));</file>
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.area.js" javascript_type="mixins" javascript_version="101099" javascript_position="1000150"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.area.js" javascript_type="mixins" javascript_version="102002" javascript_position="1000150"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.cms.builder.area.js - Front-end mixin for tables
*
@@ -2749,9 +2794,9 @@
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.block.js" javascript_type="mixins" javascript_version="101099" javascript_position="1000150"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.block.js" javascript_type="mixins" javascript_version="102002" javascript_position="1000150"><![CDATA[/**
* Invision Community
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
*
* ips.cms.builder.block.js - Front-end mixin for CMS sidebar
*
@@ -2857,7 +2902,7 @@
});
}(jQuery, _));]]></file>
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="101099" javascript_position="1000300"><![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="102002" javascript_position="1000300"><![CDATA[ips.templates.set( 'templates.media.grid', "\
<ul class='ipsGrid' data-ipsGrid data-ipsGrid-minItemSize='100' data-ipsGrid-maxItemSize='200'>\
{{{contents}}}\
</ul>\
@@ -2874,7 +2919,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="101099" javascript_position="1000300"><![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="102002" javascript_position="1000300"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
/* TEMPLATECEPTION */
ips.templates.set('templates.editor.newTab', " \
<li data-fileid='{{fileid}}' data-location='{{location}}'>\
@@ -2918,4 +2963,6 @@ app.js</order>
<order app="global" path="/dev/js//library//jquery">jquery.js
jquery.history.js
jquery.transform.js</order>
<order app="global" path="/dev/js//library//linkify">linkify.min.js
linkify-jquery.min.js</order>
</javascript>
+37 -10
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="cms" version="101099">
<app key="cms" version="102002">
<word key="__app_cms" js="0">Pages</word>
<word key="menutab__cms" js="0">Pages</word>
<word key="menutab__cms_icon" js="0">book</word>
<word key="menutab__cms_icon" js="0">files-o</word>
<word key="__indefart_content_db_lang_sl" js="0">a %s</word>
<word key="__indefart_content_record_comments_title" js="0">a comment</word>
<word key="__indefart_content_record_reviews_title" js="0">a review</word>
@@ -33,6 +33,7 @@
<word key="can_unhide_record" js="0">Can unhide %s?</word>
<word key="can_view_hidden_record" js="0">Can view a hidden %s?</word>
<word key="can_move_record" js="0">Can move %s?</word>
<word key="can_move_record_desc" js="0">Will be able to move only between the categories they have permission to moderate, not to any other category.</word>
<word key="can_lock_record" js="0">Can lock %s?</word>
<word key="can_unlock_record" js="0">Can unlock %s?</word>
<word key="can_reply_to_locked_record" js="0">Can reply to a locked %s?</word>
@@ -50,6 +51,13 @@
<word key="can_unhide_rreview" js="0">Can unhide a %s review?</word>
<word key="can_view_hidden_rreview" js="0">Can view a hidden %s review?</word>
<word key="can_delete_rreview" js="0">Can delete a %s review?</word>
<word key="can_feature_comments_record" js="0">Can recommend comments on %s?</word>
<word key="can_unfeature_comments_record" js="0">Can remove comments recommendations on %s?</word>
<word key="can_add_item_message_record" js="0">Can add messages to %s?</word>
<word key="can_edit_item_message_record" js="0">Can edit messages on %S?</word>
<word key="can_delete_item_message_record" js="0">Can delete messages on %s?</word>
<word key="can_copy_topic_database" js="0">Can copy topics to a database?</word>
<word key="can_copy_topic_database_desc" js="0">If enabled, then the user can copy topics in forums they are allowed to moderate in, to databases they are allowed to create records in</word>
<word key="r__page_add" js="0">Can create pages?</word>
<word key="r__page_edit" js="0">Can edit pages?</word>
<word key="r__page_delete" js="0">Can delete pages?</word>
@@ -122,9 +130,9 @@
<word key="content_block_add_type_custom_desc" js="0">You can author HTML or PHP for advertisements, javascript widgets (e.g. stock tickers, gamer feeds, etc.) and notices/announcements.</word>
<word key="content_block_add_custom_type_wysiwyg" js="0">Editor</word>
<word key="content_block_add_custom_type_html" js="0">Manual HTML</word>
<word key="content_block_add_custom_type_html_desc" js="0">Allows use of HTML and IPS4 template logic that you'll enter manually</word>
<word key="content_block_add_custom_type_html_desc" js="0">Allows use of HTML and Invision Community template logic that you'll enter manually</word>
<word key="content_block_add_custom_type_php" js="0">Manual PHP</word>
<word key="content_block_add_custom_type_php_desc" js="0"><![CDATA[Allows use of raw PHP that you'll enter manually. Note: don't include &lt;?php ?&gt; tags; IPS4 will handle this for you.]]></word>
<word key="content_block_add_custom_type_php_desc" js="0"><![CDATA[Allows use of raw PHP that you'll enter manually. Note: don't include &lt;?php ?&gt; tags; Invision Community will handle this for you.]]></word>
<word key="content_block_add_custom_type" js="0">Content Editor</word>
<word key="content_block_form_tab__details" js="0">Details</word>
<word key="content_block_form_tab__content" js="0">Content</word>
@@ -215,9 +223,10 @@
<word key="template_group_new" js="0">New Group</word>
<word key="template_group_new_desc" js="0">Please use only a-z and 0-9 without any special characters or spaces. The group name must start with a letter or underscore.</word>
<word key="template_title_desc" js="0">Please use only a-z and 0-9 without any special characters or spaces. The title must start with a letter or underscore.</word>
<word key="template_reserved_word" js="0">The template name may not be any of the following: %s</word>
<word key="cms_theme_designer_mode_warning" js="0"><![CDATA[Theme editing is currently unavailabe in the ACP as you have designers' mode enabled.<br /><a href='%s'>Switch off designers' mode.</a>]]></word>
<word key="cms_templates_export_title" js="0">Download Templates</word>
<word key="cms_templates_export_description" js="0">Select the templates to export from the list below. These templates will be added to a single XML file that can be imported to other IPS4 communities.</word>
<word key="cms_templates_export_description" js="0">Select the templates to export from the list below. These templates will be added to a single XML file that can be imported to other Invision Community communities.</word>
<word key="templates_block" js="0">Blocks</word>
<word key="templates_database" js="0">Database</word>
<word key="templates_page" js="0">Pages</word>
@@ -301,7 +310,7 @@
<word key="cms_use_different_gateway_desc" js="0"><![CDATA[You can enable this if you have your suite installed in a sub directory but want Pages to appear as your website root. <a href='{external.devdocs-pages_different_root}' target='_blank'>More information</a>]]></word>
<word key="cms_root_page_url" js="0">URL to gateway file</word>
<word key="pages_gateway_url_not_exist" js="0">The URL could not be found.</word>
<word key="cms_pages_different_gateway_impossible" js="0">Your IPS 4 suite is already installed at the root of your domain.</word>
<word key="cms_pages_different_gateway_impossible" js="0">Your Invision Community suite is already installed at the root of your domain.</word>
<word key="pages_different_gateway_load_error" js="0">Could not load Pages in this location. Have you uploaded the 'index.php' file?</word>
<word key="pages_different_gateway_load_error_rewrite" js="0"><![CDATA[Could not load Pages in this location. Have you uploaded the 'index.php' file and installed the .htaccess file? <a href='{external.devdocs-pages_different_root}' target='_blank'>More information</a>]]></word>
<word key="cms_root_page_url_rewrite_desc" js="0"><![CDATA[In order to support this you must <a href='{internal.app=cms&module=pages&controller=pages&do=htaccess}'><strong><u>download this file</u></strong></a>, rename it to '.htaccess' (with no file extension) and upload it to the same location as the special 'index.php' for Pages. If there is already a .htaccess file, add the contents of this one to the existing.<br>If you are not sure how to do this, contact technical support for assistance.]]></word>
@@ -315,7 +324,8 @@
<word key="cms_error_page_code" js="0">Error Code</word>
<word key="cms_articles_homepage_form" js="0">Homepage Options</word>
<word key="cms_move_to_root" js="0">Move pages to root level (no folder)</word>
<word key="cms_move_pages" js="0">Move pages to</word>
<word key="cms_move_pages" js="0">Move pages and folders to</word>
<word key="folder" js="0">Folder</word>
<word key="menu_content_page" js="0">Page</word>
<word key="content_page_form_tab__menu" js="0">Menu</word>
<word key="page_add_to_menu" js="0">Add to front navigation menu</word>
@@ -406,10 +416,10 @@
<word key="field_display_display_json_badge" js="0">Display View Format</word>
<word key="field_display_custom" js="0">Custom</word>
<word key="field_display_display_json_custom" js="0">Display Custom Format</word>
<word key="field_display_display_json_custom_desc" js="0"><![CDATA[Use {$label} to show the field label, {$value} to show the display field value and {$formValue} to show the value from the form.<br />For example, your dropdown may use a key of 'open' with a value of 'Open Record'. In this example, {$formValue} would contain 'open' and {$value} would contain 'Open Record'. You may need to add the '|raw' modifier to preserve HTML, i.e. {$value|raw}, but this can introduce security issues if not used carefully. You may use IPS4 template logic such as {{if}}.<br>If using an Address field, you can show a map by using {map} and the address with {address}.<br>If using mulitple uploads, $value is an array of File Objects.]]></word>
<word key="field_display_display_json_custom_desc" js="0"><![CDATA[Use {$label} to show the field label, {$value} to show the display field value and {$formValue} to show the value from the form.<br />For example, your dropdown may use a key of 'open' with a value of 'Open Record'. In this example, {$formValue} would contain 'open' and {$value} would contain 'Open Record'. You may need to add the '|raw' modifier to preserve HTML, i.e. {$value|raw}, but this can introduce security issues if not used carefully. You may use Invision Community template logic such as {{if}}.<br>If using an Address field, you can show a map by using {map} and the address with {address}.<br>If using mulitple uploads, $value is an array of File Objects.]]></word>
<word key="field_display_listing_json_badge" js="0">Listing View Format</word>
<word key="field_display_listing_json_custom" js="0">Listing Custom Format</word>
<word key="field_display_listing_json_custom_desc" js="0"><![CDATA[Use {$label} to show the field label, {$value} to show the display field value and {$formValue} to show the value from the form.<br />For example, your dropdown may use a key of 'open' with a value of 'Open Record'. In this example, {$formValue} would contain 'open' and {$value} would contain 'Open Record'. You may need to add the '|raw' modifier to preserve HTML, i.e. {$value|raw}, but this can introduce security issues if not used carefully. You may use IPS4 template logic such as {{if}}.<br>If using an Address field, you can show a map by using {map} and the address with {address}.<br>If using mulitple uploads, $value is an array of File Objects.]]></word>
<word key="field_display_listing_json_custom_desc" js="0"><![CDATA[Use {$label} to show the field label, {$value} to show the display field value and {$formValue} to show the value from the form.<br />For example, your dropdown may use a key of 'open' with a value of 'Open Record'. In this example, {$formValue} would contain 'open' and {$value} would contain 'Open Record'. You may need to add the '|raw' modifier to preserve HTML, i.e. {$value|raw}, but this can introduce security issues if not used carefully. You may use Invision Community template logic such as {{if}}.<br>If using an Address field, you can show a map by using {map} and the address with {address}.<br>If using mulitple uploads, $value is an array of File Objects.]]></word>
<word key="field_display_listing_json_badge_right" js="0">Show to the right of the listing area</word>
<word key="cms_field_error_bad_syntax" js="0">The HTML syntax for the custom format is incorrect.</word>
<word key="field_key" js="0">Template Key</word>
@@ -460,6 +470,9 @@
<word key="field_date_tz_utc" js="0">UTC</word>
<word key="field_date_tz_set" js="0">Manually select a timezone</word>
<word key="field_date_tz_user" js="0">Use the viewing member's timezone</word>
<word key="field_allow_attachments" js="0">Allow attachments?</word>
<word key="field_upload_thumb" js="0">Thumbnail</word>
<word key="field_upload_thumb_none" js="0">Do not create a thumbnail</word>
<word key="content_content_form_tab__config" js="0">Configuration</word>
<word key="content_cat_db_title" js="0">%s Categories</word>
<word key="content_cat_furl_not_unique" js="0">The FURL slug is not unique</word>
@@ -903,16 +916,21 @@
<word key="loc_cms_viewing_db_record_no_cats" js="0">Viewing %s in %s</word>
<word key="content_err_page_404" js="0">Cannot find the page you requested</word>
<word key="content_err_page_403" js="0">You do not have permission to view this page</word>
<word key="content_err_page_500" js="0">The page could not be displayed at this time. Please try again later.</word>
<word key="content_err_page_500_admin" js="0">There is a parse error in the page.</word>
<word key="cms_delete_linked_topic" js="0">This topic is used for %s comments and cannot be deleted</word>
<word key="digest_area_cms_cms" js="0">%s</word>
<word key="x_created_cms_in" js="0">%s posted a %s in %s</word>
<word key="x_created_cms_in_embed" js="0">%s posted %s in %s</word>
<word key="x_commented_cms" js="0">%s commented on a %s</word>
<word key="x_commented_cms_embed" js="0">%s commented on %s</word>
<word key="x_reviewed_cms_embed" js="0">%s reviewed %s</word>
<word key="acplogs__cms_added_database" js="0">Added Database: %s</word>
<word key="acplogs__cms_edited_database" js="0">Edited Database: %s</word>
<word key="acplogs__cms_deleted_database" js="0">Deleted Database: %s</word>
<word key="block_embed_options" js="0">External embed</word>
<word key="block_embed_title" js="0">External Embed</word>
<word key="embed_message" js="0"><![CDATA[This feature allows you to embed this block on an external page that <strong>isn't</strong> part of your IPS Community Suite. For pages created within the IPS Community Suite, use the normal embedding method instead.]]></word>
<word key="embed_message" js="0"><![CDATA[This feature allows you to embed this block on an external page that <strong>isn't</strong> part of your Invision Community. For pages created within Invision Community, use the normal embedding method instead.]]></word>
<word key="embed_1_title" js="0">Embedding this block</word>
<word key="embed_1_desc" js="0">To embed this block, paste the following code in your page where you'd like it to display. You can optionally have the block automatically inherit some styles (font family, link color, etc.) from the page it appears on.</word>
<word key="embed_1_toggle" js="0">Inherit key styles from the parent page</word>
@@ -927,6 +945,15 @@
<word key="__api_cms_comments" js="0">Database Comments</word>
<word key="__api_cms_records" js="0">Database Records</word>
<word key="__api_cms_reviews" js="0">Database Reviews</word>
<word key="copy_topic_to_database" js="0">Copy to Database</word>
<word key="copy_select_database" js="0">Select Database</word>
<word key="copy_select_category" js="0">Select Category</word>
<word key="record_category_id" js="0">Category</word>
<word key="copy_comments" js="0">Copy posts?</word>
<word key="copy_comments_desc" js="0">Setting this to Yes will also copy all posts on the topic and add them as comments on the new %s</word>
<word key="copy_author" js="0">Use original author?</word>
<word key="copy_author_desc" js="0">Setting this to Yes will make the author of the new %s the same as the topic. Otherwise, your account will be used</word>
<word key="copying_comments" js="0">Copying Comments...</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>
+90 -1
View File
@@ -2264,6 +2264,20 @@
"zerofill": false,
"auto_increment": false,
"binary": false
},
"field_allow_attachments": {
"name": "field_allow_attachments",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "1",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
@@ -2869,7 +2883,7 @@
],
"length": [
null,
250
191
]
}
},
@@ -3808,5 +3822,80 @@
},
"collation": "utf8mb4_unicode_ci",
"engine": "InnoDB"
},
"cms_database_fields_thumbnails": {
"name": "cms_database_fields_thumbnails",
"columns": {
"thumb_original_location": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "thumb_original_location",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_location": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "thumb_location",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_field_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "thumb_field_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_database_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "thumb_database_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"thumb_original_location"
]
}
},
"collation": "utf8_general_ci",
"engine": "InnoDB"
}
}
+349 -173
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<theme name="Default" author_name="Invision Power Services, Inc" author_url="http://www.invisionpower.com">
<theme name="Default" author_name="Invision Power Services, Inc" author_url="https://www.invisioncommunity.com">
<template template_group="blocks" template_name="embedCode" template_data="$block, $embedKey" template_location="admin" template_app="cms"><![CDATA[
<div class="ipsMessage ipsMessage_info">
{lang="embed_message"}
@@ -86,15 +86,13 @@
</div>
</form>
</div>]]></template>
<template template_group="blocks" template_name="previewBlock" template_data="" template_location="admin" template_app="cms"><![CDATA[<li class="ipsFieldRow">
<div id="elPages_block_preview_wrapper">
<template template_group="blocks" template_name="previewBlock" template_data="" template_location="admin" template_app="cms"><![CDATA[<li class="ipsFieldRow ipsFieldRow_noFlex">
<div id="elPages_block_preview_wrapper" class='ipsSpacer_bottom'>
<iframe class='loading' src='{url="app=cms&module=pages&controller=builder&do=previewBlock" base="front" protocol="\IPS\Http\Url::PROTOCOL_RELATIVE"}' data-base-url="{url="app=cms&module=pages&controller=builder&do=previewBlock" base="front" protocol="\IPS\Http\Url::PROTOCOL_RELATIVE"}" frameborder="0" name="elpages_block_preview" id="elpages_block_preview"></iframe>
<p class='ipsType_reset'>
<span data-role="refreshPreview" class="ipsButton ipsButton_light ipsButton_small">{lang="cms_block_preview_refresh"}</span>
</p>
</div>
<div class="ipsPos_right">
<span data-role="refreshPreview" class="ipsButton ipsButton_light ipsButton_small">{lang="cms_block_preview_refresh"}</span>
</div>
<br />
<br />
<li>]]></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_light ipsButton_verySmall'>{lang="cms_block_view_template"}</span>]]></template>
<template template_group="databases" template_name="downloadDialog" template_data="$database" template_location="admin" template_app="cms"><![CDATA[<div class='ipsBox ipsPad'>
@@ -108,10 +106,11 @@
</div>]]></template>
<template template_group="databases" template_name="fieldsWrapper" template_data="$tree" template_location="admin" template_app="cms"><![CDATA[<br />
<br />
<div class='acpBlock_title'>{lang="content_fields_fixed_title"}</div>
{$tree|raw}]]></template>
<template template_group="databases" template_name="manageDatabaseName" template_data="$database, $row, $page" template_location="admin" template_app="cms"><![CDATA[{{;}}
<strong>{$database->_title}</strong>
<div class='ipsBox'>
<div class='ipsBox_titleBar'>{lang="content_fields_fixed_title"}</div>
{$tree|raw}
</div>]]></template>
<template template_group="databases" template_name="manageDatabaseName" template_data="$database, $row, $page" template_location="admin" template_app="cms"><![CDATA[<strong>{$database->_title}</strong>
{{if $page}}
<a class="ipsPos_right ipsBadge ipsBadge_style1" href="{$page->url()}" target="_blank">{lang="cms_db_used_on_page" sprintf="$page->_title"}</a>
{{endif}}
@@ -132,7 +131,7 @@
{{$idField = $record::$databaseColumnId;}}
<div>
<h3 class='ipsType_sectionHead'>
<div class='ipsType_break ipsContained'>
<span class='ipsType_break ipsContained'>
{{if $record->unread()}}
<a href='{$record->url( 'getNewComment' )}' title='{lang="first_unread_post"}' data-ipsTooltip>
<span class='ipsItemStatus'><i class="fa {{if in_array( $record->$idField, $iposted )}}fa-star{{else}}fa-circle{{endif}}"></i></span>
@@ -147,9 +146,141 @@
{{if $record->container()->allow_rating}}
{template="rating" group="global" location="front" app="core" params="'large', $record->rating_hits ? ( $record->rating_total / $record->rating_hits ) : 0"}
{{endif}}
</div>
</span>
</h3>
<p class='ipsType_normal ipsType_light ipsType_blendLinks ipsType_reset'>{lang="in"} <a href='{$record->container()->url()}'>{$record->container()->_title}</a></p>
</div>]]></template>
<template template_group="global" template_name="embedRecord" template_data="$item, $url" template_location="front" template_app="cms"><![CDATA[
{{$image = NULL;}}
<div data-embedInfo-maxSize='500' class='ipsRichEmbed'>
{template="embedHeader" group="embed" app="core" params="$item, \IPS\Member::loggedIn()->language()->addToStack( 'x_created_cms_in_embed', FALSE, array( 'sprintf' => array( $item->author()->name, $item->indefiniteArticle(), $item->container()->_title ) ) ), $item->mapped('date')"}
{{if $item->record_image}}
{{$image = \IPS\File::get( "cms_Records", $item->record_image );}}
{{elseif count( $item->contentImages() )}}
{{$attachType = key( $item->contentImages()[0] );}}
{{$image = \IPS\File::get( $attachType, $item->contentImages()[0][ $attachType ] );}}
{{endif}}
{{if $image}}
<div class='ipsRichEmbed_masthead ipsRichEmbed_mastheadBg ipsType_center'>
<a href='{$item->url()}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $image->url )"}" )'>
<img src='{$image->url}' class='ipsHide' alt=''>
</a>
</div>
{{endif}}
<div class='ipsPad'>
<h3 class='ipsRichEmbed_itemTitle ipsTruncate ipsTruncate_line ipsType_blendLinks'>
<a href='{$item->url()}' title="{$item->mapped('title')}">{$item->mapped('title')}</a>
</h3>
<div class='ipsType_richText ipsType_medium ipsSpacer_top ipsSpacer_half' data-truncate='3'>
{$item->truncated(TRUE)|raw}
</div>
{{if count( $item->customFieldsForDisplay('listing') )}}
<div class='ipsSpacer_top ipsSpacer_half ipsClearfix'>
{{foreach $item->customFieldsForDisplay('listing') as $fieldId => $fieldValue}}
{{if $fieldValue}}
{$fieldValue|raw}
{{endif}}
{{endforeach}}
</div>
{{endif}}
{template="embedItemStats" group="embed" app="core" params="$item"}
</div>
</div>]]></template>
<template template_group="global" template_name="embedRecordComment" template_data="$comment, $item, $url" template_location="front" template_app="cms"><![CDATA[
<div data-embedInfo-maxSize='500' class='ipsRichEmbed'>
{template="embedHeader" group="embed" app="core" params="$comment, \IPS\Member::loggedIn()->language()->addToStack( 'x_commented_cms_embed', FALSE, array( 'sprintf' => array( $comment->author()->name, $item->indefiniteArticle() ) ) ), $comment->mapped('date')"}
<div class='ipsPad'>
<div class='ipsRichEmbed_originalItem ipsAreaBackground_reset ipsSpacer_bottom ipsType_blendLinks'>
<div>
{{if $item->record_image}}
{{$image = \IPS\File::get( "cms_Records", $item->record_image );}}
{{elseif count( $item->contentImages() )}}
{{$attachType = key( $item->contentImages()[0] );}}
{{$image = \IPS\File::get( $attachType, $item->contentImages()[0][ $attachType ] );}}
{{endif}}
{{if $image}}
<div class='ipsRichEmbed_masthead ipsRichEmbed_mastheadBg ipsType_center'>
<a href='{$item->url()}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $image->url )"}" )'>
<img src='{$image->url}' class='ipsHide' alt=''>
</a>
</div>
{{endif}}
<div class='ipsPad'>
{template="embedOriginalItem" group="embed" app="core" params="$item, TRUE, \IPS\Theme::i()->getTemplate( 'global', 'cms' )->embedRecordItemSnippet( $item ) "}
</div>
</div>
</div>
<div class='ipsType_richText ipsType_medium' data-truncate='3'>
{$comment->truncated(TRUE)|raw}
</div>
{{if \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and count( $comment->reactions() ) and settings.reputation_enabled}}
<ul class='ipsList_inline ipsSpacer_top ipsSpacer_half'>
<li>
{template="reactionOverview" app="core" group="global" params="$comment, TRUE, 'small'"}
</li>
</ul>
{{endif}}
</div>
</div>]]></template>
<template template_group="global" template_name="embedRecordItemSnippet" template_data="$item" template_location="front" template_app="cms"><![CDATA[
{{if count( $item->customFieldsForDisplay('listing') )}}
<div class='ipsSpacer_top ipsSpacer_half ipsClearfix'>
{{foreach $item->customFieldsForDisplay('listing') as $fieldId => $fieldValue}}
{{if $fieldValue}}
{$fieldValue|raw}
{{endif}}
{{endforeach}}
</div>
{{endif}}]]></template>
<template template_group="global" template_name="embedRecordReview" template_data="$comment, $item, $url" template_location="front" template_app="cms"><![CDATA[
<div data-embedInfo-maxSize='500' class='ipsRichEmbed'>
{template="embedHeader" group="embed" app="core" params="$comment, \IPS\Member::loggedIn()->language()->addToStack( 'x_reviewed_cms_embed', FALSE, array( 'sprintf' => array( $comment->author()->name, $item->indefiniteArticle() ) ) ), $comment->mapped('date')"}
<div class='ipsPad'>
<div class='ipsRichEmbed_originalItem ipsAreaBackground_reset ipsSpacer_bottom ipsType_blendLinks'>
<div>
{{if $item->record_image}}
{{$image = \IPS\File::get( "cms_Records", $item->record_image );}}
{{elseif count( $item->contentImages() )}}
{{$attachType = key( $item->contentImages()[0] );}}
{{$image = \IPS\File::get( $attachType, $item->contentImages()[0][ $attachType ] );}}
{{endif}}
{{if $image}}
<div class='ipsRichEmbed_masthead ipsRichEmbed_mastheadBg ipsType_center'>
<a href='{$item->url()}' style='background-image: url( "{expression="str_replace( array( '(', ')' ), array( '\(', '\)' ), $image->url )"}" )'>
<img src='{$image->url}' class='ipsHide' alt=''>
</a>
</div>
{{endif}}
<div class='ipsPad'>
{template="embedOriginalItem" group="embed" app="core" params="$item, TRUE, \IPS\Theme::i()->getTemplate( 'global', 'cms' )->embedRecordItemSnippet( $item ) "}
</div>
</div>
</div>
{template="rating" app="core" params="'veryLarge', $comment->mapped('rating')" group="global"}
{{if $comment->mapped('votes_total')}}
<p class='ipsType_reset ipsType_medium'>{$comment->helpfulLine()|raw}</p>
{{endif}}
<hr class='ipsHr'>
<div class='ipsType_richText ipsType_medium ipsSpacer_top ipsSpacer_half' data-truncate='3'>
{$comment->truncated(TRUE)|raw}
</div>
{{if \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and count( $comment->reactions() ) and settings.reputation_enabled}}
<ul class='ipsList_inline ipsSpacer_top ipsSpacer_half'>
<li>
{template="reactionOverview" app="core" group="global" params="$comment, TRUE, 'small'"}
</li>
</ul>
{{endif}}
</div>
</div>]]></template>
<template template_group="global" template_name="uploadDisplay" template_data="$file, $record, $downloadUrl" template_location="front" template_app="cms"><![CDATA[{{if $file->isImage()}}
<img src="$file->url" class="ipsImage" data-ipsLightbox>
@@ -186,19 +317,81 @@
{{$rootButtons = call_user_func( $tree->getRootButtons );}}
<div data-controller='cms.admin.media.main' class='cMedia_manager'>
<div class='acpBlock_title acpBlock_titleDark ipsAreaBackground_dark ipsPad'>
<div class='ipsColumns ipsColumns_collapsePhone'>
<div class='ipsColumn ipsColumn_wide'>
<div class='ipsColumns ipsColumns_collapsePhone'>
<div class='ipsColumn ipsColumn_wide'>
<div class='cMedia_managerToolbar'>
{{if $rootButtons['add_folder']}}
<a href='{$rootButtons['add_folder']['link']}' data-ipsDialog data-ipsDialog-title='{lang="cms_add_media_folder"}' class='ipsButton ipsButton_light ipsButton_small' data-role='folderButton'><i class='fa fa-plus'></i> {lang="cms_add_media_folder"}</a>
<a href='{$rootButtons['add_folder']['link']}' data-ipsDialog data-ipsDialog-title='{lang="cms_add_media_folder"}' class='ipsButton ipsButton_light ipsButton_small ipsButton_fullWidth' data-role='folderButton'><i class='fa fa-plus'></i> {lang="cms_add_media_folder"}</a>
{{endif}}
</div>
<div class='ipsColumn ipsColumn_fluid'>
<div class="ipsTabs ipsTabs_stretch ipsClearfix acpFormTabBar" id="elMedia_sidebarTabs" data-ipsTabBar data-ipsTabBar-contentarea="#elMedia_sidebar" data-ipstabbar-updateurl="false">
<a href="#elMedia_sidebarTabs" data-action="expandTabs"><i class="fa fa-caret-down"></i></a>
<ul role='tablist'>
<li>
<a href="#" class="ipsTabs_item ipsTabs_activeItem" data-type="templates" id="elTab_folders" aria-selected="true">{lang="media_folders"}</a>
</li>
<li>
<a href="#" class="ipsTabs_item ipsTabs_itemDisabled" id='elTab_overview' data-type="css">{lang="media_file_overview"}</a>
</li>
</ul>
</div>
<div id='elMedia_sidebar' class='ipsAreaBackground_reset ipsScrollbar'>
<div id='ipsTabs_elMedia_sidebarTabs_elTab_folders_panel' class='ipsTabs_panel'>
{{$roots = call_user_func( $tree->getRoots );}}
<ul class='ipsTreeList' data-role='folderList'>
<li class='ipsTreeList_activeBranch ipsTreeList_activeNode' data-role="mediaFolder" data-folderID='0' data-loaded='true'>
<a href='{$tree->url->setQueryString( array('root' => 0 ) )}'>{lang="media_root_folder"}</a>
<ul>
{{foreach $roots as $id => $row}}
{template="folderRow" group="media" app="cms" params="$tree->url, $row"}
{{endforeach}}
</ul>
</li>
</ul>
</div>
<div id='ipsTabs_elMedia_sidebarTabs_elTab_overview_panel' class='ipsTabs_panel ipsPad' data-role='mediaSidebar'>
<div data-role='itemInformation'>
<div class='ipsAreaBackground_light cMedia_preview ipsType_center' data-role='itemPreview'></div>
<div class='ipsSpacer_top'>
<strong class='ipsType_minorHeading'>{lang="media_tag_title"}</strong>
<input type='text' class='ipsField_fullWidth' value='' data-role='itemTag'>
<p class='ipsType_small ipsType_light'>{lang="media_tag_desc"}</p>
</div>
<hr class='ipsHr'>
<ul class='ipsList_reset ipsSpacer_top'>
<li class='ipsSpacer_bottom ipsSpacer_half'>
<h3 class='ipsType_minorHeading'>{lang="media_filename"}</h3>
<p class='ipsType_reset ipsType_medium ipsType_break' data-role='itemFilename'></p>
</li>
<li class='ipsSpacer_bottom ipsSpacer_half'>
<h3 class='ipsType_minorHeading'>{lang="media_uploaded"}</h3>
<p class='ipsType_reset ipsType_medium' data-role='itemUploaded'></p>
</li>
<li class='ipsSpacer_bottom ipsSpacer_half'>
<h3 class='ipsType_minorHeading'>{lang="media_size"}</h3>
<p class='ipsType_reset ipsType_medium' data-role='itemFilesize'></p>
</li>
<li class='ipsSpacer_bottom ipsSpacer_half' data-role='itemDimensionsRow'>
<h3 class='ipsType_minorHeading'>{lang="media_dims"}</h3>
<p class='ipsType_reset ipsType_medium' data-role='itemDimensions'></p>
</li>
</ul>
</div>
<div data-role='multipleItems'>
<div class='ipsPad ipsType_large ipsType_light ipsType_center ipsSpacer_top ipsSpacer_double' data-role='multipleItemsMessage'></div>
</div>
</div>
</div>
</div>
<div class='ipsColumn ipsColumn_fluid'>
<div class='cMedia_managerToolbar'>
<ul class='ipsToolList ipsToolList_horizontal'>
{{if $rootButtons['add_page']}}
<li class='ipsPos_left'><a href='{url="app=cms&module=pages&controller=media&do=upload"}' data-ipsDialog data-ipsDialog-forceReload data-ipsDialog-remoteSubmit data-ipsDialog-title='{lang="cms_add_media"}' class='ipsButton ipsButton_normal ipsButton_small ipsButton_fullWidth' data-role='uploadButton'><i class='fa fa-cloud-upload'></i> &nbsp;{lang="cms_add_media"}</a></li>
{{endif}}
<li class='ipsPos_left ipsHide' data-action='deleteFolder'><a href='{url="app=cms&module=pages&controller=media&do=delete&deleteNode=1"}' data-ipsDialog data-ipsDialog-forceReload data-ipsDialog-remoteVerify="false" data-ipsDialog-title='{lang="delete"}' class='ipsButton ipsButton_negative ipsButton_small ipsButton_fullWidth'><i class='fa fa-times'></i> {lang="cms_delete_folder_media"}</a></li>
<li class='ipsPos_left ipsHide' data-action='deleteFolder'><a href='{url="app=cms&module=pages&controller=media&do=delete"}' data-ipsDialog data-ipsDialog-forceReload data-ipsDialog-remoteVerify="false" data-ipsDialog-title='{lang="delete"}' class='ipsButton ipsButton_negative ipsButton_small ipsButton_fullWidth'><i class='fa fa-times'></i> {lang="cms_delete_folder_media"}</a></li>
<li class='ipsPos_left ipsHide' data-action='deleteSelected'><a href='#' class='ipsButton ipsButton_negative ipsButton_small ipsButton_fullWidth'><i class='fa fa-times'></i> {lang="cms_delete_selected_media"}</a></li>
<li class='ipsResponsive_showPhone ipsResponsive_block'><hr class='ipsHr'></li>
<li class='ipsPos_right'>
@@ -206,83 +399,14 @@
</li>
</ul>
</div>
</div>
</div>
<div class='ipsAreaBackground ipsPad'>
<div class='ipsColumns ipsColumns_collapsePhone'>
<div class='ipsColumn ipsColumn_wide'>
<div class="ipsTabs ipsTabs_stretch ipsClearfix acpFormTabBar" id="elMedia_sidebarTabs" data-ipsTabBar data-ipsTabBar-contentarea="#elMedia_sidebar" data-ipstabbar-updateurl="false">
<a href="#elMedia_sidebarTabs" data-action="expandTabs"><i class="fa fa-caret-down"></i></a>
<ul role='tablist'>
<li>
<a href="#" class="ipsTabs_item ipsTabs_activeItem" data-type="templates" id="elTab_folders" aria-selected="true">{lang="media_folders"}</a>
</li>
<li>
<a href="#" class="ipsTabs_item ipsTabs_itemDisabled" id='elTab_overview' data-type="css">{lang="media_file_overview"}</a>
</li>
</ul>
</div>
<div id='elMedia_sidebar' class='ipsAreaBackground_reset ipsScrollbar'>
<div id='ipsTabs_elMedia_sidebarTabs_elTab_folders_panel' class='ipsTabs_panel ipsPad'>
{{$roots = call_user_func( $tree->getRoots );}}
<ul class='ipsTreeList' data-role='folderList'>
<li class='ipsTreeList_activeBranch ipsTreeList_activeNode' data-role="mediaFolder" data-folderID='0' data-loaded='true'>
<a href='{$tree->url->setQueryString( array('root' => 0 ) )}'>{lang="media_root_folder"}</a>
<ul>
{{foreach $roots as $id => $row}}
{template="folderRow" group="media" app="cms" params="$tree->url, $row"}
{{endforeach}}
</ul>
</li>
</ul>
</div>
<div id='ipsTabs_elMedia_sidebarTabs_elTab_overview_panel' class='ipsTabs_panel ipsPad' data-role='mediaSidebar'>
<div data-role='itemInformation'>
<div class='ipsAreaBackground_light cMedia_preview ipsType_center' data-role='itemPreview'></div>
<div class='ipsSpacer_top'>
<strong class='ipsType_minorHeading'>{lang="media_tag_title"}</strong>
<input type='text' class='ipsField_fullWidth' value='' data-role='itemTag'>
<p class='ipsType_small ipsType_light'>{lang="media_tag_desc"}</p>
</div>
<hr class='ipsHr'>
<ul class='ipsList_reset ipsSpacer_top'>
<li class='ipsSpacer_bottom ipsSpacer_half'>
<h3 class='ipsType_minorHeading'>{lang="media_filename"}</h3>
<p class='ipsType_reset ipsType_medium' data-role='itemFilename'></p>
</li>
<li class='ipsSpacer_bottom ipsSpacer_half'>
<h3 class='ipsType_minorHeading'>{lang="media_uploaded"}</h3>
<p class='ipsType_reset ipsType_medium' data-role='itemUploaded'></p>
</li>
<li class='ipsSpacer_bottom ipsSpacer_half'>
<h3 class='ipsType_minorHeading'>{lang="media_size"}</h3>
<p class='ipsType_reset ipsType_medium' data-role='itemFilesize'></p>
</li>
<li class='ipsSpacer_bottom ipsSpacer_half' data-role='itemDimensionsRow'>
<h3 class='ipsType_minorHeading'>{lang="media_dims"}</h3>
<p class='ipsType_reset ipsType_medium' data-role='itemDimensions'></p>
</li>
</ul>
</div>
<div data-role='multipleItems'>
<div class='ipsPad ipsType_large ipsType_light ipsType_center ipsSpacer_top ipsSpacer_double' data-role='multipleItemsMessage'></div>
</div>
</div>
</div>
</div>
<div class='ipsColumn ipsColumn_fluid'>
<div class='ipsPad ipsAreaBackground_reset ipsScrollbar' data-role="fileListing" id='elMedia_fileList' data-showing='root'>
<ul class='ipsGrid' data-ipsGrid data-ipsGrid-minItemSize='100' data-ipsGrid-maxItemSize='200'>
{{foreach $roots as $id => $data}}
{template="fileListing" group="media" app="cms" params="$tree->url, $data"}
{{endforeach}}
</ul>
</div>
<div class='ipsPad ipsAreaBackground_reset ipsScrollbar ipsHide' data-role="searchResults" id='elMedia_searchResults'></div>
<div class='ipsPad ipsAreaBackground_reset ipsScrollbar' data-role="fileListing" id='elMedia_fileList' data-showing='root'>
<ul class='ipsGrid' data-ipsGrid data-ipsGrid-minItemSize='100' data-ipsGrid-maxItemSize='200'>
{{foreach $roots as $id => $data}}
{template="fileListing" group="media" app="cms" params="$tree->url, $data"}
{{endforeach}}
</ul>
</div>
<div class='ipsPad ipsAreaBackground_reset ipsScrollbar ipsHide' data-role="searchResults" id='elMedia_searchResults'></div>
</div>
</div>
</div>]]></template>
@@ -295,7 +419,7 @@
<ul class='ipsList_reset'>
{{if isset( $widgets[ $id ] )}}
{{foreach $widgets[ $id ] as $widget}}
<li class='{{if get_class( $widget ) != 'IPS\cms\widgets\Database'}}ipsWidget ipsWidget_{$orientation}{{endif}}' data-blockTitle="{$widget->title()}" data-blockID='{{if isset($widget->app)}}app_{$widget->app}_{{else}}plugin_{$widget->plugin}_{{endif}}{$widget->key}_{$widget->uniqueKey}'{{if $widget->hasConfiguration()}} data-blockConfig="true"{{endif}} data-controller='core.front.widgets.block'>{$widget|raw}</li>
<li class='{{if get_class( $widget ) != 'IPS\cms\widgets\Database'}}ipsWidget ipsWidget_{$orientation}{{endif}}' data-blockTitle="{$widget->title()}" data-blockID='{{if isset($widget->app)}}app_{$widget->app}_{{else}}plugin_{$widget->plugin}_{{endif}}{$widget->key}_{$widget->uniqueKey}'{{if $widget->hasConfiguration()}} data-blockConfig="true"{{endif}} data-blockErrorMessage="{lang="$widget->errorMessage" escape="true"}" data-controller='core.front.widgets.block'>{$widget|raw}</li>
{{endforeach}}
{{endif}}
</ul>
@@ -394,8 +518,8 @@
</div>]]></template>
<template template_group="records" template_name="fieldBadge" template_data="$label, $value, $classes" template_location="global" template_app="cms"><![CDATA[<span class='ipsBadge {$classes}'>{$label}: {$value|raw}</span>]]></template>
<template template_group="records" template_name="fieldDefault" template_data="$label, $value" template_location="global" template_app="cms"><![CDATA[<div class='ipsType_reset ipsType_light'><strong>{$label}:</strong> {$value|raw}</div>]]></template>
<template template_group="records" template_name="soundcloud" template_data="$url, $params" template_location="global" template_app="cms"><![CDATA[<iframe {{foreach $params as $k => $v }}{$k}="{$v}" {{endforeach}} scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url={$url}&color=ff5500"></iframe>]]></template>
<template template_group="records" template_name="spotify" template_data="$url, $params" template_location="global" template_app="cms"><![CDATA[<iframe src="https://embed.spotify.com/?uri={$url}" {{foreach $params as $k => $v }}{$k}="{$v}" {{endforeach}} frameborder="0" allowtransparency="true"></iframe>]]></template>
<template template_group="records" template_name="soundcloud" template_data="$url, $params" template_location="global" template_app="cms"><![CDATA[<iframe {{foreach $params as $k => $v }}{$k}="{$v}" {{endforeach}} src="https://w.soundcloud.com/player/?url={$url}&amp;color=ff5500"></iframe>]]></template>
<template template_group="records" template_name="spotify" template_data="$url, $params" template_location="global" template_app="cms"><![CDATA[<iframe src="https://embed.spotify.com/?uri={$url}" {{foreach $params as $k => $v }}{$k}="{$v}" {{endforeach}} allowtransparency="true"></iframe>]]></template>
<template template_group="records" template_name="title" template_data="$row, $title" template_location="admin" template_app="cms"><![CDATA[{{if $row['record_future_date'] or $row['record_approved'] === -1 or $row['record_approved'] === 0 or $row['record_pinned'] === 1 or $row['record_featured'] === 1}}
<span class='ipsPos_right'>
{{if $row['record_future_date']}}
@@ -417,7 +541,7 @@
</span>
{{endif}}
{$title}]]></template>
<template template_group="records" template_name="youtube" template_data="$url, $params" template_location="global" template_app="cms"><![CDATA[<div class='ipsEmbeddedVideo {{if \IPS\Settings::i()->max_video_width > 0}}ipsEmbeddedVideo_limited{{endif}}' contenteditable="false"><div><iframe id="ytplayer" type="text/html" {{foreach $params as $k => $v }}{$k}="{$v}" {{endforeach}} src="$url" frameborder="0"></iframe></div></div>]]></template>
<template template_group="records" template_name="youtube" template_data="$url, $params" template_location="global" template_app="cms"><![CDATA[<div class='ipsEmbeddedVideo {{if \IPS\Settings::i()->max_video_width > 0}}ipsEmbeddedVideo_limited{{endif}}' contenteditable="false"><div><iframe id="ytplayer" type="text/html" {{foreach $params as $k => $v }}{$k}="{$v}" {{endforeach}} src="$url"></iframe></div></div>]]></template>
<template template_group="revisions" template_name="rows" template_data="$table, $headers, $rows" template_location="front" template_app="cms"><![CDATA[{{foreach $rows as $row}}
<article class='ipsComment ipsComment_parent ipsClearfix ipsClear'>
<div class='ipsComment_header ipsPhotoPanel ipsPhotoPanel_mini ipsPhotoPanel_notPhone'>
@@ -742,12 +866,12 @@
<input type="hidden" name="t_key" value="{$current->key}">
<input type="hidden" name="t_id" value="{$current->id}">
<div class='ipsAreaBackground ipsPad' id='elTemplateEditor' data-controller='cms.admin.templates.main' data-normalURL="{url="app=cms&module=pages&controller=templates"}" data-ajaxURL="{url="app=cms&module=pages&controller=ajax"}">
<div id='elTemplateEditor' data-controller='cms.admin.templates.main' data-normalURL="{url="app=cms&module=pages&controller=templates"}" data-ajaxURL="{url="app=cms&module=pages&controller=ajax"}">
<div class='ipsColumns'>
<div class='ipsColumn ipsColumn_wide' data-role="fileList" data-controller='cms.admin.templates.fileList'>
<ul class='ipsList_inline ipsClearfix'>
<li><a href='#elTemplateEditor_newItemMenu_menu' id='elTemplateEditor_newItemMenu' class='ipsButton ipsButton_normal ipsButton_small' data-ipsMenu>{lang="theme_template_new"} &nbsp;<i class='fa fa-caret-down'></i></a></li>
</ul>
<div class='cTemplateControls' id='elTemplateEditor_fileListControls'>
<a href='#elTemplateEditor_newItemMenu_menu' id='elTemplateEditor_newItemMenu' class='ipsButton ipsButton_normal ipsButton_small ipsButton_fullWidth' data-ipsMenu>{lang="theme_template_new"} &nbsp;<i class='fa fa-caret-down'></i></a>
</div>
<ul id='elTemplateEditor_newItemMenu_menu' role='menu' class='ipsMenu ipsMenu_auto ipsMenu_withStem ipsHide'>
<li class='ipsMenu_item'><a role='menuitem' href='{url="app=cms&module=pages&controller=templates&do=addTemplate&type=block"}' data-ipsDialog data-ipsDialog-forceReload data-ipsDialog-title='{lang="content_template_add_template_block_title"}'>{lang="content_template_add_template_block"}</a></li>
<li class='ipsMenu_item'><a role='menuitem' href='{url="app=cms&module=pages&controller=templates&do=addTemplate&type=page"}' data-ipsDialog data-ipsDialog-forceReload data-ipsDialog-title='{lang="content_template_add_template_page_title""}'>{lang="content_template_add_template_page"}</a></li>
@@ -769,21 +893,22 @@
</div>
</div>
<div class='ipsColumn ipsColumn_fluid' data-controller='cms.admin.templates.fileEditor'>
<ul class='ipsList_inline ipsClearfix' id='elTemplateEditor_panelToolbar'>
<li class='ipsPos_right'>
<a href='#' id='elTemplateEditor_variables' class='ipsButton ipsButton_veryLight ipsButton_small' data-ipsDialog data-ipsDialog-title='{lang="content_template_editor_fields_title"}' data-ipsDialog-content="#elTemplateEditor_attributesDialog" data-ipsDialog-size='narrow'>{lang="theme_attributes"}</a>
</li>
<li class='ipsPos_right'>
<a href='{url="app=cms&module=pages&controller=templates&do=delete&t_location={$current->location}&t_key={$current->id}"}' class='ipsButton ipsButton_veryLight ipsButton_small {{if $current->user_edited == 'original'}}ipsButton_disabled{{endif}}' data-action="revert">{{if ! $current->user_edited}}{lang="delete"}{{else}}{lang="revert"}{{endif}}</a>
</li>
<li>
<button type='submit' class='ipsButton ipsButton_primary ipsButton_small' data-action="save">{lang="save"}</button>
</li>
<li>
<span data-role='loading' class='ipsHide'><i class='icon-spinner2 ipsLoading_tinyIcon'></i> &nbsp;{lang="loading"}</span>
</li>
</ul>
<br>
<div class='cTemplateControls'>
<ul class='ipsList_inline ipsClearfix' id='elTemplateEditor_panelToolbar'>
<li class='ipsPos_right'>
<a href='#' id='elTemplateEditor_variables' class='ipsButton ipsButton_veryLight ipsButton_small' data-ipsDialog data-ipsDialog-title='{lang="content_template_editor_fields_title"}' data-ipsDialog-content="#elTemplateEditor_attributesDialog" data-ipsDialog-size='narrow'>{lang="theme_attributes"}</a>
</li>
<li class='ipsPos_right'>
<a href='{url="app=cms&module=pages&controller=templates&do=delete&t_location={$current->location}&t_key={$current->id}"}' class='ipsButton ipsButton_veryLight ipsButton_small {{if $current->user_edited == 'original'}}ipsButton_disabled{{endif}}' data-action="revert">{{if ! $current->user_edited}}{lang="delete"}{{else}}{lang="revert"}{{endif}}</a>
</li>
<li>
<button type='submit' class='ipsButton ipsButton_primary ipsButton_small' data-action="save">{lang="save"}</button>
</li>
<li>
<span data-role='loading' class='ipsHide'><i class='icon-spinner2 ipsLoading_tinyIcon'></i> &nbsp;{lang="loading"}</span>
</li>
</ul>
</div>
<div id='elTemplateEditor_outerPanelWrap'>
<div id='elTemplateEditor_panelWrap'>
<ul id='elTemplateEditor_tabbar' class='ipsTabs ipsClearfix acpFormTabBar' data-ipsTabBar data-ipsTabBar-contentArea='#elTemplateEditor_panels'>
@@ -798,11 +923,6 @@
</div>
</div>
</div>
<br>
<ul class='ipsList_inline ipsType_light ipsType_small'>
<li class='cTemplateState_changed'> {lang="content_templates_modified"}</li>
<li class='cTemplateState_custom'> {lang="content_templates_custom"}</li>
</ul>
<div id='elTemplateEditor_attributesDialog' class='ipsHide'>
<div data-controller='cms.admin.templates.variablesDialog'>
<div class='ipsPad'>
@@ -837,7 +957,11 @@
</div>
</div>
</div>
</form>]]></template>
</form>
<ul class='ipsList_inline ipsType_light ipsType_small' id='elTemplateEditor_info'>
<li class='cTemplateState_changed'> {lang="content_templates_modified"}</li>
<li class='cTemplateState_custom'> {lang="content_templates_custom"}</li>
</ul>]]></template>
<template template_group="templates" template_name="viewTemplate" template_data="$template" template_location="admin" template_app="cms"><![CDATA[<div class='ipsPad'>
<strong>{lang="content_template_editor_fields_params"}:</strong> <span class='ipsType_monospace'>{$template['template_params']}</span>
<pre data-controller='core.global.editor.customtags' class='ipsType_monospace ipsTemplate_box' data-control="codemirror" data-mode="htmlmixed">
@@ -902,7 +1026,7 @@
{template="userPhoto" group="global" app="core" params="$record->author(), 'tiny'"}
</div>
<div class='ipsDataItem_main cWidgetComments'>
<div class="ipsCommentCount ipsPos_right {{if ( $record->record_comments ) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="replies_number" pluralize="$record->record_comments"}'>{expression="$record->record_comments"}</div>
<div class="ipsCommentCount ipsPos_right {{if ( $record->record_comments ) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="num_replies" pluralize="$record->record_comments"}'>{expression="$record->record_comments"}</div>
<div class='ipsType_break ipsContained'>
<a href="{$record->url()->setQueryString( 'do', 'getLastComment' )}" title='{lang="view_this_cmsrecord" sprintf="\IPS\Member::loggedIn()->language()->addToStack( 'content_db_lang_sl_' . $record::$customDatabaseId, FALSE ), $record->_title"}' class='ipsDataItem_title'>{$record->_title}</a>
</div>
@@ -938,7 +1062,7 @@
</ul>
</div>
{{endif}}]]></template>
<template template_group="widgets" template_name="Wysiwyg" template_data="$content, $orientation='horizontal'" template_location="front" template_app="cms"><![CDATA[<div class='ipsWidget_inner {{if $orientation == 'vertical'}}ipsPad{{endif}}'>
<template template_group="widgets" template_name="Wysiwyg" template_data="$content, $orientation='horizontal'" template_location="front" template_app="cms"><![CDATA[<div class='ipsWidget_inner ipsPad ipsType_richText'>
{$content|raw}
</div>
]]></template>
@@ -946,10 +1070,12 @@
#elPages_block_preview_wrapper {
background: transparent;
z-index: 1;
margin-left: 355px;
}
#elpages_block_preview {
width: 100%;
max-width: 600px;
min-width: 450px;
min-height: 230px;
margin: 10px 0;
@@ -963,23 +1089,10 @@
z-index: 0;
}</css>
<css css_location="front" css_app="cms" css_attributes="" css_path="database_index" css_name="featured.css">/* ----- */
.cCmsCategoryFeaturedEntry
{
border-bottom: 2px solid #ebebeb;
padding: 20px 0 30px 0;
}
.cCmsCategoryFeaturedEntry:last-child
{
border-bottom: 0px;
padding-bottom: 0px;
}
.cCmsCategoryFeaturedEntry .cCmsRecord_image {
float: left;
margin-right: 15px;
margin-top: 4px;
border: 4px solid #e2e2e2;
}
.cCmsCategoryFeaturedEntry .cCmsRecord_image img {
@@ -1006,17 +1119,6 @@
max-width: 150px;
}
.cmsCategory2col .ipsGrid_span6:nth-of-type(1) {
border-right: 1px solid #e2e2e2;
padding-right: 10px;
}
.cmsCategory2col .cCmsCategoryFeaturedEntry
{
border-bottom: 0px;
padding: 0px 0 30px 0;
}
.cmsCategory2col {
margin-top: 20px;
}
@@ -1044,12 +1146,6 @@
margin-top: 20px;
}
.cmsCategory3col .ipsGrid_span4:nth-of-type(1),
.cmsCategory3col .ipsGrid_span4:nth-of-type(2) {
border-right: 1px solid #e2e2e2;
padding-right: 10px;
}
/* 2 col featured image */
.cCmsCategoryFeaturedEntry.cms2ColImageFeature .cCmsRecord_image {
width: 100%;
@@ -1087,8 +1183,37 @@
.cCmsCategoryFeaturedEntry.cms3ColImageFeature .ipsType_pageTitle {
font-size: 14px;
}</css>
<css css_location="admin" css_app="cms" css_attributes="" css_path="media" css_name="media.css"><![CDATA[.cMedia_manager .ipsToolList li {
margin-top: 0 !important;
<css css_location="admin" css_app="cms" css_attributes="" css_path="media" css_name="media.css"><![CDATA[.cMedia_manager {
margin: -30px;
}
.cMedia_managerToolbar {
background: #c1c1c7;
height: 66px;
padding-top: 15px;
}
.cMedia_manager > .ipsColumns > .ipsColumn {
padding: 0;
background: #fff;
}
html[dir="ltr"] .cMedia_manager > .ipsColumns > .ipsColumn_wide {
border-right: 4px solid #c1c1c7;
}
html[dir="rtl"] .cMedia_manager > .ipsColumns > .ipsColumn_wide {
border-left: 4px solid #c1c1c7;
}
.cMedia_manager > .ipsColumns > .ipsColumn_wide .cMedia_managerToolbar {
padding-left: 15px;
padding-right: 15px;
}
html[dir="ltr"] .cMedia_manager > .ipsColumns > .ipsColumn_fluid .cMedia_managerToolbar {
padding-right: 15px;
}
html[dir="rtl"] .cMedia_manager > .ipsColumns > .ipsColumn_fluid .cMedia_managerToolbar {
padding-left: 15px;
}
/* TABS */
@@ -1104,21 +1229,22 @@
#elMedia_sidebarTabs .ipsTabs_activeItem {
background: #fff;
color: #000;
}
#elMedia_sidebar {
height: 550px;
overflow: auto;
}
#elMedia_fileList,
#elMedia_searchResults {
height: 587px;
overflow: auto;
}
#elMedia_searchField {
color: #333;
line-height: 34px;
padding: 0 7px;
}
.cMedia_item {
@@ -1197,8 +1323,10 @@
}]]></css>
<css css_location="front" css_app="cms" css_attributes="" css_path="pages" css_name="page.css">/* ----- */
.ipsWidget.ipsWidget_horizontal[data-blockid^=&quot;app_cms&quot;]:not(.ipsBox) {
.ipsWidget.ipsWidget_horizontal[data-blockid^=&quot;app_cms&quot;] {
padding: 0px !important;
background: transparent;
border: none;
}
#elCmsPageWrap .cWidgetContainer_managing ul {
@@ -1280,16 +1408,65 @@ div[data-controller=&quot;core.front.core.commentsWrapper&quot;] .ipsTabs {
max-width: 20px;
}</css>
<css css_location="admin" css_app="cms" css_attributes="" css_path="templates" css_name="templates.css"><![CDATA[/* ----- */
#elTemplateEditor {
margin: -30px;
}
.cTemplateControls {
background: #c1c1c7;
height: 66px;
padding-top: 15px;
}
.cTemplateControls .ipsButton.ipsButton_disabled {
opacity: 0.2;
}
#elTemplateEditor_fileListControls {
padding-left: 15px;
padding-right: 15px;
}
html[dir="ltr"] #elTemplateEditor_panelWrap,
html[dir="ltr"] #elTemplateEditor_panelToolbar {
margin-left: 15px;
padding-right: 15px;
}
html[dir="rtl"] #elTemplateEditor_panelWrap,
html[dir="rtl"] #elTemplateEditor_panelToolbar {
margin-right: 15px;
padding-left: 15px;
}
#elTemplateEditor > .ipsColumns > .ipsColumn {
padding: 0;
}
html[dir="ltr"] #elTemplateEditor > .ipsColumns > .ipsColumn_wide {
border-right: 4px solid #c1c1c7;
}
html[dir="rtl"] #elTemplateEditor > .ipsColumns > .ipsColumn_wide {
border-left: 4px solid #c1c1c7;
}
#elTemplateEditor_info {
position: fixed;
bottom: 0;
background: #fff;
text-align: center;
padding: 7px;
border-top: 1px solid rgba(0,0,0,0.2);
}
html[dir="ltr"] #elTemplateEditor_info {
left: 270px;
right: 0;
}
html[dir="ltr"] body.cAdminHideMenu #elTemplateEditor_info {
left: 70px;
}
html[dir="rtl"] #elTemplateEditor_info {
right: 270px;
left: 0;
}
html[dir="rtl"] body.cAdminHideMenu #elTemplateEditor_info {
right: 70px;
}
#elTemplateEditor .ipsTabs {
padding: 0;
}
@@ -1299,6 +1476,11 @@ html[dir="rtl"] #elTemplateEditor_panelToolbar {
text-overflow: clip !important;
}
#elTemplateEditor .ipsTabs_item.ipsTabs_activeItem {
background: #fff;
color: #000;
}
#elTemplateEditor [data-role="editor"],
#elTemplateEditor .CodeMirror {
border-width: 0px !important;
@@ -1325,7 +1507,6 @@ html[dir="rtl"] #elTemplateEditor_panelToolbar {
#elTemplateEditor_outerPanelWrap {
position: relative;
height: 590px;
}
#elTemplateEditor [data-role="templatePanelWrap"] {
@@ -1361,14 +1542,9 @@ html[dir="rtl"] #elTemplateEditor_panelToolbar {
/* FILE LISTING STYLES */
#elTemplateEditor_fileList {
height: 550px;
overflow: auto;
}
#elTemplateEditor [data-role="fileList"] .ipsTabs {
margin-top: 15px;
}
.cTemplateList a:not(.ipsCms_templateOptions) {
padding: 5px 0;
display: block;
@@ -1459,7 +1635,7 @@ a.ipsCms_templateOptions {
}
.cTemplateList li.cTemplateList_activeNode > a:not(.ipsCms_templateOptions) {
background: #748391;
background: #2E3D49;
color: #fff;
}
+22 -1
View File
@@ -185,5 +185,26 @@
"101096": "4.1.19.2",
"101097": "4.1.19.2",
"101098": "4.1.19.3",
"101099": "4.1.19.4"
"101099": "4.1.19.4",
"101100": "4.2.0 Beta 1",
"101101": "4.2.0 Beta 1",
"101102": "4.2.0 Beta 1",
"101103": "4.2.0 Beta 1",
"101104": "4.2.0 Beta 2",
"101105": "4.2.0 Beta 3",
"101106": "4.2.0 Beta 3a",
"101107": "4.2.0 Beta 4",
"101108": "4.2.0 Beta 4",
"101109": "4.2.0 Beta 5",
"101110": "4.2.0 Beta 5a",
"101111": "4.2.0 Beta 6",
"101112": "4.2.0 Beta 6a",
"101113": "4.2.0 Beta 6a",
"101114": "4.2.0 Beta 7",
"101115": "4.2.0 Beta 7a",
"101116": "4.2.0 Beta 8",
"101117": "4.2.0 Beta 8",
"102000": "4.2.0",
"102001": "4.2.0",
"102002": "4.2.0"
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Content Router extension: Records
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Board
* @since 17 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\ContentRouter;
@@ -32,10 +31,10 @@ class _Records
/**
* Constructor
*
* @param \IPS\Member|NULL $member If checking access, the member to check for, or NULL to not check access
* @param \IPS\Member|IPS\Member\Group|NULL $member If checking access, the member/group to check for, or NULL to not check access
* @return void
*/
public function __construct( \IPS\Member $member = NULL )
public function __construct( $member = NULL )
{
try
{
@@ -1,13 +1,12 @@
<?php
/**
* @brief Create Menu Extension : Records
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 18 Dec 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\CreateMenu;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Designers Mode Extension
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 28 Nov 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\DesignersMode;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Editor Extension: Block Form
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\EditorLocations;
@@ -1,93 +0,0 @@
<?php
/**
* @brief Editor Extension: Contact Form
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @subpackage Content
* @since 12 Nov 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\EditorLocations;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Editor Extension: Page Content
*/
class _PageContent
{
/**
* Can we use HTML in this editor?
*
* @param \IPS\Member $member The member
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
*/
public function canUseHtml( $member )
{
return TRUE;
}
/**
* Can we use attachments in this editor?
*
* @param \IPS\Member $member The member
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
*/
public function canAttach( $member )
{
return NULL;
}
/**
* Permission check for attachments
*
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param array $attachment The attachment data
* @return bool
*/
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
{
try
{
$recordClass = '\IPS\cms\Records' . $id3;
return $recordClass::load( $id1 )->canView( $member );
}
catch ( \OutOfRangeException $e )
{
return FALSE;
}
}
/**
* Attachment lookup
*
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @return \IPS\Http\Url|\IPS\Content|\IPS\Node\Model
* @throws \LogicException
*/
public function attachmentLookup( $id1, $id2, $id3 )
{
try
{
$recordClass = '\IPS\cms\Records' . $id3;
return $recordClass::load( $id1 );
}
catch ( \OutOfRangeException $e )
{
return FALSE;
}
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Editor Extension: Record Form
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\EditorLocations;
@@ -39,10 +38,16 @@ class _Records
* Can we use attachments in this editor?
*
* @param \IPS\Member $member The member
* @param \IPS\Helpers\Form\Editor $editor The editor instance
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
*/
public function canAttach( $member )
public function canAttach( $member, $editor )
{
if( !$editor->options['allowAttachments'] )
{
return FALSE;
}
return NULL;
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Editor Extension: Record Form
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\EditorLocations;
@@ -32,7 +31,7 @@ class _Widgets
*/
public function canUseHtml( $member )
{
return TRUE;
return NULL;
}
/**
@@ -1,13 +1,12 @@
<?php
/**
* @brief File Storage Extension: Media
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 07 July 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\FileStorage;
@@ -83,7 +82,7 @@ class _Media
/**
* Check if a file is valid
*
* @param \IPS\Http\Url $file The file to check
* @param string $file The file path to check
* @return bool
*/
public function isValidFile( $file )
@@ -1,13 +1,12 @@
<?php
/**
* @brief File Storage Extension: Pages
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 October 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\FileStorage;
@@ -69,7 +68,7 @@ class _Pages
/**
* Check if a file is valid
*
* @param \IPS\Http\Url $file The file to check
* @param string $file The file path to check
* @return bool
*/
public function isValidFile( $file )
@@ -1,13 +1,12 @@
<?php
/**
* @brief File Storage Extension: Records
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 11 April 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\FileStorage;
@@ -307,7 +306,7 @@ class _Records
/**
* Check if a file is valid
*
* @param \IPS\Http\Url $file The file to check
* @param string $file The file path to check
* @return bool
*/
public function isValidFile( $file )
@@ -1,13 +1,12 @@
<?php
/**
* @brief Front Navigation Extension: Pages
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 01 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\FrontNavigation;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Member Sync
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Aug 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\MemberSync;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Moderator Permissions: Databases
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 April 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\ModeratorPermissions;
@@ -46,12 +45,19 @@ class _Databases
/* Preload words */
\IPS\cms\Databases::databases();
return array(
$return = array(
'can_content_revisions_content' => 'YesNo',
'can_content_edit_record_slugs' => "YesNo",
'can_content_edit_meta_tags' => "YesNo",
'can_content_view_others_records' => "YesNo"
);
if ( \IPS\Application::appIsEnabled('forums') )
{
$return['can_copy_topic_database'] = 'YesNo';
}
return $return;
}
/**
@@ -1,13 +1,12 @@
<?php
/**
* @brief Template Plugin - Content: Block
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 12 March 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\OutputPlugins;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Template Plugin - Content: Database
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 12 March 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\OutputPlugins;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Template Plugin - Pages: Media
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 07 July 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\OutputPlugins;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Template Plugin - Pages: Page Url
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 27 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\OutputPlugins;
@@ -0,0 +1,43 @@
<?php
/**
* @brief Template Plugin - Content: Widget
* @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 Content
* @since 12 March 2014
*/
namespace IPS\cms\extensions\core\OutputPlugins;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Template Plugin - Content: Widget
*/
class _Widget
{
/**
* @brief Can be used when compiling CSS
*/
public static $canBeUsedInCss = FALSE;
/**
* Run the plug-in
*
* @param string $data The initial data from the tag
* @param array $options Array of options
* @return string Code to eval
*/
public static function runPlugin( $data, $options )
{
$config = ( isset( $options['config'] ) ) ? $options['config'] : array();
return "\IPS\Widget::load( \IPS\Application::load( '" . $options['app'] . "' ), '" . $data . "', '" . uniqid() . "', " . $config . " );";
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task: Convert bbcode pages to html pages post-3.4 upgrade
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 22 Jul 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task: Rebuild database categories
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 13 Jun 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task: Rebuild comment likes
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 16 Feb 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task: Rebuild database editor fields
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 27 March 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task: Rebuild database reciprocal maps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 31 May 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task: Rebuild database records
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 13 Jun 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Background Task: Resychronise the first post of a topic generated by Pages
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 7 Oct 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Queue;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Support Pages Databases in sitemaps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 1 April 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Sitemap;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Support Pages in sitemaps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 1 April 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Sitemap;
@@ -1,13 +1,12 @@
<?php
/**
* @brief File Storage Extension: Records
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 11 April 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Uninstall;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Uninstall callback
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 10 Feb 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\extensions\core\Uninstall;
+21
View File
@@ -8,6 +8,17 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
class cms_hook_FriendlyUrl extends _HOOK_CLASS_
{
/**
* Get FURL Definition
*
* @param bool $revert If TRUE, ignores all customisations and reloads from json
* @return array
*/
public static function furlDefinition( $revert=FALSE )
{
return array_merge( parent::furlDefinition( $revert ), array( 'content_page_path' => static::buildFurlDefinition( 'app=cms&module=pages&controller=page', 'app=cms&module=pages&controller=page', NULL, FALSE, NULL, FALSE, 'IPS\cms\Pages\Router' ) ) );
}
/**
* Create a friendly URL from a full URL, working out friendly URL data
*
@@ -41,6 +52,16 @@ class cms_hook_FriendlyUrl extends _HOOK_CLASS_
{
return $return;
}
/* The table may not yet exist if we're using the parser in an upgrade */
catch ( \Exception $e )
{
if( $e->getCode() == 1146 )
{
return $return;
}
throw $e;
}
}
/**
+2 -2
View File
@@ -19,13 +19,13 @@ class cms_hook_InternalUrl extends _HOOK_CLASS_
$return = parent::correctFriendlyUrl();
/* If it it thinks it belongs to "pages", we might be able to be more accurate */
if ( $return instanceof \IPS\Http\Url\Friendly and $return->seoTemplate === 'pages' and isset( $this->queryString['path'] ) )
if ( $return instanceof \IPS\Http\Url\Friendly and $return->seoTemplate === 'content_page_path' and isset( $this->queryString['path'] ) )
{
/* Try to find a page */
try
{
/* Create it */
$correctUrl = \IPS\cms\Pages\Page::loadFromPath( $this->queryString['path'] )->url();
$correctUrl = \IPS\cms\Pages\Router::loadFromUrl( $this )->url();
/* Set extra stuff in our query string */
$paramsToSet = array();
+1 -1
View File
@@ -29,7 +29,7 @@ class cms_hook_Output extends _HOOK_CLASS_
/* If we just logged out, we don't want to show a "no permission" error */
if ( isset( \IPS\Request::i()->_fromLogout ) )
{
$this->redirect( \IPS\Settings::i()->base_url );
$this->redirect( \IPS\Http\Url::internal('')->stripQueryString()->setQueryString( '_fromLogout', 1 ) );
}
/* If we're in an external script, just show a simple message */
+3 -2
View File
@@ -14,10 +14,11 @@ class cms_hook_Topic extends _HOOK_CLASS_
* @param string $action The action
* @param \IPS\Member|NULL $member The member doing the action (NULL for currently logged in member)
* @param string|NULL $reason Reason (for hides)
* @param bool $immediately Delete immediately
* @return void
* @throws \OutOfRangeException|\InvalidArgumentException|\RuntimeException
*/
public function modAction( $action, \IPS\Member $member = NULL, $reason = NULL )
public function modAction( $action, \IPS\Member $member = NULL, $reason = NULL, $immediately = FALSE )
{
if ( $action === 'delete' )
{
@@ -75,7 +76,7 @@ class cms_hook_Topic extends _HOOK_CLASS_
}
return parent::modAction( $action, $member, $reason );
return parent::modAction( $action, $member, $reason, $immediately );
}
}
+82 -82
View File
@@ -1,84 +1,84 @@
//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}
class cms_hook_Url extends _HOOK_CLASS_
{
/**
* Create from string
*
* This is overridden so that when we are examing a raw URL the "Gateway File" feature
* can appropriately claim the URL as belonging to it
*
* @param string $url A valid URL as per our definition (see phpDoc on class)
* @param bool $couldBeFriendly If the URL is known to not be friendly, FALSE can be passed here to save the performance implication of checking the URL
//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}
class cms_hook_Url extends _HOOK_CLASS_
{
/**
* Create from string
*
* This is overridden so that when we are examing a raw URL the "Gateway File" feature
* can appropriately claim the URL as belonging to it
*
* @param string $url A valid URL as per our definition (see phpDoc on class)
* @param bool $couldBeFriendly If the URL is known to not be friendly, FALSE can be passed here to save the performance implication of checking the URL
* @param bool $autoEncode If true, any invalid components will be automatically encoded rather than an exception thrown - useful if the entire link is user-provided
* @return \IPS\Http\Url
*/
public static function createFromString( $url, $couldBeFriendly=TRUE, $autoEncode=FALSE )
{
/* See what normal handling makes of it... */
$return = parent::createFromString( $url, $couldBeFriendly, $autoEncode );
/* If the normal handling doesn't recognise it as an internal URL and we
have a gateway file, check that */
if ( !( $return instanceof \IPS\Http\Url\Internal ) and \IPS\Settings::i()->cms_root_page_url )
{
/* Decode it */
$components = static::componentsFromUrlString( $url, $autoEncode );
/* Is it underneath the gateway? */
$gatewayUrlComponents = static::componentsFromUrlString( \IPS\Settings::i()->cms_root_page_url );
if ( $components[ static::COMPONENT_HOST ] === $gatewayUrlComponents[ static::COMPONENT_HOST ] and
$components[ static::COMPONENT_USERNAME ] === $gatewayUrlComponents[ static::COMPONENT_USERNAME ] and
$components[ static::COMPONENT_PASSWORD ] === $gatewayUrlComponents[ static::COMPONENT_PASSWORD ] and
$components[ static::COMPONENT_PORT ] === $gatewayUrlComponents[ static::COMPONENT_PORT ] and
mb_substr( $components[ static::COMPONENT_PATH ], 0, mb_strlen( $gatewayUrlComponents[ static::COMPONENT_PATH ] ) ) === $gatewayUrlComponents[ static::COMPONENT_PATH ]
)
{
$pathFromGatewayUrl = mb_substr( $components[ static::COMPONENT_PATH ], mb_strlen( $gatewayUrlComponents[ static::COMPONENT_PATH ] ) );
$fallback = FALSE;
if ( !$pathFromGatewayUrl or $pathFromGatewayUrl === 'index.php' )
{
if ( !$pathFromGatewayUrl )
{
$fallback = TRUE;
}
$queryString = \IPS\Http\Url::convertQueryAsArrayToString( $components[ static::COMPONENT_QUERY ] );
$pathFromGatewayUrl = trim( mb_substr( $queryString, 0, mb_strpos( $queryString, '&' ) ?: NULL ), '/' );
}
/* Try to find a page */
$page = NULL;
try
{
$page = \IPS\cms\Pages\Page::loadFromPath( $pathFromGatewayUrl );
return \IPS\Http\Url\Friendly::createFromComponents( $components[ static::COMPONENT_HOST ], $components[ static::COMPONENT_SCHEME ], $components[ static::COMPONENT_PATH ], $components[ static::COMPONENT_QUERY ], $components[ static::COMPONENT_PORT ], $components[ static::COMPONENT_USERNAME ], $components[ static::COMPONENT_PASSWORD ], $components[ static::COMPONENT_FRAGMENT ] )
->setFriendlyUrlData( 'content_page_path', array( $pathFromGatewayUrl ), array( 'path' => $pathFromGatewayUrl ), $pathFromGatewayUrl );
}
/* Couldn't find one? Don't accept responsibility, unless there was no $pathFromGatewayUrl and this is the gateway URL */
catch ( \OutOfRangeException $e )
{
if ( $fallback and (string) $return->stripQueryString() === \IPS\Settings::i()->cms_root_page_url )
{
try
{
$page = \IPS\cms\Pages\Page::loadFromPath( '' );
return \IPS\Http\Url\Friendly::createFromComponents( $components[ static::COMPONENT_HOST ], $components[ static::COMPONENT_SCHEME ], $components[ static::COMPONENT_PATH ], $components[ static::COMPONENT_QUERY ], $components[ static::COMPONENT_PORT ], $components[ static::COMPONENT_USERNAME ], $components[ static::COMPONENT_PASSWORD ], $components[ static::COMPONENT_FRAGMENT ] )
->setFriendlyUrlData( 'content_page_path', array( '' ), array( 'path' => '' ), '' );
}
catch ( \OutOfRangeException $e ) { }
}
}
}
}
/* Return */
return $return;
}
* @return \IPS\Http\Url
*/
public static function createFromString( $url, $couldBeFriendly=TRUE, $autoEncode=FALSE )
{
/* See what normal handling makes of it... */
$return = parent::createFromString( $url, $couldBeFriendly, $autoEncode );
/* If the normal handling doesn't recognise it as an internal URL and we
have a gateway file, check that */
if ( !( $return instanceof \IPS\Http\Url\Internal ) and \IPS\Settings::i()->cms_root_page_url )
{
/* Decode it */
$components = static::componentsFromUrlString( $url, $autoEncode );
/* Is it underneath the gateway? */
$gatewayUrlComponents = static::componentsFromUrlString( \IPS\Settings::i()->cms_root_page_url );
if ( $components[ static::COMPONENT_HOST ] === $gatewayUrlComponents[ static::COMPONENT_HOST ] and
$components[ static::COMPONENT_USERNAME ] === $gatewayUrlComponents[ static::COMPONENT_USERNAME ] and
$components[ static::COMPONENT_PASSWORD ] === $gatewayUrlComponents[ static::COMPONENT_PASSWORD ] and
$components[ static::COMPONENT_PORT ] === $gatewayUrlComponents[ static::COMPONENT_PORT ] and
mb_substr( $components[ static::COMPONENT_PATH ], 0, mb_strlen( $gatewayUrlComponents[ static::COMPONENT_PATH ] ) ) === $gatewayUrlComponents[ static::COMPONENT_PATH ]
)
{
$pathFromGatewayUrl = mb_substr( $components[ static::COMPONENT_PATH ], mb_strlen( $gatewayUrlComponents[ static::COMPONENT_PATH ] ) );
$fallback = FALSE;
if ( !$pathFromGatewayUrl or $pathFromGatewayUrl === 'index.php' )
{
if ( !$pathFromGatewayUrl )
{
$fallback = TRUE;
}
$queryString = \IPS\Http\Url::convertQueryAsArrayToString( $components[ static::COMPONENT_QUERY ] );
$pathFromGatewayUrl = trim( mb_substr( $queryString, 0, mb_strpos( $queryString, '&' ) ?: NULL ), '/' );
}
/* Try to find a page */
$page = NULL;
try
{
$page = \IPS\cms\Pages\Page::loadFromPath( $pathFromGatewayUrl );
return \IPS\Http\Url\Friendly::createFromComponents( $components[ static::COMPONENT_HOST ], $components[ static::COMPONENT_SCHEME ], $components[ static::COMPONENT_PATH ], $components[ static::COMPONENT_QUERY ], $components[ static::COMPONENT_PORT ], $components[ static::COMPONENT_USERNAME ], $components[ static::COMPONENT_PASSWORD ], $components[ static::COMPONENT_FRAGMENT ] )
->setFriendlyUrlData( 'content_page_path', array( $pathFromGatewayUrl ), array( 'path' => $pathFromGatewayUrl ), $pathFromGatewayUrl );
}
/* Couldn't find one? Don't accept responsibility, unless there was no $pathFromGatewayUrl and this is the gateway URL */
catch ( \OutOfRangeException $e )
{
if ( $fallback and (string) $return->stripQueryString() === \IPS\Settings::i()->cms_root_page_url )
{
try
{
$page = \IPS\cms\Pages\Page::loadFromPath( '' );
return \IPS\Http\Url\Friendly::createFromComponents( $components[ static::COMPONENT_HOST ], $components[ static::COMPONENT_SCHEME ], $components[ static::COMPONENT_PATH ], $components[ static::COMPONENT_QUERY ], $components[ static::COMPONENT_PORT ], $components[ static::COMPONENT_USERNAME ], $components[ static::COMPONENT_PASSWORD ], $components[ static::COMPONENT_FRAGMENT ] )
->setFriendlyUrlData( 'content_page_path', array( '' ), array( 'path' => '' ), '' );
}
catch ( \OutOfRangeException $e ) { }
}
}
}
}
/* Return */
return $return;
}
}
+33
View File
@@ -0,0 +1,33 @@
//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}
class cms_hook_topics extends _HOOK_CLASS_
{
/* !Hook Data - DO NOT REMOVE */
public static function hookData() {
return array_merge_recursive( array (
'topic' =>
array (
0 =>
array (
'selector' => '#elTopicActions_menu',
'type' => 'add_inside_start',
'content' => '{{if $topic->hidden() != -2 and \IPS\Member::loggedIn()->modPermission( \'can_copy_topic_database\' )}}
<li class=\'ipsMenu_item\'>
<a href=\'{url="app=cms&module=database&controller=topic&id=$topic->tid&_new=1" base="front" seoTemplate="topic_copy" seoTitle="$topic->title_seo"}\' data-ipsDialog data-ipsDialog-size=\'narrow\' data-ipsDialog-remoteVerify=\'false\' data-ipsDialog-title=\'{lang="copy_select_database"}\'>{lang="copy_topic_to_database"}</a>
</li>
{{endif}}',
),
),
), parent::hookData() );
}
/* End Hook Data */
}
-35
View File
@@ -1,35 +0,0 @@
//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}
class cms_hook_websiteUrl extends _HOOK_CLASS_
{
/* !Hook Data - DO NOT REMOVE */
public static function hookData() {
return array_merge_recursive( array (
'globalTemplate' =>
array (
0 =>
array (
'selector' => 'html > body > meta[itemprop=\'url\']',
'type' => 'replace',
'content' => '{{if \IPS\Settings::i()->cms_use_different_gateway AND \IPS\Settings::i()->cms_root_page_url}}
<meta itemprop="url" content="{setting="cms_root_page_url"}">
{{else}}
<meta itemprop="url" content="{setting="base_url"}">
{{endif}}',
),
),
), parent::hookData() );
}
/* End Hook Data */
}
@@ -0,0 +1,32 @@
<?php
/**
* @brief Pages External Block Gateway
* @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 Content
* @since 30 Jun 2015
*
*/
require_once str_replace( 'applications/cms/interface/developer/developer.php', '', str_replace( '\\', '/', __FILE__ ) ) . 'init.php';
\IPS\Dispatcher\External::i();
if ( \IPS\IN_DEV !== true AND ! \IPS\Theme::designersModeEnabled() )
{
exit();
}
/* The CSS is parsed by the theme engine, and the theme engine has plugins, and those plugins need to now which theme ID we're using */
if ( \IPS\Theme::designersModeEnabled() )
{
\IPS\Session\Front::i();
}
if ( isset( \IPS\Request::i()->file ) )
{
$file = file_get_contents( \IPS\ROOT_PATH . '/' . \IPS\Request::i()->file );
\IPS\Output::i()->sendOutput( preg_replace( '#<ips:template.+?\n#', '', $file ), 200, ( mb_substr( \IPS\Request::i()->file, -4 ) === '.css' ) ? 'text/css' : 'text/javascript' );
}
+3 -2
View File
@@ -1,7 +1,7 @@
/*
* IPS external widgets loader
*
* http://www.invisionpower.com
* https://www.invisioncommunity.com
*/
( function () {
"use strict";
@@ -125,6 +125,7 @@
var widgetID = widgetAttributes.id.replace( 'block_', '' );
var blockID = widgetAttributes['data-blockid'];
var blockParams = widgetAttributes['data-blockparams'];
_widgets[ widgetID ] = {
blockID: blockID
@@ -134,7 +135,7 @@
var iframe;
iframe = document.createElement('iframe');
iframe.src = _baseURL + '?widgetid=' + widgetID + '&blockid=' + blockID;
iframe.src = _baseURL + '?widgetid=' + widgetID + '&blockid=' + blockID + ( blockParams ? '&' + blockParams : '' );
iframe.id = 'ipsFrame_' + widgetID;
iframe.scrolling = 'no';
iframe.style.width = '100%';
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Pages External Block Gateway
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 Jun 2015
* @version SVN_VERSION_NUMBER
*
*/
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Pages Download Handler for custom record upload fields
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 27 May 2015
* @version SVN_VERSION_NUMBER
*/
require_once str_replace( 'applications/cms/interface/file/file.php', '', str_replace( '\\', '/', __FILE__ ) ) . 'init.php';
@@ -1,13 +1,12 @@
<?php
/**
* @brief Fields Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 8 April 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\databases;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Databases Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 31 March 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\databases;
@@ -61,7 +60,7 @@ class _databases extends \IPS\Node\Controller
'database_name' => '50'
);
$table->mainColumn = 'word_custom';
$table->mainColumn = 'database_name';
$table->quickSearch = 'word_custom';
$table->sortBy = $table->sortBy ?: 'word_custom';
@@ -124,13 +123,12 @@ class _databases extends \IPS\Node\Controller
);
/* Buttons */
$table->rootButtons = array(
'add' => array(
'title' => 'add',
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=add' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('cms_database_add') )
),
\IPS\Output::i()->sidebar['actions']['add'] = array(
'primary' => true,
'title' => 'add',
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=add' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('cms_database_add') )
);
/*if ( \IPS\Application::appIsEnabled('forums') )
@@ -216,7 +214,7 @@ class _databases extends \IPS\Node\Controller
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_databases.js', 'cms', 'admin' ) );
/* Display */
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( \IPS\Member::loggedIn()->language()->addToStack('menu__cms_databases_databases'), (string) $table );
\IPS\Output::i()->output = (string) $table;
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__cms_databases_databases');
}
@@ -289,6 +287,20 @@ class _databases extends \IPS\Node\Controller
$database->key = uniqid();
$database->save();
/* Set default perms, these will be editable post DB import */
\IPS\Db::i()->replace( 'core_permission_index', array(
'app' => 'cms',
'perm_type' => $database::$permType,
'perm_type_id' => $database->id,
'perm_view' => '*',
'perm_2' => '*', #read
'perm_3' => \IPS\Settings::i()->admin_group, #add
'perm_4' => \IPS\Settings::i()->admin_group, #edit
'perm_5' => \IPS\Settings::i()->admin_group, #reply
'perm_6' => \IPS\Settings::i()->admin_group, #rate
'perm_7' => \IPS\Settings::i()->admin_group, #review
) );
$json = json_decode( @file_get_contents( \IPS\ROOT_PATH . "/applications/cms/data/databaseschema.json" ), true );
$table = $json['cms_custom_database_1'];
@@ -394,19 +406,6 @@ class _databases extends \IPS\Node\Controller
$database->save();
/* Set default perms, these will be editable post DB import */
$perms = $database->permissions();
\IPS\Db::i()->update( 'core_permission_index', array(
'perm_view' => '*',
'perm_2' => '*', #read
'perm_3' => \IPS\Settings::i()->admin_group, #add
'perm_4' => \IPS\Settings::i()->admin_group, #edit
'perm_5' => \IPS\Settings::i()->admin_group, #reply
'perm_6' => \IPS\Settings::i()->admin_group, #rate
'perm_7' => \IPS\Settings::i()->admin_group, #review
), array( 'perm_id=?', $perms['perm_id'] ) );
/* set up some stores (and make sure they are clean from previous possibly broken imports */
\IPS\Data\Store::i()->db_import_cat_map = array();
\IPS\Data\Store::i()->db_import_cat_parent_map = array();
@@ -498,8 +497,15 @@ class _databases extends \IPS\Node\Controller
$fieldsClass = 'IPS\cms\Fields' . $database->id;
$obj = new $fieldsClass;
$obj->saveForm( $obj->formatFormValues( $attrs ) );
$values = $obj->formatFormValues( $attrs );
if ( isset( $attrs['field_extra'] ) )
{
/* The export format is always correct */
$values['field_extra'] = $attrs['field_extra'];
}
$obj->saveForm( $values );
if ( $displayJson )
{
@@ -524,9 +530,26 @@ class _databases extends \IPS\Node\Controller
\IPS\Data\Store::i()->db_import_field_map = $map;
$existingPerms = $obj->permissions();
$existingPerms = $obj->permissions();
$newPerms = array_merge( $perms, array( 'perm_id' => $existingPerms['perm_id'], 'perm_type_id' => $obj->id ) );
/* Set default permissions if not defined in export */
if( !isset( $perms['perm_view'] ) )
{
$newPerms['perm_view'] = '*';
}
if( !isset( $perms['perm_2'] ) )
{
$newPerms['perm_2'] = \IPS\Settings::i()->admin_group;
}
if( !isset( $perms['perm_3'] ) )
{
$newPerms['perm_3'] = \IPS\Settings::i()->admin_group;
}
\IPS\Db::i()->update( 'core_permission_index', array_merge( $perms, array( 'perm_id' => $existingPerms['perm_id'], 'perm_type_id' => $obj->id ) ), array( 'perm_id=?', $existingPerms['perm_id'] ) );
\IPS\Db::i()->update( 'core_permission_index', $newPerms, array( 'perm_id=?', $existingPerms['perm_id'] ) );
\IPS\Lang::saveCustom( 'cms', "content_field_" . $obj->id, $attrs['field_title'] );
@@ -1144,6 +1167,296 @@ class _databases extends \IPS\Node\Controller
}
}
/* Get the database form - abstracted so plugins can adjust easier */
$form = $this->_getDatabaseForm( $current, $category );
if ( $values = $form->values() )
{
$new = FALSE;
if ( empty( $current ) )
{
$new = TRUE;
$current = new \IPS\cms\Databases;
$current->key = uniqid(); # This is modified below to use a proper key
$current->featured_settings = NULL;
$current->fixed_field_perms = NULL;
$current->save();
/* Create a new database table */
try
{
\IPS\cms\Databases::createDatabase( $current );
$current->preLoadWords();
\IPS\Member::clearCreateMenu();
}
catch ( \Exception $ex )
{
$current->delete();
\IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack('content_acp_err_db_creation_fail', FALSE, array( 'sprintf' => $ex->getMessage() ) ), '4T259/1', 403, '' );
}
}
if ( ! $values['database_key'] )
{
if ( is_array( $values['database_name'] ) )
{
$keyToUse = uniqid();
foreach( $values['database_name'] as $langId => $word )
{
if ( ! empty( $word ) )
{
$keyToUse = $word;
break;
}
}
$current->key = \IPS\Http\Url\Friendly::seoTitle( $keyToUse );
}
else
{
$current->key = \IPS\Http\Url\Friendly::seoTitle( $values['database_name'] );
}
/* Now test it */
try
{
$database = \IPS\cms\Databases::load( $current->key, 'database_key');
/* It's taken... */
if ( $current->id != $database->id )
{
$current->key .= '_' . uniqid();
}
}
catch( \OutOfRangeException $ex )
{
/* Doesn't exist? Good! */
}
}
else
{
$current->key = $values['database_key'];
}
/* Bit options */
foreach ( array( 'comments', 'comments_mod', 'reviews', 'reviews_mod', 'indefinite_own_edit' ) as $k )
{
if ( isset( $values[ "cms_bitoptions_{$k}" ] ) )
{
$current->options[ $k ] = $values["cms_bitoptions_{$k}"];
unset( $values["cms_bitoptions_{$k}"] );
}
}
\IPS\Lang::saveCustom( 'cms', "content_db_" . $current->id, $values['database_name'] );
\IPS\Lang::saveCustom( 'cms', "content_db_" . $current->id . '_desc', $values['database_description'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_sl_" . $current->id, $values['database_lang_sl'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_pl_" . $current->id, $values['database_lang_pl'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_su_" . $current->id, $values['database_lang_su'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_pu_" . $current->id, $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_ia_" . $current->id, $values['database_lang_ia'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_sl_" . $current->id . '_pl', $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "digest_area_cms_records" . $current->id, $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "digest_area_cms_categories" . $current->id, $values['database_lang_pu'] );
$menu = array();
foreach( \IPS\Lang::getEnabledLanguages() as $id => $lang )
{
$menu[ $lang->_id ] = \sprintf( $lang->get('cms_create_menu_records_x'), $values['database_lang_su'][ $lang->_id ], $values['database_name'][ $lang->_id ] );
}
/* Notification, search/followed/new content langs */
\IPS\Lang::saveCustom( 'cms', "cms_create_menu_records_" . $current->id, $menu );
\IPS\Lang::saveCustom( 'cms', "cms_records" . $current->id . '_pl', $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "module__cms_records" . $current->id, $values['database_name'] );
$current->use_categories = $values['database_use_categories'];
$current->template_categories = $values['database_template_categories'];
$current->template_listing = $values['database_template_listing'];
$current->template_display = $values['database_template_display'];
$current->template_form = $values['database_template_form'];
$current->template_featured = $values['database_template_featured'];
$current->cat_index_type = $values['database_cat_index_type'];
$current->use_as_page_title = $values['database_use_as_page_title'];
$current->all_editable = (int) $values['database_all_editable'];
$current->revisions = (int) $values['database_revisions'];
$current->search = (int) $values['database_search'];
$current->comment_bump = $values['database_comment_bump'];
if ( $values['database_rss_enable'] )
{
$current->rss = $values['database_rss'];
}
else
{
$current->rss = 0;
}
$current->record_approve = $values['database_record_approve'];
if ( \IPS\Settings::i()->tags_enabled )
{
$current->tags_enabled = (int) $values['database_tags_enabled'];
$current->tags_noprefixes = !(bool) $values['database_tags_noprefixes'];
if ( ! \IPS\Settings::i()->tags_open_system )
{
$current->tags_predefined = ( is_array( $values['database_tags_predefined'] ) ) ? implode( ',', array_filter( array_map( 'trim', $values['database_tags_predefined'] ) ) ) : NULL;
}
}
$categories = 0;
if ( isset( $values['database_featured_categories'] ) )
{
if ( $values['database_featured_categories'] !== 0 )
{
$categories = array_keys( $values['database_featured_categories'] );
}
}
/* Featured settings */
$current->featured_settings = array(
'featured' => $values['database_featured_featured'],
'perpage' => $values['database_featured_perpage'],
'pagination' => $values['database_featured_pagination'],
'sort' => $values['database_featured_sort'],
'direction' => $values['database_featured_direction'],
'categories' => $categories
);
$current->field_sort = $values['database_field_sort'];
$current->field_direction = $values['database_field_direction'];
$current->field_perpage = $values['database_field_perpage'];
if ( \IPS\Application::appIsEnabled( 'forums' ) )
{
$current->forum_record = (int) $values['database_forum_record'];
$current->forum_comments = (int) $values['database_forum_comments'];
$current->forum_forum = ( ! $values['database_forum_forum'] ) ? 0 : $values['database_forum_forum']->id;
$current->forum_prefix = $values['database_forum_prefix'];
$current->forum_suffix = $values['database_forum_suffix'];
$current->forum_delete = (int) $values['database_forum_delete'];
}
else
{
$current->forum_record = 0;
$current->forum_comments = 0;
$current->forum_delete = 0;
}
$fieldSettingJson = array();
foreach( $values as $k => $v )
{
if ( mb_stristr( $k, 'fixed_field_setting__' ) )
{
$bits = explode( '__', $k );
$fieldSettingJson[ $bits[1] ][ $bits[2] ] = $v;
}
}
$current->fixed_field_settings = $fieldSettingJson;
$fixedFields = $current->fixed_field_perms;
$fixedFields['record_image']['visible'] = $values['database_record_image'];
foreach( array( 'perm_view', 'perm_2', 'perm_3' ) as $p )
{
if ( ! isset( $fixedFields['record_image'][ $p ] ) )
{
$fixedFields['record_image'][ $p ] = '*';
}
}
$current->fixed_field_perms = $fixedFields;
$current->use_categories = $values['database_use_categories'];
$current->save();
/* Make sure we have a default category */
$current->default_category = $current->_default_category;
if ( ! $current->use_categories )
{
$class = '\IPS\cms\Categories' . $current->id;
$category = $class::load( $current->get__default_category() );
$category->allow_rating = $values['category_allow_rating'];
$category->can_view_others = $values['category_can_view_others'];
$category->save();
}
if ( $new )
{
if ( $values['database_create_page'] === 'new' )
{
$pageValues = array();
foreach( $values as $k => $v )
{
if( mb_strpos( $k, 'page_' ) === 0 )
{
$pageValues[ $k ] = $v;
}
}
if ( $values['page_type'] === 'html' )
{
$pageValues['page_content'] = '{database="' . $current->id . '"}';
$pageValues['page_template'] = '';
}
$pageValues['page_folder_id'] = $pageValues['page_folder_id'] ?: 0;
$newPage = \IPS\cms\Pages\Page::createFromForm( $pageValues, 'html' );
if ( $values['page_type'] !== 'html' )
{
\IPS\Db::i()->insert( 'cms_page_widget_areas', array(
'area_page_id' => $newPage->id,
'area_widgets' => json_encode( array( array( 'app' => 'cms', 'key' => 'Database', 'unique' => uniqid(), 'configuration' => array( 'database' => $current->id ) ) ) ),
'area_area' => 'col1',
'area_orientation' => 'horizontal'
) );
}
$current->page_id = $newPage->id;
$current->save();
}
}
else
{
/* Use categories setting may have changed */
$current->preLoadWords();
\IPS\Member::clearCreateMenu();
}
if ( $new )
{
\IPS\Session::i()->log( 'acplogs__cms_added_database', array( 'content_db_' . $current->id => TRUE ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=permissions&id=' . $current->id ) );
}
\IPS\Session::i()->log( 'acplogs__cms_edited_database', array( 'content_db_' . $current->id => TRUE ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases' ), 'saved' );
}
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( $current ? "content_db_" . $current->id : 'add', $form, FALSE );
\IPS\Output::i()->title = ( $current ) ? \IPS\Member::loggedIn()->language()->addToStack('cms_editing_database', NULL, array( 'sprintf' => array( $current->_title ) ) ) : \IPS\Member::loggedIn()->language()->addToStack('cms_adding_database');
}
/**
* Generate the database form
*
* @param \IPS\cms\Databases $current The current database
* @param \IPS\cms\Categories $category The default catgory
* @return \IPS\Form
*/
protected function _getDatabaseForm( $current, $category )
{
$form = new \IPS\Helpers\Form( 'form', 'save', NULL, array( 'data-controller' => 'cms.admin.databases.form' ) );
$form->addTab( 'content_database_form_details' );
@@ -1569,282 +1882,7 @@ class _databases extends \IPS\Node\Controller
}
}
}
if ( $values = $form->values() )
{
$new = FALSE;
if ( empty( $current ) )
{
$new = TRUE;
$current = new \IPS\cms\Databases;
$current->key = uniqid(); # This is modified below to use a proper key
$current->featured_settings = NULL;
$current->fixed_field_perms = NULL;
$current->save();
/* Create a new database table */
try
{
\IPS\cms\Databases::createDatabase( $current );
$current->preLoadWords();
\IPS\Member::clearCreateMenu();
}
catch ( \Exception $ex )
{
$current->delete();
\IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack('content_acp_err_db_creation_fail', FALSE, array( 'sprintf' => $ex->getMessage() ) ), '4T259/1', 403, '' );
}
}
if ( ! $values['database_key'] )
{
if ( is_array( $values['database_name'] ) )
{
$keyToUse = uniqid();
foreach( $values['database_name'] as $langId => $word )
{
if ( ! empty( $word ) )
{
$keyToUse = $word;
break;
}
}
$current->key = \IPS\Http\Url\Friendly::seoTitle( $keyToUse );
}
else
{
$current->key = \IPS\Http\Url\Friendly::seoTitle( $values['database_name'] );
}
/* Now test it */
try
{
$database = \IPS\cms\Databases::load( $current->key, 'database_key');
/* It's taken... */
if ( $current->id != $database->id )
{
$current->key .= '_' . uniqid();
}
}
catch( \OutOfRangeException $ex )
{
/* Doesn't exist? Good! */
}
}
else
{
$current->key = $values['database_key'];
}
/* Bit options */
foreach ( array( 'comments', 'comments_mod', 'reviews', 'reviews_mod', 'indefinite_own_edit' ) as $k )
{
if ( isset( $values[ "cms_bitoptions_{$k}" ] ) )
{
$current->options[ $k ] = $values["cms_bitoptions_{$k}"];
unset( $values["cms_bitoptions_{$k}"] );
}
}
\IPS\Lang::saveCustom( 'cms', "content_db_" . $current->id, $values['database_name'] );
\IPS\Lang::saveCustom( 'cms', "content_db_" . $current->id . '_desc', $values['database_description'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_sl_" . $current->id, $values['database_lang_sl'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_pl_" . $current->id, $values['database_lang_pl'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_su_" . $current->id, $values['database_lang_su'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_pu_" . $current->id, $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_ia_" . $current->id, $values['database_lang_ia'] );
\IPS\Lang::saveCustom( 'cms', "content_db_lang_sl_" . $current->id . '_pl', $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "digest_area_cms_records" . $current->id, $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "digest_area_cms_categories" . $current->id, $values['database_lang_pu'] );
$menu = array();
foreach( \IPS\Lang::getEnabledLanguages() as $id => $lang )
{
$menu[ $lang->_id ] = \sprintf( $lang->get('cms_create_menu_records_x'), $values['database_lang_su'][ $lang->_id ], $values['database_name'][ $lang->_id ] );
}
/* Notification, search/followed/new content langs */
\IPS\Lang::saveCustom( 'cms', "cms_create_menu_records_" . $current->id, $menu );
\IPS\Lang::saveCustom( 'cms', "cms_records" . $current->id . '_pl', $values['database_lang_pu'] );
\IPS\Lang::saveCustom( 'cms', "module__cms_records" . $current->id, $values['database_name'] );
$current->use_categories = $values['database_use_categories'];
$current->template_categories = $values['database_template_categories'];
$current->template_listing = $values['database_template_listing'];
$current->template_display = $values['database_template_display'];
$current->template_form = $values['database_template_form'];
$current->template_featured = $values['database_template_featured'];
$current->cat_index_type = $values['database_cat_index_type'];
$current->use_as_page_title = $values['database_use_as_page_title'];
$current->all_editable = (int) $values['database_all_editable'];
$current->revisions = (int) $values['database_revisions'];
$current->search = (int) $values['database_search'];
$current->comment_bump = $values['database_comment_bump'];
if ( $values['database_rss_enable'] )
{
$current->rss = $values['database_rss'];
}
else
{
$current->rss = 0;
}
$current->record_approve = $values['database_record_approve'];
if ( \IPS\Settings::i()->tags_enabled )
{
$current->tags_enabled = (int) $values['database_tags_enabled'];
$current->tags_noprefixes = !(bool) $values['database_tags_noprefixes'];
if ( ! \IPS\Settings::i()->tags_open_system )
{
$current->tags_predefined = ( is_array( $values['database_tags_predefined'] ) ) ? implode( ',', array_filter( array_map( 'trim', $values['database_tags_predefined'] ) ) ) : NULL;
}
}
$categories = 0;
if ( isset( $values['database_featured_categories'] ) )
{
if ( $values['database_featured_categories'] !== 0 )
{
$categories = array_keys( $values['database_featured_categories'] );
}
}
/* Featured settings */
$current->featured_settings = array(
'featured' => $values['database_featured_featured'],
'perpage' => $values['database_featured_perpage'],
'pagination' => $values['database_featured_pagination'],
'sort' => $values['database_featured_sort'],
'direction' => $values['database_featured_direction'],
'categories' => $categories
);
$current->field_sort = $values['database_field_sort'];
$current->field_direction = $values['database_field_direction'];
$current->field_perpage = $values['database_field_perpage'];
if ( \IPS\Application::appIsEnabled( 'forums' ) )
{
$current->forum_record = (int) $values['database_forum_record'];
$current->forum_comments = (int) $values['database_forum_comments'];
$current->forum_forum = ( ! $values['database_forum_forum'] ) ? 0 : $values['database_forum_forum']->id;
$current->forum_prefix = $values['database_forum_prefix'];
$current->forum_suffix = $values['database_forum_suffix'];
$current->forum_delete = (int) $values['database_forum_delete'];
}
else
{
$current->forum_record = 0;
$current->forum_comments = 0;
$current->forum_delete = 0;
}
$fieldSettingJson = array();
foreach( $values as $k => $v )
{
if ( mb_stristr( $k, 'fixed_field_setting__' ) )
{
$bits = explode( '__', $k );
$fieldSettingJson[ $bits[1] ][ $bits[2] ] = $v;
}
}
$current->fixed_field_settings = $fieldSettingJson;
$fixedFields = $current->fixed_field_perms;
$fixedFields['record_image']['visible'] = $values['database_record_image'];
foreach( array( 'perm_view', 'perm_2', 'perm_3' ) as $p )
{
if ( ! isset( $fixedFields['record_image'][ $p ] ) )
{
$fixedFields['record_image'][ $p ] = '*';
}
}
$current->fixed_field_perms = $fixedFields;
$current->use_categories = $values['database_use_categories'];
$current->save();
/* Make sure we have a default category */
$current->default_category = $current->_default_category;
if ( ! $current->use_categories )
{
$class = '\IPS\cms\Categories' . $current->id;
$category = $class::load( $current->get__default_category() );
$category->allow_rating = $values['category_allow_rating'];
$category->can_view_others = $values['category_can_view_others'];
$category->save();
}
if ( $new )
{
if ( $values['database_create_page'] === 'new' )
{
$pageValues = array();
foreach( $values as $k => $v )
{
if( mb_strpos( $k, 'page_' ) === 0 )
{
$pageValues[ $k ] = $v;
}
}
if ( $values['page_type'] === 'html' )
{
$pageValues['page_content'] = '{database="' . $current->id . '"}';
$pageValues['page_template'] = '';
}
$pageValues['page_folder_id'] = $pageValues['page_folder_id'] ?: 0;
$newPage = \IPS\cms\Pages\Page::createFromForm( $pageValues, 'html' );
if ( $values['page_type'] !== 'html' )
{
\IPS\Db::i()->insert( 'cms_page_widget_areas', array(
'area_page_id' => $newPage->id,
'area_widgets' => json_encode( array( array( 'app' => 'cms', 'key' => 'Database', 'unique' => uniqid(), 'configuration' => array( 'database' => $current->id ) ) ) ),
'area_area' => 'col1',
'area_orientation' => 'horizontal'
) );
}
$current->page_id = $newPage->id;
$current->save();
}
}
else
{
/* Use categories setting may have changed */
$current->preLoadWords();
\IPS\Member::clearCreateMenu();
}
if ( $new )
{
\IPS\Session::i()->log( 'acplogs__cms_added_database', array( 'content_db_' . $current->id => TRUE ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=permissions&id=' . $current->id ) );
}
\IPS\Session::i()->log( 'acplogs__cms_edited_database', array( 'content_db_' . $current->id => TRUE ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases' ), 'saved' );
}
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( $current ? "content_db_" . $current->id : 'add', $form, FALSE );
\IPS\Output::i()->title = ( $current ) ? \IPS\Member::loggedIn()->language()->addToStack('cms_editing_database', NULL, array( 'sprintf' => array( $current->_title ) ) ) : \IPS\Member::loggedIn()->language()->addToStack('cms_adding_database');
return $form;
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Fields Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 31 March 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\databases;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Records Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 8 April 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\databases;
@@ -124,23 +123,21 @@ class _records extends \IPS\Dispatcher\Controller
/* Buttons */
if ( $database->use_categories )
{
$table->rootButtons = array(
'add' => array(
'title' => 'add',
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=records&do=select&database_id=' . \IPS\Request::i()->database_id ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('database_select_category' ) )
),
\IPS\Output::i()->sidebar['actions']['add'] = array(
'primary' => true,
'title' => 'add',
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=records&do=select&database_id=' . \IPS\Request::i()->database_id ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('database_select_category' ) )
);
}
else
{
$table->rootButtons = array(
'add' => array(
'title' => 'add',
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=records&do=form&database_id=' . \IPS\Request::i()->database_id )
),
\IPS\Output::i()->sidebar['actions']['add'] = array(
'primary' => true,
'title' => 'add',
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=records&do=form&database_id=' . \IPS\Request::i()->database_id )
);
}
@@ -223,7 +220,7 @@ class _records extends \IPS\Dispatcher\Controller
\IPS\Member::loggedIn()->language()->words[ $table->langPrefix . $database->field_title ] = \IPS\Member::loggedIn()->language()->addToStack($table->langPrefix . 'title');
/* Display */
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( $title, (string) $table );
\IPS\Output::i()->output = (string) $table;
\IPS\Output::i()->title = $title;
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Customization AJAX actions
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 07 May 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\pages;
+38 -27
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Block Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 19 Feb 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\pages;
@@ -48,7 +47,29 @@ class _blocks extends \IPS\Node\Controller
public function manage()
{
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__cms_pages_blocks');
$nodeClass = $this->nodeClass;
if ( $nodeClass::canAddRoot() )
{
\IPS\Output::i()->sidebar['actions']['add_meow'] = array(
'primary' => true,
'icon' => 'plus',
'title' => 'content_block_cat_add',
'link' => $this->url->setQueryString( 'do', 'form' ),
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_cat_add') ) : array() )
);
}
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'block_add' ) )
{
\IPS\Output::i()->sidebar['actions']['add_block'] = array(
'primary' => true,
'icon' => 'puzzle-piece',
'title' => 'content_block_block_add',
'link' => $this->url->setQueryString( array( 'do' => 'addBlockType', 'subnode' => 1 ) ),
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_block_add') ) : array() )
);
}
parent::manage();
}
@@ -77,26 +98,6 @@ class _blocks extends \IPS\Node\Controller
$nodeClass = $this->nodeClass;
$buttons = array();
if ( $nodeClass::canAddRoot() )
{
$buttons['add_meow'] = array(
'icon' => 'plus',
'title' => 'content_block_cat_add',
'link' => $this->url->setQueryString( 'do', 'form' ),
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_cat_add') ) : array() )
);
}
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'block_add' ) )
{
$buttons['add_block'] = array(
'icon' => 'puzzle-piece',
'title' => 'content_block_block_add',
'link' => $this->url->setQueryString( array( 'do' => 'addBlockType', 'subnode' => 1 ) ),
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_block_add') ) : array() )
);
}
return $buttons;
}
@@ -130,13 +131,23 @@ class _blocks extends \IPS\Node\Controller
{
if ( $widget['app'] )
{
$plugins[ \IPS\Application::load( $widget['app'] )->_title ][ 'app__' . $widget['app'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
$app = \IPS\Application::load( $widget['app'] );
if ( $app->enabled )
{
$plugins[ $app->_title ][ 'app__' . $widget['app'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
}
}
else
{
$plugins[ \IPS\Plugin::load( $widget['plugin'] )->_title ][ 'plugin__' . $widget['plugin'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
$plugin = \IPS\Plugin::load( $widget['plugin'] );
if ( $plugin->enabled )
{
$plugins[ $plugin->_title ][ 'plugin__' . $widget['plugin'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
}
}
}
catch ( \UnexpectedValueException $e ) { }
catch ( \OutOfRangeException $e ) { }
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Pages Media Management
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 07 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\pages;
+55 -21
View File
@@ -1,10 +1,10 @@
<?php
/**
* @brief Pages Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 15 Jan 2013
* @version SVN_VERSION_NUMBER
@@ -55,23 +55,6 @@ class _pages extends \IPS\Node\Controller
$nodeClass = $this->nodeClass;
$buttons = array();
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'page_add' ) )
{
$buttons['add_folder'] = array(
'icon' => 'folder-open',
'title' => 'content_add_folder',
'link' => \IPS\Http\Url::internal( 'app=cms&module=pages&controller=pages&do=form' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_add_folder') )
);
$buttons['add_page'] = array(
'icon' => 'plus-circle',
'title' => 'content_add_page',
'link' => \IPS\Http\Url::internal( 'app=cms&module=pages&controller=pages&subnode=1&do=add' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_add_page') )
);
}
return $buttons;
}
@@ -146,6 +129,25 @@ class _pages extends \IPS\Node\Controller
'link' => \IPS\Http\Url::internal( 'app=cms&module=pages&controller=pages&do=settings' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('cms_pages_settings') )
);
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'page_add' ) )
{
\IPS\Output::i()->sidebar['actions']['add_folder'] = array(
'primary' => true,
'icon' => 'folder-open',
'title' => 'content_add_folder',
'link' => \IPS\Http\Url::internal( 'app=cms&module=pages&controller=pages&do=form' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_add_folder') )
);
\IPS\Output::i()->sidebar['actions']['add_page'] = array(
'primary' => true,
'icon' => 'plus-circle',
'title' => 'content_add_page',
'link' => \IPS\Http\Url::internal( 'app=cms&module=pages&controller=pages&subnode=1&do=add' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_add_page') )
);
}
}
/**
@@ -436,4 +438,36 @@ FILE;
return \IPS\cms\Pages\Folder::munge( $folders, $pages );
}
/**
* Redirect after save
*
* @param \IPS\Node\Model $old A clone of the node as it was before or NULL if this is a creation
* @param \IPS\Node\Model $new The node now
* @param string $lastUsedTab The tab last used in the form
* @return void
*/
protected function _afterSave( \IPS\Node\Model $old = NULL, \IPS\Node\Model $new, $lastUsedTab = FALSE )
{
/* If this page was the default in a folder, and it was moved to a new folder that already has a default, we need to unset the
default page flag or there will be two defaults in the destination folder */
if( $old !== NULL AND $old->folder_id != $new->folder_id AND $old->default )
{
/* Is there already a default page in the new folder? */
try
{
$existingDefault = \IPS\Db::i()->select( 'page_id', 'cms_pages', array( 'page_folder_id=? and page_default=?', $new->folder_id, 1 ) )->first();
\IPS\Db::i()->update( 'cms_pages', array( 'page_default' => 0 ), array( 'page_id=?', $new->id ) );
\IPS\cms\Pages\Page::buildPageUrlStore();
}
catch( \UnderflowException $e )
{
/* No default found in destination folder, do nothing */
}
}
parent::_afterSave( $old, $new, $lastUsedTab );
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Templates Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 25 Feb 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\admin\pages;
@@ -517,7 +516,15 @@ class _templates extends \IPS\Dispatcher\Controller
$form = new \IPS\Helpers\Form();
$form->hiddenValues['type'] = $type;
$form->add( new \IPS\Helpers\Form\Text( 'template_title', NULL, TRUE, array( 'regex' => '/^([A-Z_][A-Z0-9_]+?)$/i' ) ) );
$form->add( new \IPS\Helpers\Form\Text( 'template_title', NULL, TRUE, array( 'regex' => '/^([A-Z_][A-Z0-9_]+?)$/i' ), function ( $val ) {
/* PHP Keywords cannot be used as template names - so make sure the full template name is not in the list */
$keywords = array( 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor' );
if ( in_array( $val, $keywords ) )
{
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack( 'template_reserved_word', FALSE, array( 'htmlsprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $keywords ) ) ) ) );
}
} ) );
/* Very specific */
if ( $type === 'database' )
@@ -547,6 +554,12 @@ class _templates extends \IPS\Dispatcher\Controller
$plugins = array();
foreach ( \IPS\Db::i()->select( "*", 'core_widgets', array( 'embeddable=1') ) as $widget )
{
/* Skip disabled applications */
if ( !in_array( $widget['app'], array_keys( \IPS\Application::enabledApplications() ) ) )
{
continue;
}
try
{
$plugins[ \IPS\Application::load( $widget['app'] )->_title ][ $widget['app'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
@@ -1,13 +1,12 @@
<?php
/**
* @brief Ajax only methods
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 01 Oct 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\front\database;
@@ -1,12 +1,11 @@
<?php
/**
* @brief [Database] Category Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @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 Content
* @since 16 April 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\front\database;
@@ -186,12 +185,12 @@ class _category extends \IPS\cms\Databases\Controller
{
if ( $obj->type == 'Number' )
{
$table->sortOptions['field_' . $id ] = 'LENGTH(`field_' . $id . '`) ' . $table->sortDirection . ',`field_' . $id . '`';
$table->sortBy = 'LENGTH(`field_' . $id . '`) ' . $table->sortDirection . ',`field_' . $id . '`';
break;
}
elseif( $obj->type == 'Date' )
{
$table->sortOptions['field_' . $id ] = 'CAST(`field_' . $id . '` AS UNSIGNED)';
$table->sortBy = 'CAST(`field_' . $id . '` AS UNSIGNED)';
break;
}
}
@@ -255,7 +254,7 @@ class _category extends \IPS\cms\Databases\Controller
break;
case 'record_rating':
$sortBy[ $database->field_sort ] = 'database_field__rating';
$table->sortOptions['database_field__rating'] = $database->field_sort;
$table->sortOptions['rating'] = $database->field_sort;
\IPS\Member::loggedIn()->language()->words['sort_database_field__rating'] = \IPS\Member::loggedIn()->language()->addToStack('database_field__rating');
break;
}
@@ -303,11 +302,11 @@ class _category extends \IPS\cms\Databases\Controller
if ( $obj->filter )
{
\IPS\Member::loggedIn()->language()->words['content_field_' . $obj->id ] = $obj->_title;
if ( $obj->type == 'DateRange' )
if ( in_array( $obj->type, array( 'Date', 'DateRange' ) ) )
{
$table->advancedSearch[ 'content_field_' . $obj->id ] = array( \IPS\Helpers\Table\SEARCH_DATE_RANGE, array( 'noDefault' => true ) );
}
if ( $obj->type == 'Number' )
else if ( $obj->type == 'Number' )
{
$table->advancedSearch[ 'content_field_' . $obj->id ] = array( \IPS\Helpers\Table\SEARCH_NUMERIC_TEXT, array( 'noDefault' => true ) );
}
@@ -562,7 +561,7 @@ class _category extends \IPS\cms\Databases\Controller
\IPS\Output::i()->allowDefaultWidgets = FALSE;
\IPS\Output::i()->sidebar['enabled'] = FALSE;
\IPS\cms\Pages\Page::$currentPage->getWidgets();
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\cms\Theme::i(), 'getTemplate' ), array( $database->template_form, 'cms', 'database' ) ), 'recordForm' ), NULL, $category, $database, \IPS\cms\Pages\Page::$currentPage, $title, $hasModOptions );
\IPS\cms\Databases\Dispatcher::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\cms\Theme::i(), 'getTemplate' ), array( $database->template_form, 'cms', 'database' ) ), 'recordForm' ), NULL, $category, $database, \IPS\cms\Pages\Page::$currentPage, $title, $hasModOptions );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( $title );
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'records/form.css', 'cms', 'front' ) );
@@ -1,13 +1,12 @@
<?php
/**
* @brief [Database] Category List Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 16 April 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\front\database;
@@ -141,7 +140,7 @@ class _index extends \IPS\cms\Databases\Controller
/* Load into memory */
$class::loadIntoMemory();
$categories = $class::roots('view', \IPS\Member::loggedIn(), null, $database->_id );
$categories = $class::roots();
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'records/index.css', 'cms', 'front' ) );
\IPS\Output::i()->title = $database->pageTitle();
@@ -182,8 +181,8 @@ class _index extends \IPS\cms\Databases\Controller
\IPS\Output::i()->redirect( $values['category']->url()->setQueryString( 'do', 'form' ) );
}
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'cms_select_category' );
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack( 'cms_select_category' ) );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'records' )->categorySelector( $form );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'cms_select_category' );
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack( 'cms_select_category' ) );
\IPS\cms\Databases\Dispatcher::i()->output = \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'records' )->categorySelector( $form );
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Record View
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 17 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\front\database;
@@ -146,6 +145,9 @@ class _record extends \IPS\Content\Controller
\IPS\Output::i()->metaTags['og:description'] = $record->record_meta_description;
}
/* Set record URL as canonical tag */
\IPS\Output::i()->linkTags['canonical'] = $record->url();
/* Update location */
if( $record->database()->use_categories )
{
@@ -172,6 +174,82 @@ class _record extends \IPS\Content\Controller
{
\IPS\Output::i()->metaTags['og:image'] = (string) \IPS\File::get( 'cms_Records', $record->record_image )->url;
}
/* Add Json-LD */
\IPS\Output::i()->jsonLd['article'] = array(
'@context' => "http://schema.org",
'@type' => "Article",
'url' => (string) $record->url(),
'discussionUrl' => (string) $record->url(),
'mainEntityOfPage' => (string) $record->url(),
'name' => htmlspecialchars( $record->_title, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'headline' => htmlspecialchars( $record->_title, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'text' => strip_tags( $record->truncated() ),
'articleBody' => strip_tags( $record->truncated() ),
'dateCreated' => \IPS\DateTime::ts( $record->record_saved )->format( \IPS\DateTime::ISO8601 ),
'datePublished' => \IPS\DateTime::ts( $record->record_publish_date ?: $record->record_saved )->format( \IPS\DateTime::ISO8601 ),
'dateModified' => \IPS\DateTime::ts( $record->record_edit_time ?: ( $record->record_publish_date ?: $record->record_saved ) )->format( \IPS\DateTime::ISO8601 ),
'pageStart' => 1,
'pageEnd' => $record->commentPageCount(),
/* Image is required */
'image' => $record->record_image ? (string) \IPS\File::get( 'cms_Records', $record->record_image )->url : \IPS\Member::load( $record->member_id )->get_photo(),
'author' => array(
'@type' => 'Person',
'name' => htmlspecialchars( \IPS\Member::load( $record->member_id )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'url' => (string) \IPS\Member::load( $record->member_id )->url(),
'image' => \IPS\Member::load( $record->member_id )->get_photo()
),
'publisher' => array(
'@type' => 'Organization',
'name' => htmlspecialchars( \IPS\Member::load( $record->member_id )->name, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE ),
'url' => (string) \IPS\Member::load( $record->member_id )->url(),
'image' => \IPS\Member::load( $record->member_id )->get_photo(),
'logo' => \IPS\Member::load( $record->member_id )->get_photo()
),
'interactionStatistic' => array(
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/ViewAction",
'userInteractionCount' => $record->record_views
),
array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/FollowAction",
'userInteractionCount' => $record::containerFollowerCount( $record->container() )
),
),
);
if( $record->averageReviewRating() )
{
\IPS\Output::i()->jsonLd['article']['aggregateRating'] = array(
'@type' => 'AggregateRating',
'ratingValue' => $record->averageReviewRating(),
'ratingCount' => $record->rating_hits,
'reviewCount' => $record->record_reviews,
'bestRating' => \IPS\Settings::i()->reviews_rating_out_of
);
}
if( $record::database()->options['reviews'] )
{
\IPS\Output::i()->jsonLd['article']['interactionStatistic'][] = array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/ReviewAction",
'userInteractionCount' => $record->record_reviews
);
}
if( $record::database()->options['comments'] )
{
\IPS\Output::i()->jsonLd['article']['commentCount'] = $record->record_comments;
\IPS\Output::i()->jsonLd['article']['interactionStatistic'][] = array(
'@type' => 'InteractionCounter',
'interactionType' => "http://schema.org/CommentAction",
'userInteractionCount' => $record->record_comments
);
}
\IPS\Output::i()->contextualSearchOptions = array();
\IPS\Output::i()->contextualSearchOptions[ \IPS\Member::loggedIn()->language()->addToStack( 'search_contextual_item', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( $record::$title ) ) ) ) ] = array( 'type' => mb_strtolower( str_replace( '\\', '_', mb_substr( $class, 4 ) ) ), 'nodes' => $record->_id );
\IPS\cms\Databases\Dispatcher::i()->output .= \IPS\cms\Theme::i()->getTemplate( $record->container()->_template_display, 'cms', 'database' )->record( $record, $comments, $form, $nextUnread );
@@ -304,8 +382,8 @@ class _record extends \IPS\Content\Controller
\IPS\Output::i()->breadcrumb[] = array( $record->url(), $record->_title );
\IPS\Output::i()->title = $title;
\IPS\Output::i()->output .= (string) $table;
\IPS\Output::i()->title = $title;
\IPS\cms\Databases\Dispatcher::i()->output .= (string) $table;
}
}
@@ -446,7 +524,7 @@ class _record extends \IPS\Content\Controller
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'codemirror/codemirror.js', 'core', 'interface' ) );
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'codemirror/codemirror.css', 'core', 'interface' ) );
\IPS\Output::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'revisions', 'cms' ), 'view' ), $record, $revision, $conflicts );
\IPS\cms\Databases\Dispatcher::i()->output = $form->customTemplate( array( \IPS\Theme::i()->getTemplate( 'revisions', 'cms' ), 'view' ), $record, $revision, $conflicts );
}
/**
@@ -527,7 +605,7 @@ class _record extends \IPS\Content\Controller
\IPS\Output::i()->allowDefaultWidgets = FALSE;
\IPS\Output::i()->sidebar['enabled'] = FALSE;
\IPS\cms\Pages\Page::$currentPage->getWidgets();
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\cms\Theme::i(), 'getTemplate' ), array( $database->template_form, 'cms', 'database' ) ), 'recordForm' ), NULL, $category, $database, \IPS\cms\Pages\Page::$currentPage, $title, $hasModOptions );
\IPS\cms\Databases\Dispatcher::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\cms\Theme::i(), 'getTemplate' ), array( $database->template_form, 'cms', 'database' ) ), 'recordForm' ), NULL, $category, $database, \IPS\cms\Pages\Page::$currentPage, $title, $hasModOptions );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( $title );
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'records/form.css', 'cms', 'front' ) );
@@ -698,9 +776,9 @@ class _record extends \IPS\Content\Controller
* @return void
* @throws \LogicException
*/
protected function _rep( $commentClass, $comment, $item )
protected function _react( $commentClass, $comment, $item )
{
return $this->_doSomething( '_rep', $commentClass, $comment, $item );
return $this->_doSomething( '_react', $commentClass, $comment, $item );
}
/**
@@ -712,9 +790,9 @@ class _record extends \IPS\Content\Controller
* @return void
* @throws \LogicException
*/
protected function _showRep( $commentClass, $comment, $item )
protected function _showReactions( $commentClass, $comment, $item )
{
return $this->_doSomething( '_showRep', $commentClass, $comment, $item );
return $this->_doSomething( '_showReactions', $commentClass, $comment, $item );
}
/**
@@ -747,4 +825,16 @@ class _record extends \IPS\Content\Controller
\IPS\Output::i()->error( 'node_error', '2T252/F', 403, '' );
}
}
/**
* Moderate
*
* @return void
*/
protected function moderate()
{
parent::moderate();
\IPS\cms\Databases\Dispatcher::i()->output = \IPS\Output::i()->output;
}
}
@@ -0,0 +1,315 @@
<?php
/**
* @brief topic
* @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 03 Mar 2017
*/
namespace IPS\cms\modules\front\database;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* topic
*/
class _topic extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
if ( !\IPS\Member::loggedIn()->modPermission( 'can_copy_topic_database' ) )
{
\IPS\Output::i()->error( 'node_error', '2T353/1', 403, '' );
}
try
{
$this->topic = \IPS\forums\Topic::load( \IPS\Request::i()->id );
}
catch( \OutOfRangeException $e )
{
\IPS\Output::i()->error( 'node_error', '2T353/3', 404, '' );
}
parent::execute();
}
/**
* Manage
*
* @return void
*/
protected function manage()
{
$wizard = new \IPS\Helpers\Wizard( array(
'database' => array( $this, '_database' ),
'category' => array( $this, '_category' ),
), \IPS\Http\Url::internal( "app=cms&module=database&controller=topic&id=" . \IPS\Request::i()->id, 'front', 'topic_copy', $this->topic->title_seo ), FALSE );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'copy_topic_to_database' );
\IPS\Output::i()->output = (string) $wizard;
}
/**
* Database
*
* @return void
*/
public function _database( $data )
{
$form = new \IPS\Helpers\Form( 'database', 'copy_select_database', \IPS\Http\Url::internal( "app=cms&module=database&controller=topic&id=" . \IPS\Request::i()->id, 'front', 'topic_copy', $this->topic->title_seo ) );
$form->class = 'ipsForm_vertical';
$form->hiddenValues['topic_id'] = \IPS\Request::i()->id;
$form->add( new \IPS\Helpers\Form\Node( 'database', NULL, TRUE, array( 'class' => '\IPS\cms\Databases', 'permissionCheck' => function( $row )
{
if ( !$row->field_title OR !$row->field_content )
{
return FALSE;
}
return $row->can( 'add' );
} ) ) );
if ( $values = $form->values() )
{
return array(
'topic_id' => $values['topic_id'],
'database_id' => $values['database']->_id
);
}
return $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
}
/**
* Category
*
* @return void
*/
public function _category( $data )
{
/* Do we need to even bother? */
$database = \IPS\cms\Databases::load( $data['database_id'] );
if ( !$database->use_categories )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=cms&module=database&controller=topic&do=form&id={$data['topic_id']}", 'front', 'topic_copy', $this->topic->title_seo )->csrf()->setQueryString( array( 'database_id' => $data['database_id'], 'category_id' => $database->default_category ) ) );
}
$catClass = 'IPS\cms\Categories' . $data['database_id'];
$form = new \IPS\Helpers\Form( 'category', 'copy_select_category', \IPS\Http\Url::internal( "app=cms&module=database&controller=topic&id=" . \IPS\Request::i()->id, 'front', 'topic_copy', $this->topic->title_seo ) );
$form->class = 'ipsForm_vertical';
$form->hiddenValues['topic_id'] = $data['topic_id'];
$form->hiddenValues['database_id'] = $data['database_id'];
$form->add( new \IPS\Helpers\Form\Node( 'select_category', NULL, TRUE, array( 'class' => $catClass, 'permissionCheck' => 'add' ) ) );
if ( $values = $form->values() )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=cms&module=database&controller=topic&do=form&id={$values['topic_id']}", 'front', 'topic_copy', $this->topic->title_seo )->csrf()->setQueryString( array( 'database_id' => $values['database_id'], 'category_id' => $values['select_category']->_id ) ) );
}
return $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
}
/**
* Form
*
* @return void
*/
protected function form()
{
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_records.js', 'cms' ) );
try
{
$database = \IPS\cms\Databases::load( \IPS\Request::i()->database_id );
}
catch( \OutOfRangeException $e )
{
\IPS\Output::i()->error( 'node_error', '2T353/2', 404, '' );
}
$recordClass = 'IPS\cms\Records' . $database->_id;
$commentClass = 'IPS\cms\Comments' . $database->_id;
$fieldClass = 'IPS\cms\Fields' . $database->_id;
$catClass = 'IPS\cms\Categories' . $database->_id;
$category = $catClass::load( \IPS\Request::i()->category_id );
$titleField = "field_{$database->field_title}";
$contentField = "field_{$database->field_content}";
$fakeRecord = new $recordClass;
$fakeRecord->$titleField = $this->topic->mapped('title');
$fakeRecord->$contentField = $this->topic->content();
\IPS\Member::loggedIn()->language()->words['copy_comments_desc'] = sprintf( \IPS\Member::loggedIn()->language()->get( 'copy_comments_desc' ), $recordClass::_definiteArticle() );
\IPS\Member::loggedIn()->language()->words['copy_author_desc'] = sprintf( \IPS\Member::loggedIn()->language()->get( 'copy_author_desc' ), $recordClass::_definiteArticle() );
$form = new \IPS\Helpers\Form;
$form->class = 'ipsForm_vertical';
$form->hiddenValues['record_category_id'] = $category->_id;
foreach( $recordClass::formElements( $fakeRecord, $category ) AS $key => $element )
{
/* Skip these */
if ( in_array( $key, array( 'record_edit_reason', 'record_edit_show' ) ) )
{
continue;
}
$form->add( $element );
}
if ( $database->options['comments'] )
{
$form->add( new \IPS\Helpers\Form\YesNo( 'copy_comments', FALSE ) );
}
$form->add( new \IPS\Helpers\Form\YesNo( 'copy_author', TRUE ) );
if ( $values = $form->values() )
{
$comments = FALSE;
if ( array_key_exists( 'copy_comments', $values ) )
{
$comments = $values['copy_comments'];
unset( $values['copy_comments'] );
}
$author = $values['copy_author'];
unset( $values['copy_author'] );
$record = $recordClass::createFromForm( $values, $category );
if ( $author )
{
$record->changeAuthor( $this->topic->author() );
}
if ( $comments )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=cms&module=database&controller=topic&do=comments&id={$this->topic->tid}", 'front', 'topic_copy', $this->topic->title_seo )->setQueryString( array( 'record_id' => $record->primary_id_field, 'database_id' => $database->_id ) ) );
}
else
{
try
{
/* If the database is on a page, go to the record */
\IPS\Output::i()->redirect( $record->url() );
}
catch( \LogicException $e )
{
/* If it is NOT then go back to the topic */
\IPS\Output::i()->redirect( $this->topic->url() );
}
}
}
$hasModOptions = FALSE;
if ( $recordClass::modPermission( 'lock', NULL, $category ) or
$recordClass::modPermission( 'pin', NULL, $category ) or
$recordClass::modPermission( 'hide', NULL, $category ) or
$recordClass::modPermission( 'feature', NULL, $category ) or
$fieldClass::fixedFieldFormShow( 'record_allow_comments' ) or
$fieldClass::fixedFieldFormShow( 'record_expiry_date' ) or
$fieldClass::fixedFieldFormShow( 'record_comment_cutoff' ) or
\IPS\Member::loggedIn()->modPermission('can_content_edit_meta_tags') )
{
$hasModOptions = TRUE;
}
array_shift( \IPS\Output::i()->breadcrumb );
$container = NULL;
try
{
$container = $this->topic->container();
foreach ( $container->parents() as $parent )
{
\IPS\Output::i()->breadcrumb[] = array( $parent->url(), $parent->_title );
}
\IPS\Output::i()->breadcrumb[] = array( $container->url(), $container->_title );
}
catch ( \Exception $e ) { }
\IPS\Output::i()->breadcrumb[] = array( $this->topic->url(), $this->topic->mapped( 'title' ) );
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack( 'copy_topic_to_database' ) );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'copy_topic_to_database' );
\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\cms\Theme::i(), 'getTemplate' ), array( $database->template_form, 'cms', 'database' ) ), 'recordForm' ), NULL, $category, $database, \IPS\cms\Pages\Page::load( $database->page_id ), \IPS\Member::loggedIn()->language()->addToStack( 'copy_topic_to_database' ), $hasModOptions );
}
/**
* Comments
*
* @return void
*/
protected function comments()
{
$mr = new \IPS\Helpers\MultipleRedirect( \IPS\Http\Url::internal( "app=cms&module=database&controller=topic&id=" . \IPS\Request::i()->id . "&do=comments", 'front', 'topic_copy', $this->topic->title_seo )->setQueryString( array( 'database_id' => \IPS\Request::i()->database_id, 'record_id' => \IPS\Request::i()->record_id ) ), function( $data ) {
$database = \IPS\cms\Databases::load( \IPS\Request::i()->database_id );
$recordClass = 'IPS\cms\Records' . \IPS\Request::i()->database_id;
$commentClass = $recordClass::$commentClass;
$record = $recordClass::load( \IPS\Request::i()->record_id );
$total = \IPS\Db::i()->select( 'COUNT(*)', 'forums_posts', array( "topic_id=? AND new_topic=? AND queued!=?", \IPS\Request::i()->id, 0, 2 ) )->first();
$done = 0;
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'forums_posts', array( "topic_id=? AND new_topic=? AND queued!=?", \IPS\Request::i()->id, 0, -2 ), "pid ASC", array( $data, 100 ) ), 'IPS\forums\Topic\Post' ) AS $post )
{
$commentClass::create( $record, $post->content(), FALSE, NULL, TRUE, $post->author(), \IPS\DateTime::create(), $post->ip_address, $post->hidden() );
$done++;
}
if ( !$done )
{
return NULL;
}
return array( $data + $done, \IPS\Member::loggedIn()->language()->addToStack( 'copying_comments' ), 100 / $total * ( $data + 100 ) );
}, function() {
$recordClass = 'IPS\cms\Records' . \IPS\Request::i()->database_id;
$record = $recordClass::load( \IPS\Request::i()->record_id );
try
{
\IPS\Output::i()->redirect( $record->url() );
}
catch( \LogicException $e )
{
\IPS\Output::i()->redirect( \IPS\forums\Topic::load( \IPS\Request::i()->id )->url() );
}
} );
$topic = \IPS\forums\Topic::load( \IPS\Request::i()->id );
array_shift( \IPS\Output::i()->breadcrumb );
$container = NULL;
try
{
$container = $topic->container();
foreach ( $container->parents() as $parent )
{
\IPS\Output::i()->breadcrumb[] = array( $parent->url(), $parent->_title );
}
\IPS\Output::i()->breadcrumb[] = array( $container->url(), $container->_title );
}
catch ( \Exception $e ) { }
\IPS\Output::i()->breadcrumb[] = array( $topic->url(), $topic->mapped( 'title' ) );
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack( 'copy_topic_to_database' ) );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'copying_comments' );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->genericBlock( (string) $mr, \IPS\Member::loggedIn()->language()->addToStack( 'copying_comments' ), 'ipsBox ipsPad' );
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief [Front] Page Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 25 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\front\pages;
@@ -246,7 +245,7 @@ class _builder extends \IPS\core\modules\front\system\widgets
\IPS\Db::i()->insert( 'cms_page_widget_areas', array( 'area_page_id' => \IPS\Request::i()->pageID, 'area_area' => \IPS\Request::i()->pageArea, 'area_widgets' => json_encode( $blocks ) ), TRUE );
\IPS\Output::i()->json( 'OK' );
}
\IPS\Output::i()->sendOutput( $widget->configuration()->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'widgets', 'core' ) ), 'formTemplate' ), $widget ) );
\IPS\Output::i()->output = $widget->configuration()->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'widgets', 'core' ) ), 'formTemplate' ), $widget );
}
}
}
+22 -8
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief [Front] Page Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 25 Feb 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\modules\front\pages;
@@ -68,8 +67,16 @@ class _page extends \IPS\Dispatcher\Controller
$permissions = $page->permissions();
\IPS\Session::i()->setLocation( $page->url(), explode( ",", $permissions['perm_view'] ), 'loc_cms_viewing_page', array( 'cms_page_' . $page->_id => TRUE ) );
}
$page->output();
try
{
$page->output();
}
catch ( \ParseError $e )
{
\IPS\Log::log( $e, 'page_error' );
\IPS\Output::i()->error( 'content_err_page_500', '2T187/4', 500, 'content_err_page_500_admin', array(), $e );
}
}
/**
@@ -161,7 +168,14 @@ class _page extends \IPS\Dispatcher\Controller
{
try
{
return \IPS\cms\Databases\Dispatcher::i()->setDatabase( $databaseId )->run();
if ( \IPS\Request::i()->isAjax() )
{
return \IPS\cms\Databases\Dispatcher::i()->setDatabase( $databaseId )->run();
}
else
{
$page->output();
}
}
catch( \OutOfRangeException $e )
{
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Beta 3 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 24 Nov 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100003;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Beta 5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100008;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Beta 6 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100010;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Beta 7 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100011;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100015;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Beta 6 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100018;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 06 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100023;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.2 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 15 Apr 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100025;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.3 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Apr 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100026;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 5 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100028;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 20 Apr 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100030;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.9 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 19 Jun 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100035;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.11 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 14 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100041;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.13 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_100044;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.13 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 30 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101000;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.6 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 11 Dec 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101021;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.9 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 28 Jan 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101026;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 08 Apr 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101034;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.15 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 25 Aug 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101056;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.16 Beta 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
{subpackage}
* @since 28 Sep 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101064;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.17 Beta 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 26 Oct 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101071;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.18 Beta 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 03 Jan 2017
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101079;
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.18.1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 20 Jan 2017
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101088;
+15 -6
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.1.19 Beta 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Pages
* @since 15 Feb 2017
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_101090;
@@ -25,7 +24,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
class _Upgrade
{
/**
* ...
* Adjust record edit time
*
* @return 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)
*/
@@ -38,4 +37,14 @@ class _Upgrade
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing record last edit time for databases";
}
}
@@ -0,0 +1,22 @@
{
"1": {
"method": "addColumn",
"params": [
"cms_database_fields",
{
"name": "field_allow_attachments",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": null,
"allow_null": false,
"default": "1",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,52 @@
<?php
/**
* @brief 4.2.0 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 12 Apr 2017
*/
namespace IPS\cms\setup\upg_101100;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.2.0 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* Fix multiple member fields
*
* @return 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()
{
/* Loop over any Member fields that allow multiple users */
foreach( \IPS\Db::i()->select( '*', 'cms_database_fields', array( 'field_type=? AND field_is_multiple=?', 'Member', 1 ) ) as $field )
{
/* Then run an update query using REPLACE() on the Pages database to fix the field */
\IPS\Db::i()->update( 'cms_custom_database_' . $field['field_database_id'], "field_{$field['field_id']}=REPLACE(field_{$field['field_id']},',','\\n')" );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing multiple member fields in Pages databases";
}
}
@@ -0,0 +1,46 @@
<?php
/**
* @brief 4.2.0 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 18 May 2017
*/
namespace IPS\cms\setup\upg_101105;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.2.0 Beta 3 Upgrade Code
*/
class _Upgrade
{
/**
* Fix customized templates to ensure reactions show
*
* @return 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()
{
/* Update records templates */
foreach( \IPS\Db::i()->select( '*', 'cms_templates', array( "template_content LIKE '%settings.reputation_enabled%'" ) ) as $row )
{
if ( preg_match( '#\$record\s+?instanceof\s+?\\\IPS\\\Content\\\Reputation#i', $row['template_content'] ) )
{
$row['template_content'] = preg_replace( '#\$record\s+?instanceof\s+?\\\IPS\\\Content\\\Reputation#i', '\IPS\IPS::classUsesTrait( $record, \'IPS\Content\Reactable\' )', $row['template_content'] );
\IPS\Db::i()->update( 'cms_templates', array( 'template_content' => $row['template_content'] ), array( 'template_id=?', $row['template_id'] ) );
}
}
return TRUE;
}
}
@@ -0,0 +1,82 @@
{
"1": {
"method": "createTable",
"params": [
{
"name": "cms_database_fields_thumbnails",
"columns": {
"thumb_original_location": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "thumb_original_location",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_location": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "thumb_location",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_field_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "thumb_field_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"thumb_database_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "thumb_database_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"thumb_original_location"
]
}
},
"collation": "utf8_general_ci",
"engine": "InnoDB"
}
]
}
}
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 08 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_11002;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 08 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\setup\upg_11003;
+4 -5
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 08 Jan 2015
* @version SVN_VERSION_NUMBER
* @note Do we need to import articles db?
*/
Loaded 100 of 2074 files, more files were not shown because too many files have changed in this diff. Show more