コード例 #1
0
 function getCMSFields($params = null)
 {
     $fields = parent::getCMSFields(array('forcetype' => 'Amount'));
     $fields->removeByName(array("ForCart", "ForItems", "ForShipping", "For"));
     $limitfield = $fields->fieldByName("Root.Main.Constraints")->fieldByName("Main.UseLimit");
     $fields->replaceField("UseLimit", $limitfield->performReadOnlyTransformation());
     return $fields;
 }
コード例 #2
0
 public function getCMSFields($params = null)
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab("Root.Main", array($codefield = TextField::create("Code")->setMaxLength(25)), "Active");
     if ($this->owner->Code && $codefield) {
         $fields->replaceField("Code", $codefield->performReadonlyTransformation());
     }
     return $fields;
 }