- Timestamp:
- 10/11/08 22:19:40 (7 weeks ago)
- Location:
- trunk/app
- Files:
-
- 8 modified
-
app_controller.php (modified) (3 diffs)
-
config/core.php (modified) (3 diffs)
-
controllers/news_controller.php (modified) (1 diff)
-
controllers/newsletters_controller.php (modified) (1 diff)
-
locale/spa/LC_MESSAGES/default.po (modified) (2 diffs)
-
views/newsletters/admin_add.ctp (modified) (1 diff)
-
views/newsletters/admin_listing.ctp (modified) (3 diffs)
-
views/newsletters/display.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/app_controller.php
r787 r809 16 16 public $components = array('Auth', 'Cookie', 'Session'); // set Security component later 17 17 18 public $helpers = array('Html', 'Form', 'Session'); 18 public $helpers = array('Html', 'Form', 'Session'); // 'Cache' 19 19 20 20 public function beforeFilter() 21 21 { 22 //$this->cacheAction = true; 23 22 24 //set locale (es or en by now) 23 25 $this->__setLocale(); … … 43 45 endif; 44 46 45 return true;47 return false; 46 48 } 47 49 … … 66 68 $this->Session->write('lang',$lang); 67 69 endif; */ 68 $lang = 'e n';70 $lang = 'es'; 69 71 $this->L10n->get($lang); 70 72 Configure::write('Config.language', $lang); -
trunk/app/config/core.php
r731 r809 56 56 * 57 57 */ 58 //Configure::write('Cache.check', true);58 // Configure::write('Cache.check', true); 59 59 /** 60 60 * Defines the default error type when using the log() function. Used for … … 199 199 * ); 200 200 */ 201 Cache::config('default', array('engine' => 'File')); 201 Cache::config('default', array('engine' => 'File')); 202 202 203 203 204 /* Cache::config('default', array('engine' => 'Xcache', //[required] … … 205 206 'probability'=> 100, //[optional] 206 207 'user' => 'aarkerio', //user from xcache.admin.user settings 207 'password' => ' kunst99' //plaintext password (xcache.admin.pass)208 'password' => 'dfdgdf' //plaintext password (xcache.admin.pass) 208 209 ) 209 210 ); */ -
trunk/app/controllers/news_controller.php
r792 r809 15 15 16 16 public $name = 'News'; 17 18 public $helpers = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 19 17 public $helpers = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 20 18 public $components = array('Portal'); 21 22 19 public $paginate = array('limit' => 8, 'page' => 1, 'order' => array('News.id' => 'DESC')); 23 20 -
trunk/app/controllers/newsletters_controller.php
r785 r809 12 12 class NewslettersController extends AppController{ 13 13 14 public $helpers = array('Ajax', 'Fck', 'Gags'); 14 public $name = 'Newsletters'; 15 public $helpers = array('Ajax', 'Fck', 'Gags'); 16 public $components = array('Portal', 'Email'); 15 17 16 public $components = array('Portal', 'Email'); 17 18 public function beforeFiler() 18 public function beforeFilter() 19 19 { 20 parent::beforeFilter(); 21 $this->Auth->allow(array(' subscribe', 'display', 'view'));20 parent::beforeFilter(); 21 $this->Auth->allow(array('view', 'display', 'subscribe')); 22 22 } 23 23 24 24 public function subscribe() 25 25 { 26 $this->layout = 'portal'; 27 $this->Portal->statics(); // Charge Portal components aka Sidebars 26 $this->pageTitle = __('Newsletters', true); 27 $this->layout = 'portal'; 28 $this->Portal->statics(); // Charge Portal components aka Sidebars 28 29 } 29 30 30 public function display( $page=1)31 public function display() 31 32 { 32 $this->layout = 'portal'; 33 $this->pageTitle = __('Newsletters', true); 34 $this->layout = 'portal'; 35 $conditions = array('Newsletter.status'=>1); 36 $fields = array('Newsletter.id', 'Newsletter.title', 'Newsletter.body', 'Newsletter.created', 'Newsletter.user_id'); 37 $order = 'Newsletter.id DESC'; 38 $limit = 20; 33 39 34 $conditions = array("Newsletter.status"=>1); 35 $fields = array("Newsletter.id", "Newsletter.title", "Newsletter.body", "Newsletter.created", "Newsletter.user_id"); 36 $order = "Newsletter.id DESC"; 37 $limit = 20; 38 39 $this->set('data', $this->Newsletter->findAll($conditions, $fields, $order, $limit)); 40 41 $this->Portal->statics(); // Using Portal component 40 $this->set('data', $this->Newsletter->findAll($conditions, $fields, $order, $limit)); 41 $this->Portal->statics(); // Using Portal component 42 42 } 43 43 44 44 public function view($id) 45 45 { 46 $conditions = array("estado"=>1, "id"=>$id); 47 $fields = array("id", "title", "body", "fecha", "referencia", "subject_id", "iduser"); 48 $order = "id DESC"; 49 $limit = 10; 50 51 $this->pageTitle = 'Noticias'; 52 $this->set('data', $this->Newsletter->findAll($conditions, $fields)); 53 54 $this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars 46 $this->pageTitle = __('Newsletter', true); 47 $conditions = array('status'=>1, 'id'=>$id); 48 $fields = array('id', 'title', 'body', 'created'); 49 $this->set('data', $this->Newsletter->find($conditions, $fields)); 50 $this->Portal->statics(); // Charge Portal components aka Sidebars 55 51 } 56 52 -
trunk/app/locale/spa/LC_MESSAGES/default.po
r806 r809 4 4 msgid "Yes" 5 5 msgstr "Si" 6 7 msgid "No published newsletters yet" 8 msgstr "Aún no se han publicado boletines" 9 10 msgid "Subscribe to newsletter" 11 msgstr "SuscrÃbase al boletÃn" 6 12 7 13 msgid "Search Results" … … 788 794 msgstr "Subir" 789 795 796 msgid "Sent" 797 msgstr "Enviado" 798 799 msgid "New newsletter" 800 msgstr "Nuevo boletÃn" 801 790 802 msgid "Teacher tools" 791 803 msgstr "Herramientas pedagógicas" -
trunk/app/views/newsletters/admin_add.ctp
r794 r809 1 1 <?php 2 echo $javascript->link('myfunctions');3 2 echo $javascript->link('fckeditor/fckeditor'); 4 3 5 echo $html->addCrumb('Control Tools', '/admin/entries/start');6 echo $html->addCrumb( 'Entries', '/admin/newsletters/listing');7 echo $html->getCrumbs(' /');4 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 5 echo $html->addCrumb(__('Newsletters', true), '/admin/newsletters/listing'); 6 echo $html->getCrumbs('/'); 8 7 9 8 echo $form->create('Newsletter'); 10 9 ?> 11 12 10 <fieldset> 13 <legend> New newsletter</legend>11 <legend><?php __('New newsletter'); ?></legend> 14 12 15 13 <table style="margin:0 auto 0 auto;"> 16 <tr> 17 <td> 18 <?php 19 echo $form->input('Newsletter.title', array("size" => 50, "maxlength" => 50)); 20 ?> 14 <tr><td> 15 <?php echo $form->input('Newsletter.title', array('size'=>50, 'maxlength' => 50, 'label'=>__('Title', true))); ?> 21 16 </td> 22 <td>17 <td> 23 18 <?php 24 echo $html->link($html->image('admin/myimages.jpg', array('alt'=> 'My Images', 'title'=>'My Images')),19 echo $html->link($html->image('admin/myimages.jpg', array('alt'=>__('My Images', true), 'title'=>__('My Images', true))), 25 20 '#', 26 array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false); ?> </p>21 array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false); ?> 27 22 </td> 28 </tr> 29 <tr><td colspan="2"> 30 <?php 31 echo $form->label('Newsletter.Body', 'Text:'); 32 echo $form->textarea('Newsletter.body', array('cols'=>60, 'rows'=>17)); 33 echo $fck->load('NewsletterBody', 'Karamelo'); 34 ?> 35 </td> 23 </tr> 24 <tr><td colspan="2"> 25 <?php 26 echo $form->textarea('Newsletter.body', array('cols'=>60, 'rows'=>17)); 27 echo $fck->load('NewsletterBody', 'Karamelo'); 28 ?> 29 </td> 36 30 </tr> 37 31 <tr> 38 <td> 39 <?php 40 echo $form->label('Newsletter.status', 'Published:'); 41 echo $form->checkbox('Newsletter.status'); 42 ?> 43 </td> 44 <td> 45 <?php 46 echo $form->label('Newsletter.end', 'Finish edition:' ); 47 echo $form->checkbox('Newsletter.end'); 48 ?> 49 </td> 50 </tr> 51 <tr><td colspan="2"></fieldset> 52 <?php echo $form->end('Save'); ?> 32 <td> 33 <?php 34 echo $form->label('Newsletter.status', __('Published', true)); 35 echo $form->checkbox('Newsletter.status'); 36 ?> 37 </td> 38 <td> 39 <?php 40 echo $form->label('Newsletter.end', __('Finish edition', true) ); 41 echo $form->checkbox('Newsletter.end'); 42 ?> 43 </td> 44 </tr> 45 <tr><td colspan="2"> 46 <?php echo $form->end(__('Save', true)); ?> 47 </fieldset> 53 48 </td></tr> 54 49 </table> -
trunk/app/views/newsletters/admin_listing.ctp
r277 r809 1 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 1 <?php 2 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 3 echo $html->getCrumbs(' / '); 2 4 3 <?php echo $html->getCrumbs(' / '); ?> 5 echo $html->div('title_section', __('Newsletters', true)); 4 6 5 <div class="title_section">Newsletters</div> 6 7 <p> 8 <?php 9 echo $html->link($html->image('actions/new.png', array("alt"=>"Add entry", "title"=>"Add entry")), '/admin/newsletters/add', null, false, false); 7 echo $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/newsletters/add', null, false, false); 10 8 ?> 11 </p>12 9 <table class="tbadmin"> 13 10 <?php 14 $th = array ('Edit', 'Title', 'Status', 'Delivered', 'Send', 'Delete');11 $th = array(__('Edit', true), __('Title', true), 'Status', __('Delivered', true), __('Sent', true), __('Delete', true)); 15 12 echo $html->tableHeaders($th); 16 foreach ($data as $val) {17 $delivered = ($val['Newsletter']['delivered'] == 0) ? 'No' : 'Yes';13 foreach ($data as $val): 14 $delivered = ($val['Newsletter']['delivered'] == 0) ? 'No' : __('Yes', true); 18 15 $tr = array ( 19 16 $gags->sendEdit($val['Newsletter']['id'], 'newsletters'), … … 21 18 $gags->setStatus($val['Newsletter']['status']), 22 19 $delivered, 23 $html->link($html->image('admin/send.gif', array( "alt"=>"Send", "title"=>"Send")),20 $html->link($html->image('admin/send.gif', array('alt'=>__('Send', true), 'title'=>__('Send', true))), 24 21 '/admin/newsletters/send/'.$val['Newsletter']['id'], null, null, false), 25 22 $gags->confirmDel($val['Newsletter']['id'], 'newsletters') … … 28 25 echo $html->tableCells($tr, array("class"=>"altRow", "onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='altRow'"), 29 26 array('class'=>'evenRow',"onmouseover"=>"this.className='highlight'", "onmouseout"=>"this.className='evenRow'")); 30 } 27 endforeach; 31 28 ?> 32 29 </table> 33 34 30 <?php 35 31 //echo $pagination; -
trunk/app/views/newsletters/display.ctp
r541 r809 1 1 <?php 2 2 3 echo $html->div('title_ section', 'Newsletters');3 echo $html->div('title_portal', __('Newsletters', true)); 4 4 5 if ( count($data) == 0):6 echo $html-> div('notice', 'Newsletter not yet done');5 if ( count($data) === 0): 6 echo $html->para('notice', __('No published newsletters yet', true)); 7 7 endif; 8 8 //die(var_dump($data)); 9 9 10 foreach ($data as $val):10 foreach ($data as $val): 11 11 $tmp = $html->div('news_title', $val['Newsletter']['title']); 12 12 $tmp .= $html->div('news_date', $val['Newsletter']['created']); 13 13 $tmp .= $html->div('news_body', $val['Newsletter']['body']); 14 15 14 echo $html->div('wrapnew', $tmp); 16 15 endforeach; 17 16 18 17 if ( $session->check('Auth.User') ): 19 echo $html->para(null, $html->link( 'Subscribe to newsletter', '/newsletters/subscribe'));18 echo $html->para(null, $html->link(__('Subscribe to newsletter', true), '/newsletters/subscribe')); 20 19 endif; 21 20 ?>
