Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -23,7 +23,7 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Categories extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
{
|
||||
use \IPS\Node\Statistics;
|
||||
use \IPS\Node\Statistics, \IPS\Content\ViewUpdates;
|
||||
|
||||
/**
|
||||
* @brief Multiton Store
|
||||
|
||||
@@ -23,6 +23,8 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Databases extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
{
|
||||
use \IPS\Content\ViewUpdates;
|
||||
|
||||
/**
|
||||
* @brief [ActiveRecord] Multiton Store
|
||||
*/
|
||||
|
||||
@@ -2110,7 +2110,7 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
|
||||
foreach( range( 1, 7 ) as $id )
|
||||
{
|
||||
$displayOptions[ $id ] = $listingOptions[ $id ] = \IPS\Theme::i()->getTemplate( 'records', 'cms', 'global' )->fieldBadge( \IPS\Member::loggedIn()->language()->addToStack('cms_badge_label'), \IPS\Member::loggedIn()->language()->addToStack('cms_badge_value'), 'ipsBadge_style' . $id );
|
||||
$displayOptions[ $id ] = $listingOptions[ $id ] = \IPS\Theme::i()->getTemplate( 'records', 'cms', 'global' )->fieldBadge( \IPS\Member::loggedIn()->language()->addToStack('cms_badge_label'), \IPS\Member::loggedIn()->language()->addToStack('cms_badge_value'), 'ipsBadge_front ipsBadge_style' . $id );
|
||||
$listingToggles[ $id ] = array( 'field_display_listing_json_badge_right' );
|
||||
}
|
||||
|
||||
@@ -2934,8 +2934,8 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
$options['app'] = 'cms';
|
||||
$options['key'] = 'Records' . static::$customDatabaseId;
|
||||
$options['allowAttachments'] = $this->allow_attachments;
|
||||
$options['autoSaveKey'] = 'RecordField_' . ( $content === NULL ? 'new' : $content->_id ) . '_' . $this->id;
|
||||
$options['attachIds'] = ( $content === NULL ) ? NULL : array( $content->_id, $this->id, static::$customDatabaseId );
|
||||
$options['autoSaveKey'] = 'RecordField_' . ( ( $content === NULL OR !$content->_id ) ? 'new' : $content->_id ) . '_' . $this->id;
|
||||
$options['attachIds'] = ( $content === NULL OR !$content->_id ) ? NULL : array( $content->_id, $this->id, static::$customDatabaseId );
|
||||
break;
|
||||
case 'Email':
|
||||
case 'Password':
|
||||
|
||||
@@ -316,14 +316,7 @@ class _Media extends \IPS\Node\Model
|
||||
$values['filename_stored'] = $values['parent'] . '_' . $values['filename'];
|
||||
$values['is_image'] = $values['media_filename']->isImage();
|
||||
|
||||
/* We need to rename it */
|
||||
try
|
||||
{
|
||||
$values['media_filename']->delete();
|
||||
}
|
||||
catch( \Exception $ex ) { }
|
||||
|
||||
$values['file_object'] = (string) \IPS\File::create( 'cms_Media', $values['filename_stored'], $values['media_filename']->contents(), 'pages_media', TRUE, NULL, FALSE );
|
||||
$values['file_object'] = (string) $values['media_filename'];
|
||||
|
||||
unset( $values['media_filename'] );
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
{
|
||||
use \IPS\Content\ViewUpdates;
|
||||
|
||||
/**
|
||||
* @brief [ActiveRecord] Multiton Store
|
||||
*/
|
||||
@@ -593,7 +595,7 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
try
|
||||
{
|
||||
$testFolder = \IPS\cms\Pages\Folder::load( $val, 'folder_name' );
|
||||
|
||||
|
||||
/* Ok, we have a folder, but is it on the same tree as us ?*/
|
||||
if ( \intval( \IPS\Request::i()->page_folder_id ) == $testFolder->parent_id )
|
||||
{
|
||||
@@ -603,11 +605,10 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
/* Nothing with the same name, so that's proper good that is */
|
||||
}
|
||||
|
||||
|
||||
/* If we hit here, we don't have an existing name so that's good */
|
||||
if ( ! \IPS\Request::i()->page_folder_id and \IPS\cms\Pages\Page::isFurlCollision( $val ) )
|
||||
if ( \IPS\cms\Pages\Page::isFurlCollision( $val ) )
|
||||
{
|
||||
throw new \InvalidArgumentException('content_folder_name_furl_collision_pages_app');
|
||||
}
|
||||
@@ -848,7 +849,28 @@ class _Page extends \IPS\Node\Model implements \IPS\Node\Permissions
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* What about system folders? */
|
||||
try
|
||||
{
|
||||
$folder = \IPS\cms\Pages\Folder::load( \IPS\Request::i()->page_folder_id );
|
||||
$base = \IPS\ROOT_PATH . '/' . $folder->path . '/';
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
$base = \IPS\ROOT_PATH . '/';
|
||||
}
|
||||
|
||||
if( is_dir( $base . $path ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if( \IPS\Request::i()->page_folder_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$defaultApplication = \IPS\Db::i()->select( 'app_directory', 'core_applications', 'app_default=1' )->first();
|
||||
|
||||
foreach( \IPS\Application::applications() as $key => $app )
|
||||
|
||||
@@ -28,7 +28,6 @@ class _Records extends \IPS\Content\Item implements
|
||||
\IPS\Content\Followable,
|
||||
\IPS\Content\Shareable,
|
||||
\IPS\Content\ReadMarkers,
|
||||
\IPS\Content\Views,
|
||||
\IPS\Content\Ratings,
|
||||
\IPS\Content\Searchable,
|
||||
\IPS\Content\FuturePublishing,
|
||||
@@ -36,7 +35,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
\IPS\Content\MetaData,
|
||||
\IPS\Content\Anonymous
|
||||
{
|
||||
use \IPS\Content\Reactable, \IPS\Content\Reportable;
|
||||
use \IPS\Content\Reactable, \IPS\Content\Reportable, \IPS\Content\Statistics, \IPS\Content\ViewUpdates;
|
||||
|
||||
/**
|
||||
* @brief Multiton Store
|
||||
@@ -1281,7 +1280,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
$return['comments'] = (int) $this->mapped('num_comments');
|
||||
}
|
||||
|
||||
if ( $this instanceof \IPS\Content\Views )
|
||||
if ( \IPS\IPS::classUsesTrait( $this, 'IPS\Content\ViewUpdates' ) )
|
||||
{
|
||||
$return['num_views'] = (int) $this->mapped('views');
|
||||
}
|
||||
@@ -3276,7 +3275,7 @@ class _Records extends \IPS\Content\Item implements
|
||||
}
|
||||
|
||||
/* Am I a Moderator with edit permissions ?*/
|
||||
if( $this->container()->modPermission( 'edit', $member, \get_called_class() ) )
|
||||
if ( static::modPermission( 'edit', $member, $this->containerWrapper() ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -4067,14 +4066,5 @@ class _Records extends \IPS\Content\Item implements
|
||||
* @var bool
|
||||
*/
|
||||
public static bool $allowPublishDateWhileEditing = TRUE;
|
||||
|
||||
/**
|
||||
* Allow editing of the publish date from existing records
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function supportsPublishDate( ?\IPS\Content\Item $item ): bool
|
||||
{
|
||||
return !static::database()->forum_record AND parent::supportsPublishDate($item);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user