-
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 17, 2024
1 parent
663a13f
commit 1e42b8c
Showing
10 changed files
with
107 additions
and
8 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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(); | ||
} | ||
} |