public function delete($id) { $record = $this->hm->getHandler('AmunService\\Content\\Page')->getRecord($id); $form = new AmunForm('DELETE', $this->url); $tabbedPane = new TabbedPane('page', 'Page'); $panel = new Panel('settings', 'Settings'); // settings $id = new Input('id', 'ID', $record->id); $id->setType('hidden'); $panel->add($id); $parentId = new Reference('parentId', 'Parent ID', $record->parentId); $parentId->setValueField('id'); $parentId->setLabelField('title'); $parentId->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/content/page'); $parentId->setDisabled(true); $panel->add($parentId); $service = new Select('serviceId', 'Service', $record->serviceId); $service->setOptions($this->getService()); $service->setDisabled(true); $panel->add($service); $status = new Select('status', 'Status', $record->status); $status->setOptions($this->getStatus()); $status->setDisabled(true); $panel->add($status); $title = new Input('title', 'Title', $record->title); $title->setType('text'); $title->setDisabled(true); $panel->add($title); $template = new Select('template', 'Template', $record->template); $template->setOptions($this->getTemplate()); $template->setDisabled(true); $panel->add($template); if ($this->user->isAnonymous() || $this->user->hasInputExceeded()) { $captcha = new Captcha('captcha', 'Captcha'); $captcha->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/core/captcha'); $panel->add($captcha); } $tabbedPane->add($panel); // extras $panel = new Panel('extras', 'Extras'); $description = new Input('description', 'Description', $record->description); $description->setType('text'); $description->setDisabled(true); $panel->add($description); $keywords = new Input('keywords', 'Keywords', $record->keywords); $keywords->setType('text'); $keywords->setDisabled(true); $panel->add($keywords); $right = new Select('rightId', 'Right', $record->rightId); $right->setOptions($this->getRights()); $right->setDisabled(true); $panel->add($right); $sort = new Input('sort', 'Sort', $record->sort); $sort->setType('text'); $sort->setDisabled(true); $panel->add($sort); $load = new Input('load', 'Load', $record->load); $load->setType('text'); $load->setDisabled(true); $panel->add($load); $cache = new Input('cache', 'Cache', $record->cache); $cache->setType('text'); $cache->setDisabled(true); $panel->add($cache); $expire = new Input('expire', 'Expire', $record->expire); $expire->setType('text'); $expire->setDisabled(true); $panel->add($expire); $publishDate = new Input('publishDate', 'Publish date', $record->publishDate); $publishDate->setType('datetime'); $expire->setDisabled(true); $panel->add($publishDate); $tabbedPane->add($panel); $form->setContainer($tabbedPane); return $form; }
public function delete($id) { $record = $this->hm->getHandler('AmunService\\Vcshook\\Author')->getRecord($id); $form = new AmunForm('DELETE', $this->url); $panel = new Element\Panel('author', 'Author'); $id = new Element\Input('id', 'ID', $record->id); $id->setType('hidden'); $panel->add($id); $userId = new Element\Reference('userId', 'User ID', $record->userId); $userId->setValueField('id'); $userId->setLabelField('name'); $userId->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/user/account'); $userId->setDisabled(true); $panel->add($userId); $name = new Element\Input('name', 'Name', $record->name); $name->setType('text'); $name->setDisabled(true); $panel->add($name); if ($this->user->isAnonymous() || $this->user->hasInputExceeded()) { $captcha = new Element\Captcha('captcha', 'Captcha'); $captcha->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/core/captcha'); $panel->add($captcha); } $form->setContainer($panel); return $form; }
public function delete($id) { $record = $this->hm->getHandler('AmunService\\Content\\Page\\Gadget')->getRecord($id); $form = new AmunForm('DELETE', $this->url); $panel = new Panel('gadget', 'Gadget'); $id = new Input('id', 'ID', $record->id); $id->setType('hidden'); $panel->add($id); $pageId = new Reference('pageId', 'Page ID', $record->pageId); $pageId->setValueField('id'); $pageId->setLabelField('title'); $pageId->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/content/page'); $pageId->setDisabled(true); $panel->add($pageId); $gadgetId = new Reference('gadgetId', 'Gadget ID', $record->gadgetId); $gadgetId->setValueField('id'); $gadgetId->setLabelField('name'); $gadgetId->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/content/gadget'); $gadgetId->setDisabled(true); $panel->add($gadgetId); $sort = new Input('sort', 'Sort', $record->sort); $sort->setType('text'); $sort->setDisabled(true); $panel->add($sort); if ($this->user->isAnonymous() || $this->user->hasInputExceeded()) { $captcha = new Captcha('captcha', 'Captcha'); $captcha->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/core/captcha'); $panel->add($captcha); } $form->setContainer($panel); return $form; }