Changeset 620
- Timestamp:
- 07/02/08 18:44:15 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 11 modified
-
controllers/news_controller.php (modified) (2 diffs)
-
locale/spa/LC_MESSAGES/default.po (modified) (5 diffs)
-
views/elements/poll.ctp (modified) (2 diffs)
-
views/helpers/gags.php (modified) (3 diffs)
-
views/layouts/admin.ctp (modified) (1 diff)
-
views/news/admin_add.ctp (modified) (4 diffs)
-
views/news/admin_edit.ctp (modified) (4 diffs)
-
views/news/admin_listing.ctp (modified) (3 diffs)
-
views/news/display.ctp (modified) (2 diffs)
-
views/news/view.ctp (modified) (2 diffs)
-
webroot/css/portal/portal.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/news_controller.php
r540 r620 38 38 $order = "News.id DESC"; 39 39 40 $limit = 10;41 42 $this->set('data', $this->News->findAll($conditions, $fields, $order ));40 $limit = 8; 41 42 $this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); 43 43 44 44 $this->Portal->statics(); // Charge Portal components aka Sidebars … … 126 126 127 127 // change user status actived/no actived 128 public function admin_change($ id, $status)128 public function admin_change($status, $news_id) 129 129 { 130 130 $this->data['News']['status'] = ($status == 0 ) ? 1 : 0; 131 131 132 $this->data['News']['id'] = $ id;132 $this->data['News']['id'] = $news_id; 133 133 134 if ($this->News->save($this->data['News'])) 135 { 136 $this->msgFlash('News status changed', '/admin/news/listing'); 137 } 134 if ($this->News->save($this->data['News'])): 135 $this->msgFlash(__('Status modified', true), '/admin/news/listing'); 136 endif; 138 137 } 139 138 -
trunk/app/locale/spa/LC_MESSAGES/default.po
r617 r620 1 1 msgid "Delete" 2 msgstr " Remover"2 msgstr "Eliminar" 3 3 4 4 msgid "Edit" … … 17 17 msgstr "Archivo" 18 18 19 msgid "Send comment" 20 msgstr "Enviar comentario" 21 22 msgid "Write comment" 23 msgstr "Comentar" 24 25 msgid "write" 26 msgstr "escribe" 27 28 msgid "Total votes" 29 msgstr "Votos totales" 30 19 31 msgid "File saved" 20 32 msgstr "Archivo guardado" … … 41 53 msgstr "Inicio" 42 54 55 msgid "Title" 56 msgstr "TÃtulo" 57 43 58 msgid "logged_in" 44 59 msgstr "Estás logeado como" … … 46 61 msgid "from_dep" 47 62 msgstr "Desde la redaccion" 63 64 msgid "Are you sure to want to delete this?" 65 msgstr "¿Está seguro de eliminar este registro?" 48 66 49 67 msgid "about_college" … … 200 218 msgstr "Publicado" 201 219 220 msgid "Draft" 221 msgstr "Borrador" 222 223 msgid "Status modified" 224 msgstr "Estado modificado" 225 202 226 msgid "Hidden" 203 227 msgstr "Oculto" -
trunk/app/views/elements/poll.ctp
r458 r620 10 10 $poll = $session->read('poll'); 11 11 12 if ( $poll != null && $Element["Poll"]['Poll']['id'] == $poll) // the user has already voted, show poll results13 {12 if ( $poll != null && $Element["Poll"]['Poll']['id'] == $poll): // the user has already voted, show poll results 13 14 14 $total_votes = 0; 15 15 16 foreach ($Element["Poll"]["Pollrow"] as $key => $val) 17 { 18 $total_votes += $val["vote"]; // the total votes 19 } 16 foreach ($Element["Poll"]["Pollrow"] as $key => $val): 17 $total_votes += $val["vote"]; // the total votes 18 endforeach; 20 19 21 echo "<p><b>" . $Element["Poll"]['Poll']['question'] ."</b></p>";20 echo $html->para('negrita', $Element['Poll']['Poll']['question']); 22 21 23 foreach ($Element["Poll"]["Pollrow"] as $key => $val) 24 { 25 if ($val["vote"] > 0) 26 { 27 $percent = ($val["vote"] * 100) / $total_votes; // % = votes * 100 / total 28 } 29 else 30 { 22 foreach ($Element['Poll']['Pollrow'] as $val): 23 if ($val['vote'] > 0): 24 $percent = ($val['vote'] * 100) / $total_votes; // % = votes * 100 / total 25 else: 31 26 $percent = 0; 32 } 27 endif; 33 28 $width = number_format($percent, 0); 34 29 echo '<p><b>'.$val['answer'].'</b> '.number_format($percent, 2).'% <br />'; 35 30 echo $html->image('static/poll/'.$val["color"].'.png', array("height"=>"10", "width"=>$width, "alt"=>$val["answer"], "title"=>$val["answer"]) ); 36 31 echo " ". $val['vote']; 37 }32 endforeach; 38 33 39 echo '<p class="negrita">Total votes:' . $total_votes . '</p>';40 }41 else // the user has no voted, print the form42 { 34 echo $html->para('negrita', __('Total votes', true).':' . $total_votes); 35 36 else: // the user has no voted, print the form 37 43 38 echo $ajax->form(); 44 39 45 40 $array = array(); 46 41 47 echo "<p><b>" . $Element["Poll"]['Poll']['question'] ."</b></p>";42 echo $html->para('negrita', $Element['Poll']['Poll']['question']); 48 43 49 echo $form->hidden('Pollrow.poll_id', array( "value"=>$Element["Poll"]['Poll']['id'])); // Poll_id44 echo $form->hidden('Pollrow.poll_id', array('value'=>$Element['Poll']['Poll']['id'])); // Poll_id 50 45 51 foreach ($Element["Poll"]['Pollrow'] as $key=>$val) 52 { 53 $array[$val['id']] = $val['answer']; // construct id->value array 54 } 46 foreach ($Element['Poll']['Pollrow'] as $val): 47 $array[$val['id']] = $val['answer']; // construct id->value array 48 endforeach; 55 49 56 50 echo '<span style="font-size:7pt">'; … … 64 58 )); 65 59 echo '</span></form>'; 66 } 67 60 endif; 68 61 ?> 69 62 </div> -
trunk/app/views/helpers/gags.php
r455 r620 14 14 public function confirmDel($id, $model) 15 15 { 16 $msg = __('Are you sure to want to delete this?', true); 17 $strB = $this->Form->create($model, array('action'=>'/admin_delete/'.$id, "onsubmit"=>"return confirm('".$msg."')")); 18 $strB .= $this->Form->end(__('Delete', true)); 16 19 17 $strB = $this->Form->create($model, array('action'=>'/admin_delete/'.$id, "onsubmit"=>"return confirm('Are you sure to delete?')")); 18 $strB .= $this->Form->end('Delete'); 19 20 return $strB; 20 return $strB; 21 21 } 22 22 … … 25 25 26 26 $strB = $this->Form->create($model, array('action'=>'admin_edit/'.$id)); 27 $strB .= $this->Form->end( 'Edit');27 $strB .= $this->Form->end(__('Edit', true)); 28 28 29 29 return $strB; … … 33 33 { 34 34 35 $status = ( $s == 1 ) ? 'Published' : 'Draft';35 $status = ( $s == 1 ) ? __('Published', true) : __('Draft', true); 36 36 37 37 return $status; -
trunk/app/views/layouts/admin.ctp
r613 r620 5 5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 6 6 <head> 7 <title>Karamelo </title>7 <title>Karamelo::cPanel</title> 8 8 <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> 9 9 <!--[if gte IE 5.5]> -
trunk/app/views/news/admin_add.ctp
r546 r620 3 3 echo $javascript->link('fckeditor/fckeditor'); 4 4 5 echo $html->addCrumb('Control Tools', '/admin/entries/start');6 echo $html->addCrumb( 'News', '/admin/news/listing');5 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 6 echo $html->addCrumb(__('News', true), '/admin/news/listing'); 7 7 echo $html->getCrumbs(' / '); 8 8 echo $form->create('News', array('onsubmit'=>'return validateNew()')); 9 9 10 echo $html->div('title_section', 'Add new');10 echo $html->div('title_section', __('Add new', true)); 11 11 ?> 12 12 <table> 13 13 <tr> 14 14 <td> 15 <?php16 echo $form->input('News.title', array( "size" => 40, "maxlength"=> 120));15 <?php 16 echo $form->input('News.title', array('size' => 40, 'maxlength' => 120)); 17 17 echo $form->error('News.title', 'Title is required.'); 18 ?> 19 </td> 20 <td> 21 <?php 22 echo $form->label('News.theme_id', 'Theme:'); 18 ?> 19 </td><td> 20 <?php 21 echo $form->label('News.theme_id', __('Theme', true)); 23 22 echo $form->select('News.theme_id', $themes, null, null, null, false, false); 24 23 ?> 25 </td> 26 <td> 24 </td><td> 27 25 <?php 28 26 echo $form->input('News.reference', array('size'=> 30, 'maxlength'=> 250, 'value'=>'http://')); 29 27 ?> 30 </td> 31 <td> 32 <?php echo $html->link($html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false) ?></p> 28 </td><td> 29 <?php echo $html->link($html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false) ?></p> 33 30 </td></tr> 34 31 … … 40 37 ?> 41 38 </td></tr> 42 <tr><td colspan="2">39 <tr><td> 43 40 <?php 44 41 echo $form->label('News.status', 'Published:' ); 45 42 echo $form->checkbox('News.status', array('value'=>1)); 46 43 ?> 47 </td> 48 <td> 44 </td><td> 49 45 <?php 50 46 echo $form->label('News.comments', 'Comments actived:' ); … … 52 48 ?> 53 49 </td> 54 <td >50 <td colspan="2"> 55 51 <?php 56 52 echo $form->label('News.end', 'Finish editing:'); … … 60 56 </tr> 61 57 62 <tr><td colspan="4"> <?php echo $form->end( 'Save'); ?> </td></tr>58 <tr><td colspan="4"> <?php echo $form->end(__('Save', true)); ?> </td></tr> 63 59 64 60 </table> -
trunk/app/views/news/admin_edit.ctp
r401 r620 1 1 <?php 2 2 echo $javascript->link('fckeditor/fckeditor'); 3 echo $html->addCrumb('Control Tools', '/admin/entries/start');4 echo $html->addCrumb( 'News', '/admin/news/listing');3 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 4 echo $html->addCrumb(__('News', true), '/admin/news/listing'); 5 5 echo $html->getCrumbs(' / '); 6 6 … … 14 14 <td> 15 15 <?php 16 echo $form->input('News.title', array('size' => 40, 'maxlength' => 120 ));16 echo $form->input('News.title', array('size' => 40, 'maxlength' => 120, 'label'=>__('Title', true))); 17 17 echo $form->error('News.title', 'Title is required.'); 18 18 ?> … … 34 34 <?php 35 35 echo $form->label('News.Body', 'Body:') . '<br />'; 36 echo $form->textarea('News.body', array('cols'=> 80, 'rows'=>35));36 echo $form->textarea('News.body', array('cols'=>90, 'rows'=>35)); 37 37 echo $fck->load('NewsBody', 'Karamelo'); 38 38 ?> … … 58 58 </td> 59 59 </tr> 60 <tr><td colspan="4"> <?php echo $form->end('Save'); ?></td></tr>60 <tr><td colspan="4"> <?php echo $form->end(__('Save', true)); ?></td></tr> 61 61 </table> -
trunk/app/views/news/admin_listing.ctp
r407 r620 1 <div class="title_section">News</div> 2 3 <p> 4 <?php 5 echo $html->link($html->image('actions/new.png', array("alt"=>"Add new", "title"=>"Add new")), '/admin/news/add', null, false, false); 6 echo $html->link($html->image('static/forum.gif', array("alt"=>"See comments", "title"=>"See comments")), '/admin/discussions/listing', null, false, false); 7 ?> 8 9 </p> 10 1 <?php 2 echo $html->div('title_section', __('News', true)); 3 echo $html->link($html->image('actions/new.png', array("alt"=>"Add new", "title"=>"Add new")), '/admin/news/add', null, false, false); 4 echo $html->link($html->image('static/forum.gif', array("alt"=>"See comments", "title"=>"See comments")), '/admin/discussions/listing', null, false, false); 5 ?> 11 6 <table class="tbadmin"> 12 13 7 <?php 14 //die(print_r($data));15 8 16 9 $th = array ('Edit', 'Title', 'Status', 'Delete'); 17 10 echo $html->tableHeaders($th); 18 foreach ($data as $key=>$val) 19 { 20 11 foreach ($data as $key=>$val): 12 $st = ($val['News']['status']) ? __('Published', true) : __('Draft', true); 21 13 $tr = array ( 22 14 $gags->sendEdit($val['News']['id'], 'news'), 23 15 $val['News']['title'], 24 $ gags->setStatus($val['News']['status']),16 $html->link($st, '/admin/news/change/'.$val['News']['status'].'/'.$val['News']['id']), 25 17 $gags->confirmDel($val['News']['id'], 'news') 26 18 ); … … 29 21 array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'")); 30 22 31 } 23 endforeach; 32 24 ?> 33 25 </table> … … 36 28 // echo $pagination; 37 29 ?> 38 -
trunk/app/views/news/display.ctp
r604 r620 2 2 // die(debug($_SERVER)); 3 3 4 echo $html->div('title_portal', __( "news_campus", true));4 echo $html->div('title_portal', __('News on Campus', true)); 5 5 6 6 foreach ($data as $val): … … 47 47 false); 48 48 49 echo $news->socialNets($val['News']['id'], $val['News']['title']); // Social nets buttons49 echo $news->socialNets($val['News']['id'], $val['News']['title']); // Social nets buttons 50 50 51 52 53 51 echo '</div>'; 54 52 endforeach; -
trunk/app/views/news/view.ctp
r604 r620 1 1 <?php 2 2 // die(debug($data)); 3 echo $html->div('titnew', $data['News']['title']); 3 4 echo $html->div('news_title', $html->link($data['News']['title'], '/news/view/'. $data['News']['id'])); 4 5 5 6 echo $html->div('redaccion', __('from_dep', true).'<i> '.$data['Theme']['theme'].'</i>, posted by '.$html->link($data['User']['username'], '/users/about/'.$data['User']['username']).' on '. $data['News']['created']); … … 58 59 ?> 59 60 <fieldset> 60 <legend> Write comment:</legend>61 <legend><?php __('Write comment'); ?></legend> 61 62 <?php 62 echo $form->label('Discussion.comment', '<b>'. $session->read('Auth.User.username') . '</b> write:').'<br />';63 echo $form->label('Discussion.comment', '<b>'. $session->read('Auth.User.username') .'</b> '. __('write', true) . ':<br />'); 63 64 echo $form->textarea('Discussion.comment', array('cols'=>60, 'rows'=>10)); 64 echo $form->end( 'Send comment');65 echo $form->end(__('Send comment', true)); 65 66 else: 66 echo $html->para(null, $html->link( 'Login to write comments', '/users/login'));67 echo $html->para(null, $html->link(__('Login to write comments', true), '/users/login')); 67 68 endif; 68 69 } -
trunk/app/webroot/css/portal/portal.css
r604 r620 213 213 214 214 #page { 215 width: 760px;215 width: 800px; 216 216 margin: 0 auto; 217 217 } … … 221 221 #content { 222 222 float: right; 223 width: 519px;223 width: 600px; 224 224 } 225 225 … … 232 232 #sidebar { 233 233 float: left; 234 width: 200px;235 padding: 0 20px 0 0;234 width: 180px; 235 padding: 0 10px 0 0; 236 236 border-right: 1px dotted #DCDCDC; 237 237 }
