-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sabina Talipova
committed
Jan 16, 2024
1 parent
f18b830
commit c98121f
Showing
11 changed files
with
117 additions
and
18 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace SilverStripe\LinkField\Form; | ||
|
||
use SilverStripe\Forms\HiddenField; | ||
use SilverStripe\Forms\ReadonlyField; | ||
|
||
class LinkField_Readonly extends LinkField | ||
{ | ||
|
||
protected $readonly = true; | ||
|
||
public function Field($properties = []) | ||
{ | ||
// Readonly field for display | ||
$field = new LinkField($this->name, $this->title); | ||
$field->setValue($this->Value()); | ||
$field->setForm($this->form); | ||
|
||
// Store values to hidden field | ||
$valueField = new HiddenField($this->name); | ||
$valueField->setValue($this->Value()); | ||
$valueField->setForm($this->form); | ||
|
||
return $field->Field() . $valueField->Field(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace SilverStripe\LinkField\Form; | ||
|
||
use SilverStripe\Forms\HiddenField; | ||
use SilverStripe\Forms\ReadonlyField; | ||
|
||
class MultiLinkField_Readonly extends MultiLinkField | ||
{ | ||
|
||
protected $readonly = true; | ||
|
||
public function Field($properties = []) | ||
{ | ||
// Readonly field for display | ||
$field = new MultiLinkField($this->name, $this->title); | ||
$field->setValue($this->getValueArray()); | ||
$field->setForm($this->form); | ||
|
||
// Store values to hidden field | ||
$valueField = new HiddenField($this->name); | ||
$valueField->setValue($this->getValueArray()); | ||
$valueField->setForm($this->form); | ||
|
||
return $field->Field() . $valueField->Field(); | ||
} | ||
} |