Changeset 131
- Timestamp:
- 07/20/07 16:54:53 (1 year ago)
- Files:
-
- branch/controllers/posts_controller.php (modified) (2 diffs)
- branch/controllers/videos_controller.php (modified) (1 diff)
- branch/views/posts/admin_index.ctp (modified) (4 diffs)
- branch/views/videos/add.ctp (modified) (1 diff)
- branch/views/videos/admin_add.ctp (modified) (2 diffs)
- branch/views/videos/admin_edit.ctp (modified) (1 diff)
- branch/views/videos/admin_home.ctp (added)
- branch/views/videos/admin_index.ctp (modified) (3 diffs)
- branch/views/videos/edit.ctp (modified) (1 diff)
- branch/webroot/js/forminit.js (modified) (1 diff)
- branch/webroot/js/jquery.passstrength.js (modified) (1 diff)
- branch/webroot/js/webrocket.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/controllers/posts_controller.php
r119 r131 151 151 if($this->Post->save($this->data)) { 152 152 $this->Session->setFlash('The Post has been saved'); 153 $this->redirect(array('action'=>' index'), null, true);153 $this->redirect(array('action'=>'home'), null, true); 154 154 } else { 155 155 $this->Session->setFlash('The Post could not be saved. Please, try again.'); … … 170 170 if($this->Post->save($this->data)) { 171 171 $this->Session->setFlash('The Post saved'); 172 $this->redirect(array('action'=>' index'), null, true);172 $this->redirect(array('action'=>'home'), null, true); 173 173 } else { 174 174 $this->Session->setFlash('The Post could not be saved. Please, try again.'); branch/controllers/videos_controller.php
r73 r131 148 148 } 149 149 } 150 151 function admin_home() 152 { 153 154 } 150 155 151 156 } branch/views/posts/admin_index.ctp
r119 r131 1 <?php e($javascript->link('forminit'));?> 2 1 3 <?php if ($posts) { ?> 2 4 <div class="posts"> … … 24 26 </thead> 25 27 <tbody> 26 <?php $row = 0; ?>27 28 <?php foreach ($posts as $post): ?> 28 <tr class="<?php ($row % 2 ? e('even') : e('odd'));?>">29 <tr id="post-<?php e($post['Post']['id']);?>"> 29 30 <td><?php echo $post['Post']['id']; ?></td> 30 31 <td><?php echo $post['Post']['title']; ?></td> … … 43 44 <?php echo $html->link('View', array('action'=>'view', $post['Post']['id'])); ?> 44 45 <?php echo $html->link('Edit', array('action'=>'edit', $post['Post']['id'])); ?> 45 <?php echo $html->link('Delete', array('action'=>'delete', $post['Post']['id']), null, 'Are you sure you want to delete #' . $post['Post']['id']); ?>46 <?php echo $html->link('Delete', array('action'=>'delete', $post['Post']['id']), array('class'=>'delete', 'id'=> $post['Post']['id']), null); ?> 46 47 </td> 47 48 </tr> 48 <?php $row++; ?>49 49 <?php endforeach; ?> 50 50 </tbody> … … 58 58 </div> 59 59 <?php } else { ?> 60 <h2>There are currently no posts. Click <?php echo $html->link('here', array('action'=>'add')); ?> to create one.</h2>60 <h2>There are currently no posts. Click <?php echo $html->link('here', '#remote-tab-2'); ?> to create one.</h2> 61 61 <?php } ?> branch/views/videos/add.ctp
r55 r131 1 <div class="video"> 2 <h2>New Video</h2> 1 <?php e($javascript->link('forminit'));?> 2 3 <div class="video-form"> 4 <h2>New Video Playlist</h2> 3 5 <?php echo $form->create('Video');?> 4 <?php echo $form->input('title', array('class' => 'required'));?> 5 <?php echo $form->input('url', array('class' => 'required'));?> 6 <?php echo $form->input('video_location', array('class' => 'required'));?> 7 <?php echo $form->input('video_date', array('class' => 'required'));?> 8 <?php echo $form->input('body', array('class' => 'required'));?> 9 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 10 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 11 <?php echo $form->input('published', array('class' => 'required'));?> 12 <?php echo $form->input('user_id', array('class' => 'required', 'options' => $users));?> 13 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 14 <?php echo $form->input('tags', array('class' => 'required'));?> 15 <?php echo $form->input('Tag/Tag', array('options' => $tags, 'multiple' => 'multiple'));?> 16 <?php echo $form->submit('Add');?> 6 7 <fieldset id="main-content"> 8 <legend>Main Content</legend> 9 <?php echo $form->input('title', array('class' => 'required'));?> 10 <?php echo $form->input('url', array('class' => 'required'));?> 11 <?php echo $form->input('video_location', array('class' => 'required'));?> 12 <?php echo $form->input('video_date', array('class' => 'required'));?> 13 <?php echo $form->input('body',array('class'=>'wymeditor'));?> 14 </fieldset> 15 <fieldset id="main-content"> 16 <legend>Meta Data</legend> 17 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 18 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 19 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 20 <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?> 21 </fieldset> 22 <fieldset id="main-content"> 23 <legend>Publishing Options</legend> 24 <?php echo $form->input('published', array('class' => 'required'));?> 25 </fieldset> 26 <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 17 27 </form> 18 28 </div> 19 <div class="actions">20 <ul>21 <li><?php echo $html->link('List Videos', array('action'=>'index')); ?></li>22 <li><?php echo $html->link('View Copyrights', array('controller'=> 'copyrights', 'action'=>'view'));?></li>23 <li><?php echo $html->link('Add Copyrights', array('controller'=> 'copyrights', 'action'=>'add')); ?></li>24 <li><?php echo $html->link('View Users', array('controller'=> 'users', 'action'=>'view'));?></li>25 <li><?php echo $html->link('Add Users', array('controller'=> 'users', 'action'=>'add')); ?></li>26 <li><?php echo $html->link('View Subjects', array('controller'=> 'subjects', 'action'=>'view'));?></li>27 <li><?php echo $html->link('Add Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?></li>28 </ul>29 </div>branch/views/videos/admin_add.ctp
r118 r131 1 <?php e($javascript->link('forminit'));?> 2 1 3 <div class="video-form"> 2 4 <h2>New Video Playlist</h2> … … 5 7 <fieldset id="main-content"> 6 8 <legend>Main Content</legend> 7 8 9 <?php echo $form->input('title', array('class' => 'required'));?> 10 <?php echo $form->input('url', array('class' => 'required'));?> 11 <?php echo $form->input('video_location', array('class' => 'required'));?> 12 <?php echo $form->input('video_date', array('class' => 'required'));?> 13 <?php echo $form->input('body',array('class'=>'wymeditor'));?> 9 14 </fieldset> 10 11 <?php echo $form->input('title', array('class' => 'required'));?> 12 <?php echo $form->input('url', array('class' => 'required'));?> 13 <?php echo $form->input('video_location', array('class' => 'required'));?> 14 <?php echo $form->input('video_date', array('class' => 'required'));?> 15 <?php echo $form->input('body', array('class' => 'required'));?> 16 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 17 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 18 <?php echo $form->input('published', array('class' => 'required'));?> 19 <?php echo $form->input('user_id', array('class' => 'required', 'options' => $users));?> 20 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 21 <?php echo $form->input('tags', array('class' => 'required'));?> 22 <?php echo $form->input('Tag/Tag', array('options' => $tags, 'multiple' => 'multiple'));?> 23 <?php echo $form->submit('Add');?> 15 <fieldset id="main-content"> 16 <legend>Meta Data</legend> 17 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 18 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 19 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 20 <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?> 21 </fieldset> 22 <fieldset id="main-content"> 23 <legend>Publishing Options</legend> 24 <?php echo $form->input('published', array('class' => 'required'));?> 25 </fieldset> 26 <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 24 27 </form> 25 28 </div> 26 <div class="actions">27 <ul>28 <li><?php echo $html->link('List Videos', array('action'=>'index')); ?></li>29 <li><?php echo $html->link('View Copyrights', array('controller'=> 'copyrights', 'action'=>'view'));?></li>30 <li><?php echo $html->link('Add Copyrights', array('controller'=> 'copyrights', 'action'=>'add')); ?></li>31 <li><?php echo $html->link('View Users', array('controller'=> 'users', 'action'=>'view'));?></li>32 <li><?php echo $html->link('Add Users', array('controller'=> 'users', 'action'=>'add')); ?></li>33 <li><?php echo $html->link('View Subjects', array('controller'=> 'subjects', 'action'=>'view'));?></li>34 <li><?php echo $html->link('Add Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?></li>35 </ul>36 </div>branch/views/videos/admin_edit.ctp
r55 r131 1 <div class="video"> 2 <h2>Edit Video</h2> 1 <?php e($javascript->link('forminit'));?> 2 3 <div class="video-form"> 4 <h2>New Video Playlist</h2> 3 5 <?php echo $form->create('Video');?> 4 <?php echo $form->input('id');?> 5 <?php echo $form->input('title', array('class' => 'required'));?> 6 <?php echo $form->input('url', array('class' => 'required'));?> 7 <?php echo $form->input('video_location', array('class' => 'required'));?> 8 <?php echo $form->input('video_date', array('class' => 'required'));?> 9 <?php echo $form->input('body', array('class' => 'required'));?> 10 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 11 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 12 <?php echo $form->input('published', array('class' => 'required'));?> 13 <?php echo $form->input('user_id', array('class' => 'required', 'options' => $users));?> 14 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 15 <?php echo $form->input('tags', array('class' => 'required'));?> 16 <?php echo $form->input('Tag/Tag', array('options' => $tags, 'multiple' => 'multiple'));?> 17 <?php echo $form->submit('Update');?> 6 7 <fieldset id="main-content"> 8 <legend>Main Content</legend> 9 <?php echo $form->input('id');?> 10 <?php echo $form->input('title', array('class' => 'required'));?> 11 <?php echo $form->input('url', array('class' => 'required'));?> 12 <?php echo $form->input('video_location', array('class' => 'required'));?> 13 <?php echo $form->input('video_date', array('class' => 'required'));?> 14 <?php echo $form->input('body',array('class'=>'wymeditor'));?> 15 </fieldset> 16 <fieldset id="main-content"> 17 <legend>Meta Data</legend> 18 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 19 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 20 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 21 <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?> 22 </fieldset> 23 <fieldset id="main-content"> 24 <legend>Publishing Options</legend> 25 <?php echo $form->input('published', array('class' => 'required'));?> 26 </fieldset> 27 <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 18 28 </form> 19 29 </div> 20 <div class="actions">21 <ul>22 <li><?php echo $html->link('Delete', array('action'=>'delete', $html->tagValue('Video/id')), null, 'Are you sure you want to delete #' . $html->tagValue('Video/id')); ?>23 <li><?php echo $html->link('List Videos', array('action'=>'index')); ?></li>24 <li><?php echo $html->link('View Copyrights', array('controller'=> 'copyrights', 'action'=>'view')); ?></li>25 <li><?php echo $html->link('Add Copyrights', array('controller'=> 'copyrights', 'action'=>'add')); ?></li>26 <li><?php echo $html->link('View Users', array('controller'=> 'users', 'action'=>'view')); ?></li>27 <li><?php echo $html->link('Add Users', array('controller'=> 'users', 'action'=>'add')); ?></li>28 <li><?php echo $html->link('View Subjects', array('controller'=> 'subjects', 'action'=>'view')); ?></li>29 <li><?php echo $html->link('Add Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?></li>30 </ul>31 </div>branch/views/videos/admin_index.ctp
r55 r131 3 3 4 4 <table cellpadding="0" cellspacing="0"> 5 <thead> 5 6 <tr> 6 7 <th><?php echo $paginator->sort('id');?></th> … … 18 19 <th>Actions</th> 19 20 </tr> 21 </thead> 22 <tbody> 20 23 <?php foreach ($videos as $video): ?> 21 24 <tr> … … 39 42 </tr> 40 43 <?php endforeach; ?> 44 </tbody> 41 45 </table> 42 46 43 47 </div> 44 48 <div class="paging"> 45 <?php echo $paginator->prev('<< previous', array(), null, array('class'=>'disabled'));?> 46 | 47 <?php echo $paginator->next('next >>', array(), null, array('class'=>'disabled'));?> 48 </div> 49 <div class="actions"> 50 <ul> 51 <li><?php echo $html->link('New Video', array('action'=>'add')); ?></li> 52 </ul> 53 </div> 49 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> 50 | <?php echo $paginator->numbers();?> 51 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> 52 </div> branch/views/videos/edit.ctp
r55 r131 1 <div class="video"> 2 <h2>Edit Video</h2> 1 <?php e($javascript->link('forminit'));?> 2 3 <div class="video-form"> 4 <h2>New Video Playlist</h2> 3 5 <?php echo $form->create('Video');?> 4 <?php echo $form->input('id');?> 5 <?php echo $form->input('title', array('class' => 'required'));?> 6 <?php echo $form->input('url', array('class' => 'required'));?> 7 <?php echo $form->input('video_location', array('class' => 'required'));?> 8 <?php echo $form->input('video_date', array('class' => 'required'));?> 9 <?php echo $form->input('body', array('class' => 'required'));?> 10 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 11 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 12 <?php echo $form->input('published', array('class' => 'required'));?> 13 <?php echo $form->input('user_id', array('class' => 'required', 'options' => $users));?> 14 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 15 <?php echo $form->input('tags', array('class' => 'required'));?> 16 <?php echo $form->input('Tag/Tag', array('options' => $tags, 'multiple' => 'multiple'));?> 17 <?php echo $form->submit('Update');?> 6 7 <fieldset id="main-content"> 8 <legend>Main Content</legend> 9 <?php echo $form->input('id');?> 10 <?php echo $form->input('title', array('class' => 'required'));?> 11 <?php echo $form->input('url', array('class' => 'required'));?> 12 <?php echo $form->input('video_location', array('class' => 'required'));?> 13 <?php echo $form->input('video_date', array('class' => 'required'));?> 14 <?php echo $form->input('body',array('class'=>'wymeditor'));?> 15 </fieldset> 16 <fieldset id="main-content"> 17 <legend>Meta Data</legend> 18 <?php echo $form->input('copyright_owner', array('class' => 'required'));?> 19 <?php echo $form->input('copyright_id', array('class' => 'required', 'options' => $copyrights));?> 20 <?php echo $form->input('subject_id', array('class' => 'required', 'options' => $subjects));?> 21 <?php echo $form->input('tags', array('class' => 'tags', 'type'=>'text'));?> 22 </fieldset> 23 <fieldset id="main-content"> 24 <legend>Publishing Options</legend> 25 <?php echo $form->input('published', array('class' => 'required'));?> 26 </fieldset> 27 <?php echo $form->submit('Add', array('class'=>'wymupdate'));?> 18 28 </form> 19 29 </div> 20 <div class="actions">21 <ul>22 <li><?php echo $html->link('Delete', array('action'=>'delete', $html->tagValue('Video/id')), null, 'Are you sure you want to delete #' . $html->tagValue('Video/id')); ?>23 <li><?php echo $html->link('List Videos', array('action'=>'index')); ?></li>24 <li><?php echo $html->link('View Copyrights', array('controller'=> 'copyrights', 'action'=>'view')); ?></li>25 <li><?php echo $html->link('Add Copyrights', array('controller'=> 'copyrights', 'action'=>'add')); ?></li>26 <li><?php echo $html->link('View Users', array('controller'=> 'users', 'action'=>'view')); ?></li>27 <li><?php echo $html->link('Add Users', array('controller'=> 'users', 'action'=>'add')); ?></li>28 <li><?php echo $html->link('View Subjects', array('controller'=> 'subjects', 'action'=>'view')); ?></li>29 <li><?php echo $html->link('Add Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?></li>30 </ul>31 </div>branch/webroot/js/forminit.js
r124 r131 40 40 41 41 $j(".tags").autocomplete("/tags/autocomplete", { multiple: true, mustMatch: false }); 42 43 $j('#UserPasswd').pstrength(); 44 45 $j('a.delete').bind('click', function(){ 46 var deletelink = this; 47 var deleteid = $(deletelink).attr('id'); 48 var x=window.confirm("Are you sure you want to delete?") 49 if(x) { 50 $j.post(deletelink.href, {id: deleteid}, function(deleteid){ 51 $j(deletelink).parent().parent().slideUp('slow').remove(); 52 }); 53 return false; 54 } else { 55 return false; 56 } 57 }); 42 58 }); branch/webroot/js/jquery.passstrength.js
r130 r131 128 128 ctlText.innerHTML = "<span style='color: " + strColor + ";'>" + strText + "</span>"; 129 129 } 130 131 // Checks a string for a list of characters132 function doesContain(strPassword, strCheck)133 {134 nCount = 0;135 for (i = 0; i < strPassword.length; i++)136 {137 if (strCheck.indexOf(strPassword.charAt(i)) > -1)138 {139 nCount++;140 }141 }142 return nCount;143 }144 130 145 131 $.fn.extend({ 146 /* ability: function(settings)132 /* pstrength: function(settings) 147 133 * The constructor method 148 * Example: $(). ability();134 * Example: $().pstrength(); 149 135 */ 150 136 pstrength: function(settings) { branch/webroot/js/webrocket.js
r128 r131 54 54 55 55 $j('#login').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'normal' }); 56 $j('#admin-tabs').tabs({ remote: true });56 $j('#admin-tabs').tabs({ remote: true, fxFade: true, fxSpeed: 'normal' }); 57 57 58 58 $j('form#ImageAddForm').ajaxForm({success: showResponse}); 59 function showResponse(){ 60 console.log(this); 61 } 59 62 60 63 $j('#accessibility').ability(); … … 62 65 $j('#UserPasswd').pstrength(); 63 66 64 function showResponse(){ 65 console.log(this); 66 } 67 $j('a.delete').bind('click', function(){ 68 var deletelink = this; 69 var deleteid = $(deletelink).attr('id'); 70 var x=window.confirm("Are you sure you want to delete?") 71 if(x) { 72 $j.post(deletelink.href, {id: deleteid}, function(deleteid){ 73 $j(deletelink).parent().parent().slideUp('slow').remove(); 74 }); 75 return false; 76 } else { 77 return false; 78 } 79 }); 67 80 });