Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -135,11 +135,11 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
$class = 'IPS\cms\Records\Review' . $database->id;
|
||||
if ( $this->member )
|
||||
{
|
||||
$object = $class::loadAndCheckPerms( $id, $this->member );
|
||||
$object = $class::loadAndCheckPerms( $review, $this->member );
|
||||
}
|
||||
else
|
||||
{
|
||||
$object = $class::load( $id );
|
||||
$object = $class::load( $review );
|
||||
}
|
||||
|
||||
return new \IPS\Api\Response( 200, $object->apiOutput( $this->member ) );
|
||||
|
||||
@@ -588,7 +588,7 @@
|
||||
<li><a href='{$comment->url('report')}' data-ipsDialog data-ipsDialog-remoteSubmit data-ipsDialog-size='medium' data-ipsDialog-flashMessage='{lang="report_submit_success"}' data-ipsDialog-title="{lang="report"}" data-action='reportComment' title='{lang="report_content"}'><span class='ipsResponsive_showPhone ipsResponsive_inline'><i class='fa fa-flag'></i></span><span class='ipsResponsive_hidePhone ipsResponsive_inline'>{lang="report_reply"}</span></a></li>
|
||||
{{endif}}
|
||||
|
||||
{{if \IPS\Member::loggedIn()->modPermission('can_use_ip_tools') and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'modcp' ) )}}
|
||||
{{if $comment->ip_address and \IPS\Member::loggedIn()->modPermission('can_use_ip_tools') and \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'modcp' ) )}}
|
||||
<li><span class='ipsResponsive_hidePhone ipsType_blendLinks'>(<a href="{url="app=core&module=modcp&controller=modcp&tab=ip_tools&ip=$comment->ip_address" seoTemplate="modcp_ip_tools"}">{lang="ip_prefix" sprintf="$comment->ip_address"}</a>) </span></li>
|
||||
{{endif}}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 11,
|
||||
"length": 20,
|
||||
"name": "member_id",
|
||||
"type": "INT",
|
||||
"type": "BIGINT",
|
||||
"unsigned": false,
|
||||
"values": [
|
||||
|
||||
@@ -697,9 +697,9 @@
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 10,
|
||||
"length": 20,
|
||||
"name": "record_edit_member_id",
|
||||
"type": "INT",
|
||||
"type": "BIGINT",
|
||||
"unsigned": true,
|
||||
"values": [
|
||||
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
{
|
||||
"Database": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Data\\Store\\Database"
|
||||
},
|
||||
"Topic": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\forums\\Topic"
|
||||
},
|
||||
"Widget": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Widget"
|
||||
},
|
||||
"Post": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\forums\\Topic\\Post"
|
||||
},
|
||||
"Url": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Http\\Url"
|
||||
},
|
||||
"InternalUrl": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Http\\Url\\Internal"
|
||||
},
|
||||
"FriendlyUrl": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Http\\Url\\Friendly"
|
||||
},
|
||||
"Lang": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Lang"
|
||||
},
|
||||
"Output": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Output"
|
||||
},
|
||||
"Database": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Data\\Store\\Database"
|
||||
},
|
||||
"Widget": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Widget"
|
||||
},
|
||||
"Lang": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Lang"
|
||||
},
|
||||
"topics": {
|
||||
"type": "S",
|
||||
"class": "\\IPS\\Theme\\class_forums_front_topics"
|
||||
},
|
||||
"Post": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\forums\\Topic\\Post"
|
||||
},
|
||||
"Parser": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Text\\Parser"
|
||||
},
|
||||
"Url": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Http\\Url"
|
||||
},
|
||||
"forums": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\forums\\modules\\admin\\forums\\forums"
|
||||
},
|
||||
"InternalUrl": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\Http\\Url\\Internal"
|
||||
},
|
||||
"Forum": {
|
||||
"type": "C",
|
||||
"class": "\\IPS\\forums\\Forum"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="cms">
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/blocks" javascript_name="ips.blocks.form.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/blocks" javascript_name="ips.blocks.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -142,7 +142,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -187,7 +187,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -250,7 +250,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -385,7 +385,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="103005" javascript_position="1000200">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000200">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -422,7 +422,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="103005" javascript_position="1000300"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="103038" javascript_position="1000300"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -730,11 +730,12 @@
|
||||
}
|
||||
|
||||
var itemId = this._getSelected().closest('[data-role="mediaItem"]').attr('data-fileid');
|
||||
|
||||
|
||||
$( e.currentTarget ).ipsDialog( {
|
||||
remoteSubmit: true,
|
||||
forceReload: true,
|
||||
url: $( e.currentTarget ).attr('data-baseUrl') + itemId,
|
||||
destructOnClose : true,
|
||||
title: ips.getString('replaceMediaFile')
|
||||
});
|
||||
},
|
||||
@@ -1060,7 +1061,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="103005" javascript_position="1000250"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="103038" javascript_position="1000250"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1106,7 +1107,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="103005" javascript_position="1000250"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000250"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1199,7 +1200,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1311,7 +1312,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1366,7 +1367,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1416,7 +1417,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1488,7 +1489,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2354,7 +2355,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2696,7 +2697,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2737,7 +2738,7 @@
|
||||
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2775,7 +2776,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.area.js" javascript_type="mixins" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.area.js" javascript_type="mixins" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2844,7 +2845,7 @@
|
||||
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.block.js" javascript_type="mixins" javascript_version="103005" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.block.js" javascript_type="mixins" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2952,7 +2953,7 @@
|
||||
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="103005" javascript_position="1000050"><![CDATA[ips.templates.set( 'templates.media.grid', "\
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[ips.templates.set( 'templates.media.grid', "\
|
||||
<ul class='ipsGrid' data-ipsGrid data-ipsGrid-minItemSize='100' data-ipsGrid-maxItemSize='200'>\
|
||||
{{{contents}}}\
|
||||
</ul>\
|
||||
@@ -2969,7 +2970,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="103005" javascript_position="1000050"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.templates.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
|
||||
/* TEMPLATECEPTION */
|
||||
ips.templates.set('templates.editor.newTab', " \
|
||||
<li data-fileid='{{fileid}}' data-location='{{location}}'>\
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<app key="cms" version="103005">
|
||||
<app key="cms" version="103038">
|
||||
<word key="__app_cms" js="0">Pages</word>
|
||||
<word key="menutab__cms" js="0">Pages</word>
|
||||
<word key="menutab__cms_icon" js="0">files-o</word>
|
||||
@@ -174,7 +174,7 @@
|
||||
<word key="cms_db_relational_with_name_disabled" js="0">Cannot use database '%s' as this database is not assigned to a page</word>
|
||||
<word key="cms_block_form_display" js="0">Templates</word>
|
||||
<word key="block_key" js="0">Template Key</word>
|
||||
<word key="block_key_desc" js="0"><![CDATA[<p class='ipsMessage ipsMessage_info'>The block key ('my_block_key') can be used in HTML templates and manual pages to fetch a specific block, for instance: <span class='ipsType_monospace'>{block="my_block_key"}</span></p><br>The key must be unique for this database. If omitted, a key will be automatically generated.]]></word>
|
||||
<word key="block_key_desc" js="0"><![CDATA[<p class='ipsMessage ipsMessage_info'>The block key ('my_block_key') can be used in HTML templates and manual pages to fetch a specific block, for instance: <span class='ipsType_monospace'>{block="my_block_key"}</span></p><br>The key must be unique for this block. If omitted, a key will be automatically generated.]]></word>
|
||||
<word key="cms_block_key_not_unique" js="0">The block key is not unique</word>
|
||||
<word key="block_cache" js="0">Cache this block</word>
|
||||
<word key="block_cache_desc" js="0">If your block contains dynamic elements, such as member data, database counts, etc, you will need to prevent this block from being cached.</word>
|
||||
@@ -229,9 +229,11 @@
|
||||
<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_theme_designer_mode_warning" js="0"><![CDATA[Theme editing is currently unavailable in the ACP as you have designers' mode enabled.<br /><a href='%s'>Switch off designers' mode.</a>]]></word>
|
||||
<word key="cms_media_designer_mode_warning" js="0"><![CDATA[Media editing is currently unavailable 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 Invision Community communities.</word>
|
||||
<word key="cms_templates_export_return" js="0">Return to the template editor</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>
|
||||
@@ -288,7 +290,7 @@
|
||||
<word key="cms_err_db_does_not_exist" js="0">That database does not exist.</word>
|
||||
<word key="cms_err_db_in_use_other_page" js="0">The database added is being used by another page.</word>
|
||||
<word key="content_acp_page_builder_msg_new" js="0">You can edit this page's content by visiting the page once it has been created.</word>
|
||||
<word key="content_acp_page_builder_msg_edit" js="0"><![CDATA[You can edit this page's content by visiting the <a href='%s' target='_blank'>page.</a>]]></word>
|
||||
<word key="content_acp_page_builder_msg_edit" js="0"><![CDATA[You can edit this page's content by visiting the <a href='%s' target='_blank' rel='noopener'>page.</a>]]></word>
|
||||
<word key="content_launch_page_builder" js="0">Open page builder</word>
|
||||
<word key="content_launch_page_view" js="0">View page</word>
|
||||
<word key="page_theme" js="0">Theme</word>
|
||||
@@ -312,12 +314,12 @@
|
||||
<word key="cms_page_error_bad_syntax" js="0">The syntax of tags or HTML logic is badly formatted.</word>
|
||||
<word key="cms_pages_settings" js="0">Advanced Settings</word>
|
||||
<word key="cms_use_different_gateway" js="0">Use a gateway under your suite root?</word>
|
||||
<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_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' rel='noopener'>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 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="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' rel='noopener'>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>
|
||||
<word key="cms_tag_blocks" js="0">Blocks</word>
|
||||
<word key="cms_tag_databases" js="0">Databases</word>
|
||||
@@ -640,6 +642,7 @@
|
||||
<word key="database_field__approved" js="0">Approved</word>
|
||||
<word key="database_field__comments" js="0">Comments</word>
|
||||
<word key="database_field__locked" js="0">Locked</word>
|
||||
<word key="database_field__last_comment" js="0">Last Comment Date</word>
|
||||
<word key="database_sort_asc" js="0">Ascending (0-9)</word>
|
||||
<word key="database_sort_desc" js="0">Descending (9-0)</word>
|
||||
<word key="content_database_form_options_forums" js="0">Forums</word>
|
||||
@@ -800,6 +803,7 @@
|
||||
<word key="content_locked_records" js="0">Locked</word>
|
||||
<word key="content_locked_record" js="0">This record is locked</word>
|
||||
<word key="content_record_last_comment" js="0">Last comment date</word>
|
||||
<word key="sort_record_updated" js="0">Last Updated</word>
|
||||
<word key="content_record_comments" js="0">Number of comments</word>
|
||||
<word key="content_record_views" js="0">Number of views</word>
|
||||
<word key="content_record_title" js="0">Title</word>
|
||||
|
||||
@@ -1706,9 +1706,9 @@
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 11,
|
||||
"length": 20,
|
||||
"name": "comment_user",
|
||||
"type": "INT",
|
||||
"type": "BIGINT",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
@@ -3313,9 +3313,9 @@
|
||||
"comment": "",
|
||||
"decimals": null,
|
||||
"default": "0",
|
||||
"length": 10,
|
||||
"length": 20,
|
||||
"name": "review_author",
|
||||
"type": "INT",
|
||||
"type": "BIGINT",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
</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>
|
||||
<a class="ipsPos_right ipsBadge ipsBadge_style1" href="{$page->url()}" target="_blank" rel="noopener">{lang="cms_db_used_on_page" sprintf="$page->_title"}</a>
|
||||
{{endif}}
|
||||
<p class='ipsType_light'>{$database->_description}</p>]]></template>
|
||||
<template template_group="databases" template_name="rebuildCommentCounts" template_data="$id" template_location="admin" template_app="cms"><![CDATA[
|
||||
@@ -991,7 +991,7 @@
|
||||
{{$categories = $catClass::roots();}}
|
||||
{{if !empty( $categories )}}
|
||||
<h3 class='ipsWidget_title ipsType_reset'>{lang="categories"}</h3>
|
||||
<div class='ipsSideMenu ipsAreaBackground_reset ipsPad_half'>
|
||||
<div class='ipsSideMenu ipsCategoriesMenu ipsAreaBackground_reset ipsPad_half'>
|
||||
<ul class='ipsSideMenu_list'>
|
||||
{{foreach $categories as $category}}
|
||||
<li>
|
||||
|
||||
@@ -253,9 +253,43 @@
|
||||
"102046": "4.2.7",
|
||||
"102047": "4.2.8",
|
||||
"102048": "4.2.8",
|
||||
"102049": "4.2.9",
|
||||
"103000": "4.3.0 Beta 1",
|
||||
"103002": "4.3.0 Beta 2",
|
||||
"103003": "4.3.0 Beta 3",
|
||||
"103004": "4.3.0 Beta 4",
|
||||
"103005": "4.3.0"
|
||||
"103005": "4.3.0",
|
||||
"103006": "4.3.1",
|
||||
"103007": "4.3.1",
|
||||
"103008": "4.3.1",
|
||||
"103009": "4.3.2",
|
||||
"103010": "4.3.2",
|
||||
"103011": "4.3.3",
|
||||
"103012": "4.3.3",
|
||||
"103013": "4.3.3",
|
||||
"103014": "4.3.3",
|
||||
"103015": "4.3.3",
|
||||
"103016": "4.3.3",
|
||||
"103017": "4.3.3",
|
||||
"103018": "4.3.3",
|
||||
"103019": "4.3.3",
|
||||
"103020": "4.3.3",
|
||||
"103021": "4.3.4",
|
||||
"103022": "4.3.4",
|
||||
"103023": "4.3.4",
|
||||
"103024": "4.3.4",
|
||||
"103025": "4.3.4",
|
||||
"103026": "4.3.5 Beta 1",
|
||||
"103027": "4.3.5 Beta 2",
|
||||
"103028": "4.3.5",
|
||||
"103029": "4.3.5",
|
||||
"103030": "4.3.5",
|
||||
"103031": "4.3.5",
|
||||
"103032": "4.3.5",
|
||||
"103033": "4.3.6 Beta 1",
|
||||
"103034": "4.3.6 Beta 2",
|
||||
"103035": "4.3.6",
|
||||
"103036": "4.3.6",
|
||||
"103037": "4.3.6",
|
||||
"103038": "4.3.6"
|
||||
}
|
||||
@@ -11,10 +11,7 @@
|
||||
},
|
||||
"Wysiwyg": {
|
||||
"class": "\\IPS\\Widget\\StaticCache",
|
||||
"restrict": [
|
||||
"sidebar",
|
||||
"cms"
|
||||
],
|
||||
"restrict": [],
|
||||
"default_area": "",
|
||||
"allow_reuse": true,
|
||||
"menu_style": "modal",
|
||||
|
||||
@@ -35,7 +35,7 @@ class _Records
|
||||
foreach( \IPS\cms\Databases::databases() as $database )
|
||||
{
|
||||
$theOnlyCategory = NULL;
|
||||
if ( $database->page_id > 0 and $database->can('add') )
|
||||
if ( $database->page_id > 0 and $database->can('view') and $database->can('add') )
|
||||
{
|
||||
$catClass = '\IPS\cms\Categories' . $database->id;
|
||||
if ( $catClass::canOnAny('add') )
|
||||
@@ -47,13 +47,13 @@ class _Records
|
||||
if( $database->use_categories AND $theOnlyCategory = $catClass::theOnlyNode() )
|
||||
{
|
||||
$items[ 'cms_create_menu_records_' . $database->id ] = array(
|
||||
'link' => $theOnlyCategory->url()->setQueryString('do', 'form')
|
||||
'link' => $theOnlyCategory->url()->setQueryString( array( 'do' => 'form', 'd' => $database->id ) )
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
$items[ 'cms_create_menu_records_' . $database->id ] = array(
|
||||
'link' => $page->url()->setQueryString('do', 'form'),
|
||||
'link' => $page->url()->setQueryString( array( 'do' => 'form', 'd' => $database->id ) ),
|
||||
'extraData' => ( $database->use_categories ) ? array( 'data-ipsDialog' => true, 'data-ipsDialog-size' => "narrow" ) : array(),
|
||||
'title' => 'cms_select_category'
|
||||
);
|
||||
|
||||
@@ -48,14 +48,15 @@ class _BlockContent
|
||||
/**
|
||||
* 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 \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
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -59,14 +59,15 @@ class _Records
|
||||
/**
|
||||
* 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 \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
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
if ( ! $id3 )
|
||||
{
|
||||
|
||||
@@ -48,14 +48,15 @@ class _Widgets
|
||||
/**
|
||||
* 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 \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
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
if ( ! $id3 )
|
||||
{
|
||||
|
||||
@@ -12,24 +12,15 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* Front Navigation Extension: Pages
|
||||
*/
|
||||
class _Cms extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
class _Cms
|
||||
{
|
||||
/**
|
||||
* Get Title
|
||||
* @deprecated
|
||||
*
|
||||
* @return string
|
||||
* @return bool
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Link
|
||||
*
|
||||
* @return \IPS\Http\Url
|
||||
*/
|
||||
public function link()
|
||||
final public function deprecated()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -80,6 +80,7 @@ class _RebuildCategories
|
||||
{
|
||||
$cat = $class::constructFromData( $row );
|
||||
$cat->setLastComment();
|
||||
$cat->setLastReview();
|
||||
$cat->save();
|
||||
|
||||
$parsed++;
|
||||
|
||||
@@ -84,7 +84,15 @@ class _ResyncTopicContent
|
||||
$class = '\IPS\cms\Records' . $data['databaseId'];
|
||||
$where = NULL;
|
||||
$parsed = 0;
|
||||
$database = \IPS\cms\Databases::load( $data['databaseId'] );
|
||||
try
|
||||
{
|
||||
$database = \IPS\cms\Databases::load( $data['databaseId'] );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
if ( ! $database->forum_record )
|
||||
{
|
||||
$cats = iterator_to_array( \IPS\Db::i()->select( 'category_id', 'cms_database_categories', array( 'category_forum_record=1 AND category_database_id=?', $data['databaseId'] ) ) );
|
||||
|
||||
@@ -43,6 +43,24 @@ class _Databases
|
||||
'sitemap_databases_priority' => new \IPS\Helpers\Form\Select( 'sitemap_databases_priority', \IPS\Settings::i()->sitemap_databases_priority, FALSE, array( 'options' => \IPS\Sitemap::$priorities, 'unlimited' => '-1', 'unlimitedLang' => 'sitemap_dont_include' ), NULL, NULL, NULL, 'sitemap_databases_priority' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings for ACP configuration
|
||||
*
|
||||
* @param array $values Values
|
||||
* @return void
|
||||
*/
|
||||
public function saveSettings( $values )
|
||||
{
|
||||
if ( $values['sitemap_configuration_info'] )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_databases_count' => $this->recommendedSettings['sitemap_databases_count'], 'sitemap_databases_priority' => $this->recommendedSettings['sitemap_databases_priority'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_databases_count' => $values['sitemap_databases_count'], 'sitemap_databases_priority' => $values['sitemap_databases_priority'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sitemap filename(s)
|
||||
@@ -115,6 +133,12 @@ class _Databases
|
||||
*/
|
||||
public function generateSitemap( $filename, $sitemap )
|
||||
{
|
||||
/* We have elected to not add databases to the sitemap */
|
||||
if ( ! \IPS\Settings::i()->sitemap_databases_count )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$tmp = explode( '_', $filename );
|
||||
$databaseId = intval( array_shift( $tmp ) );
|
||||
$database = \IPS\cms\Databases::load( $databaseId );
|
||||
@@ -165,7 +189,14 @@ class _Databases
|
||||
$totalLimit = \IPS\Settings::i()->sitemap_databases_count;
|
||||
if ( $totalLimit > -1 and ( $offset + $limit ) > $totalLimit )
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
if ( $totalLimit < $limit )
|
||||
{
|
||||
$limit = $totalLimit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $class::getItemsWithPermission( $class::sitemapWhere(), NULL, array( $offset, $limit ), 'read', \IPS\Content\Hideable::FILTER_PUBLIC_ONLY, 0, new \IPS\Member, TRUE ) as $item )
|
||||
|
||||
@@ -43,6 +43,24 @@ class _Pages
|
||||
'sitemap_pages_priority' => new \IPS\Helpers\Form\Select( 'sitemap_pages_priority', \IPS\Settings::i()->sitemap_pages_priority, FALSE, array( 'options' => \IPS\Sitemap::$priorities, 'unlimited' => '-1', 'unlimitedLang' => 'sitemap_dont_include' ), NULL, NULL, NULL, 'sitemap_pages_priority' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings for ACP configuration
|
||||
*
|
||||
* @param array $values Values
|
||||
* @return void
|
||||
*/
|
||||
public function saveSettings( $values )
|
||||
{
|
||||
if ( $values['sitemap_configuration_info'] )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_pages_count' => $this->recommendedSettings['sitemap_pages_count'], 'sitemap_pages_priority' => $this->recommendedSettings['sitemap_pages_priority'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_pages_count' => $values['sitemap_pages_count'], 'sitemap_pages_priority' => $values['sitemap_pages_priority'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sitemap filename(s)
|
||||
@@ -82,6 +100,12 @@ class _Pages
|
||||
*/
|
||||
public function generateSitemap( $filename, $sitemap )
|
||||
{
|
||||
/* We have elected to not add databases to the sitemap */
|
||||
if ( ! \IPS\Settings::i()->sitemap_pages_count )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$class = '\IPS\cms\Pages\Page';
|
||||
$count = 0;
|
||||
$member = new \IPS\Member;
|
||||
@@ -97,7 +121,14 @@ class _Pages
|
||||
$totalLimit = \IPS\Settings::i()->sitemap_pages_count;
|
||||
if ( $totalLimit > -1 and ( $offset + $limit ) > $totalLimit )
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
if ( $totalLimit < $limit )
|
||||
{
|
||||
$limit = $totalLimit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
}
|
||||
}
|
||||
|
||||
$where = array( array( '(' . \IPS\Db::i()->findInSet( 'perm_' . $class::$permissionMap[ $permissionCheck ], $member->groups ) . ' OR ' . 'perm_' . $class::$permissionMap[ $permissionCheck ] . '=? )', '*' ) );
|
||||
|
||||
@@ -8,6 +8,32 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
class cms_hook_Topic extends _HOOK_CLASS_
|
||||
{
|
||||
/**
|
||||
* Can view?
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member to check for or NULL for the currently logged in member
|
||||
* @return bool
|
||||
*/
|
||||
public function canView( $member=NULL )
|
||||
{
|
||||
$canView = parent::canView( $member );
|
||||
$member = $member ? $member : \IPS\Member::loggedIn();
|
||||
|
||||
/* Whitelist which types of do we allow */
|
||||
$do = array( 'editComment' );
|
||||
|
||||
if ( ! $canView )
|
||||
{
|
||||
/* Check to see if it's attached to a database record and we are not a guest */
|
||||
if ( isset( \IPS\Request::i()->do ) and in_array( \IPS\Request::i()->do, $do ) and $record = \IPS\cms\Records::getLinkedRecord( $this ) and $member->member_id )
|
||||
{
|
||||
return $record->canView();
|
||||
}
|
||||
}
|
||||
|
||||
return $canView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do Moderator Action
|
||||
*
|
||||
|
||||
@@ -22,6 +22,16 @@ public static function hookData() {
|
||||
<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}}',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'selector' => '#elTopicActionsBottom_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}}',
|
||||
),
|
||||
),
|
||||
|
||||
@@ -27,7 +27,16 @@ if ( \IPS\Theme::designersModeEnabled() )
|
||||
|
||||
if ( isset( \IPS\Request::i()->file ) )
|
||||
{
|
||||
$file = file_get_contents( \IPS\ROOT_PATH . '/' . \IPS\Request::i()->file );
|
||||
$realPath = realpath( \IPS\ROOT_PATH . '/themes/' . \IPS\Request::i()->file );
|
||||
$pathContainer = realpath(\IPS\ROOT_PATH . '/themes/' );
|
||||
|
||||
if( $realPath === FALSE OR mb_substr( $realPath, 0, mb_strlen( $pathContainer ) ) !== $pathContainer )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '3C171/8', 403, '' );
|
||||
exit;
|
||||
}
|
||||
|
||||
$file = file_get_contents( \IPS\ROOT_PATH . '/themes/' . \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' );
|
||||
}
|
||||
@@ -35,6 +35,12 @@ class _categories extends \IPS\Node\Controller
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
/* This controller can not be accessed without a database ID */
|
||||
if( !\IPS\Request::i()->database_id )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2S390/1', 404, '' );
|
||||
}
|
||||
|
||||
$this->url = $this->url->setQueryString( array( 'database_id' => \IPS\Request::i()->database_id ) );
|
||||
|
||||
/* Assign the correct nodeClass so contentItem is specified */
|
||||
|
||||
@@ -1593,11 +1593,12 @@ class _databases extends \IPS\Node\Controller
|
||||
), NULL, NULL, NULL, 'database_cat_index_type' ) );
|
||||
|
||||
$fields = array(
|
||||
'primary_id_field' => 'database_field__id',
|
||||
'member_id' => 'database_field__member',
|
||||
'record_publish_date' => 'database_field__saved',
|
||||
'record_last_comment' => ( $current and $current->_comment_bump === \IPS\cms\Databases::BUMP_ON_EDIT ) ? 'database_field__edited' : 'database_field__updated',
|
||||
'record_rating' => 'database_field__rating'
|
||||
'primary_id_field' => 'database_field__id',
|
||||
'member_id' => 'database_field__member',
|
||||
'record_publish_date' => 'database_field__saved',
|
||||
'record_updated' => ( $current and $current->_comment_bump === \IPS\cms\Databases::BUMP_ON_EDIT ) ? 'database_field__edited' : 'database_field__updated',
|
||||
'record_last_comment' => "database_field__last_comment",
|
||||
'record_rating' => 'database_field__rating'
|
||||
);
|
||||
|
||||
if ( $current )
|
||||
|
||||
@@ -351,14 +351,14 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
$fieldsClass = 'IPS\cms\Fields' . \IPS\Request::i()->database_id;
|
||||
$catClass = 'IPS\cms\Categories' . \IPS\Request::i()->database_id;
|
||||
$container = ( $current ) ? $catClass::load( $current->category_id ) : ( isset( \IPS\Request::i()->category_id ) ? $catClass::load( \IPS\Request::i()->category_id ) : NULL );
|
||||
$customFields = $fieldsClass::fields( $customValues, 'view', $container, 0, $current );
|
||||
$manuallyHandledFields = array( 'record_publish_date', 'record_expiry_date', 'record_allow_comments', 'record_comment_cutoff', 'record_meta_keywords', 'record_meta_description' );
|
||||
|
||||
$form = new \IPS\Helpers\Form();
|
||||
|
||||
$form->addTab( 'content_database_record_tab_content' );
|
||||
|
||||
$formElements = $class::formElements( $current, $container );
|
||||
$formElements = $class::formElements( $current, $container );
|
||||
$customFields = $class::$customFields;
|
||||
|
||||
foreach( $formElements as $name => $field )
|
||||
{
|
||||
@@ -457,13 +457,15 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
$current = $recordClass::createFromForm( $values, $category );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Claim attachments */
|
||||
foreach( $fieldClass::data() as $key => $field )
|
||||
{
|
||||
if ( mb_ucfirst( $field->type ) === 'Editor' )
|
||||
{
|
||||
\IPS\File::claimAttachments( 'RecordField_'. $field->id , $current->id, NULL, 'RecordField_'. $field->id, FALSE );
|
||||
\IPS\File::claimAttachments( 'RecordField_' . ( $new ? 'new' : $current->primary_id_field ) . '_' . $field->id , $current->primary_id_field, $field->id, \IPS\Request::i()->database_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,92 +107,100 @@ class _media extends \IPS\Node\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( "app=cms&module=pages&controller=media" );
|
||||
|
||||
/* Display the table */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__cms_pages_media');
|
||||
$output = new \IPS\Helpers\Tree\Tree( $url, 'menu__cms_pages_media',
|
||||
/* Get Roots */
|
||||
function () use ( $url )
|
||||
{
|
||||
$data = \IPS\cms\modules\admin\pages\media::getRowsForTree( 0 );
|
||||
$rows = array();
|
||||
|
||||
foreach ( $data as $id => $row )
|
||||
{
|
||||
if( ( \IPS\Request::i()->isAjax() && $row instanceof \IPS\cms\Media ) || !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
$rows[ $id ] = ( $row instanceof \IPS\cms\Media) ? \IPS\cms\modules\admin\pages\media::getItemRow( $row, $url ) : \IPS\cms\modules\admin\pages\media::getFolderRow( $row, $url );
|
||||
}
|
||||
}
|
||||
|
||||
if( \IPS\Request::i()->isAjax() ){
|
||||
\IPS\Output::i()->sendOutput( json_encode( $rows ), 200, 'application/json', \IPS\Output::i()->httpHeaders );
|
||||
}
|
||||
|
||||
return $data;
|
||||
},
|
||||
/* Get Row */
|
||||
function ( $id, $root ) use ( $url )
|
||||
{
|
||||
if ( $root )
|
||||
{
|
||||
return \IPS\cms\modules\admin\pages\media::getFolderRow( \IPS\cms\Media\Folder::load( $id ), $url );
|
||||
}
|
||||
else
|
||||
{
|
||||
return \IPS\cms\modules\admin\pages\media::getItemRow( \IPS\cms\Media::load( $id ), $url );
|
||||
}
|
||||
},
|
||||
/* Get Row Parent ID*/
|
||||
function ()
|
||||
{
|
||||
return NULL;
|
||||
},
|
||||
/* Get Children */
|
||||
function ( $id ) use ( $url )
|
||||
{
|
||||
$rows = array();
|
||||
$data = \IPS\cms\modules\admin\pages\media::getRowsForTree( $id );
|
||||
|
||||
if ( ! isset( \IPS\Request::i()->subnode ) )
|
||||
{
|
||||
foreach ( $data as $id => $row )
|
||||
{
|
||||
if( \IPS\Request::i()->get == 'folders' && !( $row instanceof \IPS\cms\Media ) )
|
||||
{
|
||||
$rows[ $id ] = \IPS\cms\modules\admin\pages\media::getFolderRow( $row, $url );
|
||||
}
|
||||
elseif ( \IPS\Request::i()->get == 'files' && $row instanceof \IPS\cms\Media )
|
||||
{
|
||||
$rows[ $id ] = \IPS\cms\modules\admin\pages\media::getItemRow( $row, $url );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if( \IPS\Request::i()->isAjax() ){
|
||||
\IPS\Output::i()->sendOutput( json_encode( $rows ), 200, 'application/json', \IPS\Output::i()->httpHeaders );
|
||||
}
|
||||
|
||||
return $rows;
|
||||
},
|
||||
array( $this, '_getRootButtons' ),
|
||||
TRUE,
|
||||
FALSE,
|
||||
FALSE
|
||||
);
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_media.js', 'cms' ) );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'media/media.css', 'cms', 'admin' ) );
|
||||
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
if ( \IPS\Theme::designersModeEnabled() )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( $output, 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
$link = \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=designersmode' );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( \IPS\Member::loggedIn()->language()->addToStack('cms_media_designer_mode_warning', NULL, array( 'sprintf' => array( $link ) ) ), 'information', NULL, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'media', 'cms', 'admin' )->media( $output );
|
||||
$url = \IPS\Http\Url::internal( "app=cms&module=pages&controller=media" );
|
||||
|
||||
/* Display the table */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__cms_pages_media');
|
||||
$output = new \IPS\Helpers\Tree\Tree( $url, 'menu__cms_pages_media',
|
||||
/* Get Roots */
|
||||
function () use ( $url )
|
||||
{
|
||||
$data = \IPS\cms\modules\admin\pages\media::getRowsForTree( 0 );
|
||||
$rows = array();
|
||||
|
||||
foreach ( $data as $id => $row )
|
||||
{
|
||||
if( ( \IPS\Request::i()->isAjax() && $row instanceof \IPS\cms\Media ) || !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
$rows[ $id ] = ( $row instanceof \IPS\cms\Media) ? \IPS\cms\modules\admin\pages\media::getItemRow( $row, $url ) : \IPS\cms\modules\admin\pages\media::getFolderRow( $row, $url );
|
||||
}
|
||||
}
|
||||
|
||||
if( \IPS\Request::i()->isAjax() ){
|
||||
\IPS\Output::i()->sendOutput( json_encode( $rows ), 200, 'application/json', \IPS\Output::i()->httpHeaders );
|
||||
}
|
||||
|
||||
return $data;
|
||||
},
|
||||
/* Get Row */
|
||||
function ( $id, $root ) use ( $url )
|
||||
{
|
||||
if ( $root )
|
||||
{
|
||||
return \IPS\cms\modules\admin\pages\media::getFolderRow( \IPS\cms\Media\Folder::load( $id ), $url );
|
||||
}
|
||||
else
|
||||
{
|
||||
return \IPS\cms\modules\admin\pages\media::getItemRow( \IPS\cms\Media::load( $id ), $url );
|
||||
}
|
||||
},
|
||||
/* Get Row Parent ID*/
|
||||
function ()
|
||||
{
|
||||
return NULL;
|
||||
},
|
||||
/* Get Children */
|
||||
function ( $id ) use ( $url )
|
||||
{
|
||||
$rows = array();
|
||||
$data = \IPS\cms\modules\admin\pages\media::getRowsForTree( $id );
|
||||
|
||||
if ( ! isset( \IPS\Request::i()->subnode ) )
|
||||
{
|
||||
foreach ( $data as $id => $row )
|
||||
{
|
||||
if( \IPS\Request::i()->get == 'folders' && !( $row instanceof \IPS\cms\Media ) )
|
||||
{
|
||||
$rows[ $id ] = \IPS\cms\modules\admin\pages\media::getFolderRow( $row, $url );
|
||||
}
|
||||
elseif ( \IPS\Request::i()->get == 'files' && $row instanceof \IPS\cms\Media )
|
||||
{
|
||||
$rows[ $id ] = \IPS\cms\modules\admin\pages\media::getItemRow( $row, $url );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if( \IPS\Request::i()->isAjax() ){
|
||||
\IPS\Output::i()->sendOutput( json_encode( $rows ), 200, 'application/json', \IPS\Output::i()->httpHeaders );
|
||||
}
|
||||
|
||||
return $rows;
|
||||
},
|
||||
array( $this, '_getRootButtons' ),
|
||||
TRUE,
|
||||
FALSE,
|
||||
FALSE
|
||||
);
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_media.js', 'cms' ) );
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'media/media.css', 'cms', 'admin' ) );
|
||||
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( $output, 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'media', 'cms', 'admin' )->media( $output );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +228,7 @@ class _media extends \IPS\Node\Controller
|
||||
$form = new \IPS\Helpers\Form( 'form', 'upload' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'media_filename', NULL, FALSE, array( 'allowedFileTypes' => array_merge( \IPS\File::$safeFileExtensions, array( 'pdf' ) ), 'obscure' => FALSE, 'maxFileSize' => 5, 'storageExtension' => 'core_Theme', 'storageContainer' => 'pages_media', 'multiple' => FALSE, 'minimize' => FALSE ), NULL, NULL, NULL, 'media_filename' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'media_filename', NULL, FALSE, array( 'allowedFileTypes' => array_merge( \IPS\File::$safeFileExtensions, array( 'pdf' ) ), 'obscure' => FALSE, 'maxFileSize' => 5, 'storageExtension' => 'cms_Media', 'storageContainer' => 'pages_media', 'multiple' => FALSE, 'minimize' => FALSE ), NULL, NULL, NULL, 'media_filename' ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -250,7 +258,11 @@ class _media extends \IPS\Node\Controller
|
||||
$values['media_filename']->delete();
|
||||
}
|
||||
catch( \Exception $ex ) { }
|
||||
|
||||
|
||||
/* Wipe out included JS just in case we're using this media thing */
|
||||
\IPS\cms\Templates::deleteCompiledFiles();
|
||||
\IPS\cms\Pages\Page::deleteCachedIncludes();
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( "app=cms&module=pages&controller=media" );
|
||||
@@ -286,7 +298,7 @@ class _media extends \IPS\Node\Controller
|
||||
$form = new \IPS\Helpers\Form( 'form', 'upload' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'media_filename', NULL, FALSE, array( 'allowedFileTypes' => array_merge( \IPS\File::$safeFileExtensions, array( 'pdf', 'svg' ) ), 'obscure' => FALSE, 'maxFileSize' => 5, 'storageExtension' => 'core_Theme', 'storageContainer' => 'pages_media', 'multiple' => true, 'minimize' => FALSE ), NULL, NULL, NULL, 'media_filename' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'media_filename', NULL, FALSE, array( 'allowedFileTypes' => array_merge( \IPS\File::$safeFileExtensions, array( 'pdf', 'svg' ) ), 'obscure' => FALSE, 'maxFileSize' => 5, 'storageExtension' => 'cms_Media', 'storageContainer' => 'pages_media', 'multiple' => true, 'minimize' => FALSE ), NULL, NULL, NULL, 'media_filename' ) );
|
||||
|
||||
if ( ! isset( \IPS\Request::i()->media_parent ) and ! \IPS\Request::i()->media_parent )
|
||||
{
|
||||
@@ -350,6 +362,10 @@ class _media extends \IPS\Node\Controller
|
||||
$count++;
|
||||
}
|
||||
|
||||
/* Wipe out included JS just in case we're using this media thing */
|
||||
\IPS\cms\Templates::deleteCompiledFiles();
|
||||
\IPS\cms\Pages\Page::deleteCachedIncludes();
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( "app=cms&module=pages&controller=media" );
|
||||
|
||||
@@ -214,6 +214,7 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'templates_' . $location, FALSE, FALSE, array( 'options' => $data ) ) );
|
||||
}
|
||||
$form->addButton( 'cms_templates_export_return', 'link', \IPS\Http\Url::internal( "app=cms&module=pages&controller=templates" ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -331,7 +332,10 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->error( 'cms_no_templates_selected', '1T285/1', 403, '' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( "app=cms&module=pages&controller=templates" ), \IPS\Member::loggedIn()->language()->addToStack( 'menu__cms_pages_templates' ) );
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack('cms_templates_export_title') );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('cms_templates_export_title');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'admin' )->block( 'cms_templates_export_title', $form, FALSE );
|
||||
}
|
||||
|
||||
@@ -435,7 +439,6 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
'icon' => 'download',
|
||||
'title' => 'cms_templates_export_title',
|
||||
'link' => \IPS\Http\Url::internal( "app=cms&module=pages&controller=templates&do=export" ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('cms_templates_export_title') )
|
||||
);
|
||||
|
||||
\IPS\Output::i()->sidebar['actions']['upload'] = array(
|
||||
@@ -956,16 +959,64 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
|
||||
foreach( \IPS\cms\Templates::$databaseDefaults as $field => $template )
|
||||
{
|
||||
\IPS\Db::i()->update( 'cms_databases', array( 'database_template_' . $field => $new ), array( 'database_template_' . $field . ' =?', \IPS\Request::i()->group ) );
|
||||
\IPS\Db::i()->update( 'cms_databases', array( 'database_template_' . $field => mb_strtolower( $new ) ), array( 'database_template_' . $field . ' =?', \IPS\Request::i()->group ) );
|
||||
}
|
||||
|
||||
unset( \IPS\Data\Store::i()->cms_databases );
|
||||
|
||||
$this->findAndUpdateTemplates( $new, \IPS\Request::i()->group );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=pages&controller=templates' . ( isset( \IPS\Request::i()->t_location ) ? '&t_location=' . \IPS\Request::i()->t_location : '' ) ), 'deleted' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=pages&controller=templates' . ( isset( \IPS\Request::i()->t_location ) ? '&t_location=' . \IPS\Request::i()->t_location : '' ) ), 'saved' );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( \IPS\Member::loggedIn()->language()->addToStack('cms_template_database_options'), $form, FALSE, '', NULL, TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find templates referencing a template and update them
|
||||
*
|
||||
* @param string $new New template group name
|
||||
* @param string $old Old template group name
|
||||
* @return void
|
||||
*/
|
||||
protected function findAndUpdateTemplates( $new, $old )
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'cms_templates', array( 'template_content LIKE ?', '%' . $old . '%' ) ) as $template )
|
||||
{
|
||||
/* Make sure template tags call the correct group */
|
||||
if ( mb_stristr( $template['template_content'], '{template' ) )
|
||||
{
|
||||
preg_match_all( '/\{([a-z]+?=([\'"]).+?\\2 ?+)}/', $template['template_content'], $matches, PREG_SET_ORDER );
|
||||
|
||||
/* Work out the plugin and the values to pass */
|
||||
foreach( $matches as $index => $array )
|
||||
{
|
||||
preg_match_all( '/(.+?)=' . $array[ 2 ] . '(.+?)' . $array[ 2 ] . '\s?/', $array[ 1 ], $submatches );
|
||||
|
||||
$plugin = array_shift( $submatches[ 1 ] );
|
||||
if ( $plugin == 'template' )
|
||||
{
|
||||
$value = array_shift( $submatches[ 2 ] );
|
||||
$options = array();
|
||||
|
||||
foreach ( $submatches[ 1 ] as $k => $v )
|
||||
{
|
||||
$options[ $v ] = $submatches[ 2 ][ $k ];
|
||||
}
|
||||
|
||||
if ( isset( $options['app'] ) and $options['app'] == 'cms' and isset( $options['location'] ) and $options['location'] == 'database' and isset( $options['group'] ) and $options['group'] == mb_strtolower( $old ) )
|
||||
{
|
||||
$replace = '{template="' . $value . '" app="' . $options['app'] . '" location="' . $options['location'] . '" group="' . mb_strtolower( $new ) . '" params="' . ( isset( $options['params'] ) ? $options['params'] : NULL ) . '"}';
|
||||
|
||||
\IPS\Db::i()->update( 'cms_templates', array( 'template_content' => str_replace( $matches[$index][0], $replace, $template['template_content'] ) ), array( 'template_id=?', $template['template_id'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the template group! OH NOES
|
||||
|
||||
@@ -184,16 +184,16 @@ class _category extends \IPS\cms\Databases\Controller
|
||||
$sortFields[ $database->field_title ] = $fieldClass::load( $database->field_title );
|
||||
foreach( $sortFields as $id => $obj )
|
||||
{
|
||||
if ( $table->sortBy == 'field_' . $id )
|
||||
if ( $table->sortBy == $RecordsClass::$databaseTable . '.' . 'field_' . $id OR $table->sortBy == 'field_' . $id )
|
||||
{
|
||||
if ( $obj->type == 'Number' )
|
||||
{
|
||||
$table->sortBy = 'LENGTH(`field_' . $id . '`) ' . $table->sortDirection . ',`field_' . $id . '`';
|
||||
$table->sortOptions[ $table->sortBy ] = 'LENGTH(`field_' . $id . '`) ' . $table->sortDirection . ',`field_' . $id . '`';
|
||||
break;
|
||||
}
|
||||
elseif( $obj->type == 'Date' )
|
||||
{
|
||||
$table->sortBy = 'CAST(`field_' . $id . '` AS UNSIGNED)';
|
||||
$table->sortOptions[ $table->sortBy ] = 'CAST(`field_' . $id . '` AS UNSIGNED)';
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ class _category extends \IPS\cms\Databases\Controller
|
||||
}
|
||||
|
||||
$sortBy = array(
|
||||
'record_last_comment' => 'content_record_last_comment',
|
||||
'record_updated' => 'content_record_last_updated',
|
||||
'record_comments' => 'content_record_comments',
|
||||
'record_views' => 'content_record_views',
|
||||
'field_' . $database->field_title => 'content_record_title',
|
||||
@@ -241,6 +241,9 @@ class _category extends \IPS\cms\Databases\Controller
|
||||
/* Ensure we have all sort options available */
|
||||
$table->sortOptions = array_unique( array_merge( $table->sortOptions, array_combine( array_keys( $sortBy ), array_keys( $sortBy ) ) ) );
|
||||
|
||||
/* To avoid confusion, label 'updated' as 'Recently Updated' as last comment */
|
||||
\IPS\Member::loggedIn()->language()->words[ $table->langPrefix . 'sort_updated' ] = \IPS\Member::loggedIn()->language()->addToStack('content_record_last_comment');
|
||||
|
||||
if ( !isset( $sortBy[ $database->field_sort ] ) )
|
||||
{
|
||||
switch ( $database->field_sort )
|
||||
@@ -325,7 +328,18 @@ class _category extends \IPS\cms\Databases\Controller
|
||||
$table->advancedSearch['sort_by'][1]['options']['field_' . $obj->id ] = 'content_field_' . $obj->id;
|
||||
}
|
||||
|
||||
$table->sortOptions[ 'field_' . $obj->id ] = isset( $table->sortOptions[ 'field_' . $obj->id ] ) ? $table->sortOptions[ 'field_' . $obj->id ] : 'field_' . $obj->id;
|
||||
if ( in_array( $obj->type, array( 'Date', 'DateRange' ) ) )
|
||||
{
|
||||
$table->sortOptions[ 'field_' . $obj->id ] = 'CAST(`field_' . $obj->id . '` AS UNSIGNED)';
|
||||
}
|
||||
else if ( $obj->type == 'Number' )
|
||||
{
|
||||
$table->sortOptions[ 'field_' . $obj->id ] = 'LENGTH(`field_' . $obj->id . '`) ' . $table->sortDirection . ',`field_' . $obj->id . '`';
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->sortOptions[ 'field_' . $obj->id ] = isset( $table->sortOptions[ 'field_' . $obj->id ] ) ? $table->sortOptions[ 'field_' . $obj->id ] : 'field_' . $obj->id;
|
||||
}
|
||||
}
|
||||
|
||||
$table->advancedSearchCallback = function( $table, $values ) use ( $database, $sortBy, $customFields )
|
||||
@@ -414,17 +428,18 @@ class _category extends \IPS\cms\Databases\Controller
|
||||
{
|
||||
if ( isset( $customFields[ mb_substr( $values['sort_by'], 6 ) ] ) and $customFields[ mb_substr( $values['sort_by'], 6 ) ]->type == 'Number' )
|
||||
{
|
||||
$table->sortBy = 'LENGTH(`' . $values['sort_by'] . '`) ' . $table->sortDirection . ',`' . $values['sort_by'] . '`';
|
||||
$table->sortOptions[ $values['sort_by'] ] = 'LENGTH(`' . $values['sort_by'] . '`) ' . $table->sortDirection . ',`' . $values['sort_by'] . '`';
|
||||
}
|
||||
elseif( isset( $customFields[ mb_substr( $values['sort_by'], 6 ) ] ) and $customFields[ mb_substr( $values['sort_by'], 6 ) ]->type == 'Date' )
|
||||
{
|
||||
$table->sortBy = 'CAST(`' . $values['sort_by'] . '` AS UNSIGNED)';
|
||||
$table->sortOptions[ $values['sort_by'] ] = 'CAST(`' . $values['sort_by'] . '` AS UNSIGNED)';
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->sortBy = $values['sort_by'];
|
||||
$table->sortOptions[ $values['sort_by'] ] = $values['sort_by'];
|
||||
}
|
||||
|
||||
|
||||
$table->sortBy = $values['sort_by'];
|
||||
$table->sortDirection = $values['sort_direction'];
|
||||
}
|
||||
|
||||
|
||||
@@ -163,10 +163,29 @@ class _index extends \IPS\cms\Databases\Controller
|
||||
*/
|
||||
protected function form()
|
||||
{
|
||||
/* If the page is the default page and Pages is the default app, the node selector cannot find the page as it bypasses the Database dispatcher */
|
||||
if ( \IPS\cms\Pages\Page::$currentPage === NULL and \IPS\cms\Databases\Dispatcher::i()->databaseId === NULL and isset( \IPS\Request::i()->page_id ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\cms\Pages\Page::$currentPage = \IPS\cms\Pages\Page::load( \IPS\Request::i()->page_id );
|
||||
$database = \IPS\cms\Pages\Page::$currentPage->getDatabase();
|
||||
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'content_err_page_404', '2T389/1', 404, '' );
|
||||
}
|
||||
}
|
||||
else if ( \IPS\cms\Pages\Page::$currentPage === NULL and \IPS\cms\Databases\Dispatcher::i()->databaseId === NULL and isset( \IPS\Request::i()->d ) )
|
||||
{
|
||||
\IPS\cms\Pages\Page::$currentPage = \IPS\cms\Pages\Page::loadByDatabaseId( \IPS\Request::i()->d );
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form( 'select_category', 'continue' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'category', NULL, TRUE, array(
|
||||
'url' => \IPS\cms\Pages\Page::$currentPage->url()->setQueryString('do', 'form'),
|
||||
'url' => \IPS\cms\Pages\Page::$currentPage->url()->setQueryString( array( 'do' => 'form', 'page_id' => \IPS\cms\Pages\Page::$currentPage->id ) ),
|
||||
'class' => 'IPS\cms\Categories' . \IPS\cms\Databases\Dispatcher::i()->databaseId,
|
||||
'permissionCheck' => function( $node )
|
||||
{
|
||||
|
||||
@@ -262,17 +262,17 @@ class _record extends \IPS\Content\Controller
|
||||
\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
|
||||
);
|
||||
}
|
||||
elseif( $record->container()->allow_rating )
|
||||
elseif( $record->container()->allow_rating AND $record->averageRating() AND $record->numberOfRatings() )
|
||||
{
|
||||
\IPS\Output::i()->jsonLd['article']['aggregateRating'] = array(
|
||||
'@type' => 'AggregateRating',
|
||||
'ratingValue' => $record->averageRating(),
|
||||
'ratingCount' => $record->numberOfRatings(),
|
||||
'bestRating' => \IPS\Settings::i()->reviews_rating_out_of
|
||||
);
|
||||
}
|
||||
|
||||
@@ -605,10 +605,21 @@ class _record extends \IPS\Content\Controller
|
||||
|
||||
$title = \IPS\Member::loggedIn()->language()->addToStack( 'content_record_form_edit_record', FALSE, array( 'sprintf' => array( $record->_title ) ) );
|
||||
$formElements = $recordClass::formElements( $record, $category );
|
||||
|
||||
if ( \IPS\Request::i()->id AND ! $record->canEdit() )
|
||||
|
||||
// We check if the form has been submitted to prevent the user loosing their content
|
||||
if ( isset( \IPS\Request::i()->form_submitted ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'module_no_permission', '2T252/D', 403, '' );
|
||||
if ( ! $record->couldEdit() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'module_no_permission', '2T252/G', 403, '' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ! $record->canEdit() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'module_no_permission', '2T252/D', 403, '' );
|
||||
}
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form( 'form', isset( \IPS\Member::loggedIn()->language()->words[ $recordClass::$formLangPrefix . '_save' ] ) ? $recordClass::$formLangPrefix . '_save' : 'save' );
|
||||
|
||||
@@ -356,7 +356,7 @@ class _builder extends \IPS\core\modules\front\system\widgets
|
||||
*
|
||||
* @param string $uniqueId The unique key of the widget (eg: wzsj1233)
|
||||
* @param array $widgets Current widgets (eg from core_widget_areas.widgets (json decoded))
|
||||
* @return boolen True if something removed, false if not
|
||||
* @return bool True if something removed, false if not
|
||||
*/
|
||||
protected function _checkAndDeleteFromCoreWidgets( $uniqueId, $widgets )
|
||||
{
|
||||
|
||||
@@ -397,7 +397,7 @@ class _Upgrade
|
||||
|
||||
if ( $field['field_type'] == 'checkbox' and count( $json ) )
|
||||
{
|
||||
$field['field_type'] = 'CheckboxSet';
|
||||
$save['field_type'] = 'CheckboxSet';
|
||||
}
|
||||
}
|
||||
else if ( $field['field_type'] == 'upload' )
|
||||
|
||||
@@ -818,7 +818,7 @@ EOF;
|
||||
}
|
||||
else
|
||||
{
|
||||
$theValue[] = $eachValue;
|
||||
$theValue[ $eachKey ] = $eachValue;
|
||||
}
|
||||
}
|
||||
$v = $theValue;
|
||||
|
||||
@@ -159,9 +159,9 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
protected static $loadedCatsFromPath = array();
|
||||
|
||||
/**
|
||||
* @brief [Records] Database object
|
||||
* @brief [Records] Database objects
|
||||
*/
|
||||
protected static $database = NULL;
|
||||
protected static $database = array();
|
||||
|
||||
/**
|
||||
* @brief Latest posted record
|
||||
@@ -223,12 +223,12 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
*/
|
||||
public static function database()
|
||||
{
|
||||
if ( static::$database === NULL )
|
||||
if ( !isset( static::$database[ static::$customDatabaseId ] ) )
|
||||
{
|
||||
static::$database = \IPS\cms\Databases::load( static::$customDatabaseId );
|
||||
static::$database[ static::$customDatabaseId ] = \IPS\cms\Databases::load( static::$customDatabaseId );
|
||||
}
|
||||
|
||||
return static::$database;
|
||||
return static::$database[ static::$customDatabaseId ];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -793,6 +793,20 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
return parent::canDelete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Changed Columns
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
if ( !$this->_new AND isset( $this->changed['can_view_others'] ) )
|
||||
{
|
||||
$this->updateSearchIndexPermissions();
|
||||
}
|
||||
parent::save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*
|
||||
@@ -1002,13 +1016,13 @@ class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
/**
|
||||
* Get URL
|
||||
*
|
||||
* @return \IPS\Http\Url
|
||||
* @return \IPS\Http\Url|NULL
|
||||
*/
|
||||
public function url()
|
||||
{
|
||||
if( $this->_url === NULL )
|
||||
{
|
||||
if ( \IPS\cms\Pages\Page::$currentPage and static::database()->page_id == \IPS\cms\Pages\Page::$currentPage->id )
|
||||
if ( \IPS\cms\Pages\Page::$currentPage and \IPS\cms\Databases::load( $this->database_id )->page_id == \IPS\cms\Pages\Page::$currentPage->id )
|
||||
{
|
||||
$pagePath = \IPS\cms\Pages\Page::$currentPage->full_path;
|
||||
}
|
||||
|
||||
@@ -812,10 +812,7 @@ class _Databases extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
parent::save();
|
||||
|
||||
/* Clear cache */
|
||||
if ( isset( \IPS\Data\Store::i()->cms_databases ) )
|
||||
{
|
||||
unset( \IPS\Data\Store::i()->cms_databases );
|
||||
}
|
||||
unset( \IPS\Data\Store::i()->cms_databases );
|
||||
|
||||
/* If this database isn't searchable, make sure its content is not in the search index */
|
||||
if( $removeSearchIndex )
|
||||
@@ -860,11 +857,6 @@ class _Databases extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
{
|
||||
$field->delete( TRUE );
|
||||
}
|
||||
|
||||
if ( isset( \IPS\Data\Store::i()->cms_databases ) )
|
||||
{
|
||||
unset( \IPS\Data\Store::i()->cms_databases );
|
||||
}
|
||||
|
||||
/* Delete comments */
|
||||
\IPS\Db::i()->delete( 'cms_database_comments', array( 'comment_database_id=?', $this->id ) );
|
||||
@@ -926,17 +918,18 @@ class _Databases extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
\IPS\Lang::deleteCustom( 'cms', "cms_records" . $this->id . '_pl' );
|
||||
\IPS\Lang::deleteCustom( 'cms', "module__cms_records" . $this->id );
|
||||
|
||||
/* Unclaim attachments */
|
||||
/* Unclaim attachments */
|
||||
\IPS\File::unclaimAttachments( 'cms_Records', NULL, NULL, $this->id );
|
||||
\IPS\File::unclaimAttachments( 'cms_Records' . $this->id );
|
||||
|
||||
/* Remove widgets */
|
||||
$this->removeWidgets();
|
||||
|
||||
/* Best remove the stored data */
|
||||
unset( \IPS\Data\Store::i()->database_reciprocal_links );
|
||||
|
||||
|
||||
/* Delete the database record */
|
||||
parent::delete();
|
||||
|
||||
/* Best remove the stored data */
|
||||
unset( \IPS\Data\Store::i()->database_reciprocal_links, \IPS\Data\Store::i()->cms_databases );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -983,10 +976,7 @@ class _Databases extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
parent::setPermissions( $insert, $matrix );
|
||||
|
||||
/* Clear cache */
|
||||
if ( isset( \IPS\Data\Store::i()->cms_databases ) )
|
||||
{
|
||||
unset( \IPS\Data\Store::i()->cms_databases );
|
||||
}
|
||||
unset( \IPS\Data\Store::i()->cms_databases );
|
||||
|
||||
/* Clone these permissions to all categories that do not have permissions */
|
||||
$class = '\IPS\cms\Categories' . $this->id;
|
||||
|
||||
@@ -400,17 +400,7 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
{
|
||||
$customValidationCode = function( $val ) use ( $database, $row, $record )
|
||||
{
|
||||
$where = array( array( 'field_' . $row->id . '=?', $val ) );
|
||||
|
||||
if ( $record !== NULL )
|
||||
{
|
||||
$where[] = array( 'primary_id_field != ?', $record->_id );
|
||||
}
|
||||
|
||||
if ( \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $database->id, $where )->first() )
|
||||
{
|
||||
throw new \LogicException( \IPS\Member::loggedIn()->language()->addToStack( "field_unique_entry_not_unique", FALSE, array( 'sprintf' => array( $database->recordWord( 1 ) ) ) ) );
|
||||
}
|
||||
call_user_func_array( 'IPS\cms\Fields' . static::$customDatabaseId . '::validateUnique', array( $val, $row, $record ) );
|
||||
};
|
||||
}
|
||||
|
||||
@@ -996,6 +986,32 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if this value is unique
|
||||
* Used in custom validation for fomr helpers
|
||||
*
|
||||
* @param string $val The value to check
|
||||
* @param \IPS\cms\Fields $field The field
|
||||
* @param \IPS\cms\Records $record The record (if any)
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public static function validateUnique( $val, $field, $record )
|
||||
{
|
||||
$database = \IPS\cms\Databases::load( static::$customDatabaseId );
|
||||
|
||||
$where = array( array( 'field_' . $field->id . '=?', $val ) );
|
||||
|
||||
if ( $record !== NULL )
|
||||
{
|
||||
$where[] = array( 'primary_id_field != ?', $record->_id );
|
||||
}
|
||||
|
||||
if ( \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $database->id, $where )->first() )
|
||||
{
|
||||
throw new \LogicException( \IPS\Member::loggedIn()->language()->addToStack( "field_unique_entry_not_unique", FALSE, array( 'sprintf' => array( $database->recordWord( 1 ) ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [ActiveRecord] Duplicate
|
||||
*
|
||||
@@ -2737,7 +2753,10 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
{
|
||||
unset( \IPS\Data\Store::i()->$key );
|
||||
}
|
||||
|
||||
|
||||
/* Remove reciprocal map data */
|
||||
\IPS\Db::i()->delete( 'cms_database_fields_reciprocal_map', array( 'map_origin_database_id=? AND map_field_id=? ', static::$customDatabaseId, $this->id ) );
|
||||
|
||||
/* Best remove the stored data */
|
||||
unset( \IPS\Data\Store::i()->database_reciprocal_links );
|
||||
|
||||
@@ -2996,7 +3015,20 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
{
|
||||
case 'Text':
|
||||
case 'TextArea':
|
||||
$customValidationCode = 'IPS\cms\Fields' . static::$customDatabaseId . '::validateInput_' . $this->id;
|
||||
if ( $this->unique )
|
||||
{
|
||||
$field = $this;
|
||||
$customValidationCode = function( $val ) use ( $field, $record )
|
||||
{
|
||||
call_user_func_array( 'IPS\cms\Fields' . static::$customDatabaseId . '::validateUnique', array( $val, $field, $record ) );
|
||||
|
||||
return call_user_func( 'IPS\cms\Fields' . static::$customDatabaseId . '::validateInput_' . $field->id, $val );
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
$customValidationCode = 'IPS\cms\Fields' . static::$customDatabaseId . '::validateInput_' . $this->id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ class _Media extends \IPS\Node\Model
|
||||
public function form( &$form )
|
||||
{
|
||||
/* Build form */
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'media_filename', ( ( $this->filename ) ? \IPS\File::get( 'cms_Media', $this->file_object ) : NULL ), FALSE, array( 'obscure' => FALSE, 'maxFileSize' => 5, 'storageExtension' => 'core_Theme', 'storageContainer' => 'pages_media' ), NULL, NULL, NULL, 'media_filename' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'media_filename', ( ( $this->filename ) ? \IPS\File::get( 'cms_Media', $this->file_object ) : NULL ), FALSE, array( 'obscure' => FALSE, 'maxFileSize' => 5, 'storageExtension' => 'cms_Media', 'storageContainer' => 'pages_media' ), NULL, NULL, NULL, 'media_filename' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'media_parent', $this->parent ? $this->parent : 0, FALSE, array(
|
||||
'class' => '\IPS\cms\Media\Folder',
|
||||
@@ -379,6 +379,13 @@ class _Media extends \IPS\Node\Model
|
||||
*/
|
||||
public static function exportDesignersModeMedia()
|
||||
{
|
||||
/* Make sure our media folder exists */
|
||||
if ( !is_dir( \IPS\ROOT_PATH . '/themes/cms/media' ) )
|
||||
{
|
||||
mkdir( \IPS\ROOT_PATH . '/themes/cms/media', \IPS\IPS_FOLDER_PERMISSION );
|
||||
chmod( \IPS\ROOT_PATH . '/themes/cms/media', \IPS\IPS_FOLDER_PERMISSION );
|
||||
}
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'cms_media' ) as $media )
|
||||
{
|
||||
/* We could use recursive mode but it wouldn't correctly chmod the intermediate dirs */
|
||||
|
||||
@@ -1045,7 +1045,7 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
$template = \IPS\cms\Templates::load( $key );
|
||||
|
||||
$return[ $thing ][ $key ] = \IPS\Http\Url::createFromString( \IPS\Http\Url::baseUrl() . "/applications/cms/interface/developer/developer.php" )
|
||||
->setQueryString( 'file', '/themes/cms/' . $template->location . '/' . $template->group . '/' . $template->title );
|
||||
->setQueryString( 'file', 'cms/' . $template->location . '/' . $template->group . '/' . $template->title );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
@@ -1933,6 +1933,11 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
*/
|
||||
public function mapToDatabase( $databaseId )
|
||||
{
|
||||
/* Ensure this page has an ID (as in, $page->save() has not been called yet on a new page) */
|
||||
if ( ! $this->id )
|
||||
{
|
||||
throw new \LogicException('cms_err_page_id_is_empty');
|
||||
}
|
||||
try
|
||||
{
|
||||
/* is this page already in use */
|
||||
@@ -2021,6 +2026,9 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
|
||||
unset( \IPS\Data\Store::i()->frontNavigation );
|
||||
|
||||
/* Remove any widgets for this page */
|
||||
\IPS\Db::i()->delete( 'cms_page_widget_areas', array( 'area_page_id=?', $this->id ) );
|
||||
|
||||
parent::delete();
|
||||
|
||||
if ( $this->full_path and \IPS\Theme::designersModeEnabled() )
|
||||
|
||||
@@ -1812,6 +1812,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
$class = '\IPS\cms\Categories' . static::$customDatabaseId;
|
||||
$category = $class::load( $this->category_id );
|
||||
$category->setLastComment();
|
||||
$category->setLastReview();
|
||||
$category->save();
|
||||
}
|
||||
}
|
||||
@@ -2256,7 +2257,11 @@ class _Records extends \IPS\Content\Item implements
|
||||
|
||||
if ( $topic === NULL )
|
||||
{
|
||||
$this->syncTopic();
|
||||
try
|
||||
{
|
||||
$this->syncTopic();
|
||||
}
|
||||
catch( \Exception $ex ) { }
|
||||
|
||||
/* Try again */
|
||||
$topic = $this->topic( FALSE );
|
||||
@@ -2323,7 +2328,11 @@ class _Records extends \IPS\Content\Item implements
|
||||
}
|
||||
else if ( $this->_forum_forum )
|
||||
{
|
||||
$this->syncTopic();
|
||||
try
|
||||
{
|
||||
$this->syncTopic();
|
||||
}
|
||||
catch( \Exception $ex ) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2368,7 +2377,11 @@ class _Records extends \IPS\Content\Item implements
|
||||
}
|
||||
elseif ( $this->_forum_forum and ! $this->isFutureDate() )
|
||||
{
|
||||
$this->syncTopic();
|
||||
try
|
||||
{
|
||||
$this->syncTopic();
|
||||
}
|
||||
catch( \Exception $ex ) { };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2443,6 +2456,35 @@ class _Records extends \IPS\Content\Item implements
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this topic linked to a record?
|
||||
*
|
||||
* @param \IPS\forums\Topic $topic Forums topic
|
||||
* @return \IPS\cms\Records|NULL
|
||||
*/
|
||||
public static function getLinkedRecord( $topic )
|
||||
{
|
||||
foreach( \IPS\cms\Databases::databases() as $database )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( $database->forum_record and $database->forum_forum == $topic->container()->_id )
|
||||
{
|
||||
$class = '\IPS\cms\Records' . $database->id;
|
||||
$record = $class::load( $topic->tid, 'record_topicid' );
|
||||
|
||||
if ( $record->_forum_record )
|
||||
{
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( \Exception $e ) { }
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Topic (checks member's permissions)
|
||||
*
|
||||
@@ -2465,10 +2507,10 @@ class _Records extends \IPS\Content\Item implements
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Post this record as a forum topic
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function syncTopic()
|
||||
@@ -2488,6 +2530,19 @@ class _Records extends \IPS\Content\Item implements
|
||||
throw new \UnexpectedValueException('content_record_bad_forum_for_topic');
|
||||
}
|
||||
|
||||
/* Run a test for the record url, this call will throw an LogicException if the database isn't associated to a page */
|
||||
try
|
||||
{
|
||||
$this->url();
|
||||
}
|
||||
catch ( \LogicException $e )
|
||||
{
|
||||
$idColumn = static::$databaseColumnId;
|
||||
|
||||
\IPS\Log::log( sprintf( "Record %s in database %s tried to sync the topic, but failed because it has no valid url", $this->$idColumn , static::$customDatabaseId), 'cms_topicsync' );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Existing topic */
|
||||
if ( $this->record_topicid )
|
||||
{
|
||||
|
||||
@@ -680,7 +680,7 @@ class _Templates extends \IPS\Patterns\ActiveRecord
|
||||
$content = $this->content;
|
||||
|
||||
/* Build on demand */
|
||||
if ( $this->type != 'js' and ( mb_stristr( $this->content, "{block=" ) or mb_stristr( $this->content, "{{if" ) ) )
|
||||
if ( $this->type != 'js' and ( mb_stristr( $this->content, "{block=" ) or mb_stristr( $this->content, "{{if" ) or mb_stristr( $this->content, "{media=" ) ) )
|
||||
{
|
||||
$functionName = 'css_' . mt_rand();
|
||||
\IPS\Theme::makeProcessFunction( str_replace( '\\', '\\\\', $content ), $functionName );
|
||||
|
||||
@@ -120,6 +120,13 @@ class _Database extends \IPS\Widget
|
||||
try
|
||||
{
|
||||
$database = \IPS\cms\Databases::load( intval( $this->configuration['database'] ) );
|
||||
|
||||
if ( ! $database->page_id and \IPS\cms\Pages\Page::$currentPage )
|
||||
{
|
||||
$database->page_id = \IPS\cms\Pages\Page::$currentPage->id;
|
||||
$database->save();
|
||||
}
|
||||
|
||||
static::$html = \IPS\cms\Databases\Dispatcher::i()->setDatabase( $database->id )->run();
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
|
||||
@@ -88,14 +88,15 @@ class _RecordFeed extends \IPS\Content\Widget
|
||||
$form = parent::configuration( $form );
|
||||
|
||||
/* Tags */
|
||||
if ( $database and $database->tags_enabled )
|
||||
if ( $database )
|
||||
{
|
||||
/* Sort */
|
||||
$sortOptions = array(
|
||||
'primary_id_field' => 'database_field__id',
|
||||
'member_id' => 'database_field__member',
|
||||
'record_publish_date' => 'database_field__saved',
|
||||
'record_last_comment' => ( $database and $database->_comment_bump === \IPS\cms\Databases::BUMP_ON_EDIT ) ? 'database_field__edited' : 'database_field__updated',
|
||||
'record_updated' => ( $database and $database->_comment_bump === \IPS\cms\Databases::BUMP_ON_EDIT ) ? 'database_field__edited' : 'database_field__updated',
|
||||
'record_last_comment' => 'sort_record_last_comment',
|
||||
'record_rating' => 'database_field__rating'
|
||||
);
|
||||
|
||||
@@ -124,22 +125,25 @@ class _RecordFeed extends \IPS\Content\Widget
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'widget_feed_sort_on', isset( $this->configuration['widget_feed_sort_on'] ) ? $this->configuration['widget_feed_sort_on'] : $class::$databaseColumnMap['updated'], FALSE, array( 'options' => $sortOptions ) ), NULL, NULL, NULL, 'widget_feed_sort_on' );
|
||||
|
||||
$options = array( 'autocomplete' => array( 'unique' => TRUE, 'source' => NULL, 'freeChoice' => TRUE ) );
|
||||
|
||||
if ( \IPS\Settings::i()->tags_force_lower )
|
||||
|
||||
if ( $database->tags_enabled )
|
||||
{
|
||||
$options['autocomplete']['forceLower'] = TRUE;
|
||||
$options = array( 'autocomplete' => array( 'unique' => TRUE, 'source' => NULL, 'freeChoice' => TRUE ) );
|
||||
|
||||
if ( \IPS\Settings::i()->tags_force_lower )
|
||||
{
|
||||
$options['autocomplete']['forceLower'] = TRUE;
|
||||
}
|
||||
|
||||
if ( \IPS\Settings::i()->tags_clean )
|
||||
{
|
||||
$options['autocomplete']['filterProfanity'] = TRUE;
|
||||
}
|
||||
|
||||
$options['autocomplete']['prefix'] = FALSE;
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'widget_feed_tags', ( isset( $this->configuration['widget_feed_tags'] ) ? $this->configuration['widget_feed_tags'] : array( 'tags' => NULL ) ), FALSE, $options ) );
|
||||
}
|
||||
|
||||
if ( \IPS\Settings::i()->tags_clean )
|
||||
{
|
||||
$options['autocomplete']['filterProfanity'] = TRUE;
|
||||
}
|
||||
|
||||
$options['autocomplete']['prefix'] = FALSE;
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'widget_feed_tags', ( isset( $this->configuration['widget_feed_tags'] ) ? $this->configuration['widget_feed_tags'] : array( 'tags' => NULL ) ), FALSE, $options ) );
|
||||
}
|
||||
|
||||
/* Any filterable fields */
|
||||
|
||||
@@ -111,7 +111,7 @@ class _Rss extends \IPS\Widget\StaticCache
|
||||
{
|
||||
$items[ $guid ] = array(
|
||||
'title' => $article['title'],
|
||||
'content' => \IPS\Text\Parser::parseStatic( $article['content'] ),
|
||||
'content' => \IPS\Text\Parser::parseStatic( $article['content'], TRUE, NULL, new \IPS\Member ),
|
||||
'link' => (string) $article['link'],
|
||||
'date' => ( $article['date'] instanceof \IPS\DateTime ) ? $article['date']->getTimestamp() : $article['date']
|
||||
);
|
||||
|
||||
@@ -107,6 +107,7 @@ class _Wysiwyg extends \IPS\Widget\StaticCache
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_core.js', 'core' ) );
|
||||
return $this->output( isset( $this->configuration['content'] ) ? $this->configuration['content'] : '' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user