Changeset 642
- Timestamp:
- 07/11/08 14:28:03 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 6 modified
-
controllers/replies_controller.php (modified) (4 diffs)
-
locale/spa/LC_MESSAGES/default.po (modified) (1 diff)
-
views/catfaqs/admin_listing.ctp (modified) (1 diff)
-
views/faqs/admin_add.ctp (modified) (1 diff)
-
views/faqs/admin_edit.ctp (modified) (1 diff)
-
views/faqs/admin_listing.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/replies_controller.php
r562 r642 25 25 public function add() 26 26 { 27 if (!empty($this->data['Reply'])) 28 {27 if (!empty($this->data['Reply'])): 28 29 29 $this->Sanitize = new Sanitize; 30 30 … … 35 35 $this->Reply->create(); 36 36 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; 42 41 } 43 42 … … 46 45 public function admin_edit($id = null) 47 46 { 48 if (empty($this->data))49 {47 if (empty($this->data)): 48 50 49 $this->Reply->id = $id; 51 50 52 51 $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; 61 58 } 62 59 … … 68 65 $this->data['Reply']['id'] = $reply_id; 69 66 70 if ($this->Reply->save($this->data['Reply'])) 71 { 67 if ($this->Reply->save($this->data['Reply'])): 72 68 $this->msgFlash('Reply status changed', '/admin/topics/listing/'.$topic_id); 73 }69 endif; 74 70 } 75 71 76 72 public function admin_delete($topic_id, $reply_id) 77 73 { 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; 82 77 } 83 78 } -
trunk/app/locale/spa/LC_MESSAGES/default.po
r637 r642 4 4 msgid "Groups" 5 5 msgstr "Grupos" 6 7 msgid "Questions & answers" 8 msgstr "Preguntas y respuestas" 9 10 msgid "New Question/Answer" 11 msgstr "Nueva pregunta/respuesta" 12 13 msgid "Question" 14 msgstr "Pregunta" 15 16 msgid "Answer" 17 msgstr "Respuesta" 18 19 msgid "FAQ categories" 20 msgstr "CategorÃas de preguntas y respuestas" 6 21 7 22 msgid "Email" -
trunk/app/views/catfaqs/admin_listing.ctp
r613 r642 21 21 foreach ($data as $val): 22 22 $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;')); 25 25 $tmp .= $html->link($gags->setStatus($val['Catfaq']['status']),'/admin/catfaqs/change/'.$val['Catfaq']['status'].'/'.$val['Catfaq']['id']); 26 26 $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 ?> 5 5 6 6 <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 />'; 12 11 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)); 17 21 ?> 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 2 echo $javascript->link('myfunctions'); 3 echo $javascript->link('fckeditor/fckeditor'); 3 4 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(' / '); ?> 5 echo $html->addCrumb('Control Panel', '/admin/entries/start'); 6 echo $html->addCrumb('FAQs', '/admin/catfaqs/listing'); 7 echo $html->getCrumbs(' / '); 9 8 10 9 11 <?php echo $html->formTag('/admin/faqs/edit/','post'); ?> 12 <?php echo $html->hiddenTag('Faq/catfaq_id'); ?> 13 <?php echo $html->hiddenTag('Faq/id'); ?> 10 echo $form->create('Faq', array('action'=>'edit')); 11 echo $form->hidden('Faq.catfaq_id'); 12 echo $form->hidden('Faq.id'); 13 ?> 14 14 <fieldset> 15 <legend> Edit Faq</legend>15 <legend><?php __('Edit FAQ');?></legend> 16 16 <?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)); 20 32 ?> 21 <br />22 23 <p>24 <?php25 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') ?>43 33 </fieldset> 44 </form>45 </div> -
trunk/app/views/faqs/admin_listing.ctp
r306 r642 4 4 echo $javascript->link('fckeditor/fckeditor'); 5 5 endif; 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 & 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')); 22 14 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, 24 16 array("update" => "updater","loading"=>"Element.show('loading');Element.hide('updater');", "complete"=>"Element.hide('loading');Effect.Appear('updater')"), 25 17 null, false); 26 18 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>'; 19 echo $ajax->div('updater') . $ajax->divEnd('updater'); 20 21 foreach ($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')); 35 24 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')); 38 27 echo '</div>'; 39 } 28 endforeach; 40 29 ?>
