Changeset 541

Show
Ignore:
Timestamp:
05/21/08 15:27:00 (5 months ago)
Author:
aarkerio
Message:

New Try

Location:
trunk/app
Files:
72 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/app_controller.php

    r540 r541  
    2525     $this->Auth->authorize      = 'controller';   
    2626     $this->Auth->deny('*'); 
    27     
    28      $this->set('cU', $this->Auth->user());  // $cU current user array to use in the views if user logged in 
    2927 } 
    3028 
  • trunk/app/views/acquaintances/admin_listing.ctp

    r313 r541  
    11<?php  
    2      echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
    3      echo $html->getCrumbs(' / ');  
     2  echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
     3  echo $html->getCrumbs(' / ');  
     4  echo $html->div('title_section', $session->read('Auth.User.username') . '\'s Acquaintance'); 
    45?> 
    5  
    6 <div class="title_section"><?php echo $cU['User']['username']; ?>'s Acquaintances</div> 
    76 
    87<script type="text/javascript">  
     
    2221</script> 
    2322 
    24 <p><?php echo $html->link($html->image('actions/new.png', array("alt"=>"Add new link", "title"=>"Add new link")), '#', array("onclick"=>"hU()"), false, false); ?></p> 
     23<?php echo $html->para(null, $html->link($html->image('actions/new.png', array("alt"=>"Add new link", "title"=>"Add new link")), '#', array('onclick'=>'hU()'), false, false));  
     24?> 
    2525 
    2626<div id="trh" style="margin:0;padding:0;padding-left:40px;width:80%;display:none;"> 
    27 <?php echo $form->create('Acquaintance', array('action'=>'admin_add')); ?> 
     27<?php echo $form->create('Acquaintance', array('action'=>'add')); ?> 
    2828 <fieldset> 
    2929 <legend>New Acquaintance</legend> 
  • trunk/app/views/acquaintances/display.ctp

    r256 r541  
    1  
    2 <div style="font-size:18pt;padding:4px;boder:1px solid #c0c0c0"> <?php echo $blog["User"]["username"]; ?>'s suggested links</div>  
    3  
    41<?php 
    52//die(var_dump($data)); 
     3echo $html->div(null, $blog['User']['username'], array('style'=>'font-size:18pt;padding:4px;boder:1px solid #c0c0c0')); 
    64 
    7 foreach ($data as $val) 
    8 { 
    9  echo '<div style="padding:3px;border:1px dotted gray;margin:3px;">'; 
    10  echo "<h2>". $val['Acquaintance']['name']   . "</h2>"; 
    11  echo '<p>' . $val['Acquaintance']['description']   . '</p>'; 
    12  echo '<p>' . $html->link($html->image('static/icon_http.gif', array("alt"=>"Go!", "alt"=>"Go!")),$val['Acquaintance']['url'], null, false, false).'</p>'; 
     5foreach ($data as $val): 
     6 
     7 $tmp  =  '<h2>'. $val['Acquaintance']['name']   . '</h2>'; 
     8 $tmp .= para(null, $val['Acquaintance']['description']); 
     9 $tmp .= para(null,$html->link($html->image('static/icon_http.gif', array("alt"=>"Go!", "alt"=>"Go!")),$val['Acquaintance']['url'], null, false, false)); 
    1310  
    14  echo '</div>'; 
    15  } 
     11 echo $html->div(null, $tmp, array('style'=>'padding:3px;border:1px dotted gray;margin:3px;')); 
     12 
     13endforeach; 
    1614?> 
    1715 
  • trunk/app/views/answers/admin_edit.ctp

    r363 r541  
    11<?php  
    2 //die(debug($this->data)); 
    3    echo $form->create('Answer'); 
    4    echo $form->hidden('Answer.question_id', array('value'=>$this->data['Question']['id'])); 
    5  ?> 
     2 //die(debug($this->data)); 
     3 echo $form->create('Answer'); 
     4 echo $form->hidden('Answer.question_id', array('value'=>$this->data['Question']['id'])); 
     5?> 
    66<fieldset><legend>Edit answer</legend> 
    77<?php 
    88 echo $html->div('required',$form->input('Answer.answer', array("size" => 50, "maxlength" => 120)));  
    99 echo $html->div('required',$form->label('Answer.correct','Answer is correct:').$form->checkbox('Answer.correct'));  
    10   
     10 echo $form->end('Save'); 
    1111 echo '<fieldset>'; 
    12  echo $form->end('Save'); 
    13  ?> 
     12?> 
    1413 
    1514 
  • trunk/app/views/answers/answers.ctp

    r251 r541  
    11<?php 
    2 foreach ($data as $val)  
    3 {       
     2foreach ($data as $val):       
    43   echo $val["question"];   
    5 } 
     4endforeach; 
    65?> 
  • trunk/app/views/answers/questions.ctp

    r365 r541  
    11<?php 
    22// die( debug( $data )); 
    3 foreach ($data as $val)    
    4 { 
    5   $st = ($val['Answer']['correct']==1) ? 'Yes' : 'No';       
     3foreach ($data as $val): 
     4 
     5  $st   = ($val['Answer']['correct']==1) ? 'Yes' : 'No';       
    66  $tmp  = $html->div(null, $html->link('Delete', '/admin/answers/delete/'.$val['Answer']['id'].'/'.$val['Answer']['question_id'])); 
    77  $tmp .= $html->div(null, $html->link('Edit',   '/admin/answers/edit/'  .$val['Answer']['id'])); 
     
    1111 
    1212  echo $html->div('adminblock', $tmp); 
    13 } 
     13endforeach; 
    1414?> 
  • trunk/app/views/categories/admin_listing.ctp

    r269 r541  
    11<div class="title_section">Blog Categories <a style="font-size:7pt" href="javascript:window.close()">Close window</a></div> 
    22 
    3 <div id="editzone"></id> 
     3<div id="editzone"></div> 
    44 
    55<div id="add" style="padding:5px;border:1px dotted #d95681;width:350px;margin-bottom:6px;"> 
     
    77<?php  
    88    echo $ajax->form(); 
    9     echo $html->hiddenTag('Category/user_id', $othAuth->user('id')); 
     9    echo $html->hidden('Category/user_id', $session->read('Auth.User.id')); 
    1010    echo "<fieldset>"; 
    1111    echo $form->labelTag( 'Category/title', 'Title: ' );  
  • trunk/app/views/categories/todo.ctp

    r269 r541  
    11<?php 
    2  
    32//File: /app/views/categories/todo.thtml 
    43 
    54foreach ($data as $key=>$val) 
    6     {    
     5{    
    76        echo "<form onsubmit=\"return false;\">"; 
    87        echo "<p><b>". $val['Category']['title']   . "</b> "; 
    98         
    10         if ($othAuth->user('id') == $val['Category']['user_id']) 
     9        if ($session->read('Auth.User.id') == $val['Category']['user_id']) 
    1110        {   
    1211            echo "<form onsubmit=\"return false;\">"; 
  • trunk/app/views/catfaqs/admin_add.ctp

    r351 r541  
    1 <?php echo $form->create('Catfaq'); ?> 
     1<?php echo $form->create('Catfaq', array('onsubmit'=>'return chkData()')); ?> 
    22<fieldset> 
    33  <legend>New FAQ Category</legend> 
  • trunk/app/views/catfaqs/admin_edit.ctp

    r253 r541  
    1 <div> 
    2 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?>  
    3 <?php echo $html->addCrumb('FAQs', '/admin/catfaqs/listing'); ?>  
    4 <?php echo $html->getCrumbs(' / '); ?> 
    5 </div> 
     1<?php  
     2 echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?>  
     3 echo $html->addCrumb('FAQs', '/admin/catfaqs/listing'); ?>  
     4 echo $html->getCrumbs(' / ');  
    65 
    7 <?php  
    8    echo $html->formTag('/admin/catfaqs/edit','post');  
    9    echo $html->hidden('Catfaq/id'); 
     6 echo $form->create('Catfaq', array('onsubmit'=>'return chkData()'));  
     7 echo $form->hidden('Catfaq.id'); 
    108?> 
    119<fieldset> 
    1210  <legend>Edit Item</legend> 
    1311  <?php  
    14     echo $form->labelTag('Catfaq/title', 'Title:' ); 
    15     echo $html->input('Catfaq/title', array("size" => 30, "maxlength" => 90)); 
    16     echo $html->tagErrorMsg('Catfaq/title', 'Title is required.'); 
     12    echo $form->input('Catfaq.title', array("size" => 30, "maxlength" => 90)); 
    1713      
    18      echo $form->labelTag('Catfaq/description', 'Description:' ); 
    19     echo $html->textarea('Catfaq/description', array("cols" => 40, "row" => 20)); 
    20     echo $html->tagErrorMsg('Catfaq/description', 'Description is required.'); 
     14    echo $form->label('Catfaq.description', 'Description:'); 
     15    echo $form->textarea('Catfaq.description', array("cols" => 40, "row" => 20)); 
    2116  ?> 
    2217  <div style="clear:both"></div> 
    2318  <br /> 
    24   <?php echo $html->submit('Save') ?> 
     19  <?php echo $form->end('Save'); ?> 
    2520</fieldset> 
    26 </form> 
  • trunk/app/views/catfaqs/admin_listing.ctp

    r477 r541  
    88echo $html->getCrumbs(' / ');  
    99 
    10 echo '<div id="loading" style="display: none;">'; 
    11                   echo $html->image("static/loading.gif", array("alt"=>"Loading")); 
    12 echo '</div>'; 
     10echo $ajax->div('loading', array('style'=>'display:none')); 
     11                 echo $html->image("static/loading.gif", array("alt"=>"Loading")); 
     12echo $ajax->divEnd('loading'); 
    1313     
    1414echo  $html->para(null, $ajax->link($html->image('actions/new.png', array("alt"=>"Add new category", "title"=>"Add new category")),                   '/admin/catfaqs/add',  
  • trunk/app/views/catfaqs/display.ctp

    r253 r541  
    1 <div style="font-size:18pt;padding:5px;boder:1px solid #c0c0c0"> <?php echo $blog["User"]["username"]; ?>'s Faqs</div> 
     1<?php 
     2//die(debug($data)); 
    23 
    3 <?php 
    4 //die(print_r($data)); 
    5 foreach ($data as $val) 
    6 { 
     4echo $html->div(null, $blog['User']['username'].'s Faq', array('style'=>'font-size:18pt;padding:5px;boder:1px solid #c0c0c0')); 
     5 
     6foreach ($data as $val): 
    77   echo '<div style="border:1px dotted gray;padding:4px;margin-bottom:15px">'; 
    88        echo $html->link($val['Catfaq']['title'], '/catfaqs/view/'.$val['Catfaq']['id'].'/'.$blog["User"]["id"], array("class"=>"titlelink")) . '<br />'; 
    99        echo '<b>Description</b>: <i>' .  $val['Catfaq']['description']  . '</i><br />'; 
    1010    echo '</div>'; 
    11 } 
     11endforeach; 
    1212?> 
    1313 
  • trunk/app/views/catfaqs/show.ctp

    r253 r541  
    1 <div class="title_section">Faqs</div> 
     1<?php 
     2//debug($data); 
     3echo $html->div('title_section', 'Faqs'); 
    24 
    3 <div> 
    4 <?php 
    5 //var_dump($data); 
    6  
    7 foreach ($data as $key=>$val) { 
     5foreach ($data as $val)  
     6{ 
    87        echo "<p><a href=\"edit/".$val['Catfaq']['id']."\">Reply/a> "; 
    98          echo  $val['Catfaq']['code']     . " "; 
    109          echo  $val['Catfaq']['title']    . " "; 
    1110        echo "<a href=\"delete/".$val['Catfaq']['id']."\">Delete</a> </p>"; 
    12     } 
     11} 
    1312?>  
    14 </div> 
  • trunk/app/views/catfaqs/view.ctp

    r256 r541  
    1 <div style="font-size:18pt;padding:5px;boder:1px solid #c0c0c0"> <?php echo $data["Catfaq"]["title"]; ?> FAQ</div> 
    2  
    31<?php 
    42//die(var_dump($data)); 
    5 foreach ($data["Faq"] as $v) 
    6 { 
    7    echo '<div style="border:1px dotted gray;padding:4px;margin-bottom:15px">'; 
    8         echo '<p style="font-weight:bold;">' .  $v['question'] . '</p>'; 
    9         echo '<p>' .  $v['answer']    . '</p>'; 
    10         echo '<p>' . $html->link($html->image('static/arrow_top.gif', array("alt"=>"Go top", "title"=>"Go top")), '#main', null, null, false) . '</p>'; 
     3 
     4echo $html->div(null, $data['Catfaq']['title'] .' FAQ', array('style'=>'font-size:18pt;padding:5px;boder:1px solid #c0c0c0')); 
     5 
     6foreach ($data["Faq"] as $v): 
     7  echo '<div style="border:1px dotted gray;padding:4px;margin-bottom:15px">'; 
     8    echo $html->para(null, $v['question']); 
     9    echo $html->para(null, $v['answer']); 
     10    echo $html->para(null,$html->link($html->image('static/arrow_top.gif', array("alt"=>"Go top", "title"=>"Go top")), '#main', null, null, false)); 
    1111    echo '</div>'; 
    12 } 
     12endforeach; 
    1313?> 
    1414 
  • trunk/app/views/catforums/admin_edit.ctp

    r325 r541  
    1 <div class="spaced"> 
    21<?php  
    32    echo $form->create('Catforum');  
     
    65<fieldset> 
    76<legend>Edit Phorums Category</legend> 
     7<?php 
     8   echo $form->input('Catforum.title', array('size'=>60, 'maxlength'=>90)); 
     9   echo $form->error('Catforum.title','Please enter a title.');  
    810 
    9 <?php 
    10     echo $form->input('Catforum.title', array('size'=>60, 'maxlength'=>90)); 
    11     echo $form->error('Catforum.title','Please enter a title.');  
    12 ?> 
    13 <br /> 
    14 <br /> 
    15 <?php  
    1611   echo $form->input('Catforum.description', array("size" => 60, "maxlength" => 90)); 
    1712   echo $form->error('Catforum.description','Please enter a description.'); 
     13 
     14   echo $form->label('Catforum.status', 'Status:') . "<br />"; 
     15   echo $form->checkbox('Catforum.status', array('value'=>1)); 
    1816?> 
    1917 
    20 <br /><br /> 
    21 <?php  
    22     echo $form->label('Catforum.status', 'Status:') . "<br />"; 
    23     echo $form->checkbox('Catforum.status', array('value'=>1)); 
    24 ?> 
    25 <br /><br /> 
    26 <p style="clear:both"></p></fieldset> 
     18<p style="clear:both"></p> 
    2719<?php echo $form->end('Update'); ?> 
    28  
    29 </div> 
    30  
     20</fieldset> 
  • trunk/app/views/catforums/admin_listing.ctp

    r393 r541  
    22 // exit(debug($data)); 
    33?> 
    4 <script type="text/javascript">  
    5 <!--  
    6 function hU() { 
    7  
    8 var tr = document.getElementById('trh'); 
    9  
    10   if (tr.style.display == 'none') 
    11   { 
    12             tr.style.display = 'table-row'; 
    13   } else { 
    14             tr.style.display = 'none'; 
    15   } 
    16 } 
    17 --> 
    18 </script> 
    19  
    204<?php  
    215 echo $html->div('title_section', 'Categories Forums'); 
     
    2711<tr style="text-align:left;display:none;border:1px dotted grey;padding:6px" id="trh"> 
    2812<td colspan="7"> 
    29   <?php echo $form->create('Catforum', array('action'=>'admin_add')); ?> 
     13  <?php echo $form->create('Catforum', array('action'=>'add', 'onsubmit'=>'return chkData()')); ?> 
    3014  <fieldset> 
    3115     <legend>Add new Category Forum</legend> 
     
    4428$th = array ('Edit', 'Add', 'Title', 'Description', 'Status', 'Delete', '&nbsp;'); 
    4529echo $html->tableHeaders($th);   
     30 
    4631foreach ($data as $val) 
    47  { 
     32{ 
    4833             
    4934       $tr = array (  
     
    6954?> 
    7055</table> 
     56 
     57<script type="text/javascript">  
     58<!--  
     59function hU()  
     60{ 
     61 
     62  var tr = document.getElementById('trh'); 
     63 
     64  if (tr.style.display == 'none') 
     65  { 
     66            tr.style.display = 'table-row'; 
     67  } else { 
     68            tr.style.display = 'none'; 
     69  } 
     70} 
     71--> 
     72</script> 
  • trunk/app/views/catforums/display.ctp

    r325 r541  
    1 <div style="font-size:18pt;padding:5px;boder:1px solid #c0c0c0"> <?php echo $blog["User"]["username"]; ?>'s Forums</div> 
    2  
    31<?php 
    42//die(print_r($data)); 
     3echo $html->div(null, $blog['User']['username'] .'\'s Forums', array('style'=>'font-size:18pt;padding:5px;boder:1px solid #c0c0c0')); 
     4  
     5foreach ($data as $val): 
    56 
    6 foreach ($data as $val) 
    7  { 
    8      echo '<div style="border:1px dotted gray;padding:4px;margin-bottom:15px">'; 
    9      echo '<h2>Category:' .  $val['Catforum']['title']        . '</h2>'; 
    10      echo '<b>Description</b>: <i>' .  $val['Catforum']['description']  . '</i><br />'; 
     7   echo '<div style="border:1px dotted gray;padding:4px;margin-bottom:15px">'; 
     8   echo '<h2>Category:' .  $val['Catforum']['title']        . '</h2>'; 
     9   echo '<b>Description</b>: <i>' .  $val['Catforum']['description']  . '</i><br />'; 
    1110      
    12       foreach ( $val['Forum'] as $v) 
    13       { 
     11   foreach ( $val['Forum'] as $v ): 
     12 
    1413         echo '<div style="vertical-align:middle;padding:6px;margin:10px 10px 10px 20px;border:1px solid orange;">'; 
    1514            echo $html->link( 
     
    2019                             null, null, false) . '  '; 
    2120 
    22         echo $html->link($v['title'], '/forums/display/'.$v['id'], array('style'=>'font-weight:bold')) 
    23 .' '.$v['description'].'<br />'; 
     21        echo $html->link($v['title'], '/forums/display/'.$v['id'], array('style'=>'font-weight:bold')).' '.$v['description'].'<br />'; 
    2422        echo '</div>'; 
    25       } 
    26       echo '</div>'; 
    27  } 
     23 
     24   endforeach; 
     25   echo '</div>'; 
     26endforeach; 
    2827?> 
  • trunk/app/views/catglossaries/admin_add.ctp

    r313 r541  
    22  echo $html->div(null, $html->addCrumb('Control Tools', '/admin/entries/start'). $html->getCrumbs(' / '));  
    33  echo $html->div('title_section', 'Add new Glossary Category'); 
    4 ?> 
    54 
    6 <div class="spaced"> 
    75 
    8 <?php echo $form->create('Catglossary', array('action'=>'admin_add')); ?> 
     6<?php echo $form->create('Catglossary'); ?> 
    97<fieldset> 
    108  <legend>New Category</legend> 
    119  <?php  
    1210    echo $form->input('Catglossary.title', array("size" => 30, "maxlength" => 90, "value"=>"Example: Brazilian history")); 
    13     echo $form->error('Catglossary.title', 'A Glossary title is required.'); 
    14       
    15     echo $form->label('Catglossary.description', 'Description:' ); 
     11      
     12    echo $form->label('Catglossary.description', 'Description:'); 
    1613    echo $form->textarea('Catglossary.description', array("cols" => 40, "row" => 20)); 
    17     echo $form->error('Catglossary.description', 'A category description is required.'); 
    1814  ?> 
    1915  <br /><br /> 
     
    2319  <br /><br /> 
    2420  <div style="clear:both"></div> 
    25   <br /></fieldset> 
     21   
    2622  <?php echo $form->end('Save'); ?> 
    27 </div> 
     23</fieldset> 
  • trunk/app/views/catglossaries/admin_edit.ctp

    r405 r541  
    44   echo $html->getCrumbs(' / ');  
    55 
    6    echo $form->create('Catglossary');  
     6   echo $form->create('Catglossary', array('onsubmit'=>'return chkData()'));  
    77   echo $form->hidden('Catglossary.id'); 
    88?> 
     
    1414