Elxis CMS Forum

Extensions => Components => Topic started by: xaro on March 30, 2010, 10:35:23

Title: Ios Reservations: New tabs in menu?
Post by: xaro on March 30, 2010, 10:35:23
Hello, I need help :) How can I add a new tabs in menu in hotel view? I need this simple site to "additional information" Is there any posibilities?
(like descriptions site - only text)
Title: Re: Ios Reservations: New tabs in menu?
Post by: datahell on March 30, 2010, 22:03:36
I replied to your e-mail, I will post a short how-to here too.

It is easy but you have to edit file:
components/com_reservations/reservations.html
Function "showHotel" (line 1243)

Tabs start at line 1285

$restabs = new iosResTabs();
.....

To entry a new tab you have to do 2 things.
1. Set the tab title (menu title) by adding the title in the menu titles array

if ($hotel->comments || (trim($hotel->tripadvisor) != '')) {
     array_push($menu_items, $resmaster->lng->COMMENTS);
}
Add bellow:
$menu_items[]  = 'Title here for your new tab';

2. Add the tab data
Find $restabs->endpane();
Add BEFORE

$restabs->starttab();
//Your tab data here
$restabs->endtab();

So at the end you will have something like this:

Code: [Select]
<?php 
if ($hotel->comments || (trim($hotel->tripadvisor) != &#39;&#39;)) {
$restabs->starttab();
resextend::showComments($review$hotel);
$restabs->endtab();
}
$restabs->starttab();
echo &
#39;Your tab data here&#39;;
$restabs->endtab();
$restabs->endpane();
?>
Title: Re: Ios Reservations: New tabs in menu?
Post by: xaro on March 31, 2010, 00:01:01
Thanks, In front page its work but what about admin site - I add a new tab menu named "additional info.." in hotel admin site file admin.reservations.html.php

<?php
      $tabs->endTab();
      $tabs->startTab($adminLanguage->A_DESCRIPTION2,"descri");
?>

      <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
      <tr>
         <th colspan="2" style="<?php self::thstyle(); ?>"><?php echo $adminLanguage->A_DESCRIPTION2; ?></th>
      </tr>
      <tr>
              <td width="400" nowrap="nowrap">
              <textarea name="infor" cols="60" rows="30" class="text_area"><?php echo htmlspecialchars( $row->infor, ENT_QUOTES, 'UTF-8' ); ?></textarea>
            </td>
      </tr>
      </table>

and I modify file reserveschema.xml


   <table name="res_hotels">
      <field name="hid" type="I">
         <KEY/>
         <AUTOINCREMENT/>
      </field>
                                <field name="infor" type="X"></field>
When I edit text in admin panel in hotel site in this box and I save hotel - the text disappears (doesnt save in base) - I add manualy in phpmyadmin row named "infor" in table hotel but it doesnt work - nothing saved. But if I change box terms and conditions to open in frontpage in my new tabs - it works. What do I do wrong?

I have a suggestion in admin site when somebody adds a new locations or hotels or rooms and saves them the order cannot be changed. Its not good when the list of destiantions is long and I would like to move their order.
Title: Re: Ios Reservations: New tabs in menu?
Post by: datahell on March 31, 2010, 07:58:29
XML schema is used only during install. You have to edit the database hotel object if you added a new column in table res_hotels.