Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Block Controller
|
||||
* @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 19 Feb 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\cms\modules\admin\pages;
|
||||
@@ -48,7 +47,29 @@ class _blocks extends \IPS\Node\Controller
|
||||
public function manage()
|
||||
{
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__cms_pages_blocks');
|
||||
$nodeClass = $this->nodeClass;
|
||||
|
||||
if ( $nodeClass::canAddRoot() )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['add_meow'] = array(
|
||||
'primary' => true,
|
||||
'icon' => 'plus',
|
||||
'title' => 'content_block_cat_add',
|
||||
'link' => $this->url->setQueryString( 'do', 'form' ),
|
||||
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_cat_add') ) : array() )
|
||||
);
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'block_add' ) )
|
||||
{
|
||||
\IPS\Output::i()->sidebar['actions']['add_block'] = array(
|
||||
'primary' => true,
|
||||
'icon' => 'puzzle-piece',
|
||||
'title' => 'content_block_block_add',
|
||||
'link' => $this->url->setQueryString( array( 'do' => 'addBlockType', 'subnode' => 1 ) ),
|
||||
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_block_add') ) : array() )
|
||||
);
|
||||
}
|
||||
parent::manage();
|
||||
}
|
||||
|
||||
@@ -77,26 +98,6 @@ class _blocks extends \IPS\Node\Controller
|
||||
$nodeClass = $this->nodeClass;
|
||||
$buttons = array();
|
||||
|
||||
if ( $nodeClass::canAddRoot() )
|
||||
{
|
||||
$buttons['add_meow'] = array(
|
||||
'icon' => 'plus',
|
||||
'title' => 'content_block_cat_add',
|
||||
'link' => $this->url->setQueryString( 'do', 'form' ),
|
||||
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_cat_add') ) : array() )
|
||||
);
|
||||
}
|
||||
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'pages', 'block_add' ) )
|
||||
{
|
||||
$buttons['add_block'] = array(
|
||||
'icon' => 'puzzle-piece',
|
||||
'title' => 'content_block_block_add',
|
||||
'link' => $this->url->setQueryString( array( 'do' => 'addBlockType', 'subnode' => 1 ) ),
|
||||
'data' => ( $nodeClass::$modalForms ? array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('content_block_block_add') ) : array() )
|
||||
);
|
||||
}
|
||||
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
@@ -130,13 +131,23 @@ class _blocks extends \IPS\Node\Controller
|
||||
{
|
||||
if ( $widget['app'] )
|
||||
{
|
||||
$plugins[ \IPS\Application::load( $widget['app'] )->_title ][ 'app__' . $widget['app'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
|
||||
$app = \IPS\Application::load( $widget['app'] );
|
||||
if ( $app->enabled )
|
||||
{
|
||||
$plugins[ $app->_title ][ 'app__' . $widget['app'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$plugins[ \IPS\Plugin::load( $widget['plugin'] )->_title ][ 'plugin__' . $widget['plugin'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
|
||||
$plugin = \IPS\Plugin::load( $widget['plugin'] );
|
||||
if ( $plugin->enabled )
|
||||
{
|
||||
$plugins[ $plugin->_title ][ 'plugin__' . $widget['plugin'] . '__' . $widget['key'] ] = \IPS\Member::loggedIn()->language()->addToStack( 'block_' . $widget['key'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( \UnexpectedValueException $e ) { }
|
||||
catch ( \OutOfRangeException $e ) { }
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user