Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -40,6 +40,8 @@ class _categories extends \IPS\Node\Controller
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'databases_use' );
|
||||
|
||||
/* This controller can not be accessed without a database ID */
|
||||
if( !\IPS\Request::i()->database_id )
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ class _databases extends \IPS\Node\Controller
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'databases_manage' );
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'databases_use' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ class _databases extends \IPS\Node\Controller
|
||||
if ( ! @$xml->read() )
|
||||
{
|
||||
@unlink( \IPS\Request::i()->file );
|
||||
\IPS\Output::i()->error( 'xml_upload_invalid', '2C163/1', 403, '' );
|
||||
\IPS\Output::i()->error( 'xml_upload_invalid', '2T259/5', 403, '' );
|
||||
}
|
||||
|
||||
/* Is this the first batch? */
|
||||
@@ -1554,7 +1554,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_databases.js', 'cms', 'admin' ) );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( $current ? "content_db_" . $current->id : 'add', $form, FALSE );
|
||||
\IPS\Output::i()->title = ( $current ) ? \IPS\Member::loggedIn()->language()->addToStack('cms_editing_database', NULL, array( 'sprintf' => array( $current->_title ) ) ) : \IPS\Member::loggedIn()->language()->addToStack('cms_adding_database');
|
||||
\IPS\Output::i()->title = ( $current ) ? \IPS\Member::loggedIn()->language()->addToStack( 'cms_editing_database', FALSE, array( 'sprintf' => array( $current->_title ) ) ) : \IPS\Member::loggedIn()->language()->addToStack('cms_adding_database');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1599,7 +1599,7 @@ class _databases extends \IPS\Node\Controller
|
||||
if ( $disabled === TRUE )
|
||||
{
|
||||
$form->hiddenValues['database_use_categories_impossible'] = TRUE;
|
||||
\IPS\Member::loggedIn()->language()->words['database_use_categories_warning'] = \IPS\Member::loggedIn()->language()->addToStack( 'database_use_categories_impossible', NULL, array( 'sprintf' => array( $current->numberOfCategories() ) ) );
|
||||
\IPS\Member::loggedIn()->language()->words['database_use_categories_warning'] = \IPS\Member::loggedIn()->language()->addToStack( 'database_use_categories_impossible', FALSE, array( 'sprintf' => array( $current->numberOfCategories() ) ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'database_use_as_page_title' , $current ? $current->use_as_page_title : 1, FALSE, array(
|
||||
@@ -1881,8 +1881,8 @@ class _databases extends \IPS\Node\Controller
|
||||
$rebuildUrlCounts = \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&id=' . $current->id . '&do=rebuildCommentCounts' );
|
||||
|
||||
\IPS\Member::loggedIn()->language()->words['database_forum_record_desc'] = \IPS\Member::loggedIn()->language()->addToStack( 'database_forum_record__desc' ) . ' ' .
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'database_forum_record__rebuild', NULL, array( 'sprintf' => array( $rebuildUrl ) ) ) . ' ' .
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'database_forum_comments__rebuild', NULL, array( 'sprintf' => array( $rebuildUrlCounts ) ) );
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'database_forum_record__rebuild', FALSE, array( 'sprintf' => array( $rebuildUrl ) ) ) . ' ' .
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'database_forum_comments__rebuild', FALSE, array( 'sprintf' => array( $rebuildUrlCounts ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -43,7 +43,8 @@ class _fields extends \IPS\Node\Controller
|
||||
$this->url = $this->url->setQueryString( array( 'database_id' => \IPS\Request::i()->database_id ) );
|
||||
|
||||
$this->nodeClass = '\IPS\cms\Fields' . \IPS\Request::i()->database_id;
|
||||
|
||||
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'databases_use' );
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'cms_fields_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
public function execute()
|
||||
{
|
||||
$this->url = $this->url->setQueryString( array( 'database_id' => \IPS\Request::i()->database_id ) );
|
||||
|
||||
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'databases_use' );
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'records_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
@@ -506,13 +507,6 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
$changeAuthor = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $values['record_author_choice'] === 'notme' and ! empty( $values['record_member_id'] ) )
|
||||
{
|
||||
$changeAuthor = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Just editing, thanks */
|
||||
if ( ! $new )
|
||||
|
||||
@@ -193,6 +193,11 @@ class _ajax extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$where[] = array( 'template_user_created=1 and template_user_edited=1' );
|
||||
}
|
||||
|
||||
if ( isset( \IPS\Request::i()->type ) )
|
||||
{
|
||||
$where[] = array( 'template_type=?', \IPS\Request::i()->type );
|
||||
}
|
||||
|
||||
$select = \IPS\Db::i()->select(
|
||||
'*',
|
||||
@@ -236,14 +241,17 @@ class _ajax extends \IPS\Dispatcher\Controller
|
||||
$tags['cms_error_page']['{error_code}'] = 'cms_error_page_code';
|
||||
}
|
||||
|
||||
foreach( \IPS\cms\Databases::roots( NULL, NULL ) as $id => $db )
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'databases', 'databases_use' ) )
|
||||
{
|
||||
if ( ! $db->page_id )
|
||||
foreach ( \IPS\cms\Databases::roots( NULL, NULL ) as $id => $db )
|
||||
{
|
||||
$tags['cms_tag_databases']['{database="' . $db->key . '"}'] = $db->_title;
|
||||
if ( !$db->page_id )
|
||||
{
|
||||
$tags['cms_tag_databases']['{database="' . $db->key . '"}'] = $db->_title;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach( \IPS\cms\Blocks\Block::roots( NULL, NULL ) as $id => $block )
|
||||
{
|
||||
$tags['cms_tag_blocks']['{block="' . $block->key . '"}'] = $block->_title;
|
||||
|
||||
@@ -169,16 +169,19 @@ class _blocks extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
$disabled = array();
|
||||
foreach( \IPS\cms\Databases::databases() as $db )
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'cms', 'databases', 'databases_use' ) )
|
||||
{
|
||||
if ( $db->page_id )
|
||||
foreach ( \IPS\cms\Databases::databases() as $db )
|
||||
{
|
||||
$plugins[ \IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_title' ) ][ 'db_feed_' . $db->id ] = \IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_block_with_name', NULL, array( 'sprintf' => array( $db->_title ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$disabled[] = 'db_feed_' . $db->id;
|
||||
$plugins[ \IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_title' ) ][ 'db_feed_' . $db->id ] = \IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_block_with_name_disabled', NULL, array( 'sprintf' => array( $db->_title ) ) );
|
||||
if ( $db->page_id )
|
||||
{
|
||||
$plugins[\IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_title' )]['db_feed_' . $db->id] = \IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_block_with_name', FALSE, array('sprintf' => array($db->_title)) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$disabled[] = 'db_feed_' . $db->id;
|
||||
$plugins[\IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_title' )]['db_feed_' . $db->id] = \IPS\Member::loggedIn()->language()->addToStack( 'cms_db_feed_block_with_name_disabled', FALSE, array('sprintf' => array($db->_title)) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ class _media extends \IPS\Node\Controller
|
||||
if ( \IPS\Theme::designersModeEnabled() )
|
||||
{
|
||||
$link = \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=designersmode' );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( \IPS\Member::loggedIn()->language()->addToStack('cms_media_designer_mode_warning', NULL, array( 'sprintf' => array( $link ) ) ), 'information', NULL, FALSE );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( \IPS\Member::loggedIn()->language()->addToStack( 'cms_media_designer_mode_warning', FALSE, array( 'sprintf' => array( $link ) ) ), 'information', NULL, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -307,7 +307,7 @@ FILE;
|
||||
|
||||
if ( isset( static::$pageToDatabaseMap[ $page->id ] ) )
|
||||
{
|
||||
$badge = array( 0 => 'style7', 1 => \IPS\Member::loggedIn()->language()->addToStack( 'page_database_display', NULL, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack('content_db_' . static::$pageToDatabaseMap[ $page->id ] ) ) ) ) );
|
||||
$badge = array( 0 => 'style7', 1 => \IPS\Member::loggedIn()->language()->addToStack( 'page_database_display', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack('content_db_' . static::$pageToDatabaseMap[ $page->id ] ) ) ) ) );
|
||||
}
|
||||
return \IPS\Theme::i()->getTemplate( 'trees', 'core' )->row( $url, $page->id, $page->seo_name, false, $page->getButtons( \IPS\Http\url::internal('app=cms&module=pages&controller=pages'), true ), "", 'file-text-o', NULL, FALSE, NULL, NULL, $badge, FALSE, FALSE, FALSE );
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
$lang = NULL;
|
||||
if( !empty( $values['lang'] ) )
|
||||
{
|
||||
$lang = $values['lang'] == 'updated' ? 'app_now_updated' : 'app_now_installed';
|
||||
$lang = $values['lang'] == 'updated' ? 'application_now_updated' : 'application_now_installed';
|
||||
}
|
||||
|
||||
if( !empty( $values['marketplace'] ) )
|
||||
@@ -330,7 +330,7 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
if ( \IPS\Theme::designersModeEnabled() )
|
||||
{
|
||||
$link = \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=designersmode' );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( \IPS\Member::loggedIn()->language()->addToStack('cms_theme_designer_mode_warning', NULL, array( 'sprintf' => array( $link ) ) ), 'information', NULL, FALSE );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( \IPS\Member::loggedIn()->language()->addToStack( 'cms_theme_designer_mode_warning', FALSE, array( 'sprintf' => array( $link ) ) ), 'information', NULL, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -613,6 +613,14 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
) ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'template_group_new', NULL, FALSE, array( 'regex' => '/^([a-z_][a-z0-9_]+?)?$/' ), function( $val ) {
|
||||
/* PHP Keywords cannot be used as template names - so make sure the full template name is not in the list */
|
||||
$keywords = array( 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor' );
|
||||
|
||||
if ( \in_array( $val, $keywords ) )
|
||||
{
|
||||
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack( 'template_reserved_word', FALSE, array( 'htmlsprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $keywords ) ) ) ) );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$count = \IPS\Db::i()->select( 'COUNT(*)', 'cms_templates', array( "LOWER(template_group)=?", mb_strtolower( str_replace( ' ', '_', $val ) ) ) )->first();
|
||||
@@ -997,10 +1005,10 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
$names[] = $db->_title;
|
||||
}
|
||||
|
||||
$form->addMessage( \IPS\Member::loggedIn()->language()->addToStack( 'cms_database_template_used_in', NULL, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $names ) ) ) ), 'ipsMessage ipsMessage_info' );
|
||||
$form->addMessage( \IPS\Member::loggedIn()->language()->addToStack( 'cms_database_template_used_in', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $names ) ) ) ), 'ipsMessage ipsMessage_info' );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'cms_database_group_name', \IPS\cms\Templates::readableGroupName( \IPS\Request::i()->group ), NULL, array( 'regex' => '/^([A-Z_][A-Z0-9_\.\s]+?)$/i' ), function( $val ) {
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'cms_database_group_name', \IPS\Request::i()->group, NULL, array( 'regex' => '/^([a-z_][a-z0-9_]+?)?$/' ), function( $val ) {
|
||||
/* PHP Keywords cannot be used as template names - so make sure the full template name is not in the list */
|
||||
$keywords = array( 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor' );
|
||||
|
||||
@@ -1022,7 +1030,7 @@ class _templates extends \IPS\Dispatcher\Controller
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$new = str_replace( ' ', '_', $values['cms_database_group_name'] );
|
||||
$new = str_replace( ' ', '_', mb_strtolower( $values['cms_database_group_name'] ) );
|
||||
|
||||
if ( $new != \IPS\Request::i()->group )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user