Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,10 @@
|
||||
/**
|
||||
* @brief Records Model
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Content
|
||||
* @since 8 April 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -183,7 +184,8 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
try
|
||||
{
|
||||
$class = '\IPS\cms\Categories' . $database->id;
|
||||
return $class::load( $val )->_title;
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'records', 'cms', 'admin' )->category( $class::load( $val ) );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
@@ -210,6 +212,13 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
\IPS\Output::i()->sidebar['actions']['databasepermissions'] = array(
|
||||
'title' => 'cms_database_permissions',
|
||||
'icon' => 'lock',
|
||||
'link' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=permissions&id=' . $database->_id ),
|
||||
'data' => NULL
|
||||
);
|
||||
|
||||
/* Reset languages */
|
||||
\IPS\Member::loggedIn()->language()->words[ $table->langPrefix . $database->field_title ] = \IPS\Member::loggedIn()->language()->addToStack($table->langPrefix . 'title');
|
||||
|
||||
@@ -226,7 +235,10 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
public function delete()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'records_delete' );
|
||||
|
||||
|
||||
/* Make sure the user confirmed the deletion */
|
||||
\IPS\Request::i()->confirmedDelete();
|
||||
|
||||
$recordClass = '\IPS\cms\Records' . \IPS\Request::i()->database_id;
|
||||
|
||||
try
|
||||
@@ -270,7 +282,7 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
$form = new \IPS\Helpers\Form( 'select_category', 'continue' );
|
||||
$form->class = 'ipsForm_vertical ipsForm_noLabels';
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'category', $category, TRUE, array(
|
||||
'url' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=records&do=select&database_id=' . \IPS\Request::i()->database_id . ( $move ) ? '&move=' . $move : '' ),
|
||||
'url' => \IPS\Http\Url::internal( 'app=cms&module=databases&controller=records&do=select&database_id=' . \IPS\Request::i()->database_id . ( ( $move ) ? '&move=' . $move : '' ) ),
|
||||
'class' => $catClass,
|
||||
'multiple' => false,
|
||||
'permissionCheck' => function( $node )
|
||||
@@ -293,8 +305,7 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if ( $move and $record )
|
||||
{
|
||||
$record->category_id = $values['category']->id;
|
||||
$record->save();
|
||||
$record->move( $values['category'] );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=records&database_id=' . \IPS\Request::i()->database_id ), 'completed' );
|
||||
}
|
||||
@@ -332,7 +343,7 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
$fieldsClass = 'IPS\cms\Fields' . \IPS\Request::i()->database_id;
|
||||
$catClass = 'IPS\cms\Categories' . \IPS\Request::i()->database_id;
|
||||
$container = ( $current ) ? $catClass::load( $current->category_id ) : ( isset( \IPS\Request::i()->category_id ) ? $catClass::load( \IPS\Request::i()->category_id ) : NULL );
|
||||
$customFields = $fieldsClass::fields( $customValues, 'view', $container );
|
||||
$customFields = $fieldsClass::fields( $customValues, 'view', $container, 0, $current );
|
||||
$manuallyHandledFields = array( 'record_publish_date', 'record_expiry_date', 'record_allow_comments', 'record_comment_cutoff', 'record_meta_keywords', 'record_meta_description' );
|
||||
|
||||
$form = new \IPS\Helpers\Form();
|
||||
@@ -452,7 +463,7 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
/* Other data */
|
||||
$current->record_meta_keywords = $values['record_meta_keywords'];
|
||||
$current->record_meta_description = $values['record_meta_description'];
|
||||
|
||||
|
||||
$changeAuthor = FALSE;
|
||||
if ( ! empty( \IPS\Request::i()->id ) )
|
||||
{
|
||||
@@ -469,6 +480,11 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
$values['record_member_id'] = \IPS\Member::loggedIn();
|
||||
$changeAuthor = TRUE;
|
||||
}
|
||||
else if ( $values['record_author_choice'] === 'me' )
|
||||
{
|
||||
$values['record_member_id'] = \IPS\Member::loggedIn();
|
||||
$changeAuthor = TRUE;
|
||||
}
|
||||
else if ( $values['record_author_choice'] === 'notme' and ! empty( $values['record_member_id'] ) )
|
||||
{
|
||||
$changeAuthor = TRUE;
|
||||
@@ -526,4 +542,27 @@ class _records extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( $current ? $title : 'add', $form, FALSE );
|
||||
\IPS\Output::i()->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the category tree
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function categoryTree()
|
||||
{
|
||||
$class = '\IPS\cms\Categories' . \IPS\Request::i()->database_id;
|
||||
try
|
||||
{
|
||||
$category = $class::load( \IPS\Request::i()->id );
|
||||
$parents = iterator_to_array( $category->parents() );
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->block( \IPS\Member::loggedIn()->language()->addToStack('content_tree_title'), \IPS\Theme::i()->getTemplate( 'records', 'cms', 'admin' )->categoryTree( $category, $parents ), FALSE );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('content_tree_title');
|
||||
|
||||
}
|
||||
catch( \Exception $ex )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user