/** * handle tree edit */ private function handleConfigGet($retrieveFields = true) { $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile); $request = Request::getInstance(); $view = ViewManager::getInstance(); $view->setType(Form::VIEW_CONFIG); $key = $this->getKey(); $fields = array(); if ($retrieveFields) { if ($this->exists($key)) { $fields = $this->getDetail($key); } else { $fields = array_merge($this->getFields(SqlParser::MOD_INSERT), $this->plugin->getGlobalSettings()); } } else { $fields = $this->getFields(SqlParser::MOD_UPDATE); } // get all tree nodes which have plugin modules $site = new SystemSite(); $tree = $site->getTree(); $treelist = $tree->getList(); foreach ($treelist as &$item) { $item['name'] = $tree->toString($item['id'], '/', 'name'); } $template->setVariable('cbo_tree_id', Utils::getHtmlCombo($treelist, $fields['ref_tree_id'])); $template->setVariable('cbo_optin_tree_id', Utils::getHtmlCombo($treelist, $fields['optin_tree_id'])); // get action type $template->setVariable('cbo_action', Utils::getHtmlCombo($this->plugin->actionList, $fields['action'], '...')); $this->setFields($fields); $template->setVariable($fields); $template->setVariable($key); // add breadcrumb item $this->director->theme->handleAdminLinks($template); $this->template[$this->director->theme->getConfig()->main_tag] = $template; }