change order of menu

Discuss everything related to Medical Appointment. All versions. Any questions related to the Medical Appointment developing or using should be posted to this forum.

Moderators: alexandrleonenko, Milton

palle
Newbie
Newbie
Posts: 6
Joined: Apr 4th, '12, 09:57

change order of menu

Postby palle » May 23rd, '12, 14:40

hi,
i am almost got all modifications done on the script to make it work perfect for my needs.
just one thing how do i change the order of the menu. where do i change the order of the menu?
not the order of the custom menu which i can do at the admin page i mean the order of the appointment and login field etc.

administrator
Site Admin
Site Admin
Posts: 6067
Joined: Jan 7th, '09, 23:18
Contact:

Re: change order of menu

Postby administrator » May 24th, '12, 07:21

What menu do you speak about? Top or Left?
Anyway, all changes may be done in Admin -> Menus -> Up/Down Order

palle
Newbie
Newbie
Posts: 6
Joined: Apr 4th, '12, 09:57

Re: change order of menu

Postby palle » Jun 4th, '12, 16:43

I am talking about the menu at left side. I would like to have the order exchanged of the search field and the log-in

Image

My code of the default.tpl look as follow

Code: Select all

   <?php
      // Draw header menu
      Menu::DrawHeaderMenu();
   ?>       

   <div id="content-wrap">
      <div id="left-column<?php echo '-'.Application::Get('defined_left'); ?>" class="no_print">
         <!-- LEFT COLUMN -->
         <?php
            // Draw menu tree
            Menu::DrawMenu('left');
            draw_block_top(_APPOINTMENTS);
            Doctors::DrawAppointmentsBlock();
            draw_block_bottom();                  
         ?>                           
         <!-- END OF LEFT COLUMN -->            
      </div>

      <div id="content<?php echo '-'.Application::Get('defined_right'); ?>">
         <!-- MAIN CONTENT -->
         <?php
            if((Application::Get('page') != '') && file_exists('page/'.Application::Get('page').'.php')){
               include_once('page/'.Application::Get('page').'.php');
            }else if((Application::Get('patient') != '') && file_exists('patient/'.Application::Get('patient').'.php')){
               if(Modules::IsModuleInstalled('patients')){   
                  include_once('patient/'.Application::Get('patient').'.php');
               }else{

administrator
Site Admin
Site Admin
Posts: 6067
Joined: Jan 7th, '09, 23:18
Contact:

Re: change order of menu

Postby administrator » Jun 5th, '12, 05:53

currently it's possible in include/classes/Menu.class.php in Menu::DrawMenu() method manually.

palle
Newbie
Newbie
Posts: 6
Joined: Apr 4th, '12, 09:57

Re: change order of menu

Postby palle » Jun 5th, '12, 13:48

You mean this position? Could you please advise me a little bit more? I do not understand the structure yet. Like what part is the search field and which one the log-in?
sorry for asking so stupidly.


public static function DrawMenu($menu_position = 'left', $draw = true)
{
global $objSettings, $objLogin;
$output = '';

if($menu_position == 'left') $objLogin->DrawLoginLinks();

// Get all menus which have items (links to pages)
$menus = self::GetMenus($menu_position);
$menus_count = $menus[1];

$objNews = News::Instance();
$show_news_block = ModulesSettings::Get('news', 'show_news_block');
$show_subscribe_block = ModulesSettings::Get('news', 'show_newsletter_subscribe_block');
if(Modules::IsModuleInstalled('news') && ($show_news_block == 'right side' || $show_subscribe_block == 'right side')) $menus_count++;

if($menus_count > 0) $output .= '<div id="column-'.$menu_position.'-wrapper" style="'.(($menus_count > 0) ? 'width:215px;' : '').'">';

// Display all menu titles (names) according to their order
$cur_menu = '';
for($menu_ind = 0; $menu_ind < $menus[1]; $menu_ind++){
// Start draw new menu
$output .= draw_block_top($menus[0][$menu_ind]['menu_name'], '', 'maximazed', false);
$menu_links = self::GetMenuLinks($menus[0][$menu_ind]['id'], Application::Get('lang'), $menu_position);
if($menu_links[1] > 0) $output .= '<ul>';
for($menu_link_ind = 0; $menu_link_ind < $menu_links[1]; $menu_link_ind++) {
if($menu_links[0][$menu_link_ind]['content_type'] == 'link'){
$output .= '<li>'.prepare_permanent_link($menu_links[0][$menu_link_ind]['link_url'], $menu_links[0][$menu_link_ind]['menu_link'], $menu_links[0][$menu_link_ind]['link_target'], 'main_menu_link').'</li>';
}else{
// draw current menu link
$class = (Application::Get('page_id') == $menu_links[0][$menu_link_ind]['id']) ? ' active' : '';
$output .= '<li>'.prepare_link('pages', 'pid', $menu_links[0][$menu_link_ind]['id'], $menu_links[0][$menu_link_ind]['page_key'], $menu_links[0][$menu_link_ind]['menu_link'], 'main_menu_link_'.Application::Get('lang_dir').$class).'</li>';
}
}
if($menu_links[1] > 0) $output .= '</ul>';
$output .= draw_block_bottom(false);
}

if($menu_position == 'left'){
if(!$objLogin->IsLoggedIn() || Application::Get('preview') == 'yes'){
if(Modules::IsModuleInstalled('patients') && ModulesSettings::Get('patients', 'allow_login') == 'yes'){
if(Application::Get('patient') != 'login' && Application::Get('page') != 'checkout_signin'){
$output .= Patients::DrawLoginFormBlock(false);
}
}
}
if(Modules::IsModuleInstalled('news')){
if($show_news_block == 'left side') $output .= $objNews->DrawNewsBlock(false);
if($show_subscribe_block == 'left side') $output .= $objNews->DrawSubscribeBlock(false);
}
// Draw local time
// $output .= draw_block_top(_LOCAL_TIME, '', 'maximazed', false);
// $output .= Clinic::DrawLocalTime(false);
// $output .= draw_block_bottom(false);
}

if($menu_position == 'right'){
if(Modules::IsModuleInstalled('news')){
if($show_news_block == 'right side') $output .= $objNews->DrawNewsBlock(false);
if($show_subscribe_block == 'right side') $output .= $objNews->DrawSubscribeBlock(false);
}
}

if($menus_count > 0) $output .= '</div>';
$output .= '<br />';


if($draw) echo $output;
else return $output;
}

administrator
Site Admin
Site Admin
Posts: 6067
Joined: Jan 7th, '09, 23:18
Contact:

Re: change order of menu

Postby administrator » Jun 6th, '12, 06:42

I mean this:

if($menu_position == 'left') $objLogin->DrawLoginLinks();


Return to “ApPHP Medical Appointment / uDoctorAppointment Talk {developers/users}”