Changeset 1062
- Timestamp:
- 04/26/10 16:26:04 (22 months ago)
- Location:
- plugins/apostropheBlogPlugin/trunk
- Files:
-
- 6 modified
-
config/doctrine/schema.yml (modified) (2 diffs)
-
config/routing.yml (modified) (4 diffs)
-
lib/form/doctrine/PluginaBlogItemForm.class.php (modified) (2 diffs)
-
lib/model/doctrine/PluginaBlogItem.class.php (modified) (2 diffs)
-
modules/aBlogAdmin/lib/BaseaBlogAdminActions.class.php (modified) (1 diff)
-
web/js/aBlog.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostropheBlogPlugin/trunk/config/doctrine/schema.yml
r1046 r1062 6 6 Timestampable: ~ 7 7 Taggable: ~ 8 Sluggable:9 canUpdate: true10 8 columns: 11 9 id: … … 20 18 type: string(255) 21 19 notnull: true 20 slug: 21 type: string(255) 22 notnull: true 23 unique: true 24 slug_saved: 25 type: boolean 26 default: false 22 27 excerpt: 23 28 type: string -
plugins/apostropheBlogPlugin/trunk/config/routing.yml
r1056 r1062 269 269 url: 270 270 param: { module: aEvent, action: today } 271 class: aRoute 271 class: aRoute 272 272 273 273 … … 275 275 # blog admin routes # 276 276 ################ 277 278 279 277 280 278 a_blog_admin: … … 286 284 column: slug 287 285 with_wildcard_routes: true 288 with_show: false286 with_show: false 289 287 290 288 a_blog_admin_autocomplete: … … 292 290 param: { module: aBlogAdmin, action: autocomplete } 293 291 class: sfRoute 294 295 292 296 293 a_blog_admin_edit: -
plugins/apostropheBlogPlugin/trunk/lib/form/doctrine/PluginaBlogItemForm.class.php
r1006 r1062 17 17 18 18 unset( 19 $this['type'], $this['page_id'], $this['created_at'], $this['updated_at'] 19 $this['type'], $this['page_id'], $this['created_at'], $this['updated_at'], $this['slug_saved'] 20 20 ); 21 21 … … 52 52 $this->widgetSchema['tags'] = new sfWidgetFormInput(array('default' => implode(', ', $this->getObject()->getTags())), array('class' => 'tag-input', 'autocomplete' => 'off')); 53 53 $this->validatorSchema['tags'] = new sfValidatorString(array('required' => false)); 54 }55 56 public function updateSlugColumn($value)57 {58 return $value;59 54 } 60 55 -
plugins/apostropheBlogPlugin/trunk/lib/model/doctrine/PluginaBlogItem.class.php
r1046 r1062 12 12 */ 13 13 abstract class PluginaBlogItem extends BaseaBlogItem 14 { 14 { 15 protected $update = true; 16 15 17 /** 16 18 * These date methods are use in the routing of the permalink … … 51 53 $this->slug = 'untitled-'.$this['id']; 52 54 $this->title = 'untitled'; 55 $this['slug_saved'] = false; 56 $this->update = false; 53 57 $this->save(); 58 } 59 60 public function preUpdate($event) 61 { 62 if($this->update) 63 { 64 if(array_key_exists('slug', $this->getModified())) 65 { 66 $this['slug_saved'] = true; 67 } 68 if($this['slug_saved'] == false) 69 { 70 $this['slug'] = aTools::slugify($this['title']); 71 } 72 } 54 73 } 55 74 -
plugins/apostropheBlogPlugin/trunk/modules/aBlogAdmin/lib/BaseaBlogAdminActions.class.php
r1046 r1062 17 17 $this->a_blog_post->Author = $this->getUser()->getGuardUser(); 18 18 $this->a_blog_post->save(); 19 $this->redirect('a BlogAdmin/edit?slug='.$this->a_blog_post->getSlug());19 $this->redirect('a_blog_admin_edit', $this->a_blog_post); 20 20 } 21 21 -
plugins/apostropheBlogPlugin/trunk/web/js/aBlog.js
r1054 r1062 98 98 { 99 99 var permalinkInput = $('#a_blog_post_permalink_interface'); 100 100 var slugInput = $('#a_blog_post_slug'); 101 101 if (slug != null) 102 102 { 103 permalinkInput.val(slug); 103 permalinkInput.val(slug); 104 slugInput.val(slug); 104 105 }; 105 106

