Example #1
0
File: Form.php Project: visapi/amun
 public function create()
 {
     $form = new AmunForm('POST', $this->url);
     $panel = new Panel('friend', 'Friend');
     $status = new Select('status', 'Status', Record::REQUEST);
     $status->setOptions($this->getStatus());
     $status->setDisabled(true);
     $panel->add($status);
     $userId = new Input('userId', 'User', $this->user->getName());
     $userId->setType('text');
     $userId->setDisabled(true);
     $panel->add($userId);
     $friendId = new Reference('friendId', 'Friend ID');
     $friendId->setValueField('id');
     $friendId->setLabelField('name');
     $friendId->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/user/account');
     $panel->add($friendId);
     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;
 }
Example #2
0
File: Form.php Project: visapi/amun
 public function create($pageId = 0)
 {
     $form = new AmunForm('POST', $this->url);
     $panel = new Panel('page', 'Page');
     if (empty($pageId)) {
         $pageId = new Reference('pageId', 'Page ID');
         $pageId->setValueField('id');
         $pageId->setLabelField('title');
         $pageId->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/content/page');
         $panel->add($pageId);
     } else {
         $pageId = new Input('pageId', 'Page ID', $pageId);
         $pageId->setType('hidden');
         $panel->add($pageId);
     }
     $contentType = new Input('contentType', 'Content Type');
     $contentType->setType('text');
     $panel->add($contentType);
     $content = new Textarea('content', 'Content');
     $panel->add($content);
     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;
 }
Example #3
0
File: Form.php Project: visapi/amun
 public function create($pageId = 0)
 {
     $form = new AmunForm('POST', $this->url);
     $panel = new Panel('page', 'Pipe');
     if (empty($pageId)) {
         $pageId = new Reference('pageId', 'Page ID');
         $pageId->setValueField('id');
         $pageId->setLabelField('title');
         $pageId->setSrc($this->config['psx_url'] . '/' . $this->config['psx_dispatch'] . 'api/content/page');
         $panel->add($pageId);
     } else {
         $pageId = new Input('pageId', 'Page ID', $pageId);
         $pageId->setType('hidden');
         $panel->add($pageId);
     }
     $media = new Select('mediaId', 'Media');
     $media->setOptions($this->getMedia());
     $panel->add($media);
     $processor = new Select('processor', 'Processor', 'passthru');
     $processor->setOptions($this->getProcessor());
     $panel->add($processor);
     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;
 }
Example #4
0
File: Form.php Project: visapi/amun
 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;
 }
Example #5
0
File: Form.php Project: visapi/amun
 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;
 }
Example #6
0
File: Form.php Project: visapi/amun
 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;
 }