Esempio n. 1
0
 public function getPart(One_Form_Container_Form $form, $part)
 {
     $part = $form->findPart($part);
     if (is_null($part)) {
         return null;
     } else {
         return $part;
     }
 }
Esempio n. 2
0
 static function addObligatedWidgets(One_Form_Container_Form $form, One_Scheme $scheme)
 {
     // the form should always have a (hidden) widget with the value of the identityAttribute unless there is no identityAttribute
     if (!is_null($scheme->getIdentityAttribute()) && !$form->hasWidget($scheme->getIdentityAttribute()->getName())) {
         $form->addWidget(new One_Form_Widget_Scalar_Hidden($scheme->getIdentityAttribute()->getName(), $scheme->getIdentityAttribute()->getName(), NULL, array('one' => 'one', 'language' => strtolower(One_Config::get('app.language')))));
     }
     if (!$form->hasWidget('task')) {
         $form->addWidget(new One_Form_Widget_Scalar_Hidden('task', 'task', NULL, array('default' => 'edit', 'one' => 'one', 'language' => strtolower(One_Config::get('app.language')))));
     }
     if (!$form->hasWidget('scheme')) {
         $form->addWidget(new One_Form_Widget_Scalar_Hidden('scheme', 'scheme', NULL, array('default' => $scheme->getName(), 'one' => 'one', 'language' => strtolower(One_Config::get('app.language')))));
     }
 }