Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\cms\modules\admin\databases;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -23,6 +23,11 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _databases extends \IPS\Node\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Node Class
|
||||
*/
|
||||
@@ -52,23 +57,23 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
/* Columns */
|
||||
$table->joins = array(
|
||||
array( 'select' => 'w.word_custom as database_name', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'content_db_', cms_databases.database_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
|
||||
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'content_db_', cms_databases.database_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
|
||||
);
|
||||
|
||||
$table->include = array( 'database_name', 'database_record_count', 'database_category_count' );
|
||||
$table->include = array( 'word_custom', 'database_record_count', 'database_category_count' );
|
||||
$table->widths = array(
|
||||
'database_name' => '50'
|
||||
'word_custom' => '50'
|
||||
);
|
||||
|
||||
$table->mainColumn = 'database_name';
|
||||
$table->quickSearch = 'database_name';
|
||||
$table->mainColumn = 'word_custom';
|
||||
$table->quickSearch = 'word_custom';
|
||||
|
||||
$table->sortBy = $table->sortBy ?: 'database_name';
|
||||
$table->sortBy = $table->sortBy ?: 'word_custom';
|
||||
$table->sortDirection = $table->sortDirection ?: 'asc';
|
||||
|
||||
/* Parsers */
|
||||
$table->parsers = array(
|
||||
'database_name' => function( $val, $row )
|
||||
'word_custom' => function( $val, $row )
|
||||
{
|
||||
$page = NULL;
|
||||
$database = NULL;
|
||||
@@ -247,7 +252,7 @@ class _databases extends \IPS\Node\Controller
|
||||
move_uploaded_file( $values['cms_database_import'], $tempFile );
|
||||
|
||||
/* Initate a redirector */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=import' )->setQueryString( array( 'file' => $tempFile, 'key' => md5_file( $tempFile ) ) ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=import' )->setQueryString( array( 'file' => $tempFile, 'key' => md5_file( $tempFile ) ) )->csrf() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -266,6 +271,7 @@ class _databases extends \IPS\Node\Controller
|
||||
public function import()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'databases_add' );
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
if ( !file_exists( \IPS\Request::i()->file ) or md5_file( \IPS\Request::i()->file ) !== \IPS\Request::i()->key )
|
||||
{
|
||||
@@ -273,7 +279,7 @@ class _databases extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output = new \IPS\Helpers\MultipleRedirect(
|
||||
\IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=import' )->setQueryString( array( 'file' => \IPS\Request::i()->file, 'key' => \IPS\Request::i()->key ) ),
|
||||
\IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=import' )->setQueryString( array( 'file' => \IPS\Request::i()->file, 'key' => \IPS\Request::i()->key ) )->csrf(),
|
||||
function( $data )
|
||||
{
|
||||
/* Open XML file */
|
||||
@@ -289,10 +295,10 @@ class _databases extends \IPS\Node\Controller
|
||||
/* Is this the first batch? */
|
||||
$database = null;
|
||||
$i = 0;
|
||||
if ( !is_array( $data ) )
|
||||
if ( !\is_array( $data ) )
|
||||
{
|
||||
$database = new \IPS\cms\Databases;
|
||||
$database->key = mt_rand();
|
||||
$database->key = 'import_' . mt_rand();
|
||||
$database->save();
|
||||
|
||||
/* Set default perms, these will be editable post DB import */
|
||||
@@ -435,7 +441,7 @@ class _databases extends \IPS\Node\Controller
|
||||
{
|
||||
while ( $xml->read() )
|
||||
{
|
||||
if( ! in_array( $xml->name, $areas ) OR $xml->nodeType != \XMLReader::ELEMENT )
|
||||
if( ! \in_array( $xml->name, $areas ) OR $xml->nodeType != \XMLReader::ELEMENT )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -467,7 +473,7 @@ class _databases extends \IPS\Node\Controller
|
||||
$perms = array();
|
||||
foreach( $node->attributes() as $k => $v )
|
||||
{
|
||||
if ( mb_substr( $k, 0, 5 ) === 'perm_' or in_array( $k, array( 'app', 'owner_only', 'friend_only', 'authorized_users' ) ) )
|
||||
if ( mb_substr( $k, 0, 5 ) === 'perm_' or \in_array( $k, array( 'app', 'owner_only', 'friend_only', 'authorized_users' ) ) )
|
||||
{
|
||||
$perms[ $k ] = (string) $v;
|
||||
}
|
||||
@@ -488,7 +494,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
$tryJson = json_decode( $v, TRUE );
|
||||
|
||||
if ( $k === 'field_display_json' AND is_array( $tryJson ) )
|
||||
if ( $k === 'field_display_json' AND \is_array( $tryJson ) )
|
||||
{
|
||||
$displayJson = $tryJson;
|
||||
continue;
|
||||
@@ -585,14 +591,14 @@ class _databases extends \IPS\Node\Controller
|
||||
$perms = array();
|
||||
foreach( $node->attributes() as $k => $v )
|
||||
{
|
||||
if ( mb_substr( $k, 0, 5 ) === 'perm_' or in_array( $k, array( 'app', 'owner_only', 'friend_only', 'authorized_users' ) ) )
|
||||
if ( mb_substr( $k, 0, 5 ) === 'perm_' or \in_array( $k, array( 'app', 'owner_only', 'friend_only', 'authorized_users' ) ) )
|
||||
{
|
||||
$perms[ $k ] = (string) $v;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$attrs[ $k ] = ( in_array( $k, array( 'category_parent_id' ) ) ) ? (int) $v : (string) $v;
|
||||
$attrs[ $k ] = ( \in_array( $k, array( 'category_parent_id' ) ) ) ? (int) $v : (string) $v;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,12 +618,13 @@ class _databases extends \IPS\Node\Controller
|
||||
/* Create a category */
|
||||
$category = new \IPS\cms\Categories;
|
||||
$category->database_id = $database->id;
|
||||
$category::$permType = 'categories_' . $database->id;
|
||||
|
||||
$category->saveForm( $category->formatFormValues( $attrs ) );
|
||||
|
||||
if ( $category->fields AND $category->fields !== '*' )
|
||||
{
|
||||
if ( is_array( $category->fields ) )
|
||||
if ( \is_array( $category->fields ) )
|
||||
{
|
||||
$field_map = \IPS\Data\Store::i()->db_import_field_map;
|
||||
$newMap = array();
|
||||
@@ -630,7 +637,7 @@ class _databases extends \IPS\Node\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $newMap ) )
|
||||
if ( \count( $newMap ) )
|
||||
{
|
||||
$category->fields = json_encode( $newMap );
|
||||
$category->save();
|
||||
@@ -784,7 +791,7 @@ class _databases extends \IPS\Node\Controller
|
||||
if ( isset( \IPS\Data\Store::i()->db_import_field_map ) )
|
||||
{
|
||||
$map = \IPS\Data\Store::i()->db_import_field_map;
|
||||
$sortId = intval( mb_substr( $database->field_sort, 6 ) );
|
||||
$sortId = \intval( mb_substr( $database->field_sort, 6 ) );
|
||||
|
||||
if ( isset( $map[ $sortId ] ) )
|
||||
{
|
||||
@@ -870,7 +877,7 @@ class _databases extends \IPS\Node\Controller
|
||||
'comment_bump', 'forum_record', 'forum_comments', 'forum_delete', 'forum_forum', 'forum_prefix', 'forum_suffix', 'search', 'tags_enabled', 'tags_noprefixes', 'tags_predefined', 'fixed_field_perms',
|
||||
'cat_index_type', 'template_form', 'template_featured', 'featured_settings', 'options' ) as $field )
|
||||
{
|
||||
if ( is_array( $database->$field ) )
|
||||
if ( \is_array( $database->$field ) )
|
||||
{
|
||||
$arrays[ $field ] = $database->$field;
|
||||
}
|
||||
@@ -881,7 +888,7 @@ class _databases extends \IPS\Node\Controller
|
||||
if ( $database->$field instanceof \IPS\Patterns\Bitwise )
|
||||
{
|
||||
$bwfield = $database->$field;
|
||||
$store = intval( $bwfield->values['options'] );
|
||||
$store = \intval( $bwfield->values['options'] );
|
||||
}
|
||||
|
||||
$xml->startAttribute( $field );
|
||||
@@ -890,7 +897,7 @@ class _databases extends \IPS\Node\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $arrays ) )
|
||||
if ( \count( $arrays ) )
|
||||
{
|
||||
foreach( $arrays as $field => $v )
|
||||
{
|
||||
@@ -927,7 +934,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
foreach( $row as $k => $v )
|
||||
{
|
||||
if ( array_key_exists( $k, $fieldSchema['columns'] ) AND ! in_array( $k, $removeFields ) AND ! in_array( $k, $textFields ) )
|
||||
if ( array_key_exists( $k, $fieldSchema['columns'] ) AND ! \in_array( $k, $removeFields ) AND ! \in_array( $k, $textFields ) )
|
||||
{
|
||||
$xml->startAttribute( $k );
|
||||
$xml->text( $v );
|
||||
@@ -974,7 +981,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
foreach( $row as $k => $v )
|
||||
{
|
||||
if ( array_key_exists( $k, $categorySchema['columns'] ) AND ! in_array( $k, $removeFields ) AND ! in_array( $k, $textFields ) )
|
||||
if ( array_key_exists( $k, $categorySchema['columns'] ) AND ! \in_array( $k, $removeFields ) AND ! \in_array( $k, $textFields ) )
|
||||
{
|
||||
$xml->startAttribute( $k );
|
||||
$xml->text( $v );
|
||||
@@ -1010,7 +1017,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
foreach( array('template_listing', 'template_display', 'template_categories', 'template_featured') as $area )
|
||||
{
|
||||
if ( isset( $templates['cms']['database'][ $database->$area ] ) and is_array( $templates['cms']['database'][ $database->$area ] ) )
|
||||
if ( isset( $templates['cms']['database'][ $database->$area ] ) and \is_array( $templates['cms']['database'][ $database->$area ] ) )
|
||||
{
|
||||
/* Only fetch edited/added templates, no point in fetching default theme templates */
|
||||
foreach( $templates['cms']['database'][ $database->$area ] as $key => $item )
|
||||
@@ -1034,7 +1041,7 @@ class _databases extends \IPS\Node\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $toSave ) )
|
||||
if ( \count( $toSave ) )
|
||||
{
|
||||
foreach( $toSave as $group => $items )
|
||||
{
|
||||
@@ -1116,6 +1123,31 @@ class _databases extends \IPS\Node\Controller
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases' ), 'deleted' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Permissions
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function permissions()
|
||||
{
|
||||
parent::permissions();
|
||||
|
||||
$database = \IPS\cms\Databases::load( \IPS\Request::i()->id );
|
||||
|
||||
try
|
||||
{
|
||||
if( $database->page_id AND \IPS\cms\Pages\Page::load( $database->page_id )->permissions()['perm_view'] != '*' )
|
||||
{
|
||||
/* We want the message to show at the top, so get our output as we will start over */
|
||||
$output = \IPS\Output::i()->output;
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->message( \IPS\Member::loggedIn()->language()->addToStack('database_page_permissions_restrict', FALSE, array( 'sprintf' => array( $database->page_id ) ) ), 'warning' );
|
||||
\IPS\Output::i()->output .= $output;
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $e ){}
|
||||
}
|
||||
|
||||
/**
|
||||
* Promote
|
||||
*
|
||||
@@ -1161,6 +1193,8 @@ class _databases extends \IPS\Node\Controller
|
||||
*/
|
||||
public function rebuildTopicContent()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
if ( isset( \IPS\Request::i()->process ) )
|
||||
{
|
||||
\IPS\Task::queue( 'cms', 'ResyncTopicContent', array( 'databaseId' => \IPS\Request::i()->id ), 3, array( 'databaseId' ) );
|
||||
@@ -1181,6 +1215,7 @@ class _databases extends \IPS\Node\Controller
|
||||
{
|
||||
if ( isset( \IPS\Request::i()->process ) )
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\cms\Records' . \IPS\Request::i()->id ), 3, array( 'class' ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cms&module=databases&controller=databases&do=form&id=' . \IPS\Request::i()->id ), 'database_rebuild_added' );
|
||||
}
|
||||
@@ -1193,6 +1228,7 @@ class _databases extends \IPS\Node\Controller
|
||||
/**
|
||||
* Add/Edit
|
||||
*
|
||||
* @csrfChecked Uses $this->_getDatabaseForm() which uses Form Helper 7 Oct 2019
|
||||
* @return void
|
||||
*/
|
||||
public function form()
|
||||
@@ -1244,7 +1280,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
if ( ! $values['database_key'] )
|
||||
{
|
||||
if ( is_array( $values['database_name'] ) )
|
||||
if ( \is_array( $values['database_name'] ) )
|
||||
{
|
||||
$keyToUse = mt_rand();
|
||||
foreach( $values['database_name'] as $langId => $word )
|
||||
@@ -1343,11 +1379,8 @@ class _databases extends \IPS\Node\Controller
|
||||
{
|
||||
$current->tags_enabled = (int) $values['database_tags_enabled'];
|
||||
$current->tags_noprefixes = !(bool) $values['database_tags_noprefixes'];
|
||||
|
||||
if ( ! \IPS\Settings::i()->tags_open_system )
|
||||
{
|
||||
$current->tags_predefined = ( is_array( $values['database_tags_predefined'] ) ) ? implode( ',', array_filter( array_map( 'trim', $values['database_tags_predefined'] ) ) ) : NULL;
|
||||
}
|
||||
$current->tags_predefined = ( \is_array( $values['database_tags_predefined'] ) ) ? implode( ',', array_filter( array_map( 'trim', $values['database_tags_predefined'] ) ) ) : NULL;
|
||||
|
||||
}
|
||||
|
||||
$categories = 0;
|
||||
@@ -1375,6 +1408,16 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
if ( \IPS\Application::appIsEnabled( 'forums' ) )
|
||||
{
|
||||
/* Are we changing where comments go? */
|
||||
if ( !$new AND ( (int) $current->forum_record != (int) $values['database_forum_record'] OR (int) $current->forum_comments != (int) $values['database_forum_comments'] ) )
|
||||
{
|
||||
\IPS\Task::queue( 'cms', 'MoveComments', array(
|
||||
'databaseId' => $current->id,
|
||||
'to' => ( $values['database_forum_comments'] AND $values['database_forum_record'] ) ? 'forums' : 'pages',
|
||||
'deleteTopics' => (bool) ( !$values['database_forum_record'] )
|
||||
), 1, array( 'databaseId', 'to' ) );
|
||||
}
|
||||
|
||||
$current->forum_record = (int) $values['database_forum_record'];
|
||||
$current->forum_comments = (int) $values['database_forum_comments'];
|
||||
$current->forum_forum = ( ! $values['database_forum_forum'] ) ? 0 : $values['database_forum_forum']->id;
|
||||
@@ -1388,7 +1431,10 @@ class _databases extends \IPS\Node\Controller
|
||||
$current->forum_comments = 0;
|
||||
$current->forum_delete = 0;
|
||||
}
|
||||
|
||||
|
||||
/* SEO */
|
||||
$current->canonical_flag = (int) $values['database_canonical_flag'];
|
||||
|
||||
$fieldSettingJson = array();
|
||||
|
||||
foreach( $values as $k => $v )
|
||||
@@ -1429,6 +1475,7 @@ class _databases extends \IPS\Node\Controller
|
||||
$category->allow_rating = $values['category_allow_rating'];
|
||||
$category->can_view_others = $values['category_can_view_others'];
|
||||
$category->save();
|
||||
$category->cloneDatabasePermissions();
|
||||
}
|
||||
|
||||
if ( $new )
|
||||
@@ -1607,7 +1654,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
foreach( $FieldsClass::data() as $id => $field )
|
||||
{
|
||||
if ( in_array( $field->type, array( 'checkbox', 'multiselect', 'attachments' ) ) )
|
||||
if ( \in_array( $field->type, array( 'checkbox', 'multiselect', 'attachments' ) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1646,10 +1693,10 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
$form->addHeader( 'cms_database_form_display' );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_categories', ! empty( $current ) ? $current->template_categories : NULL, FALSE, array( 'options' => $templatesCat ), NULL, NULL, NULL, 'database_template_categories' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_listing' , ! empty( $current ) ? $current->template_listing : NULL, FALSE, array( 'options' => $templatesList ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_display' , ! empty( $current ) ? $current->template_display : NULL, FALSE, array( 'options' => $templatesDisplay ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_form' , ! empty( $current ) ? $current->template_form : NULL, FALSE, array( 'options' => $templatesForm ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_categories', ! empty( $current ) ? $current->template_categories : NULL, FALSE, array( 'options' => $templatesCat ), NULL, NULL, \IPS\Theme::i()->getTemplate( 'databases', 'cms' )->templateGoButton('database_template_categories'), 'database_template_categories' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_listing' , ! empty( $current ) ? $current->template_listing : NULL, FALSE, array( 'options' => $templatesList ), NULL, NULL, \IPS\Theme::i()->getTemplate( 'databases', 'cms' )->templateGoButton('database_template_listing'), 'database_template_listing' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_display' , ! empty( $current ) ? $current->template_display : NULL, FALSE, array( 'options' => $templatesDisplay ), NULL, NULL, \IPS\Theme::i()->getTemplate( 'databases', 'cms' )->templateGoButton('database_template_display'), 'database_template_display' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'database_template_form' , ! empty( $current ) ? $current->template_form : NULL, FALSE, array( 'options' => $templatesForm ), NULL, NULL, \IPS\Theme::i()->getTemplate( 'databases', 'cms' )->templateGoButton('database_template_form'), 'database_template_form' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'database_key', ! empty( $current ) ? $current->key : FALSE, FALSE, array(), function( $val )
|
||||
{
|
||||
@@ -1745,10 +1792,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'database_tags_enabled' , $current ? $current->tags_enabled : FALSE, FALSE, array( 'togglesOn' => array( 'database_tags_noprefixes', 'database_tags_predefined' ) ), NULL, NULL, NULL, 'database_tags_enabled' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'database_tags_noprefixes', $current ? ! $current->tags_noprefixes : FALSE, FALSE, array(), NULL, NULL, NULL, 'database_tags_noprefixes' ) );
|
||||
if ( ! \IPS\Settings::i()->tags_open_system )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'database_tags_predefined', $current ? $current->tags_predefined: '', FALSE, array( 'autocomplete' => array( 'unique' => 'true' ), 'nullLang' => 'database_tags_predefined_unlimited' ), NULL, NULL, NULL, 'database_tags_predefined' ) );
|
||||
}
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'database_tags_predefined', $current ? $current->tags_predefined: '', FALSE, array( 'autocomplete' => array( 'unique' => 'true' ), 'nullLang' => 'database_tags_predefined_unlimited' ), NULL, NULL, NULL, 'database_tags_predefined' ) );
|
||||
}
|
||||
|
||||
$form->addHeader( 'content_database_form_options_fields' );
|
||||
@@ -1774,12 +1818,12 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
$ffsettings = $current->fixed_field_settings;
|
||||
|
||||
if ( isset( $ffsettings['record_image']['image_dims'] ) and is_array( $ffsettings['record_image']['image_dims'] ) )
|
||||
if ( isset( $ffsettings['record_image']['image_dims'] ) and \is_array( $ffsettings['record_image']['image_dims'] ) )
|
||||
{
|
||||
$widthHeight = $ffsettings['record_image']['image_dims'];
|
||||
}
|
||||
|
||||
if ( isset( $ffsettings['record_image']['thumb_dims'] ) and is_array( $ffsettings['record_image']['thumb_dims'] ) )
|
||||
if ( isset( $ffsettings['record_image']['thumb_dims'] ) and \is_array( $ffsettings['record_image']['thumb_dims'] ) )
|
||||
{
|
||||
$thumbWidthHeight = $ffsettings['record_image']['thumb_dims'];
|
||||
}
|
||||
@@ -1857,6 +1901,17 @@ class _databases extends \IPS\Node\Controller
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'database_forum_delete' , $current ? $current->forum_delete : FALSE, FALSE, array(), NULL, NULL, NULL, 'database_forum_delete' ) );
|
||||
}
|
||||
|
||||
/* SEO */
|
||||
$form->addTab( 'content_database_form_seo' );
|
||||
$form->addHeader( 'database_canonical_header' );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'database_canonical_flag', ! empty( $current ) ? $current->canonical_flag : NULL, FALSE, array(
|
||||
'options' => array(
|
||||
'0' => 'database_canonical_flag_0',
|
||||
'1' => 'database_canonical_flag_1'
|
||||
)
|
||||
) ) );
|
||||
|
||||
if ( ! $current )
|
||||
{
|
||||
$form->addTab( 'content_database_form_options_page' );
|
||||
@@ -1920,7 +1975,7 @@ class _databases extends \IPS\Node\Controller
|
||||
|
||||
foreach( $pageFormFields as $name => $field )
|
||||
{
|
||||
if ( is_array( $field ) )
|
||||
if ( \is_array( $field ) )
|
||||
{
|
||||
$form->addHeader( $field[0] );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user