Changeset 642

Show
Ignore:
Timestamp:
07/11/08 14:28:03 (3 months ago)
Author:
aarkerio
Message:

Update FAQS

Location:
trunk/app
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/replies_controller.php

    r562 r642  
    2525 public function add()  
    2626 { 
    27    if (!empty($this->data['Reply'])) 
    28    {  
     27   if (!empty($this->data['Reply'])): 
     28  
    2929     $this->Sanitize = new Sanitize; 
    3030      
     
    3535     $this->Reply->create(); 
    3636      
    37      if ($this->Reply->save($this->data['Reply'])) 
    38      {  
    39           $this->msgFlash('Reply added', $this->data['Reply']['redirect_to']); 
    40      } 
    41    }  
     37     if ($this->Reply->save($this->data)):  
     38          $this->msgFlash(__('Reply saved', true), $this->data['Reply']['redirect_to']); 
     39     endif; 
     40  endif;  
    4241 } 
    4342  
     
    4645 public function admin_edit($id = null) 
    4746 { 
    48     if (empty($this->data)) 
    49     { 
     47   if (empty($this->data)): 
     48    
    5049        $this->Reply->id = $id; 
    5150         
    5251        $this->data = $this->Reply->read(); 
    53     } 
    54     else 
    55     { 
    56         if ($this->Reply->save($this->data['Reply'])) 
    57         { 
    58             $this->flash('Reply updated.','/admin/topics/listing/'.$topic_id); 
    59         } 
    60     } 
     52   else: 
     53    
     54        if ($this->Reply->save($this->data['Reply'])): 
     55             $this->flash(__('Reply updated', true),'/admin/topics/listing/'.$this->data['Reply']['topic_id']); 
     56    endif; 
     57   endif; 
    6158 } 
    6259 
     
    6865    $this->data['Reply']['id']     = $reply_id; 
    6966      
    70     if ($this->Reply->save($this->data['Reply'])) 
    71     { 
     67    if ($this->Reply->save($this->data['Reply'])): 
    7268       $this->msgFlash('Reply status changed', '/admin/topics/listing/'.$topic_id); 
    73     } 
     69    endif; 
    7470 } 
    7571 
    7672 public function admin_delete($topic_id, $reply_id) 
    7773 { 
    78      if ( $this->Reply->del($reply_id) ) 
    79      { 
    80         $this->msgFlash('Reply deleted','/admin/topics/listing/'.$topic_id); 
    81      } 
     74   if ( $this->Reply->del($reply_id) ): 
     75        $this->msgFlash(__('Data deleted', true),'/admin/topics/listing/'.$topic_id); 
     76   endif; 
    8277 } 
    8378} 
  • trunk/app/locale/spa/LC_MESSAGES/default.po

    r637 r642  
    44msgid  "Groups" 
    55msgstr "Grupos" 
     6 
     7msgid  "Questions & answers" 
     8msgstr "Preguntas y respuestas" 
     9 
     10msgid  "New Question/Answer" 
     11msgstr "Nueva pregunta/respuesta" 
     12 
     13msgid  "Question" 
     14msgstr "Pregunta" 
     15 
     16msgid  "Answer" 
     17msgstr "Respuesta" 
     18 
     19msgid  "FAQ categories" 
     20msgstr "Categorías de preguntas y respuestas" 
    621 
    722msgid  "Email" 
  • trunk/app/views/catfaqs/admin_listing.ctp

    r613 r642  
    2121foreach ($data as $val): 
    2222 $tmp  = $html->div('butonright', $gags->sendEdit($val['Catfaq']['id'], 'catfaqs')); 
    23  $tmp .= $html->link($val['Catfaq']['title'], '/admin/faqs/listing/'.$val['Catfaq']['id']); 
    24  $tmp .= $html->para(null,  $val['Catfaq']['description']); 
     23 $tmp .= $html->link($val['Catfaq']['title'], '/admin/faqs/listing/'.$val['Catfaq']['id'], array('style'=>'font-size:14pt;font-weight:bold;')); 
     24 $tmp .= $html->para(null,  $val['Catfaq']['description'], array('style'=>'font-weight:bold;')); 
    2525 $tmp .= $html->link($gags->setStatus($val['Catfaq']['status']),'/admin/catfaqs/change/'.$val['Catfaq']['status'].'/'.$val['Catfaq']['id']); 
    2626  $tmp .= $html->div('butonright', $gags->confirmDel($val['Catfaq']['id'], 'catfaqs')); 
  • trunk/app/views/faqs/admin_add.ctp

    r347 r642  
    1 <div class="title_section">Add new Question and Answer</div> 
    2  
    3 <?php echo $form->create('Faq'); ?> 
    4 <?php echo $form->hidden('Faq.catfaq_id', array('value'=>$catfaq_id)); ?> 
     1<?php  
     2 echo $form->create('Faq');  
     3 echo $form->hidden('Faq.catfaq_id', array('value'=>$catfaq_id));  
     4?> 
    55 
    66<fieldset> 
    7    <legend>New Question/Answer</legend> 
    8     
    9  <?php  
    10    echo $form->input('Faq.question', array("size" => 50, "maxlength" => 120));  
    11    echo $form->error('Faq.question', 'Question is required.') . '<br /><br />';  
     7   <legend><?php __('New Question/Answer');?></legend>   
     8<?php  
     9  echo $form->input('Faq.question', array('size' => 50, 'maxlength' => 120, 'label'=>__('Question', true)));  
     10  echo $form->error('Faq.question', 'Question is required.') . '<br /><br />';  
    1211 
    13    echo $form->label('Faq.answer', 'Answer:' ) . '<br />'; 
    14    echo $form->textarea('Faq.answer', array("rows"=>"15", "cols"=>"60")); 
    15    echo $fck->load('FaqAnswer', 'Karamelo');  
    16    echo $form->error('Faq.answer', 'Answer is required.');  
     12  echo $form->label('Faq.answer', __('Answer',true) ) . '<br />'; 
     13  echo $form->textarea('Faq.answer', array('rows'=>15, 'cols'=>60)); 
     14  echo $fck->load('FaqAnswer', 'Basic');  
     15  echo $form->error('Faq.answer', 'Answer is required.');  
     16 
     17  echo $form->label('Faq.status', __('Published',true)) . '<br />'; 
     18  echo $form->checkbox('Faq.status', array('value'=>1)); 
     19   
     20  echo $form->end(__('Save', true));  
    1721?> 
    18   <br /><br /> 
    19   <?php   
    20     echo $html->para(null, $form->label('Faq.status', 'Published:' ) . '<br />'. $form->checkbox('Faq.status')); 
    21   ?> 
    22    
    23   <br /> 
    24   </fieldset> 
    25   <?php echo $form->end('Send'); ?> 
     22</fieldset> 
  • trunk/app/views/faqs/admin_edit.ctp

    r268 r642  
    1 <?php echo $javascript->link('myfunctions'); ?> 
    2 <?php echo $javascript->link('fckeditor/fckeditor'); ?>  
     1<?php  
     2echo $javascript->link('myfunctions');  
     3echo $javascript->link('fckeditor/fckeditor'); 
    34 
    4 <div class="spaced"> 
    5  
    6 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?>  
    7 <?php echo $html->addCrumb('FAQs', '/admin/catfaqs/listing'); ?>  
    8 <?php echo $html->getCrumbs(' / '); ?> 
     5echo $html->addCrumb('Control Panel', '/admin/entries/start');  
     6echo $html->addCrumb('FAQs', '/admin/catfaqs/listing');   
     7echo $html->getCrumbs(' / '); 
    98 
    109 
    11 <?php echo $html->formTag('/admin/faqs/edit/','post'); ?> 
    12 <?php echo $html->hiddenTag('Faq/catfaq_id'); ?> 
    13 <?php echo $html->hiddenTag('Faq/id'); ?> 
     10echo $form->create('Faq', array('action'=>'edit'));  
     11echo $form->hidden('Faq.catfaq_id');  
     12echo $form->hidden('Faq.id');  
     13?> 
    1414<fieldset> 
    15    <legend>Edit Faq</legend> 
     15   <legend><?php __('Edit FAQ');?></legend> 
    1616<?php  
    17   echo $form->labelTag('Faq/question', 'Question:' ) .'<br />';  
    18   echo $html->input('Faq/question', array("size" => 40, "maxlength" => 50));  
    19   echo $html->tagErrorMsg('Faq/question', 'Question is required.');  
     17  echo $form->input('Faq.question', array('size' => 40, 'maxlength' => 50, 'label'=>__('Question', true)));  
     18  echo $form->error('Faq.question', 'Question is required.');  
     19 
     20  echo $form->label('Faq.answer', __('Answer',true)) . '<br />'; 
     21  echo $form->textarea('Faq.answer', array('cols'=>70, 'rows'=>40)); 
     22  echo $fck->load('FaqAnswer', 'Karamelo');  
     23  echo $form->error('Faq.answer', 'Answer is required.');  
     24 
     25  echo $form->label('Faq.status', __('Published', true) ) .'<br />'; 
     26  echo $form->checkbox('Faq.status', array('value'=>1)); 
     27  
     28 echo $form->label('Faq.end', __('End edition', true)).'<br />'; 
     29 echo $form->checkbox('Faq.end', array('value'=>1)); 
     30  
     31 echo $form->end(__('Save', true));  
    2032?> 
    21   <br /> 
    22    
    23   <p> 
    24   <?php  
    25       echo $form->labelTag( 'Faq/answer', 'Answer:' ) . '<br />'; 
    26       echo $html->textarea('Faq/answer', array("cols"=>80, "rows"=>45)); 
    27       echo $fck->load('Faq/answer', 'Karamelo');  
    28       echo $html->tagErrorMsg('Faq/answer', 'Answer is required.');  
    29   ?> 
    30   <br /> 
    31   </p> 
    32    
    33   <p> 
    34   <?php echo $form->labelTag('Faq/status', 'Published:' );?><br /> 
    35   <?php echo $html->checkbox('Faq/status', null, array("value"=>1)); ?> 
    36   <br /> 
    37   <?php echo $form->labelTag('Faq/end', 'End edition:' );?><br /> 
    38   <?php echo $html->checkbox('Faq/end', null, array("value"=>1)); ?> 
    39  
    40 </p>  
    41   <br /> 
    42   <?php echo $html->submit('Save') ?> 
    4333</fieldset> 
    44 </form> 
    45 </div> 
  • trunk/app/views/faqs/admin_listing.ctp

    r306 r642  
    44  echo $javascript->link('fckeditor/fckeditor'); 
    55endif; 
    6 ?> 
    7 <script type="text/javascript"> 
    8    window.onload = timedMsg; 
    9 </script> 
    10 <?php  
    11 $session->flash(); 
    12 echo $html->addCrumb('Control Tools', '/admin/entries/start'); 
    13 echo $html->addCrumb('FAQs', '/admin/catfaqs/listing');  
    14 echo $html->getCrumbs(' / ');  
    15 ?> 
    16 <div class="title_section">Questions &amp; answers</div> 
    17 <p> 
    18 <?php 
    19  echo '<div id="loading" style="display: none;">'; 
    20                   echo $html->image("static/loading.gif", array("alt"=>"Loading")); 
    21  echo '</div>'; 
     6 
     7 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
     8 echo $html->addCrumb('FAQs', '/admin/catfaqs/listing');  
     9 echo $html->getCrumbs(' / ');  
     10 
     11 echo $html->div('title_section', __('Questions & answers', true)); 
     12     
     13 echo $html->div(null, $html->image("static/loading.gif", array('alt'=>'Loading')), array('id'=>'loading', 'style'=>'display:none')); 
    2214     
    23  echo  $ajax->link($html->image('actions/new.png', array("alt"=>"Add new FAQ", "title"=>"Add new FAQ")),'/admin/faqs/add/'.$catfaq_id,  
     15 echo  $ajax->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))),'/admin/faqs/add/'.$catfaq_id,  
    2416     array("update" => "updater","loading"=>"Element.show('loading');Element.hide('updater');", "complete"=>"Element.hide('loading');Effect.Appear('updater')"),  
    2517                null, false); 
    2618 
    27 echo $ajax->div('updater'); 
    28 echo $ajax->divEnd('updater'); 
    29 ?></p> 
    30 <?php 
    31 foreach ($data as $val) 
    32 { 
    33    echo '<div style="padding:6px 3px 28px 4px;margin:10px 0 5px 0;border:1px dotted gray;">'; 
    34         echo '<div class="butonright">'. $gags->sendEdit($val['Faq']['id'], 'faqs')   . '</div>'; 
     19echo $ajax->div('updater') . $ajax->divEnd('updater'); 
     20 
     21foreach ($data as $val): 
     22   echo '<div style="padding:28px 6px 29px 5px;margin:10px 0 5px 0;border:1px dotted gray;">'; 
     23        echo $html->div('butonright', $gags->sendEdit($val['Faq']['id'], 'faqs')); 
    3524        echo '<b>'.$val['Faq']['question'] . '</b><br />'; 
    36         echo '<p style="margin-left:15px;">'. $val['Faq']['answer']  . '</p>'; 
    37         echo '<div class="butonright">'. $gags->confirmDel($val['Faq']['id'], 'faqs') . '</div>'; 
     25        echo $html->div(null, $val['Faq']['answer']); 
     26        echo $html->div('butonright', $gags->confirmDel($val['Faq']['id'], 'faqs')); 
    3827   echo '</div>'; 
    39 } 
     28endforeach; 
    4029?>