public static function setForm($form)
 {
     static::$form = $form;
 }
 static function getUserForm()
 {
     if (!isset(static::$form)) {
         static::$form = static::objects()->one();
     }
     return static::$form;
 }
Example #3
0
 /**
  * @param array|string $value
  * @param array $path
  */
 protected function doImport(&$value, array &$path)
 {
     $type = !is_string($value) ? !isset($value['type']) ? null : $value['type'] : $value;
     $files = $this->getFiles($type, isset($value['context']) ? $value['context'] : null);
     if (!$files) {
         return;
     }
     /** @var BlueprintForm $blueprint */
     $blueprint = new static($files);
     $blueprint->setContext($this->context)->setOverrides($this->overrides)->load();
     $name = implode('/', $path);
     $this->embed($name, $blueprint->form(), '/', false);
 }
 static function getDefaultForm()
 {
     if (!isset(static::$form)) {
         if (($o = static::objects()) && $o[0]) {
             static::$form = $o[0];
         } else {
             //TODO: Remove the code below and move it to task??
             static::$form = self::__loadDefaultForm();
         }
     }
     return static::$form;
 }
Example #5
0
 /**
  * Closes a form
  *
  * @return string A form closing tag
  */
 public static function close()
 {
     $close = static::form()->close();
     // Destroy Form instance
     static::$form = null;
     // Reset all values
     static::$values = null;
     static::$errors = null;
     static::$rules = null;
     return $close;
 }
Example #6
0
 /**
  * Closes a form
  *
  * @return string A form closing tag
  */
 public static function close()
 {
     $close = static::form()->close();
     // Destroy Form instance
     static::$form = null;
     return $close;
 }