Example #1
0
 /** Add module into queue
  * @param string $module  Module path
  * @param array $locals  Local variables
  * @param array $parents List of ids of parent modules - can inherit data by DataBus
  * @uses \System\DataBus
  * @return void
  */
 public function add($module, array $locals = array(), array $parents = array())
 {
     if (empty($locals['mod-conds']) || is_array($locals['mod-conds']) && Module::eval_conds($locals['mod-conds'])) {
         if (!empty($locals['module_id'])) {
             $id = $locals['module_id'];
         } else {
             $id = \System\Module::get_new_id();
         }
         $mod = \System\Module::from_path($module, array("module_id" => $id, "dbus" => $this->dbus(), "flow" => $this, "parents" => $parents, "renderer" => $this->response->renderer, "response" => $this->response, "request" => $this->response->request));
         $mod->update_attrs($locals);
         $this->enqueue($mod);
     }
 }
Example #2
0
 /** Render form or add form to processing
  * @param System\Module $obj    Module to render the form in
  * @param array         $locals Extra local data
  * @return mixed
  */
 public function out(\System\Module $obj = NULL, array $locals = array())
 {
     $template = self::get_default_template();
     $ctx = (array) $locals + array("f" => $this);
     $this->group_end();
     $this->tab_group_end();
     if ($obj) {
         return $obj->partial($template, $ctx);
     } else {
         return $this->response->renderer->partial($template, $ctx);
     }
 }