szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
$link_param = $my_app->get_param('link_param');
$link_id = $my_app->get_param('link_id');
echo 'link_param-' . $link_param . '<br>';
echo 'link_id-' . $link_id . '<br>';
if (!empty($link_id)) {
    $shortcut = new phpos_shortcuts();
    $row = $shortcut->get_shortcut($link_id);
    $start_title = $row['file_title'];
}
$monit_success = "\n\t\tjSuccess(\n\t\t\t'" . txt('created') . "',\n\t\t\t{\n\t\t\t\tautoHide : true, \n\t\t\t\tclickOverlay : false,\n\t\t\t\tMinWidth : 200,\n\t\t\t\tTimeShown : 5000,\n\t\t\t\tShowTimeEffect : 1000,\n\t\t\t\tHideTimeEffect : 600,\n\t\t\t\tLongTrip :20,\n\t\t\t\tHorizontalPosition : 'right',\n\t\t\t\tVerticalPosition : 'bottom',\n\t\t\t\tShowOverlay : false\n\t\t\t}\n\t\t);";
$success_code = winclose(WIN_ID) . $monit_success;
winset('title', txt('new_icon_title') . ' - Menu Start');
winset('width', '600');
winset('height', '300');
wincenter();
$form = new phpos_forms();
$form->onsuccess($success_code);
$html .= $form->form_start('new_menustart', helper_ajax('menustartAction.php'), array('app_params' => ''));
$after_reload = $my_app->get_param('after_reload');
$form->reload_after_submit(array($after_reload));
$form->input('hidden', 'new_link_type', '', '', 'menustart');
$form->status();
$app = new phpos_app();
$app->set_app_id($link_param);
$app->load_config();
$html .= $layout->subtitle(txt('shortcuts_url_title'), MY_RESOURCES . 'link_icon.png');
$html .= $layout->txtdesc(txt('shortcuts_url_desc'));
$form = new phpos_forms();
$form->onsuccess($success_code);
$html .= $form->form_start('new_url_link', helper_ajax('linkAction.php'), array('app_params' => ''));
$after_reload = $my_app->get_param('after_reload');
$form->reload_after_submit(array($after_reload));
$form->input('hidden', 'new_link_type', '', '', 'link');
$link_id = $my_app->get_param('link_id');
if (!empty($link_id)) {
    $wincfg['back'] = null;
    $shortcut = new phpos_shortcuts();
    $db_shortcut = $shortcut->get_shortcut($link_id);
    $db_params = $shortcut->get_params_from_db($link_id);
    $url = base64_decode($db_params['url']);
    $start_link_title = $db_shortcut['file_title'];
    $button = txt('shortcuts_window_btn_update_url');
    $wincfg['title'] = txt('shortcuts_window_title_update_url');
}
$form->status();
$form->condition('not_null', true, txt('name_empty'));
$form->input('text', 'new_link_name', txt('shortcuts_form_icon_name'), txt('shortcuts_form_icon_name_desc'), $start_link_title);
$form->condition('not_null', true, txt('url_empty'));
$form->input('text', 'new_link_url', txt('shortcuts_url_form_url'), txt('shortcuts_url_form_url_desc'), $url);
$icons = new phpos_icons();
$c = $icons->count_icons();
$items = array('null' => '---');
if ($c != 0) {
require_once PHPOS_DIR . 'classes/class.languages.php';
require_once PHPOS_DIR . 'controllers/languageController.php';
define('PHPOS_IN_EXPLORER', true);
require PHPOS_DIR . 'plugins/fs.db_mysqlPlugin.php';
//$filesystem_class = 'phpos_fs_plugin_'.$my_app->get_param('fs');
$phposFS = new phpos_fs_plugin_db_mysql();
// start filesytem
$config = new phpos_config();
$config->set_id_user();
$shortcut = new phpos_shortcuts();
$startmenu = new phpos_startmenu();
$records = $startmenu->get_all();
$i = 1;
foreach ($records as $item) {
    if ($shortcut->is_shortcut($item['id_file'])) {
        $row = $shortcut->get_shortcut($item['id_file']);
        $icon = $shortcut->link_icon($row['plugin_id'], $row['app_id'], $row['icon'], $row['app_action']);
        $app_action = 'app_id:' . $row['app_id'] . '@' . $row['app_action'];
        $action = winopen($row['file_title'], $row['plugin_id'], $app_action, $row['app_params']);
        $context_menu = array('delete::' . txt('del_from_start') . '::delete_menustart_item("' . $item['id'] . '");::delete');
        $apiWindow = new api_wintask();
        $apiWindow->setContextMenu($context_menu);
        $js .= $apiWindow->contextMenuRender('startmenu_left_item_' . $i, 'img');
        $apiWindow->resetContextMenu();
        $items .= '<div id="startmenu_left_item_' . $i . '" class="startmenu_left_item" onclick="' . $action . '"><img src="' . $icon . '"><span>' . $row['file_title'] . '</span></div>';
        $i++;
    }
}
$js .= "\n function delete_menustart_item(delete_id)\n {\n\t\tphpos.managerWindows('action=delete_start_item&item_id='+delete_id);\n\t\tphpos.menustartClose();\n  }\n\t";
$my_app = new phpos_app();
jquery_function($js);