Changeset 806 for trunk/app/views

Show
Ignore:
Timestamp:
10/10/08 21:03:41 (8 weeks ago)
Author:
aarkerio
Message:

Little changes

Location:
trunk/app/views
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/elements/search.ctp

    r404 r806  
    2525<?php  
    2626    echo $form->create('Entry', array('action'=>'search', 'onsubmit'=>"return chkSearch()")); 
    27     echo $form->input('Entry.terms', array('label'=>'', 'size' =>12, 'value' => "Search...", "maxlength" => 40,  
     27    echo $form->input('Entry.terms', array('label'=>'', 'size' =>12, 'value' => 'Search...', 'maxlength' => 40,  
    2828         "onblur" => "if(this.value=='') this.value='Search...';",  
    2929         "onfocus"=>"if(this.value=='Search...') this.value='';")); 
  • trunk/app/views/entries/search.ctp

    r541 r806  
    11<?php 
     2//die(debug($data)); 
     3echo $html->div('title_portal', __('Search Results', true)); 
    24 
    3 echo $html->div('title_section','Results'); 
     5if ( count($data) < 1 ): 
     6  echo $html->div(null, 'Sorry, no search results'); 
     7else: 
     8  $num = (count($data['News']) + count($data['Entry'])); 
     9  echo $html->div(null, $num.' results found'); 
     10endif; 
    411 
    5 echo '<div style="padding:4px;margin:4px;">'; 
     12if (count($data['Entry']) > 0 ): 
     13 echo $html->div(null, 'Edublogs', array('style'=>'margin-top:10px;padding:4px;background-color:#ecebeb;font-size:13pt;')); 
     14 foreach($data['Entry'] as $e): 
     15      $tmp  = $html->link($e[0]['title'], '/entries/view/'.$e[0]['id']).'<br />';  
     16      $tmp .= 'Rank:'.$e[0]['rank'] .'<br /> '. $e[0]['ts_headline']; 
     17       echo $html->div(null, $tmp, array('style'=>'padding:4px;font-size:10pt;')); 
     18 endforeach; 
     19endif; 
    620 
    7 //die(print_r($data)); 
     21if (count($data['News']) > 0 ): 
     22 echo $html->div(null, __('News', true), array('style'=>'margin-top:10px;padding:4px;background-color:#ecebeb;font-size:13pt;')); 
     23 foreach($data['News'] as $n): 
     24      $tmp  = $html->link($n[0]['title'], '/news/view/'.$n[0]['id']).'<br />';  
     25      $tmp .= 'Rank:'.$n[0]['rank'] .'<br /> '. $n[0]['ts_headline']; 
     26       echo $html->div(null, $tmp, array('style'=>'padding:4px;font-size:10pt;')); 
     27 endforeach; 
     28endif; 
    829 
    9 $Models = array('Entry'=>'entries', 'News'=>'news', 'Podcast'=>'podcasts', 'Faq'=>'faqs', 'Glossary'=>'glossaries', 'Lesson'=>'lessons'); 
    10  
    11 $i = 0; 
    12  
    13 foreach( $Models as $model => $controller) 
    14  
    15    if (count($data[$model]) > 1 )  
    16    {  
    17      $i++; 
    18      echo '<div style="padding:4px;background-color:#ecebeb;font-size:14pt;">' . $model . '</div>'; 
    19      echo "<p>" .count($data[$model]) . " results found</p>"; 
    20        
    21      foreach ($data[$model] as $val)  
    22      {   
    23         switch($model) 
    24         { 
    25           case 'Entry': 
    26           echo '<p>'; 
    27            echo $html->link($val[$model]['title'], '/users/entry/' .$val[$model]['id'].'/'.$val[$model]['id']); 
    28               echo '</p>'; 
    29               break; 
    30                
    31           case 'News': 
    32               echo '<p><a href="/users/entry/' .$val[$model]['id'].'/'.$val[$model]['id'].'">' . $val[$model]['title'] . '</a></p>'; 
    33               break; 
    34                
    35           case 'Podcast': 
    36               echo '<p><a href="/users/entry/' .$val[$model]['id'].'/'.$val[$model]['id'].'">' . $val[$model]['title'] . '</a></p>'; 
    37               break; 
    38                
    39           case 'Faq': 
    40               echo '<p><a href="/users/entry/' .$val[$model]['id'].'/'.$val[$model]['id'].'">' . $val[$model]['question'] . '</a></p>'; 
    41               break; 
    42                
    43           case 'Glossary': 
    44               echo '<p><a href="/users/entry/' .$val[$model]['id'].'/'.$val[$model]['id'].'">' . $val[$model]['item'] . '</a></p>'; 
    45               break; 
    46                
    47           case 'Lesson': 
    48               echo '<p><a href="/users/entry/' .$val[$model]['id'].'/'.$val[$model]['id'].'">' . $val[$model]['title'] . '</a></p>'; 
    49               break; 
    50         } 
    51      } 
    52    } 
    53 } 
    54  
    55 if ( $i == 0): 
    56    echo "<h3>Sorry, no results found.</h3>"; 
    57 endif; 
    5830?> 
    59 </div> 
  • trunk/app/views/layouts/portal.ctp

    r682 r806  
    9696 
    9797   // search 
    98    //$list = array('<h2 class="bg3">'.__('Search', true).'</h2>'.$this->element('search')); 
    99    // echo $html->nestedList($list); 
     98   $list = array('<h2 class="bg3">'.__('Search', true).'</h2>'.$this->element('search')); 
     99   echo $html->nestedList($list); 
    100100 
    101101  $tmp  = $html->para(null,$html->link($html->image('static/valid_xhtml10_80x15_22.png'), 'http://www.w3.org/TR/xhtml1/', null, null, false));