Changeset 111
- Timestamp:
- 07/18/07 15:52:42 (1 year ago)
- Files:
-
- branch/controllers/events_controller.php (modified) (7 diffs)
- branch/controllers/posts_controller.php (modified) (3 diffs)
- branch/models/event.php (modified) (2 diffs)
- branch/views/events/add.ctp (modified) (1 diff)
- branch/views/events/admin_add.ctp (modified) (3 diffs)
- branch/views/events/admin_view.ctp (modified) (1 diff)
- branch/views/events/edit.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/controllers/events_controller.php
r107 r111 3 3 4 4 var $name = 'Events'; 5 var $helpers = array(' Html', 'Form', 'Ajax', 'GoogleMap');5 var $helpers = array('GoogleMap'); 6 6 7 7 function index() { 8 $this->Event->recursive = 0; 9 $this->set('events', $this->paginate()); 10 $this->set('default', $this->Event->aveLatLng()); 8 $this->Event->recursive = 1; 9 $isFeed = ife($this->RequestHandler->prefers('rss') == 'rss', true, false); 10 11 if ($isFeed) { 12 $this->set('channel', array('title' => 'Latest events for Webrocket', 'description' => 'Webrocket RSS Feed')); 13 } 14 if (!$isFeed) { 15 // Overide paginate limit, may need to change 16 $this->cacheAction = '1 hour'; 17 $this->passedArgs['limit'] = 10; 18 $this->passedArgs['order'] = array('Event.created' => 'DESC'); 19 $this->set('events', $this->paginate(null, array('Event.published'=>1))); 20 $this->set('default', $this->Event->aveLatLng()); 21 } else { 22 // RSS Feed 23 $this->set('posts', $this->Event->findAll(null, null, array('Event.created' => 'DESC'), 20)); 24 } 11 25 } 12 26 … … 20 34 21 35 function add() { 22 if (!empty($this->data)) { 23 $this->cleanUpFields(); 24 $this->Event->create(); 25 if ($this->Event->save($this->data)) { 26 $this->Session->setFlash('The Event has been saved'); 27 $this->redirect(array('action'=>'index'), null, true); 28 } else { 29 $this->Session->setFlash('The Event could not be saved. Please, try again.'); 36 if ($this->level >= 500 ) { 37 if (!empty($this->data)) { 38 $this->data['Event']['user_id'] = $this->othAuth->user('id'); 39 $this->cleanUpFields(); 40 $this->Event->create(); 41 if ($this->Event->save($this->data)) { 42 $this->Session->setFlash('The Event has been saved'); 43 $this->redirect(array('action'=>'index'), null, true); 44 } else { 45 $this->Session->setFlash('The Event could not be saved. Please, try again.'); 46 } 30 47 } 48 $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 49 $this->set('eventTypes', $this->Event->EventType->generateList()); 50 $this->set('subjects', $this->Event->Subject->generateList()); 51 } else { 52 $this->Session->setFlash('You do not have permission to add an event. Please log in.'); 53 $this->redirect(array('controller' => 'users','action'=>'login'), null, true); 31 54 } 32 $venues = $this->Event->Venue->generateList(null, 'name ASC');33 $eventTypes = $this->Event->EventType->generateList();34 $users = $this->Event->User->generateList();35 $subjects = $this->Event->Subject->generateList();36 $this->set(compact('tags', 'venues', 'eventTypes', 'users', 'subjects'));37 55 } 38 56 39 57 function edit($id = null) { 40 if (!$id && empty($this->data)) { 41 $this->Session->setFlash('Invalid Event'); 42 $this->redirect(array('action'=>'index'), null, true); 58 if ($this->othAuth->user('id') == $this->data['Event']['user_id'] || $this->level >= 900) { 59 if (!$id && empty($this->data)) { 60 $this->Session->setFlash('Invalid Event'); 61 $this->redirect(array('action'=>'index'), null, true); 62 } 63 if (!empty($this->data)) { 64 $this->cleanUpFields(); 65 if ($this->Event->save($this->data)) { 66 $this->Session->setFlash('The Event saved'); 67 $this->redirect(array('action'=>'index'), null, true); 68 } else { 69 $this->Session->setFlash('The Event could not be saved. Please, try again.'); 70 } 71 } 72 if (empty($this->data)) { 73 $this->data = $this->Event->read(null, $id); 74 } 75 $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 76 $this->set('eventTypes', $this->Event->EventType->generateList()); 77 $this->set('subjects', $this->Event->Subject->generateList()); 78 } else { 79 $this->Session->setFlash('You do not have permission to edit an event. Please log in.'); 80 $this->redirect(array('controller' => 'users','action'=>'login'), null, true); 43 81 } 44 if (!empty($this->data)) {45 $this->cleanUpFields();46 if ($this->Event->save($this->data)) {47 $this->Session->setFlash('The Event saved');48 $this->redirect(array('action'=>'index'), null, true);49 } else {50 $this->Session->setFlash('The Event could not be saved. Please, try again.');51 }52 }53 if (empty($this->data)) {54 $this->data = $this->Event->read(null, $id);55 }56 $tags = $this->Event->Tag->generateList();57 $venues = $this->Event->Venue->generateList();58 $eventTypes = $this->Event->EventType->generateList();59 $users = $this->Event->User->generateList();60 $subjects = $this->Event->Subject->generateList();61 $this->set(compact('tags','venues','eventTypes','users','subjects'));62 82 } 63 83 … … 67 87 $this->redirect(array('action'=>'index'), null, true); 68 88 } 69 if ($this->Event->del($id)) { 70 $this->Session->setFlash('Event #'.$id.' deleted'); 71 $this->redirect(array('action'=>'index'), null, true); 89 if ($this->othAuth->user('id') == $this->data['Post']['user_id'] || $this->level >= 900) { 90 if ($this->Event->del($id)) { 91 $this->Session->setFlash('Event #'.$id.' deleted'); 92 $this->redirect(array('action'=>'index'), null, true); 93 } 94 } else { 95 $this->Session->setFlash('You do no have permission to delete this'); 96 $this->redirect(array('controller'=>'users','action'=>'login'), null, true); 72 97 } 73 98 } … … 75 100 76 101 function admin_index() { 77 $this->Event->recursive = 0; 78 $this->set('events', $this->paginate()); 79 $this->set('default', $this->Event->aveLatLng()); 102 $this->Event->recursive = 1; 103 $isFeed = ife($this->RequestHandler->prefers('rss') == 'rss', true, false); 104 105 if ($isFeed) { 106 $this->set('channel', array('title' => 'Latest events for Webrocket', 'description' => 'Webrocket RSS Feed')); 107 } 108 if (!$isFeed) { 109 // Overide paginate limit, may need to change 110 $this->cacheAction = '1 hour'; 111 $this->passedArgs['limit'] = 10; 112 $this->passedArgs['order'] = array('Event.created' => 'DESC'); 113 $this->set('events', $this->paginate(null, array('Event.published'=>1))); 114 $this->set('default', $this->Event->aveLatLng()); 115 } else { 116 // RSS Feed 117 $this->set('posts', $this->Event->findAll(null, null, array('Event.created' => 'DESC'), 20)); 118 } 80 119 } 81 120 … … 90 129 function admin_add() { 91 130 if (!empty($this->data)) { 131 $this->data['Event']['user_id'] = $this->othAuth->user('id'); 92 132 $this->cleanUpFields(); 93 133 $this->Event->create(); … … 99 139 } 100 140 } 101 $venues = $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName'); 102 $eventTypes = $this->Event->EventType->generateList(); 103 $users = $this->Event->User->generateList(); 104 $subjects = $this->Event->Subject->generateList(); 105 $this->set(compact('venues', 'eventTypes', 'users', 'subjects')); 141 $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 142 $this->set('eventTypes', $this->Event->EventType->generateList()); 143 $this->set('subjects', $this->Event->Subject->generateList()); 106 144 } 107 145 … … 123 161 $this->data = $this->Event->read(null, $id); 124 162 } 125 $tags = $this->Event->Tag->generateList(); 126 $venues = $this->Event->Venue->generateList(); 127 $eventTypes = $this->Event->EventType->generateList(); 128 $users = $this->Event->User->generateList(); 129 $subjects = $this->Event->Subject->generateList(); 130 $this->set(compact('tags','venues','eventTypes','users','subjects')); 163 $this->set('venues', $this->Event->Venue->generateList(null, 'name ASC', null,'{n}.Venue.id','{n}.Venue.fullName')); 164 $this->set('eventTypes', $this->Event->EventType->generateList()); 165 $this->set('subjects', $this->Event->Subject->generateList()); 131 166 } 132 167 branch/controllers/posts_controller.php
r110 r111 59 59 } 60 60 } 61 $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 62 $this->set('subjects', $this->Post->Subject->generateList()); 63 $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 61 64 } else { 62 65 $this->Session->setFlash('You do not have permission to add a post. Please log in.'); 63 66 $this->redirect(array('controller' => 'users','action'=>'login'), null, true); 64 67 } 65 $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 66 $this->set('subjects', $this->Post->Subject->generateList()); 67 $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 68 68 69 } 69 70 … … 83 84 } 84 85 } 86 $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name')); 87 $this->set('subjects', $this->Post->Subject->generateList()); 88 $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt')); 85 89 } else { 86 90 $this->Session->setFlash('You do no have permission to edit this post'); … … 90 94 $this->data = $this->Post->read(null, $id); 91 95 } 92 $this->set('access_levels', $this->Group->generateList(null, 'Group.name ASC', null,'{n}.Group.level', '{n}.Group.name'));93 $this->set('subjects', $this->Post->Subject->generateList());94 $this->set('images', $this->Post->Image->generateList(null,null,null,'{n}.Image.id', '{n}.Image.alt'));95 96 } 96 97 branch/models/event.php
r107 r111 8 8 //The Associations below have been created with all possible keys, those that are not needed can be removed 9 9 var $belongsTo = array( 10 'Venue' => array('className' => 'Venue', 11 'foreignKey' => 'venue_id', 12 'conditions' => '', 13 'fields' => '', 14 'order' => '', 15 'counterCache' => ''), 10 'Venue' => array('className' => 'Venue'), 16 11 'EventType' => array('className' => 'EventType', 17 'foreignKey' => 'event_type_id', 18 'conditions' => '', 19 'fields' => '', 20 'order' => '', 21 'counterCache' => ''), 22 'User' => array('className' => 'User', 23 'foreignKey' => 'user_id', 24 'conditions' => '', 25 'fields' => '', 26 'order' => '', 27 'counterCache' => ''), 28 'Subject' => array('className' => 'Subject', 29 'foreignKey' => 'subject_id', 30 'conditions' => '', 31 'fields' => '', 32 'order' => '', 33 'counterCache' => ''), 12 'foreignKey' => 'event_type_id'), 13 'User' => array('className' => 'User'), 14 'Subject' => array('className' => 'Subject'), 34 15 ); 35 16 … … 39 20 'foreignKey' => 'event_id', 40 21 'associationForeignKey' => 'tag_id', 41 'conditions' => '', 42 'fields' => '', 43 'order' => '', 44 'limit' => '', 45 'offset' => '', 46 'unique' => '', 47 'finderQuery' => '', 48 'deleteQuery' => '', 49 'insertQuery' => ''), 22 'order' => 'Tag.tag ASC', 23 'unique' => true), 50 24 ); 51 25 branch/views/events/add.ctp
r79 r111 2 2 <?php echo $form->create('Event');?> 3 3 <fieldset> 4 <legend><?php __(' Add', true);?> <?php __('Event');?></legend>4 <legend><?php __('Event Details');?></legend> 5 5 <?php 6 echo $form->input('venue_id'); 7 echo $form->input('event_type_id'); 8 echo $form->input('event_date'); 9 echo $form->input('event_time'); 10 echo $form->input('event_url'); 11 echo $form->input('body'); 12 echo $form->input('tags'); 13 echo $form->input('user_id'); 14 echo $form->input('subject_id'); 15 echo $form->input('published'); 16 echo $form->input('Tag'); 6 e($form->input('subject_id')); 7 e($form->input('venue_id')); 8 e($form->input('event_type_id')); 9 e($form->input('event_url')); 10 e($form->input('event_ticket1', array('label'=>'Ticket URL'))); 11 e($form->input('event_ticket2', array('label'=>'Ticket Phone'))); 12 e($form->input('event_price', array('label'=>'Ticket Price'))); 13 e($form->input('body', array('class'=>'wymeditor'))); 17 14 ?> 18 15 </fieldset> 19 <?php echo $form->end('Submit');?> 16 17 <fieldset> 18 <legend><?php __('Event Date & Time');?></legend> 19 <?php 20 e($form->input('event_date')); 21 e($form->input('event_time')); 22 ?> 23 </fieldset> 24 25 <fieldset> 26 <legend><?php __('Event Metadata');?></legend> 27 <?php e($form->input('tags', array('type'=>'text', 'class'=>'tags')));?> 28 </fieldset> 29 30 <fieldset> 31 <legend><?php __('Event Options');?></legend> 32 <?php e($form->input('published')); ?> 33 </fieldset> 34 <?php e($form->end('Submit', array('class'=>'wymupdate')));?> 20 35 </div> 21 <div class="actions">22 <ul>23 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('action'=>'index'));?></li>24 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('controller'=> 'venues', 'action'=>'index')); ?> </li>25 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('controller'=> 'venues', 'action'=>'add')); ?> </li>26 <li><?php echo $html->link(__('List', true).' '.__('Event Types', true), array('controller'=> 'event_types', 'action'=>'index')); ?> </li>27 <li><?php echo $html->link(__('New', true).' '.__('Event Type', true), array('controller'=> 'event_types', 'action'=>'add')); ?> </li>28 <li><?php echo $html->link(__('List', true).' '.__('Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li>29 <li><?php echo $html->link(__('New', true).' '.__('User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li>30 <li><?php echo $html->link(__('List', true).' '.__('Subjects', true), array('controller'=> 'subjects', 'action'=>'index')); ?> </li>31 <li><?php echo $html->link(__('New', true).' '.__('Subject', true), array('controller'=> 'subjects', 'action'=>'add')); ?> </li>32 <li><?php echo $html->link(__('List', true).' '.__('Tags', true), array('controller'=> 'tags', 'action'=>'index')); ?> </li>33 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add')); ?> </li>34 </ul>35 </div>branch/views/events/admin_add.ctp
r85 r111 4 4 <legend><?php __('Event Details');?></legend> 5 5 <?php 6 e cho $form->input('subject_id');7 e cho $form->input('venue_id');8 e cho $form->input('event_type_id');9 e cho $form->input('event_url');10 e cho $form->input('event_ticket1', array('label'=>'Ticket URL'));11 e cho $form->input('event_ticket2', array('label'=>'Ticket Phone'));12 e cho $form->input('event_price', array('label'=>'Ticket Price'));13 e cho $form->input('body', array('class'=>'wymeditor'));6 e($form->input('subject_id')); 7 e($form->input('venue_id')); 8 e($form->input('event_type_id')); 9 e($form->input('event_url')); 10 e($form->input('event_ticket1', array('label'=>'Ticket URL'))); 11 e($form->input('event_ticket2', array('label'=>'Ticket Phone'))); 12 e($form->input('event_price', array('label'=>'Ticket Price'))); 13 e($form->input('body', array('class'=>'wymeditor'))); 14 14 ?> 15 15 </fieldset> … … 18 18 <legend><?php __('Event Date & Time');?></legend> 19 19 <?php 20 e cho $form->input('event_date');21 e cho $form->input('event_time');20 e($form->input('event_date')); 21 e($form->input('event_time')); 22 22 ?> 23 23 </fieldset> … … 25 25 <fieldset> 26 26 <legend><?php __('Event Metadata');?></legend> 27 <?php e cho $form->input('tags', array('type'=>'text', 'class'=>'tags'));?>27 <?php e($form->input('tags', array('type'=>'text', 'class'=>'tags')));?> 28 28 </fieldset> 29 29 30 30 <fieldset> 31 31 <legend><?php __('Event Options');?></legend> 32 <?php e cho $form->input('published'); ?>32 <?php e($form->input('published')); ?> 33 33 </fieldset> 34 <?php e cho $form->end('Submit', array('class'=>'wymupdate'));?>34 <?php e($form->end('Submit', array('class'=>'wymupdate')));?> 35 35 </div> branch/views/events/admin_view.ctp
r79 r111 1 <div class="event"> 2 <h2><?php __('Event');?></h2> 3 <dl> 4 <dt class="altrow">Id</dt> 5 <dd class="altrow"> 6 <?php echo $event['Event']['id']?> 7 8 </dd> 9 <dt>Venue</dt> 10 <dd> 11 <?php echo $html->link($event['Venue']['name'], array('controller'=> 'venues', 'action'=>'view', $event['Venue']['id'])); ?> 12 13 </dd> 14 <dt class="altrow">EventType</dt> 15 <dd class="altrow"> 16 <?php echo $html->link($event['EventType']['title'], array('controller'=> 'event_types', 'action'=>'view', $event['EventType']['id'])); ?> 17 18 </dd> 19 <dt>Event Date</dt> 20 <dd> 21 <?php echo $event['Event']['event_date']?> 22 23 </dd> 24 <dt class="altrow">Event Time</dt> 25 <dd class="altrow"> 26 <?php echo $event['Event']['event_time']?> 27 28 </dd> 29 <dt>Event Url</dt> 30 <dd> 31 <?php echo $event['Event']['event_url']?> 32 33 </dd> 34 <dt class="altrow">Body</dt> 35 <dd class="altrow"> 36 <?php echo $event['Event']['body']?> 37 38 </dd> 39 <dt>Tags</dt> 40 <dd> 41 <?php echo $event['Event']['tags']?> 42 43 </dd> 44 <dt class="altrow">User</dt> 45 <dd class="altrow"> 46 <?php echo $html->link($event['User']['name'], array('controller'=> 'users', 'action'=>'view', $event['User']['id'])); ?> 47 48 </dd> 49 <dt>Subject</dt> 50 <dd> 51 <?php echo $html->link($event['Subject']['title'], array('controller'=> 'subjects', 'action'=>'view', $event['Subject']['id'])); ?> 52 53 </dd> 54 <dt class="altrow">Published</dt> 55 <dd class="altrow"> 56 <?php echo $event['Event']['published']?> 57 58 </dd> 59 <dt>Created</dt> 60 <dd> 61 <?php echo $event['Event']['created']?> 62 63 </dd> 64 <dt class="altrow">Modified</dt> 65 <dd class="altrow"> 66 <?php echo $event['Event']['modified']?> 67 68 </dd> 69 </dl> 1 <?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").jmap({center: ['. $event['Venue']['latitude'] .','. $event['Venue']['longitude'] .']});});'));?> 2 <?php e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $event['Venue']['latitude'] . '","' . $event['Venue']['longitude'] . '","' . $event['Venue']['name'] . '<br />' . $event['Venue']['street'] . '<br />' . $event['Venue']['city'] . ',' . $event['Venue']['postcode'] . '");});'));?> 3 4 <div class="vevent" id="hcalendar-<?php echo $event['Event']['id']?>"> 5 <h2><?php __('Event');?></h2> 6 7 <div style="float:right;width:50%;height:400px;" id="gmap"></div> 8 <div style="width:100%"> 9 <h3><?php e($event['EventType']['title']);?> - <?php e($event['Subject']['title']);?> - <?php e($event['Venue']['city']);?></h3> 10 11 <a class="url" href="<?php echo $event['Event']['event_url']?>"> 12 <abbr class="dtstart" title="20080716T0800"><?php echo $event['Event']['event_date']?> <?php echo $event['Event']['event_time']?></abbr>— 13 <span class="summary"><?php e($event['EventType']['title']);?> — <?php e($event['Subject']['title']); ?></span> — at 14 <span class="location"><?php e($event['Venue']['name']);?></span> 15 </a> 16 <div class="description"><?php echo $event['Event']['body']?></div> 17 <div class="tags">Tags: 18 <?php foreach ($event['Tag'] as $tag) : ?> 19 <a href="http://eventful.com/events/tags/<?php e($tag['tag']);?>"><?php e($tag['tag']);?></a> 20 <?php endforeach;?> 21 </div> 22 </div> 70 23 </div> 24 71 25 <div class="actions"> 72 26 <ul> 73 27 <li><?php echo $html->link(__('Edit', true).' '.__('Event', true), array('action'=>'edit', $event['Event']['id'])); ?> </li> 74 28 <li><?php echo $html->link(__('Delete', true).' '.__('Event', true), array('action'=>'delete', $event['Event']['id']), null, __('Are you sure you want to delete', true).' #' . $event['Event']['id'] . '?'); ?> </li> 75 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('action'=>'index')); ?> </li>76 <li><?php echo $html->link(__('New', true).' '.__('Event', true), array('action'=>'add')); ?> </li>77 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('controller'=> 'venues', 'action'=>'index')); ?> </li>78 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('controller'=> 'venues', 'action'=>'add')); ?> </li>79 <li><?php echo $html->link(__('List', true).' '.__('Event Types', true), array('controller'=> 'event_types', 'action'=>'index')); ?> </li>80 <li><?php echo $html->link(__('New', true).' '.__('Event Type', true), array('controller'=> 'event_types', 'action'=>'add')); ?> </li>81 <li><?php echo $html->link(__('List', true).' '.__('Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li>82 <li><?php echo $html->link(__('New', true).' '.__('User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li>83 <li><?php echo $html->link(__('List', true).' '.__('Subjects', true), array('controller'=> 'subjects', 'action'=>'index')); ?> </li>84 <li><?php echo $html->link(__('New', true).' '.__('Subject', true), array('controller'=> 'subjects', 'action'=>'add')); ?> </li>85 <li><?php echo $html->link(__('List', true).' '.__('Tags', true), array('controller'=> 'tags', 'action'=>'index')); ?> </li>86 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add')); ?> </li>87 29 </ul> 88 30 </div> 89 <div class="related">90 <h3><?php __('Related');?> <?php __('Tags');?></h3>91 <?php if (!empty($event['Tag'])):?>92 <table cellpadding = "0" cellspacing = "0">93 <tr>94 <th>Id</th>95 <th>Tag</th>96 <th class="actions"><?php __('Actions');?></th>97 </tr>98 <?php99 $i = 0;100 foreach ($event['Tag'] as $tag):101 $class = null;102 if ($i++ % 2 == 0) {103 $class = ' class="altrow"';104 }105 ?>106 <tr<?php echo $class;?>>107 <td><?php echo $tag['id'];?></td>108 <td><?php echo $tag['tag'];?></td>109 <td class="actions">110 <?php echo $html->link(__('View', true), array('controller'=> 'tags', 'action'=>'view', $tag['id'])); ?>111 <?php echo $html->link(__('Edit', true), array('controller'=> 'tags', 'action'=>'edit', $tag['id'])); ?>112 <?php echo $html->link(__('Delete', true), array('controller'=> 'tags', 'action'=>'delete', $tag['id']), null, __('Are you sure you want to delete', true).' #' . $tag['id'] . '?'); ?>113 </td>114 </tr>115 <?php endforeach; ?>116 </table>117 <?php endif; ?>118 119 <div class="actions">120 <ul>121 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add'));?> </li>122 </ul>123 </div>124 </div>branch/views/events/edit.ctp
r79 r111 2 2 <?php echo $form->create('Event');?> 3 3 <fieldset> 4 <legend><?php __('E dit', true);?> <?php __('Event');?></legend>4 <legend><?php __('Event Details');?></legend> 5 5 <?php 6 6 echo $form->input('id'); 7 echo $form->input('subject_id'); 7 8 echo $form->input('venue_id'); 8 9 echo $form->input('event_type_id'); 9 echo $form->input('event_date');10 echo $form->input('event_time');11 10 echo $form->input('event_url'); 12 echo $form->input('body'); 13 echo $form->input('tags'); 14 echo $form->input('user_id'); 15 echo $form->input('subject_id'); 16 echo $form->input('published'); 17 echo $form->input('Tag'); 11 echo $form->input('event_ticket1', array('label'=>'Ticket URL')); 12 echo $form->input('event_ticket2', array('label'=>'Ticket Phone')); 13 echo $form->input('event_price', array('label'=>'Ticket Price')); 14 echo $form->input('body', array('class'=>'wymeditor')); 18 15 ?> 19 16 </fieldset> 20 <?php echo $form->end('Submit');?> 17 18 <fieldset> 19 <legend><?php __('Event Date & Time');?></legend> 20 <?php 21 echo $form->input('event_date'); 22 echo $form->input('event_time'); 23 ?> 24 </fieldset> 25 26 <fieldset> 27 <legend><?php __('Event Metadata');?></legend> 28 <?php echo $form->input('tags', array('type'=>'text', 'class'=>'tags'));?> 29 </fieldset> 30 31 <fieldset> 32 <legend><?php __('Event Options');?></legend> 33 <?php echo $form->input('published'); ?> 34 </fieldset> 35 <?php echo $form->end('Submit', array('class'=>'wymupdate'));?> 21 36 </div> 22 37 <div class="actions"> 23 38 <ul> 24 39 <li><?php echo $html->link(__('Delete', true), array('action'=>'delete', $form->value('Event.id')), null, __('Are you sure you want to delete', true).' #' . $form->value('Event.id')); ?></li> 25 <li><?php echo $html->link(__('List', true).' '.__('Events', true), array('action'=>'index'));?></li>26 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('controller'=> 'venues', 'action'=>'index')); ?> </li>27 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('controller'=> 'venues', 'action'=>'add')); ?> </li>28 <li><?php echo $html->link(__('List', true).' '.__('Event Types', true), array('controller'=> 'event_types', 'action'=>'index')); ?> </li>29 <li><?php echo $html->link(__('New', true).' '.__('Event Type', true), array('controller'=> 'event_types', 'action'=>'add')); ?> </li>30 <li><?php echo $html->link(__('List', true).' '.__('Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li>31 <li><?php echo $html->link(__('New', true).' '.__('User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li>32 <li><?php echo $html->link(__('List', true).' '.__('Subjects', true), array('controller'=> 'subjects', 'action'=>'index')); ?> </li>33 <li><?php echo $html->link(__('New', true).' '.__('Subject', true), array('controller'=> 'subjects', 'action'=>'add')); ?> </li>34 <li><?php echo $html->link(__('List', true).' '.__('Tags', true), array('controller'=> 'tags', 'action'=>'index')); ?> </li>35 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add')); ?> </li>36 40 </ul> 37 41 </div>