edit post

context->transport->post->getUploader())))) { $safety = PostSafety::getAll(); $context = new StdClass; $context->label = 'Safety'; $context->name = 'safety'; $context->optionValues = array_map(function($s) { return $s->toInteger(); }, $safety); $context->optionLabels = array_map(function($s) { return ucfirst($s->toDisplayString()); }, $safety); $context->activeOptionValue = $this->context->transport->post->getSafety()->toInteger(); $this->renderExternal('input-radioboxes', $context); } if (Access::check(new Privilege( Privilege::EditPostTags, Access::getIdentity($this->context->transport->post->getUploader())))) { $context = new StdClass; $context->label = 'Tags'; $context->name = 'tags'; $context->placeholder = 'Enter some tags…'; $context->value = join(',', array_map( function($tag) { return htmlspecialchars($tag->getName()); }, $this->context->transport->post->getTags())); $this->renderExternal('input-text', $context); } if (Access::check(new Privilege( Privilege::EditPostSource, Access::getIdentity($this->context->transport->post->getUploader())))) { $context = new StdClass; $context->label = 'Source'; $context->name = 'source'; $context->value = htmlspecialchars($this->context->transport->post->getSource()); $this->renderExternal('input-text', $context); } if (Access::check(new Privilege( Privilege::EditPostRelations, Access::getIdentity($this->context->transport->post->getUploader())))) { $context = new StdClass; $context->label = 'Relations'; $context->name = 'relations'; $context->placeholder = 'id1,id2,…'; $context->value = join(',', array_map( function($post) { return $post->getId(); }, $this->context->transport->post->getRelations())); $this->renderExternal('input-text', $context); } if (Access::check(new Privilege( Privilege::EditPostContent, Access::getIdentity($this->context->transport->post->getUploader())))) { $context = new StdClass; $context->label = 'File'; $context->name = 'url'; $context->placeholder = 'Some URL…'; $this->renderExternal('input-text', $context); $context = new StdClass; $context->name = 'file'; $this->renderExternal('input-file', $context); } if (Access::check(new Privilege( Privilege::EditPostThumb, Access::getIdentity($this->context->transport->post->getUploader())))) { $context = new StdClass; $context->name = 'thumb'; $context->label = 'Thumb'; if ($this->context->transport->post->hasCustomThumb()) $context->additionalInfo = '(Currently using custom thumb)'; $this->renderExternal('input-file', $context); } ?>