Changeset 301
- Timestamp:
- 02/24/10 12:27:29 (11 years ago)
- Location:
- trunk/server/www/app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/www/app/controllers/galleries_controller.php
r298 r301 256 256 if (!empty($this->data)) { 257 257 $slug = $this->Gallery->read('slug', $this->data['Gallery']['id']); 258 $slug = $slug['Gallery']['slug']; 258 259 } 259 260 … … 271 272 if ($this->Gallery->save($this->data)) { 272 273 $this->Session->setFlash(__('The Gallery has been saved', true)); 273 $this->redirect(array('action' => 'view', $ this->data['Gallery']['slug']));274 $this->redirect(array('action' => 'view', $slug)); 274 275 } else { 275 276 $this->Session->setFlash(__('The Gallery could not be saved. Please, try again.', true)); -
trunk/server/www/app/models/gallery.php
r297 r301 221 221 { 222 222 if (isset($this->data['Gallery']['description'])) { 223 // Convert the markdown description to HTML 223 224 App::import('Vendor', 'markdown'); 224 225 App::import('Vendor', 'HTMLPurifier', array('file' => 'htmlpurifier/HTMLPurifier.standalone.php')); … … 230 231 $desc_html = Markdown($this->data['Gallery']['description']); 231 232 $this->data['Gallery']['description_html'] = $purifier->purify($desc_html); 233 234 // Save the markdown version to file 235 $suite = $this->Testsuite->find('first', array( 236 'conditions' => array('Testsuite.gallery_id' => $this->id), 237 'recursive' => -1, 238 )); 239 240 if ($suite) { 241 $path = FILES . $suite['Testsuite']['root'] . DS . 'description.txt'; 242 file_put_contents($path, $this->data['Gallery']['description']); 243 } 232 244 } 233 245 -
trunk/server/www/app/models/request.php
r300 r301 348 348 { 349 349 if (isset($this->data['Request']['description'])) { 350 // Convert the description to HTML 350 351 App::import('Vendor', 'markdown'); 351 352 App::import('Vendor', 'HTMLPurifier', array('file' => 'htmlpurifier/HTMLPurifier.standalone.php')); … … 357 358 $desc_html = Markdown($this->data['Request']['description']); 358 359 $this->data['Request']['description_html'] = $purifier->purify($desc_html); 360 361 // Save the Markdown version to file 362 $root = $this->field('root'); 363 file_put_contents(FILES . $root . DS . 'description.txt', $this->data['Request']['description']); 359 364 } 360 365
Note: See TracChangeset
for help on using the changeset viewer.