Example #1
0
            $contextMenus['DIR'][] = '---';
            $contextMenus['DIR'][] = 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit';
        }
        if (!$readonly || is_root()) {
            $contextMenus['WINDOW'][] = 'newfolder::' . txt('new_folder') . '::' . winmodal(txt('new_folder'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',back:null, dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::folder_files';
            if (globalconfig('disable_upload') != 1 || is_root()) {
                $contextMenus['WINDOW'][] = 'upload::' . txt('upload_here') . '::' . winmodal('Nowa ikona', 'app', 'app_id:shortcuts@upload,width:300,height:350', 'desktop:1,location:' . $context_location . ',back:null,dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::disk';
            }
        } else {
            $contextMenus['WINDOW'] = array('read::This folder is readonly::;::login');
        }
        break;
    case 'ftp':
        $contextMenus['FILE'] = array('open::' . txt('open') . '::explorer_ftp_view("' . $icons[$i]['id'] . '", "' . $icons[$i]['basename'] . '", "' . $my_app->get_param('fs') . '");::folder_open', '---', 'download::' . txt('download') . '::explorer_ftp_download("' . $icons[$i]['id'] . '", "' . $icons[$i]['basename'] . '", "' . $my_app->get_param('fs') . '");::download', '---', 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',action_id:null,edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit');
        $contextMenus['DIR'] = array('open::' . txt('open') . '::alert("normalopen' . $item . '");::folder_open', '---', 'rename::' . txt('rename') . '::' . winmodal(txt('rename'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',dir_id:' . $context_dir_id . ',action_id:null,edit_id:' . base64_encode($icons[$i]['id']) . ',old_name:' . base64_encode($icons[$i]['basename']) . ',after_reload:' . WIN_ID) . '::edit');
        $contextMenus['WINDOW'] = array('newfolder::' . txt('new_folder') . '::' . winmodal(txt('new_folder'), 'app', 'app_id:shortcuts@folder', 'location:' . $context_location . ',back:null, dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::folder_files', 'upload::' . txt('upload_here') . '::' . winmodal('Nowa ikona', 'app', 'app_id:shortcuts@upload,width:300,height:350', 'desktop:1,location:' . $context_location . ',back:null,dir_id:' . $context_dir_id . ',after_reload:' . WIN_ID) . '::disk');
        break;
}
if (APP_ACTION == 'desktop') {
    //$contextMenus['WINDOW'][] = '---';
    $contextMenus['WINDOW'][] = 'wallpaper::' . txt('change_desktop_wallpaper') . '::' . winopen(txt('account_settings'), 'cp', 'app_id:users@index', 'section:wallpapers') . '::application';
    //$contextMenus['WINDOW'][] = '---';
    //$contextMenus['WINDOW'][] = '---';
    if ($context_fs == 'local_files') {
        $action = "phpos.desktopSwitch('database'); \$('#desktop_switch_left').click(); ";
        $contextMenus['WINDOW'][] = 'todb::' . txt('context_to_db') . '::' . $action . '::application';
    } else {
        $action = "phpos.desktopSwitch('local_files'); \$('#desktop_switch_right').click(); ";
        $contextMenus['WINDOW'][] = 'tolocal::' . txt('context_to_local') . '::' . $action . '::application';
    }
}
Example #2
0
function actionStopShare($menu_item)
{
    global $my_app;
    $j = winmodal(txt('share_folder'), 'app', 'app_id:shortcuts@share,width:300,height:350', 'stop_share:1,desktop:1,location:' . $context_location . ',dir_id:' . $context_dir_id . ',shared_id:' . base64_encode($my_app->get_param('dir_id')) . ',after_reload:' . WIN_ID);
    return $j;
}
     $shared = new phpos_shared();
     if (!defined('SHARED')) {
         $plugged_context_menu[] = '---';
         if (!$shared->is_folder_shared($icons[$i]['id'])) {
             $plugged_context_menu[] = 'share::' . txt('share_folder') . '::' . winmodal(txt('share_folder'), 'app', 'app_id:shortcuts@share,width:300,height:350', 'desktop:1,location:' . $context_location . ',dir_id:' . $context_dir_id . ',shared_id:' . base64_encode($icons[$i]['id']) . ',after_reload:' . WIN_ID) . '::ftpfolder';
         } else {
             $icons[$i]['is_shared'] = true;
             $plugged_context_menu[] = 'share::' . txt('stop_share_folder') . '::' . winmodal(txt('share_folder'), 'app', 'app_id:shortcuts@share,width:300,height:350', 'stop_share:1,desktop:1,location:' . $context_location . ',dir_id:' . $context_dir_id . ',shared_id:' . base64_encode($icons[$i]['id']) . ',after_reload:' . WIN_ID) . '::ftpfolder';
         }
     }
 }
 /*.............................................. */
 // file properties
 if ((APP_ACTION == 'index' || APP_ACTION == 'desktop') && $context_fs == 'ftp' || $context_fs == 'local_files') {
     $plugged_context_menu[] = '---';
     $plugged_context_menu[] = 'properties::' . txt('fileinfo_context') . '::' . winmodal(txt('file_info'), 'app', 'app_id:shortcuts@file_info', 'location:' . $context_location . ',fs:' . $context_fs . ',edit_id:' . base64_encode($icons[$i]['id']) . ',dir_name:' . base64_encode(dirname($icons[$i]['id'])) . ',file_name:' . base64_encode($icons[$i]['basename']) . ',file_modified:' . base64_encode($icons[$i]['modified_at']) . ',file_type:' . base64_encode($icons[$i]['extension']) . ',file_chmod:' . base64_encode($icons[$i]['chmod']) . ',file_created:' . base64_encode($icons[$i]['created_at']) . ',after_reload:' . WIN_ID) . '::edit';
 }
 /*.............................................. */
 // action from context
 if (!empty($plugged_context_menu[0]) && ($context_fs == 'ftp' || $context_fs == 'local_files')) {
     $e = explode('::', $plugged_context_menu[0]);
     if ($e[0] == 'open' && !empty($e[1]) && !$phposFS->is_directory($icons[$i])) {
         $icons[$i]['action'] = str_replace('"', '\'', $e[2]);
     }
 }
 /*.............................................. */
 // Rewrite render code from plugin
 if (!empty($my_plugin) && !empty($plugindata['render_rewrite'])) {
     $html['icons'] .= $explorer->get_explorer_icon_html($icons[$i], $plugindata['render_rewrite']);
 } else {
     $html['icons'] .= $explorer->get_explorer_icon_html($icons[$i]);
Example #4
0
 public function generate_to_edit_context($filesystem, $plugin_id, $link_param, $id = null)
 {
     switch ($filesystem) {
         case 'local_files':
             break;
             /*.............................................. */
         /*.............................................. */
         case 'db_mysql':
             switch ($plugin_id) {
                 case 'app':
                 case 'link':
                     $shortcut_action = 'app';
                     if ($link_param == 'webframes') {
                         $shortcut_action = 'iframe';
                     }
                     if ($link_param == 'mediaframes') {
                         $shortcut_action = 'medialink';
                     }
                     if ($plugin_id == 'link') {
                         $shortcut_action = 'link';
                     }
                     $param_id = null;
                     if (!empty($id)) {
                         $param_id = ',link_id:' . $id;
                     }
                     $str = 'edit_link::' . txt('edit_shortcut') . '::' . winmodal(txt('edit_shortcut'), 'app', 'app_id:shortcuts@' . $shortcut_action . ',width:300,height:350', 'desktop:1,back:null,location:edit,after_reload:' . WIN_ID . ',link_type:app,link_param:' . $link_param . $param_id) . '::edit';
                     break;
             }
             break;
     }
     return $str;
 }
 public function savefile_dialog()
 {
     $allowed = null;
     if ($this->allowed_extensions_exists()) {
         $allowed = $this->parse_allowed_extensions();
     }
     //$this->cache_data_to_save($data);
     $str .= winmodal(txt('explorer_api_window_save_title'), 'app', 'app_id:explorer@index,width:700,height:450', 'api_dialog:1,api_dialog_type:save_as_file,api_file_ext:' . $this->file_extension . ',fs:' . $this->fs . ',win_id:' . $this->window_id . $allowed);
     return $str;
 }