function action() { $response = $this->products(); $t = $this->response->html->template($this->tpldir . "/cloud-selector-products.tpl.php"); $t->add($this->response->html->thisfile, "thisfile"); $t->add($response->table, 'table'); $t->add($response->products, 'products'); $t->add($this->lang['label_product_group'], 'label_product_group'); $t->add($this->lang['label_add_product'], 'label_add_product'); $t->add($response->form); $t->group_elements(array('param_' => 'form')); require_once $this->openqrm->get('basedir') . '/plugins/cloud/web/class/cloud-selector.add.class.php'; $controller = new cloud_selector_add($this->openqrm, $this->response, $this->controller); $controller->actions_name = $this->actions_name; $controller->tpldir = $this->tpldir; $controller->identifier_name = $this->identifier_name; $controller->message_param = $this->message_param; $controller->lang = $this->lang; $data = $controller->action(); $t->add($data, 'form_add'); return $t; }
function add($hidden = true) { $data = ''; if ($hidden === true) { require_once $this->webdir . '/plugins/cloud/class/cloud-selector.add.class.php'; $controller = new cloud_selector_add($this->openqrm, $this->response, $this); $controller->actions_name = $this->actions_name; $controller->tpldir = $this->webdir . '/plugins/cloud/tpl'; $controller->identifier_name = $this->identifier_name; $controller->message_param = $this->message_param; $controller->lang = $this->lang; $data = $controller->action(); } $content['label'] = $this->lang['label_add_product']; $content['value'] = $data; $content['target'] = $this->response->html->thisfile; $content['request'] = $this->response->get_array($this->actions_name, 'add'); $content['onclick'] = false; if ($this->action === 'add') { $content['active'] = true; } return $content; }