if (!empty($old_name)) {
    $wincfg['back'] = null;
    $wincfg['title'] = txt('shortcuts_window_title_rename');
    $input_title = txt('shortcuts_rename_title');
    $input_tip = txt('shortcuts_rename_tip');
    $button = txt('shortcuts_window_btn_rename');
    $form_id = 'new_rename';
    $default_value = strip_tags(base64_decode($old_name));
    $succ_msg = txt('shortcuts_window_msg_rename');
}
$monit_success = "\n\t\tjSuccess(\n\t\t\t'" . $succ_msg . "',\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;
/*
**************************
*/
$app = new phpos_app();
$app->set_app_id($link_param);
$app->load_config();
$after_reload = $my_app->get_param('after_reload');
$form = new phpos_forms();
$form->onsuccess($success_code);
if (empty($old_name)) {
    $html .= $layout->subtitle(txt('shortcuts_newdir_title'), MY_RESOURCES_URL . 'folder.png');
    $html .= $layout->txtdesc(txt('shortcuts_newdir_desc'));
} else {
    $html .= $layout->subtitle(txt('shortcuts_rename_title'), MY_RESOURCES_URL . 'rename.png');
    $html .= $layout->txtdesc(txt('shortcuts_rename_desc'));
}
$html .= $form->form_start($form_id, helper_post_outside('null', '', $after_reload), array('app_params' => ''));
$form->reload_after_submit(array($after_reload));
if (!empty($edit_id)) {
$app_name = $apiWindow->get_app_name();
if (!empty($_GET['action'])) {
    $apiWindow->setAPPID($app_name . '@' . filter::alfas($_GET['action']));
    $apiWindow->updateWindow();
}
$app_action = $apiWindow->get_app_action();
define("APP_ID", $app_name);
define("APP_ACTION", $app_action);
define("WIN_TYPE", $apiWindow->getParam('wintype'));
/*
**************************
*/
if (file_exists(PHPOS_DIR . 'plugins/window.' . $apiWindow->getParam('wintype') . 'Plugin.php')) {
    define('PHPOS_PLUGIN', true);
    if (!empty($app_name)) {
        $my_app = new phpos_app();
        $my_app->set_app_id($app_name);
        $my_app->set_app_action($app_action);
        $my_app->set_window($apiWindow);
        $my_app->load_config();
        // esc - close
        if (WIN_ID != 1) {
            $tips = "\n\t\t\t\t//Select all anchor tag with rel set to tooltip\n\t\t\t\t\$('a[rel=tooltip]').mouseover(function(e) {\n\t\t\t\t\n\t\t\t\t//Grab the title attribute's value and assign it to a variable\n\t\t\t\tvar tip = \$(this).attr('title');\t\n\t\t\t\t\n\t\t\t\t//Remove the title attribute's to avoid the native tooltip from the browser\n\t\t\t\t\$(this).attr('title','');\n\t\t\t\t\n\t\t\t\t//Append the tooltip template and its value\n\t\t\t\t\$(this).append('<div id=\"tooltip\"><div class=\"tipHeader\"></div><div class=\"tipBody\">' + tip + '</div><div class=\"tipFooter\"></div></div>');\t\t\n\t\t\t\t\t\t\n\t\t\t\t//Show the tooltip with faceIn effect\n\t\t\t\t\$('#tooltip').fadeIn('500');\n\t\t\t\t\$('#tooltip').fadeTo('10',0.9);\n\t\t\t\t\n\t\t\t}).mousemove(function(e) {\n\t\t\t\n\t\t\t\t//Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse\n\t\t\t\t\$('#tooltip').css('top', e.pageY - 100 );\n\t\t\t\t\$('#tooltip').css('left', e.pageX - 80 );\n\t\t\t\t\n\t\t\t}).mouseout(function() {\n\t\t\t\n\t\t\t\t//Put back the title attribute's value\n\t\t\t\t\$(this).attr('title',\$('.tipBody').html());\n\t\t\t\n\t\t\t\t//Remove the appended tooltip template\n\t\t\t\t\$(this).children('div#tooltip').remove();\n\t\t\t\t\n\t\t\t});\n\t\t\t";
            $keyboard = '	
				$(document).keyup(function(e)
				{
					switch(e.which)
					{
						// user presses the "a"
						case 97:	alert("a");
									break;	
 public function link_icon($plugin = 'app', $app_id = null, $icon = null, $app_action = null)
 {
     $app = new phpos_app();
     $app->set_app_id($app_id);
     $app->load_config();
     if (!empty($icon)) {
         $user_icons = new phpos_icons();
         $user_icons_dir = $user_icons->get_icons_dir();
         $user_icons_url = $user_icons->get_icons_url();
         if (file_exists($user_icons_dir . $icon)) {
             return $user_icons_url . $icon;
         }
     } else {
         if ($app_id == 'mediaframes') {
             return ICONS . 'mediaframes/' . $app_action . '.png';
         }
         return $app->get_icon();
     }
 }
	PHPOS Web Operating system
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
if (form_submit('new_mediaframe')) {
    $shortcut = new phpos_shortcuts();
    $app_id = $my_app->get_param('link_param');
    $app = new phpos_app();
    $app->set_app_id($app_id);
    $app->load_config();
    $location_id = $my_app->get_param('location');
    $id_parent = 0;
    switch ($location_id) {
        case 'desktop':
            $location = 'desktop';
            break;
        case 'menustart':
            $location = 'menustart';
            break;
        case 'db':
            $location = 'db';
            break;
        case 'edit':
Beispiel #5
0
**********************************

	PHPOS Web Operating system
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
if (APP_ACTION == 'cp') {
    $cp = new phpos_app();
    $cp_array = $cp->cp_list();
    $title = '<img src="' . ICONS . 'server/cp.png' . '" style="width:30px; display:inline-block; vertical-align:middle" />  ' . txt('control_panel');
    $html['icons'] .= $layout->area_start($title);
    $html['icons'] .= $layout->txtdesc(txt('control_panel_desc'));
    $html['right_items_title'] = txt('control_panel');
    $html['right_items_desc'] = txt('control_panel_right_desc');
    $html['right_items_img'] = 'cp.png';
    foreach ($cp_array as $cp_app) {
        foreach ($cp_app as $item) {
            $cp->set_app_id($item['app_id']);
            $cp->load_config();
            $tmp_app_action = '';
            if (!empty($item['id'])) {
                $tmp_app_action = '@' . $item['id'];
            }
 public function cp_list()
 {
     $all_apps = $this->apps_list();
     foreach ($all_apps as $app_name) {
         $app = new phpos_app();
         $app->set_app_id($app_name);
         $app->load_config();
         if ($app->have_cp()) {
             $cp_array[] = $app->get_cp_list();
         }
     }
     return $cp_array;
 }
	PHPOS Web Operating system
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
?>
<div id="phpos_startmenu_layout_apps">
<?php 
$apps = new phpos_app();
$app_list = $apps->my_apps_list();
$c = count($app_list);
if ($c != 0) {
    foreach ($app_list as $item) {
        $apps->set_app_id($item);
        $apps->load_config();
        $is_hide = $apps->get_hidden();
        if (!$is_hide) {
            echo '<div class="startmenu_app_item" title="' . $apps->get_desc() . '" onclick="' . $apps->link_action() . '"><img src="' . $apps->get_icon() . '"><span>' . $apps->get_title() . '</span></div>';
            /*
            echo '<div class="startmenu_app_item" title="'.$apps->get_desc().'" onclick="'.$apps->link_action().'"><img src="'.$apps->get_icon().'"><span>'.txt($item).'</span></div>';
            */
        }
    }
}
    $succ_msg = txt('shortcuts_window_msg_media_updated');
}
$monit_success = "\n\t\tjSuccess(\n\t\t\t'" . $succ_msg . "',\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;
$app = new phpos_app();
$app->set_app_id($link_param);
$app->load_config();
$html .= $layout->txtdesc(txt('st_shortcut_medialink'));
$form = new phpos_forms();
$form->onsuccess($success_code);
$form->focus('new_link_name');
$html .= $form->form_start('new_mediaframe', helper_ajax('iframeAction.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', '', '', 'app');
$app = new phpos_app();
$app->set_app_id('mediaframes');
$app->load_config();
$actions = $app->get_actions();
$c = count($actions);
if ($c != 0) {
    $html .= $layout->subtitle(txt('shortcuts_media_type_title'), MY_RESOURCES_URL . 'mediaframes.png');
    $html .= $layout->txtdesc(txt('shortcuts_media_type_desc'));
    $items = array();
    foreach ($actions as $key => $data) {
        $items[$key] = $data['name'];
        $default_value = $app->get_default_action();
    }
    // if edit
    $link_id = $my_app->get_param('link_id');
    if (!empty($link_id)) {
	MIT License
	(c) 2013 Marcin Szczyglinski
	szczyglis83@gmail.com
	GitHUB: https://github.com/phpos/
	File version: 1.0.0, 2013.10.08
 
**********************************
*/
if (!defined('PHPOS')) {
    die;
}
if (form_submit('new_link')) {
    $shortcut = new phpos_shortcuts();
    $app_id = $my_app->get_param('link_param');
    // app params
    $app = new phpos_app();
    $app->set_app_id($app_id);
    $app->load_config();
    $params = $app->get_available_params();
    $c = count($params);
    if ($c != 0) {
        $post_app_params = array();
        foreach ($params as $key => $data) {
            $post_param = 'param_' . $key;
            if (isset($_POST[$post_param])) {
                $post_app_params[$key] = $_POST[$post_param];
            }
        }
    }
    $location_id = $my_app->get_param('location');
    $id_parent = 0;
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);
jquery_onready($js_delete);
include PHPOS_DIR . 'views/startmenuView.php';
echo $my_app->render_javascript_jquery();
Beispiel #11
0
    */
} else {
    // app params
    $location_id = $my_app->get_param('location');
    $wincfg['title'] = txt('shortcuts_window_title_app_step2');
    $wincfg['width'] = '600';
    $wincfg['height'] = '550';
    $button = txt('shortcuts_window_btn_app_new');
    if ($location_id != 'edit') {
        $succ_msg = txt('shortcuts_window_msg_app_created');
    } else {
        $succ_msg = txt('shortcuts_window_msg_app_updated');
    }
    $monit_success = "\n\t\tjSuccess(\n\t\t\t'" . $succ_msg . "',\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;
    $app = new phpos_app();
    $app->set_app_id($link_param);
    $app->load_config();
    if ($back == 1) {
        $html .= $layout->back_button(txt('shortcuts_window_back_to_apps'), link_action('app', 'link_param:0'), txt('shortcuts_window_back_to_apps'), null);
    }
    $html .= $layout->subtitle($app->get_title(), $app->get_icon());
    $html .= $layout->subtitle(txt('shortcuts_app_form_choose_params'), MY_RESOURCES . 'upload.png');
    $html .= $layout->txtdesc(txt('shortcuts_app_form_choose_params_desc'));
    $form = new phpos_forms();
    $form->onsuccess($success_code);
    $html .= $form->form_start('new_link', helper_ajax('appAction.php'), array('app_params' => ''));
    $after_reload = $my_app->get_param('after_reload');
    $form->reload_after_submit(array($after_reload));
    $form->input('hidden', 'user_action_new', '', '', '1');
    $form->input('hidden', 'new_link_type', '', '', 'app');