Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
+28
-15
@@ -201,6 +201,11 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$buttons['edit']['link'] = $buttons['edit']['link']->setQueryString( 'searchResult', \IPS\Request::i()->searchResult );
|
||||
}
|
||||
if ( isset( $buttons['delete'] ) and isset( \IPS\Request::i()->root ) and \IPS\Request::i()->root == $id )
|
||||
{
|
||||
unset( $buttons['delete']['data']['delete'] );
|
||||
$buttons['delete']['data']['confirm'] = '';
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'trees', 'core' )->row(
|
||||
$this->url,
|
||||
@@ -545,22 +550,26 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
$key = \IPS\Request::i()->key;
|
||||
$dummyForm = new \IPS\Helpers\Form;
|
||||
$node->form( $dummyForm );
|
||||
$value = isset( \IPS\Request::i()->value ) ? \IPS\Request::i()->value : NULL;
|
||||
if ( $value === NULL )
|
||||
if( isset( $_SESSION[ $key ] ) )
|
||||
{
|
||||
foreach ( $dummyForm->elements as $tab => $elements )
|
||||
$value = $_SESSION[ $key ];
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = isset( \IPS\Request::i()->value ) ? \IPS\Request::i()->value : NULL;
|
||||
if ( $value === NULL )
|
||||
{
|
||||
if ( isset( $elements[ $key ] ) )
|
||||
foreach ( $dummyForm->elements as $tab => $elements )
|
||||
{
|
||||
$value = $elements[ $key ]->value;
|
||||
break;
|
||||
if ( isset( $elements[ $key ] ) )
|
||||
{
|
||||
$value = $elements[ $key ]->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_array( $value ) )
|
||||
{
|
||||
$value = implode( ',', $value );
|
||||
|
||||
$_SESSION[ $key ] = $value;
|
||||
}
|
||||
|
||||
/* Build Form */
|
||||
@@ -577,7 +586,7 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$url = $this->url;
|
||||
$multiRedirectUrl = $this->url->setQueryString( array( 'do' => 'massChange', 'key' => \IPS\Request::i()->key, 'value' => $value, 'nodes' => \IPS\Request::i()->nodes ?: $values['nodes'], 'from' => \IPS\Request::i()->from, 'form_submitted' => 1, 'csrfKey' => \IPS\Request::i()->csrfKey ) );
|
||||
$multiRedirectUrl = $this->url->setQueryString( array( 'do' => 'massChange', 'key' => \IPS\Request::i()->key, 'nodes' => \IPS\Request::i()->nodes ?: $values['nodes'], 'from' => \IPS\Request::i()->from, 'form_submitted' => 1, 'csrfKey' => \IPS\Request::i()->csrfKey ) );
|
||||
if ( \IPS\Request::i()->subnode )
|
||||
{
|
||||
$multiRedirectUrl = $multiRedirectUrl->setQueryString( 'subnode', 1 );
|
||||
@@ -598,9 +607,9 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
$did++;
|
||||
$_node = $nodeClass::constructFromData( $row );
|
||||
|
||||
if ( $_node->canCopyValue( \IPS\Request::i()->key, \IPS\Request::i()->value ) )
|
||||
if ( $_node->canCopyValue( \IPS\Request::i()->key, $_SESSION[ \IPS\Request::i()->key ] ) )
|
||||
{
|
||||
$values = $_node->formatFormValues( array( \IPS\Request::i()->key => \IPS\Request::i()->value ) );
|
||||
$values = $_node->formatFormValues( array( \IPS\Request::i()->key => $_SESSION[ \IPS\Request::i()->key ] ) );
|
||||
|
||||
foreach( $values as $k => $v )
|
||||
{
|
||||
@@ -639,6 +648,10 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
/* Clear the value in the session */
|
||||
unset( $_SESSION[ \IPS\Request::i()->key ] );
|
||||
|
||||
/* And redirect */
|
||||
$finishUrl = $url->setQueryString( array( 'do' => 'form', 'id' => \IPS\Request::i()->from ) );
|
||||
if ( \IPS\Request::i()->subnode )
|
||||
{
|
||||
@@ -1223,7 +1236,7 @@ class _Controller extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Do we have any children or content? */
|
||||
if ( $node->hasChildren( NULL, NULL, TRUE ) or $node->showDeleteOrMoveForm() )
|
||||
if ( $node->hasChildren( NULL, NULL, TRUE ) or $node->showDeleteOrMoveForm() or isset( \IPS\Request::i()->ajaxValidate ) )
|
||||
{
|
||||
$form = $node->deleteOrMoveForm( FALSE, TRUE );
|
||||
if ( $values = $form->values() )
|
||||
|
||||
Reference in new issue
Block a user