Cette révision appartient à :
Stéphane Goetz 2015-08-02 15:42:23 +02:00
Parent 27e0e8780c
révision b1eaa506b2
5 fichiers modifiés avec 20 ajouts et 6 suppressions

Voir le fichier

@ -39,7 +39,8 @@ class Generate extends SymfonyCommand
$daux->getGenerator()->generateAll($input, $output, $width);
}
protected function prepareDaux(InputInterface $input) {
protected function prepareDaux(InputInterface $input)
{
$daux = new Daux(Daux::STATIC_MODE);
// Set the format if requested

Voir le fichier

@ -193,14 +193,21 @@ class Api
*/
public function uploadAttachment($id, $attachment)
{
//get if attachment is uploaded
// Check if an attachment with
// this name is uploaded
try {
$result = $this->getClient()->get("content/$id/child/attachment?filename=$attachment[filename]")->json();
} catch (BadResponseException $e) {
throw $this->handleError($e);
}
$url = "content/$id/child/attachment" . (count($result['results']) ? "/{$result['results'][0]['id']}/data" : "");
$url = "content/$id/child/attachment";
// If the attachment is already uploaded,
// the update URL is different
if (count($result['results'])) {
$url .= "/{$result['results'][0]['id']}/data";
}
try {
$this->getClient()->post(

Voir le fichier

@ -85,10 +85,12 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
} elseif ($node instanceof Content) {
$params['request'] = $node->getUrl();
$contentType = $this->daux->getContentTypeHandler()->getType($node);
$data = [
'title' => $this->prefix . $node->getTitle(),
'file' => $node,
'page' => ContentPage::fromFile($node, $params, $this->daux->getContentTypeHandler()->getType($node)),
'page' => ContentPage::fromFile($node, $params, $contentType),
];
// As the page is lazily generated

Voir le fichier

@ -82,7 +82,9 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
$page['breadcrumb_separator'] = $params['html']['breadcrumb_separator'];
}
$context = ['page' => $page, 'params' => $params];
$template = new Template($params['templates'], $params['theme']['templates']);
return $template->render($this->homepage ? 'theme::home' : 'theme::content', ['page' => $page, 'params' => $params]);
return $template->render($this->homepage ? 'theme::home' : 'theme::content', $context);
}
}

Voir le fichier

@ -61,7 +61,9 @@ class Builder
$config = $parent->getConfig();
if (!in_array(pathinfo($path, PATHINFO_EXTENSION), $config['valid_content_extensions'])) {
$entry = new Raw($parent, static::removeSortingInformations(static::getFilename($path)), $path, filemtime($path));
$uri = static::removeSortingInformations(static::getFilename($path));
$entry = new Raw($parent, $uri, $path, filemtime($path));
$entry->setTitle(static::removeSortingInformations($name, ' '));
$entry->setName($name);