Changeset 491

Show
Ignore:
Timestamp:
05/15/08 14:24:46 (8 months ago)
Author:
aarkerio
Message:

Message interfase

Location:
trunk/app
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/app_controller.php

    r427 r491  
    1818 public function beforeFilter() 
    1919 { 
    20      $this->Auth->fields = array('username' => 'email', 'password' => 'pwd'); 
    21      $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); 
    22      $this->Auth->loginRedirect = array('controller' => 'news', 'action' => 'display'); 
     20     $this->Auth->fields         = array('username' => 'email', 'password' => 'pwd'); 
     21     $this->Auth->loginAction    = array('controller' => 'users', 'action' => 'login'); 
     22     $this->Auth->loginRedirect  = array('controller' => 'news', 'action' => 'display'); 
    2323     $this->Auth->logoutRedirect = '/news/display'; 
    24      $this->Auth->loginError = 'Invalid e-mail / password combination. Please try again'; 
    25      $this->Auth->authorize = 'controller';   
     24     $this->Auth->loginError     = 'Invalid e-mail / password combination. Please try again'; 
     25     $this->Auth->authorize      = 'controller';   
     26     $this->Auth->autoRedirect   = true; 
    2627     $this->Auth->deny('*'); 
    27      $this->Auth->autoRedirect = true; 
    28      $this->set('cU', $this->Auth->user());  // $cU current user array to use in the views if user logged 
     28    
     29     $this->set('cU', $this->Auth->user());  // $cU current user array to use in the views if user logged in 
    2930 } 
    3031   
  • trunk/app/controllers/entries_controller.php

    r404 r491  
    3939 { 
    4040      $user_id = $this->Entry->User->field('id', array('User.username'=>$username)); 
    41  
    42       $this->Entry->unbindModel(array('hasMany'=>array('Comment'))); 
    43        
     41      $this->Entry->unbindModel(array('hasMany'=>array('Comment')));       
    4442      $this->layout    = 'rss'; 
    45        
    4643      $conditions      = array("Entry.status"=>1, "Entry.user_id"=>$user_id); 
    47        
    4844      $fields          = array("Entry.id", "Entry.title", "Entry.created", "Entry.body", "Entry.subject_id", "Entry.user_id", "User.username"); 
    49        
    5045      $order           = 'Entry.id DESC'; 
    51        
    5246      $limit           = 20; 
    5347       
  • trunk/app/views/entries/rss.ctp

    r431 r491  
     1<?php  
     2die(debug($data));  
     3?> 
    14<rss version="2.0"> 
    25<channel> 
     
    710 
    811<?php 
    9 /// die(var_dump($data));  
    10  
    11 foreach ($data as $v)  
    12  
    13      
     12foreach ($data as $v):   
     13    die(debug($v)); 
    1414    $body   = substr($v["Entry"]['body'],0,300) . "..."; 
    1515?> 
    1616 <item> 
    17         <title><?php echo $v["Entry"]['title']; ?></title> 
    18         <link>http://<?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></link> 
    19         <comments><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo  $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></comments> 
     17   <title><?php echo $v["Entry"]['title']; ?></title> 
     18   <link>http://<?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></link> 
     19   <comments><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo  $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></comments> 
    2020         <description><![CDATA['<?php echo $body ?>']]></description> 
    2121        <pubDate><?php  echo $v["Entry"]['created'] ?></pubDate> 
     
    2323        <category><?php echo $v["Entry"]['subject_id']; ?></category> 
    2424        <guid><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></guid> 
    25     </item> 
    26 <?php } ?>  
     25</item> 
     26<?php endforeach; ?>  
    2727 
    2828</channel> 
  • trunk/app/views/messages/display.ctp

    r484 r491  
    77<?php 
    88 
    9 echo '<b>From</b>:'     . $data["User"]["username"]  . '<br />'; 
    10 echo '<b>Subject</b>: ' . $data["Message"]["title"]  . '<br />'; 
     9echo '<b>From</b>:'     . $data['User']['username']  . '<br />'; 
     10echo '<b>Subject</b>: ' . $data['Message']['title']  . '<br />'; 
    1111echo '<div style="padding:5px;background-color:#e7e6e6;margin:5px;">' . $data['Message']['body'] .'</div>'; 
    1212 
     
    1414 
    1515echo $ajax->div("delbutton", array("style"=>"text-align:right")); 
    16    echo $gags->confirmDel($data['Message']['id'], 'messages'); 
     16   echo $form->create('Message', array('onsubmit'=>'return confirm(\'Are you sure to delete?\')','action'=>'delete')); 
     17   echo $form->hidden('Message.id', array('value'=>$data['Message']['id'])); 
     18   echo $form->end('Delete'); 
    1719echo $ajax->divEnd("delbutton"); 
    1820?> 
     
    2325<?php 
    2426  echo $ajax->form();  
    25   echo $form->hidden('Message.username',   array("value"=>$cU['User']['username'])); 
    26   echo $form->hidden('Message.sender',  array("value"=>$cU['User']['id'])); 
    27   echo $form->hidden('Message.message_id', array("value"=> $data["Message"]["id"])); 
    28   echo $form->hidden('Message.user_id',    array("value"=> $data["Message"]["sender"]));  
     27  echo $form->hidden('Message.username',   array('value'=>$cU['User']['username'])); 
     28  echo $form->hidden('Message.sender',     array('value'=>$cU['User']['id'])); 
     29  echo $form->hidden('Message.message_id', array('value'=> $data["Message"]["id"])); 
     30  echo $form->hidden('Message.user_id',    array('value'=> $data["Message"]["sender"]));  
    2931?> 
    3032<fieldset> 
     
    3537  echo $form->input('Message.title', array("size" => 35, "maxlength" => 50, "value"=> 'Re: ' . $data["Message"]["title"])) . "<br />"; 
    3638  echo $form->label('Message.body', 'Message:').'<br />'; 
    37   echo $form->textarea('Message.body', array("cols"=>50, "rows"=>10, "value"=>"\n\n".'>> '.$data["User"]["username"] . ' wrote: ' . $data["Message"]["body"])); 
    38   echo $fck->load('MessageBody', 'Basic', 600, 160);  
    39  
     39  echo $form->textarea('Message.body', array("cols"=>50, "rows"=>10, "value"=>"\n\n".'>> '.$data["User"]["username"] .' wrote: ' . $data["Message"]["body"])); 
    4040  echo $ajax->submit('Reply', array("url" => "/messages/add",  
    4141                                         "update"=>"formhidden", 
  • trunk/app/views/messages/sentmessages.ctp

    r490 r491  
    2222     
    2323} 
    24   
    25  
    2624?> 
    27  
    28 </td></tr> 
    2925</table> 
    3026<script language="Javascript" type="text/javascript"> 
  • trunk/app/views/users/edit.ctp

    r480 r491  
    3030  echo $form->textarea('User.cv', array("cols" => 50, "rows" => 7)); 
    3131   
    32   echo $form->input('User.quote', array("size" => 50, "maxlength" => 150)); 
     32  echo $form->input('User.quote', array("size" =>30, "maxlength"=>150)); 
    3333   
    3434  echo $form->label('User.newsletter', 'Subscribe to newsletter:' );