function getContent() { $this->createGatekeeper(); // This functionality is for logged-in users only // Are we loading an entity? if (!empty($this->arguments)) { $object = \IdnoPlugins\Event\Event::getByID($this->arguments[0]); } else { $object = new \IdnoPlugins\Event\Event(); $autosave = new \Idno\Core\Autosave(); foreach (array('title', 'summary', 'location', 'starttime', 'endtime', 'body') as $field) { $object->{$field} = $autosave->getValue('event', $field); } } if ($owner = $object->getOwner()) { $this->setOwner($owner); } $t = \Idno\Core\Idno::site()->template(); $body = $t->__(array('object' => $object))->draw('entity/Event/edit'); if (empty($object)) { $title = 'Write an event'; } else { $title = 'Edit event'; } if (!empty($this->xhr)) { echo $body; } else { $t->__(array('body' => $body, 'title' => $title))->drawPage(); } }
<?php echo $this->draw('entity/edit/header'); $autosave = new \Idno\Core\Autosave(); if (!empty($vars['object']->body)) { $body = $vars['object']->body; } else { $body = $autosave->getValue('entry', 'bodyautosave'); } if (!empty($vars['object']->title)) { $title = $vars['object']->title; } else { $title = $autosave->getValue('entry', 'title'); } if (!empty($vars['object'])) { $object = $vars['object']; } else { $object = false; } /* @var \Idno\Core\Template $this */ ?> <form action="<?php echo $vars['object']->getURL(); ?> " method="post"> <div class="row"> <div class="span8 offset2 edit-pane">
<?php echo $this->draw('entity/edit/header'); $autosave = new \Idno\Core\Autosave(); if (!empty($vars['object']->body)) { $body = $vars['object']->body; } else { $body = $autosave->getValue('recipe', 'bodyautosave'); } if (!empty($vars['object']->title)) { $title = $vars['object']->title; } else { $title = $autosave->getValue('recipe', 'title'); } if (!empty($vars['object']->ingredients)) { $ingredients = $vars['object']->ingredients; } else { $ingredients = $autosave->getValue('recipe', 'ingredients'); } if (!empty($vars['object']->yield)) { $yield = $vars['object']->yield; } else { $yield = $autosave->getValue('recipe', 'yield'); } if (!empty($vars['object']->duration)) { $duration = $vars['object']->duration; } else { $duration = $autosave->getValue('recipe', 'duration'); } if (!empty($vars['object'])) { $object = $vars['object'];
<?php echo $this->draw('entity/edit/header'); $autosave = new \Idno\Core\Autosave(); if (!empty($vars['object']->body)) { $body = $vars['object']->body; } else { $body = $autosave->getValue('review', 'bodyautosave'); } if (!empty($vars['object']->title)) { $title = $vars['object']->title; } else { $title = $autosave->getValue('review', 'title'); } if (!empty($vars['object']->rating)) { $rating = $vars['object']->rating; } else { $rating = $autosave->getValue('review', 'rating'); } if (!empty($vars['object']->productName)) { $productName = $vars['object']->productName; } else { $productName = $autosave->getValue('review', 'productName'); } if (!empty($vars['object']->productCategory)) { $productCategory = $vars['object']->productCategory; } else { $productCategory = $autosave->getValue('review', 'productCategory'); } if (!empty($vars['object']->productLink)) { $productLink = $vars['object']->productLink;
<?php echo $this->draw('entity/edit/header'); $autosave = new \Idno\Core\Autosave(); if (!($title = $vars['object']->title)) { $title = $autosave->getValue('event', 'title'); } if (!($summary = $vars['object']->summary)) { $summary = $autosave->getValue('event', 'summary'); } if (!($location = $vars['object']->location)) { $location = $autosave->getValue('event', 'location'); } if (!($starttime = $vars['object']->starttime)) { $starttime = $autosave->getValue('event', 'starttime'); } if (!($endtime = $vars['object']->endtime)) { $endtime = $autosave->getValue('event', 'endtime'); } if (!($body = $vars['object']->body)) { $body = $autosave->getValue('event', 'body'); } ?> <form action="<?php echo $vars['object']->getURL(); ?> " method="post"> <div class="row"> <div class="span8 offset2 edit-pane"> <h4>