Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -330,9 +330,10 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
* @param \IPS\Node\Model|NULL $container Parent container
|
||||
* @param int $flags Bit flags
|
||||
* @param \IPS\cms\Records|NULL $record The record itself
|
||||
* @param bool $includeDefaultValue Include the default value for the field
|
||||
* @return array
|
||||
*/
|
||||
public static function fields( $values, $permissionCheck='view', \IPS\Node\Model $container=NULL, $flags=0, \IPS\cms\Records $record = NULL )
|
||||
public static function fields( $values, $permissionCheck='view', \IPS\Node\Model $container=NULL, $flags=0, \IPS\cms\Records $record = NULL, bool $includeDefaultValue = TRUE )
|
||||
{
|
||||
$fields = array();
|
||||
$database = \IPS\cms\Databases::load( static::$customDatabaseId );
|
||||
@@ -430,10 +431,9 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
}
|
||||
else
|
||||
{
|
||||
$fields[ $row->id ] = $row->buildHelper( $row->default_value, $customValidationCode, $record, $flags );
|
||||
$fields[ $row->id ] = $row->buildHelper( $includeDefaultValue ? $row->default_value : NULL , $customValidationCode, $record, $flags );
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@@ -1061,11 +1061,12 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
|
||||
$where = array( array( 'field_' . $field->id . '=?', $val ) );
|
||||
|
||||
if ( $record !== NULL )
|
||||
if ( $record !== NULL and $record->_id )
|
||||
{
|
||||
|
||||
$where[] = array( 'primary_id_field != ?', $record->_id );
|
||||
}
|
||||
|
||||
|
||||
if ( \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_' . $database->id, $where )->first() )
|
||||
{
|
||||
throw new \LogicException( \IPS\Member::loggedIn()->language()->addToStack( "field_unique_entry_not_unique", FALSE, array( 'sprintf' => array( $database->recordWord( 1 ) ) ) ) );
|
||||
@@ -2121,7 +2122,7 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
if ( ! $isTitleOrContent )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'field_display_listing', $this->id ? $this->display_listing : 1, FALSE, array(
|
||||
'togglesOn' => array('field_truncate', 'field_display_listing_json_badge', 'field_show_map_listing', 'field_show_map_listing_dims' )
|
||||
'togglesOn' => array('field_display_listing_json_badge' )
|
||||
), NULL, NULL, NULL, 'field_display_listing' ) );
|
||||
}
|
||||
|
||||
@@ -2132,7 +2133,9 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'field_display_listing_json_badge_right', ( isset( $displayJson['listing']['right'] ) ? $displayJson['listing']['right'] : 0 ), FALSE, array(), NULL, NULL, NULL, 'field_display_listing_json_badge_right' ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'field_show_map_listing', $mapListing, FALSE, array(), NULL, NULL, NULL, 'field_show_map_listing' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'field_show_map_listing', $mapListing, FALSE, array(
|
||||
'togglesOn' => [ 'field_show_map_listing_dims' ]
|
||||
), NULL, NULL, NULL, 'field_show_map_listing' ) );
|
||||
$form->add( new \IPS\Helpers\Form\WidthHeight( 'field_show_map_listing_dims', $mapListingDims, FALSE, array( 'resizableDiv' => FALSE ), NULL, NULL, NULL, 'field_show_map_listing_dims' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Codemirror( 'field_display_listing_json_custom', ( isset( $displayJson['listing']['html'] ) ? $displayJson['listing']['html'] : NULL ), FALSE, array( 'placeholder' => '{label}: {value}' ), function( $val )
|
||||
@@ -2163,13 +2166,15 @@ class _Fields extends \IPS\CustomField implements \IPS\Node\Permissions
|
||||
if ( ! $isTitleOrContent )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'field_display_display', $this->id ? $this->display_display : 1, FALSE, array(
|
||||
'togglesOn' => array( 'field_display_display_json_badge', 'field_show_map_display', 'field_show_map_display_dims', 'field_display_display_json_where' )
|
||||
'togglesOn' => array( 'field_display_display_json_badge', 'field_display_display_json_where' )
|
||||
), NULL, NULL, NULL, 'field_display_display' ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'field_display_display_json_badge', $displayDefault, FALSE, array( 'options' => $displayOptions, 'toggles' => $displayToggles, 'parse' => 'raw' ), NULL, NULL, NULL, 'field_display_display_json_badge' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'field_show_map_display', $mapDisplay, FALSE, array(), NULL, NULL, NULL, 'field_show_map_display' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'field_show_map_display', $mapDisplay, FALSE, array(
|
||||
'togglesOn' => [ 'field_show_map_display_dims' ]
|
||||
), NULL, NULL, NULL, 'field_show_map_display' ) );
|
||||
$form->add( new \IPS\Helpers\Form\WidthHeight( 'field_show_map_display_dims', $mapDisplayDims, FALSE, array( 'resizableDiv' => FALSE ), NULL, NULL, NULL, 'field_show_map_display_dims' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Codemirror( 'field_display_display_json_custom', ( isset( $displayJson['display']['html'] ) ? $displayJson['display']['html'] : NULL ), FALSE, array( 'placeholder' => '{label}: {value}' ), function( $val )
|
||||
|
||||
Reference in new issue
Block a user