Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -289,12 +289,16 @@ EOF;
|
||||
/**
|
||||
* Delete compiled versions
|
||||
*
|
||||
* @param int|array $ids Integer ID or Array IDs to remove
|
||||
* @param null|int|array $ids Integer ID or Array IDs to remove
|
||||
* @return void
|
||||
*/
|
||||
public static function deleteCompiled( $ids )
|
||||
public static function deleteCompiled( $ids=NULL )
|
||||
{
|
||||
if ( is_numeric( $ids ) )
|
||||
if ( $ids === NULL )
|
||||
{
|
||||
$ids = iterator_to_array( \IPS\Db::i()->select( 'block_id', 'cms_blocks' )->setValueField('block_id') );
|
||||
}
|
||||
else if ( is_numeric( $ids ) )
|
||||
{
|
||||
$ids = array( $ids );
|
||||
}
|
||||
@@ -431,6 +435,14 @@ EOF;
|
||||
unset( $buttons['edit']['data'] );
|
||||
}
|
||||
|
||||
/* View Details */
|
||||
$buttons['details'] = array(
|
||||
'icon' => 'search',
|
||||
'title' => 'block_embed_options',
|
||||
'link' => \IPS\Http\Url::internal( "app=cms&module=pages&controller=blocks&do=embedOptions&id={$this->_id}" ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('block_embed_options') )
|
||||
);
|
||||
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
@@ -447,7 +459,7 @@ EOF;
|
||||
$block_plugin = ( isset( \IPS\Request::i()->block_plugin ) ) ? \IPS\Request::i()->block_plugin : ( $this->id ? $this->plugin : null );
|
||||
|
||||
/* Build form */
|
||||
$form->addtab( 'content_block_form_tab__details' );
|
||||
$form->addTab( 'content_block_form_tab__details' );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'block_name', NULL, TRUE, array(
|
||||
'app' => 'cms',
|
||||
'key' => ( $this->id ? "content_block_name_" . $this->id : NULL )
|
||||
@@ -550,12 +562,12 @@ EOF;
|
||||
|
||||
if ( is_callable( array( $this->widget(), 'configuration' ) ) )
|
||||
{
|
||||
$form->addtab( 'content_block_form_tab__feed' );
|
||||
$form->addTab( 'content_block_form_tab__feed' );
|
||||
$this->widget()->configuration( $form );
|
||||
}
|
||||
}
|
||||
|
||||
$form->addtab( 'content_block_form_tab__content');
|
||||
$form->addTab( 'content_block_form_tab__content');
|
||||
|
||||
if ( $block_type === 'plugin' )
|
||||
{
|
||||
@@ -606,7 +618,8 @@ EOF;
|
||||
$form->add( new \IPS\Helpers\Form\Editor( 'block_content', $this->content, FALSE, array(
|
||||
'app' => 'cms',
|
||||
'key' => 'BlockContent',
|
||||
'autoSaveKey' => 'block-content-' . ( $this->id ? $this->id : 'new' ) ), NULL, NULL, NULL, 'block_content_editor' ) );
|
||||
'autoSaveKey' => 'block-content-' . ( $this->id ? $this->id : 'new' ),
|
||||
'attachIds' => ( $this->id ) ? array( $this->id ) : NULL ), NULL, NULL, NULL, 'block_content_editor' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -656,15 +669,16 @@ EOF;
|
||||
*/
|
||||
public function formatFormValues( $values )
|
||||
{
|
||||
/* Claim Attachments - we need to adjust the temp key based on presence if this block existed or not */
|
||||
if ( \IPS\Request::i()->block_editor === 'editor' )
|
||||
{
|
||||
\IPS\File::claimAttachments( ( $this->id ) ? 'block-content-' . $this->id : 'block-content-new', $this->id );
|
||||
}
|
||||
|
||||
if ( ! $this->id )
|
||||
{
|
||||
$this->active = 1;
|
||||
$this->save();
|
||||
|
||||
if ( \IPS\Request::i()->block_editor === 'editor' )
|
||||
{
|
||||
\IPS\File::claimAttachments( 'block-content/block-' . $this->id, $this->id );
|
||||
}
|
||||
}
|
||||
|
||||
$config = array();
|
||||
|
||||
Reference in new issue
Block a user