Version 4.2.0

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

No files matched your search

+24 -12
View File
@@ -1,13 +1,12 @@
<?php
/**
* @brief Folder Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Content
* @since 15 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\cms\Pages;
@@ -93,6 +92,11 @@ class _Folder extends \IPS\Node\Model
* @brief [Node] Order Database Column
*/
public static $databaseColumnOrder = 'path';
/**
* @brief [Node] Automatically set position for new nodes
*/
public static $automaticPositionDetermination = FALSE;
/**
* @brief [Node] Node Title
@@ -202,7 +206,7 @@ class _Folder extends \IPS\Node\Model
$return['delete'] = array(
'icon' => 'trash-o',
'title' => 'empty',
'link' => $url->setQueryString( array( 'do' => 'delete', 'id' => $this->_id, 'deleteNode' => 0 ) ),
'link' => $url->setQueryString( array( 'do' => 'delete', 'id' => $this->_id ) ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('empty') ),
'hotkey'=> 'd'
);
@@ -374,7 +378,10 @@ class _Folder extends \IPS\Node\Model
*/
public function getItemCount()
{
return (int) \IPS\Db::i()->select( 'COUNT(*)', 'cms_pages', array( 'page_folder_id=?', $this->id ) )->first();
$pages = (int) \IPS\Db::i()->select( 'COUNT(*)', 'cms_pages', array( 'page_folder_id=?', $this->id ) )->first();
$subFolders = (int) \IPS\Db::i()->select( 'COUNT(*)', 'cms_folders', array( 'folder_parent_id=?', $this->id ) )->first();
return $pages + $subFolders;
}
/**
@@ -404,22 +411,27 @@ class _Folder extends \IPS\Node\Model
* Handle submissions of form to delete or move content
*
* @param array $values Values from form
* @param bool $deleteWhenDone Delete the node when done?
* @return void
*/
public function deleteOrMoveFormSubmit( $values, $deleteWhenDone=TRUE )
public function deleteOrMoveFormSubmit( $values )
{
if ( $values['cms_move_pages'] )
{
$folderId = $values['cms_move_pages']->id;
$folderId = $values['cms_move_pages']->_id;
}
else
{
$folderId = 0;
}
\IPS\Db::i()->update( 'cms_pages', array( 'page_folder_id' => $folderId ), array( 'page_folder_id=?', $this->id ) );
\IPS\Db::i()->update( 'cms_folders', array( 'folder_parent_id' => $folderId ), array( 'folder_id=?', $this->id ) );
\IPS\Db::i()->update( 'cms_pages', array( 'page_folder_id' => $folderId ), array( 'page_folder_id=?', $this->_id ) );
\IPS\Db::i()->update( 'cms_folders', array( 'folder_parent_id' => $folderId ), array( 'folder_id=?', $this->_id ) );
\IPS\Db::i()->update( 'cms_folders', array( 'folder_parent_id' => $folderId ), array( 'folder_parent_id=?', $this->_id ) );
unset( \IPS\Data\Store::i()->pages_page_urls );
/* Update pages */
\IPS\cms\Pages\Page::resetPath( $folderId );
/* Delete it */
\IPS\Session::i()->log( 'acplog__node_deleted', array( $this->title => TRUE, $this->titleForLog() => FALSE ) );