/** * handle tree edit */ private function handleConfigGet($retrieveFields = true) { $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile); $request = Request::getInstance(); $view = ViewManager::getInstance(); $view->setType(NewsLetter::VIEW_CONFIG); if (!$request->exists('tree_id')) { throw new Exception('Node ontbreekt.'); } if (!$request->exists('tag')) { throw new Exception('Tag ontbreekt.'); } $tree_id = intval($request->getValue('tree_id')); $tag = $request->getValue('tag'); $key = array('tree_id' => $tree_id, 'tag' => $tag); $fields = array(); if ($retrieveFields) { $fields = $this->exists($key) ? $this->getDetail($key) : $this->getFields(SqlParser::MOD_INSERT); } else { $fields = $this->getFields(SqlParser::MOD_UPDATE); } $template->setVariable('cbo_display', Utils::getHtmlCombo(NewsLetter::getDisplayTypeList(), $fields['display'])); $fields['tree_id'] = $tree_id; $fields['tag'] = $tag; $this->setFields($fields); $template->setVariable($fields); // add breadcrumb item $this->director->theme->handleAdminLinks($template); $this->template[$this->director->theme->getConfig()->main_tag] = $template; }
/** * handle tree edit */ private function handleConfigGet($retrieveFields = true) { $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile); $request = Request::getInstance(); $view = ViewManager::getInstance(); $view->setType(NewsLetter::VIEW_CONFIG); if (!$request->exists('tree_id')) { throw new Exception('Node ontbreekt.'); } if (!$request->exists('tag')) { throw new Exception('Tag ontbreekt.'); } $tree_id = intval($request->getValue('tree_id')); $tag = $request->getValue('tag'); $key = array('tree_id' => $tree_id, 'tag' => $tag); $fields = array(); if ($retrieveFields) { $fields = $this->exists($key) ? $this->getDetail($key) : $this->getFields(SqlParser::MOD_INSERT); } else { $fields = $this->getFields(SqlParser::MOD_UPDATE); } $template->setVariable('cbo_display', Utils::getHtmlCombo(NewsLetter::getDisplayTypeList(), $fields['display'])); $fields['tree_id'] = $tree_id; $fields['tag'] = $tag; $this->setFields($fields); $template->setVariable($fields); // 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'])); $template->setVariable('cbo_del_tree_id', Utils::getHtmlCombo($treelist, $fields['del_tree_id'])); // get action type $template->setVariable('cbo_action', Utils::getHtmlCombo($this->actionList, $fields['action'], '...')); // add breadcrumb item $this->director->theme->handleAdminLinks($template); $this->template[$this->director->theme->getConfig()->main_tag] = $template; }