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

+15 -15
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Hook 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
* @since 5 Aug 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\Plugin;
@@ -251,7 +250,7 @@ class _Hook extends \IPS\Patterns\ActiveRecord
}
/* IPS Cloud Sync */
\IPS\IPS::resyncIPSCloud();
\IPS\IPS::resyncIPSCloud( 'Wrote hooks.php file' );
}
/**
@@ -280,7 +279,7 @@ class _Hook extends \IPS\Patterns\ActiveRecord
*/
public function editForm( $url )
{
$url = $url->setQueryString( 'tab', NULL )->setQueryString( 'hook', $this->id );
$url = $url->setQueryString( 'tab', 'hooks' )->setQueryString( 'hook', $this->id );
if( !\IPS\Request::i()->isAjax() )
{
@@ -405,19 +404,19 @@ class _Hook extends \IPS\Patterns\ActiveRecord
/* Is this an edit? */
$current = NULL;
if ( isset( \IPS\Request::i()->tab ) and \IPS\Request::i()->tab != 'new' )
if ( isset( \IPS\Request::i()->hookTab ) AND \IPS\Request::i()->hookTab != 'new' AND isset( $hookData[ \IPS\Request::i()->template ][ \substr( \IPS\Request::i()->hookTab, 3 ) ] ) )
{
$current = $hookData[ \IPS\Request::i()->template ][ \substr( \IPS\Request::i()->tab, 3 ) ];
$current = $hookData[ \IPS\Request::i()->template ][ \substr( \IPS\Request::i()->hookTab, 3 ) ];
}
$_idSuffix = $current ? md5( $current['selector'] ) : '';
/* Build form for current tab */
$activeTab = ( isset( \IPS\Request::i()->tab ) and array_key_exists( \IPS\Request::i()->tab, $tabs ) ) ? \IPS\Request::i()->tab : '__new__';
$activeTab = ( isset( \IPS\Request::i()->hookTab ) and array_key_exists( \IPS\Request::i()->hookTab, $tabs ) ) ? \IPS\Request::i()->hookTab : '__new__';
$form = new \IPS\Helpers\Form;
if ( $current )
{
$form->addButton( 'delete', 'link', $url->setQueryString( 'do', 'editHook' )->setQueryString( 'template', \IPS\Request::i()->template )->setQueryString( 'delete', \substr( \IPS\Request::i()->tab, 3 ) ), 'ipsButton ipsButton_alternate' );
$form->addButton( 'delete', 'link', $url->setQueryString( 'do', 'editHook' )->setQueryString( 'template', \IPS\Request::i()->template )->setQueryString( 'delete', \substr( \IPS\Request::i()->hookTab, 3 ) ), 'ipsButton ipsButton_alternate' );
}
$form->class = 'ipsForm_vertical';
$form->attributes['data-controller'] = 'core.admin.system.themeHook';
@@ -456,6 +455,7 @@ class _Hook extends \IPS\Patterns\ActiveRecord
$options['tags'][ $tag ] = $tag;
}
}
$form->add( new \IPS\Helpers\Form\Codemirror( 'plugin_theme_hook_content', ( isset( $current['content'] ) ? $current['content'] : NULL ), NULL, $options, NULL, NULL, NULL, 'cm-' . \IPS\Request::i()->template . $_idSuffix ) );
$form->add( new \IPS\Helpers\Form\Stack( 'plugin_theme_hook_css_class', ( isset( $current['css_classes'] ) ? $current['css_classes'] : NULL ), NULL, array(), NULL, NULL, NULL, 'plugin_theme_hook_css_class' . $_idSuffix ) );
$form->add( new \IPS\Helpers\Form\Stack( 'plugin_theme_hook_attribute_keys', ( isset( $current['attributes_add'] ) ? $current['attributes_add'] : NULL ), NULL, array( 'stackFieldType' => 'KeyValue' ), NULL, NULL, NULL, 'plugin_theme_hook_attribute_keys' . $_idSuffix ) );
@@ -491,9 +491,9 @@ class _Hook extends \IPS\Patterns\ActiveRecord
$save['attributes_remove'] = $values['plugin_theme_hook_attribute_names'];
break;
}
if ( isset( \IPS\Request::i()->tab ) and \IPS\Request::i()->tab != 'new' )
if ( isset( \IPS\Request::i()->hookTab ) and \IPS\Request::i()->hookTab != 'new' )
{
$hookData[ $template ][ \substr( \IPS\Request::i()->tab, 3 ) ] = $save;
$hookData[ $template ][ \substr( \IPS\Request::i()->hookTab, 3 ) ] = $save;
}
else
{
@@ -514,12 +514,12 @@ class _Hook extends \IPS\Patterns\ActiveRecord
}
/* Construct tab interface */
if ( \IPS\Request::i()->isAjax() and isset( \IPS\Request::i()->tab ) )
if ( \IPS\Request::i()->isAjax() and isset( \IPS\Request::i()->hookTab ) )
{
\IPS\Output::i()->output = $form;
return;
}
$tabbedContent = \IPS\Theme::i()->getTemplate( 'global' )->tabs( $tabs, $activeTab, $form, $url->setQueryString( 'do', 'editHook' )->setQueryString( 'template', \IPS\Request::i()->template ) );
$tabbedContent = \IPS\Theme::i()->getTemplate( 'global' )->tabs( $tabs, $activeTab, $form, $url->setQueryString( 'do', 'editHook' )->setQueryString( 'template', \IPS\Request::i()->template ), 'hookTab' );
if ( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->output = $tabbedContent;