protected function doInit() { $countTemplate = array(); if (isset($this->countTemplate)) { $countTemplate['countTemplate'] = $this->createJooseSnippet('Psc.UI.Template', array('jQueryTemplate' => $this->widgetSelector($this->countTemplate))); } $this->autoloadJoose($this->createJooseSnippet('Psc.UI.Comments', array_merge(array('widget' => $this->widgetSelector(), 'commentTemplate' => $this->createJooseSnippet('Psc.UI.Template', array('jQueryTemplate' => $this->widgetSelector($this->commentTemplate))), 'service' => $this->createJooseSnippet('Psc.CommentsService', array('ajaxService' => $this->jsExpr('main'), 'pullRequest' => $this->createJooseSnippet('Psc.Request', (array) $this->pullRequestMeta->export())))), $countTemplate))->loadOnPscReady('main')->addRequirement('app/main')->addRequirementAlias('nothing')->addRequirementAlias('main')); }
public function __construct(RequestMeta $tabRequestMeta, $label, $entityName = NULL, $entityIdentifier = NULL, $tabLabel = NULL) { parent::__construct($tabRequestMeta->getUrl(), $label); $this->tabRequestMeta = $tabRequestMeta; $this->entityName = $entityName; $this->identifier = $entityIdentifier; $this->tablabel = $tabLabel; }
/** * @param Psc\CMS\RequestMeta $requestMeta */ public function setRequestMeta(RequestMeta $requestMeta) { $this->requestMeta = $requestMeta; if (!isset($this->data)) { $this->data = array(); } $this->data['request'] = $this->requestMeta->export(); return $this; }
public function setRequestMeta(RequestMeta $requestMeta) { $this->setAction($requestMeta->getUrl()); $this->setHTTPHeader('X-Psc-Cms-Request-Method', $requestMeta->getMethod()); return $this; }
/** * "Formular" Speichern (PUT) * * @return Psc\CMS\RequestMeta */ public function getSaveRequestMeta(Entity $entity = NULL, $subResource = NULL) { $idIsInt = ($type = $this->getIdentifier()->getType()) instanceof IntegerType; // custom save request if ($subResource != NULL) { $requestMeta = new RequestMeta(\Psc\Net\HTTP\Request::PUT, $this->constructUrl(array($this->getEntityName(), $idIsInt ? '%d' : '%s', $subResource)), array($type)); if (isset($entity)) { $requestMeta->setInput($entity->getIdentifier()); } return $requestMeta; } else { if (!isset($this->saveRequestMeta)) { $this->saveRequestMeta = new RequestMeta(\Psc\Net\HTTP\Request::PUT, $this->constructUrl(array($this->getEntityName(), $idIsInt ? '%d' : '%s')), array($type)); } if (isset($entity)) { $meta = clone $this->saveRequestMeta; return $meta->setInput($entity->getIdentifier()); } return $this->saveRequestMeta; } }