Changeset 240
- Timestamp:
- 02/18/08 20:28:30 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 7 added
- 7 removed
- 3 modified
-
controllers/news_controller.php (modified) (2 diffs)
-
views/elements/lastentries.ctp (added)
-
views/elements/lastentries.thtml (deleted)
-
views/elements/login.ctp (added)
-
views/elements/login.thtml (deleted)
-
views/elements/login_hide.ctp (added)
-
views/elements/login_hide.thtml (deleted)
-
views/elements/menu_b.ctp (added)
-
views/elements/menu_b.thtml (deleted)
-
views/elements/poll.ctp (added)
-
views/elements/poll.thtml (deleted)
-
views/elements/search.ctp (added)
-
views/elements/search.thtml (deleted)
-
views/elements/search_blog.ctp (added)
-
views/elements/search_blog.thtml (deleted)
-
views/layouts/portal.ctp (modified) (5 diffs)
-
views/news/display.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/news_controller.php
r238 r240 11 11 class NewsController extends AppController { 12 12 13 public $helpers = array('Ajax', 'F orm', 'Fck', 'News', 'Time', 'Gags');14 15 public $components = array('Portal', 'Mypagination', 'Security', 'Session');13 public $helpers = array('Ajax', 'Fck', 'News', 'Time', 'Gags'); 14 15 //public $components = array('Portal'); 16 16 17 17 public function display($page=1) … … 23 23 $conditions = array("News.status"=>1); 24 24 25 $fields = array("News.id", "News.title", "News.comments", "News.body", "News.created", "News.reference", "News.theme_id", "News.user_id", "Theme.img", "Theme.theme", "User.username" );25 $fields = array("News.id", "News.title", "News.comments", "News.body", "News.created", "News.reference", "News.theme_id", "News.user_id", "Theme.img", "Theme.theme", "User.username", "Subject.title", "Subject.id"); 26 26 27 27 $order = "News.id DESC"; -
trunk/app/views/layouts/portal.ctp
r239 r240 1 1 <?php echo '<?xml version="1.0"?>'; ?> 2 < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">2 <?php echo $html->docType(); ?> 3 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 4 <head> 5 5 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 6 6 <title>Karamelo:: <?php echo $title_for_layout; ?> </title> 7 <meta name="keywords" content="education, school " />7 <meta name="keywords" content="education, school, elearning" /> 8 8 <meta name="description" content="Educational Portal" /> 9 9 <?php … … 23 23 <div id="toplinks"> 24 24 <?php 25 if ( $othAuth->sessionValid() )25 if ( isset( $cU['User']['id']) ) 26 26 { 27 27 echo '<span style="font-size:7pt;color:#8bb126;padding-right:15px">You are logged in as <b>'; 28 28 29 echo $ othAuth->user('username').'</b></span>'.$html->link('(Logout)', '/users/logout') . ' | ';29 echo $cU['User']['username'] .'</b></span>'.$html->link('(Logout)', '/users/logout') . ' | '; 30 30 31 31 if ( $othAuth->user('group_id') < 3 ) // the logged user is teacher or admin? … … 59 59 echo $this->renderElement('menu_b'); 60 60 61 if ( $othAuth->sessionValid() )61 if ( isset( $cU['User']['id']) ) 62 62 { 63 63 echo '<div class="spaced">'.$html->link('Logout','/users/logout').'</div>'; … … 68 68 } 69 69 70 echo $this->renderElement('lastentries', $Element["Lentry"]);70 // echo $this->renderElement('lastentries', $Element["Lentry"]); 71 71 echo '<br />'; 72 echo $this->renderElement('poll', $Element["Poll"]);72 //echo $this->renderElement('poll', $Element["Poll"]); 73 73 74 echo $this->renderElement('subjects');74 // echo $this->renderElement('subjects'); 75 75 ?> 76 <ul> 77 78 <li id="archives"> 79 <h2 class="bg3">Search</h2> 80 <?php echo $this->renderElement('search'); ?> 76 <ul> 77 <li id="archives"> 78 <h2 class="bg3">Search</h2> 79 <?php echo $this->renderElement('search'); ?> 81 80 </li> 82 81 </ul> … … 88 87 <div id="footer"> 89 88 90 <p><?php echo $this->renderElement('footer') . '<br /> ' . $this->renderElement('quote', $Element["Quote"]); ?></p> 89 <p><?php 90 // echo $this->renderElement('footer') . '<br /> ' . $this->renderElement('quote', $Element["Quote"]); 91 ?></p> 91 92 92 <p id="legal"><strong>Karamelo</strong> © 200 7. Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p>93 <p id="legal"><strong>Karamelo</strong> © 2002-2008. Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a></p> 93 94 <p id="links"> <a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a> | <a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a></p> 94 95 </div> 95 96 <!-- end footer --> 96 97 <?php 97 if ( ! $othAuth->sessionValid() )98 if ( !isset( $cU['User']) ) 98 99 { 99 100 echo $this->renderElement('login_hide'); -
trunk/app/views/news/display.ctp
r238 r240 1 <div class="titnew"><?php echo $data['News']['title']; ?></div> 2 <div class="redaccion">From <i><?php echo $data['Theme']['theme']; ?> dept</i>, 3 posted by <a style="font-size:7pt;" href="/users/blogger/<?php echo $data['User']['username']; ?>"><?php echo $data['User']['username']; ?></a> on <?php echo $data['News']['created']; ?></div> 4 <div class="bodynew"> 5 6 <div class="img_new"> 7 <?php echo $html->link( 8 $html->image('themes/'.$data['Theme']['img'], array("alt"=>$data['Theme']['theme'], "title"=>$data['Theme']['theme'], "class"=>"themes")), 9 '/news/category/' .$data['News']['theme_id'], 10 null, null, false); 11 ?> 12 </div> 13 14 <?php echo $data['News']['body']; ?> 15 16 <br /> 17 <span style="font-size:7pt;">Permalink:</span> <br /> 18 <a style="font-size:7pt;" href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/news/display/<?php echo $data['News']['id']; ?>">http://<?php echo $_SERVER['SERVER_NAME']; ?>/news/display/<?php echo $data['News']['id']; ?></a> 19 <br /><br /> 20 <b>Reference:</b> 21 22 <?php echo $html->link( 23 $html->image('static/newwindow.gif', array("alt"=>"Open new window", "title"=>"Open new window")), 24 $data['News']['reference'], 25 array("onclick"=>"window.open(this.href, '_help', 'status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"), 26 null, 27 null, 28 false); 29 30 31 echo $news->socialNets($data['News']['id'], $data['News']['title']); // Social nets buttons 32 33 if ( $data['News']['comments'] == 1 ) // comments are actived ?? 1 <div class="title_section">News</div> 2 3 <?php 4 //die(var_dump($data)); 5 6 foreach ($data as $key => $val) 7 { 8 echo "<div class=\"wrapnew\">"; 9 echo "<div class=\"news_title\">". $val['News']['title'] . "</div>"; 10 echo "<div class=\"news_date\">" . $val['News']['created'] . "</div>"; 11 echo "<div class=\"news_body\">"; 12 13 echo "Subject: ". $html->link($val['Subject']['title'], '/news/all/'.$val['Subject']['id'], null, false, false) . "<br /><br />"; 14 15 echo $val['News']['body'] . "</div>"; 16 17 if (strlen($val['News']['reference']) > 5 ) // the reference 34 18 { 35 $i = 1; 36 echo '<div id="cnews">'; 37 foreach($data["Commentnews"] as $v) 38 { 39 $bg = ($i%2==0) ? "#e2e2e2" : "#fff"; 40 41 echo '<div class="comentnew" style="background-color:'.$bg.'">'; 42 echo $time->timeAgoInWords($v["created"]) . " <b>". $v["name"] . "</b> wrote:<br />"; 43 echo $v["comment"]; 44 echo "</div>"; 45 $i++; 46 } 47 echo "</div>"; 19 echo "<div>". $html->link('Reference', $val['News']['reference']) ."</div>"; 20 } 21 22 echo "</div>"; 23 } 48 24 ?> 49 50 <p>51 <?php52 echo $html->formTag('/commentnews/add/','post', array("onsubmit"=>"return validateNew()"));53 echo $html->hiddenTag('Commentnews/new_id', $data['News']['id']);54 echo $html->hiddenTag('Commentnews/level', 1);55 echo $html->hiddenTag('Commentnews/comentnew_id', 1);56 ?>57 <fieldset>58 <legend>Add comment:</legend>59 60 <?php61 if ( $othAuth->user('username') )62 {63 echo $html->hiddenTag('Commentnews/user_id', $othAuth->user('id'));64 echo $html->hiddenTag('Commentnews/name', $othAuth->user('username'));65 echo '<b>'. $othAuth->user('username') . '</b> writes. ';66 }67 else68 {69 echo $html->hiddenTag('Commentnews/user_id', 0);70 echo $html->input('Commentnews/name', array("size" => 25, "maxlength" => 50));71 echo $form->labelTag( 'Commentnews/name', ' Name:' );72 echo $html->tagErrorMsg('Commentnews/name', 'Name is required.');73 74 echo '<br /><br /> <img src="'. $html->url('/comentnews/captcha') .'" alt="Captcha" /> <br />';75 echo $html->input('Commentnews/captcha', array("size" => 6, "maxlength" => 6));76 echo $form->labelTag( 'Commentnews/cptcha', 'Introduce el codigo, todas la letras son minusculas' );77 }78 ?>79 80 <?php echo $form->labelTag( 'Commentnews/comment', 'Comment:' );?><br />81 <?php echo $html->textarea('Commentnews/comment', array("cols"=>70, "rows"=>10)) ?>82 <?php echo $html->tagErrorMsg('Commentnews/comment', 'Comment is required.'); ?>83 <br />84 </p>85 86 <br />87 <?php echo $html->submit('Add comment') ?>88 </fieldset>89 </form>90 <?php } ?>91 </div>
