<?php
/*
#####################################
#  ShopOS: Shopping Cart Software.
#  Copyright (c) 2008-2010
#  http://www.shopos.ru
#  http://www.shoposs.com
#  Ver. 1.0.0
#####################################
*/

require('includes/top.php');
include( dir_path_admin('func') . 'plugin.php'); 

$plugins = $p->info;

$plugins_file = $p->get_name (); // получение списка плагинов /

$p->lang ();

if (isset($_GET['main_page']))
{
?>

<?php $main->head(); ?>
<?php $main->top_menu(); ?>

<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td class="boxCenter" width="100%" valign="top">
	<?php  

	    if (isset($_GET['main_page']) && isset($os_action['main_page_admin'][$_GET['main_page']]))
		{		
			foreach ($plugins_file as $_val)
			{
			   if ($_val[0] == $os_action_plug[$_GET['main_page']])
			   {
			       $plugin_data = get_plugin_data($_val[1]);
			       $_p_name = (!empty($plugin_data['Name']) ? $plugin_data['Name'] : $_GET['main_page']);
			   }
			}
		    $_p = $_p_name; 
		}
		else
		{
		   $_p = ''; 
		}
	?>
    <?php $main->heading('plugin.gif', $_p); ?>  
	<?php $main->fly_menu(PLUGINS_URL, MODULES_OTHER);

  if (isset($os_action['main_page_admin'][$_GET['main_page']]) && function_exists($_GET['main_page']))
  {
      $p->name = $os_action_plug[ $_GET['main_page'] ];
	  $p->group = $p->info[$p->name]['group'];
	  $p->set_dir();
	  
	  $_GET['main_page']();
  }
  else
  {
     echo 'no page!';
  }
  
  


	?>
	</td>
  </tr>
</table>

</div>
<?php $main->bottom(); 
}
else
{
    if (isset($os_action['page_admin'][$_GET['page']]) && function_exists($_GET['page']))
    {
	    $p->name = $os_action_plug[ $_GET['page'] ];
	    $p->group = $p->info[$p->name]['group'];
	    $p->set_dir();
		
	    $_GET['page']();
    }
    else
    {
        echo 'no page!';
    }
}
?>