コード例 #1
0
ファイル: indexAction.php プロジェクト: brian-clemont/phpos
//echo 'id file: '.$my_app->get_param('id_file').'<br>';
if ($my_app->get_param('file_info') !== null) {
    $file_info = $my_app->get_param('file_info');
    winset('title', $file_info['basename']);
    $explorerAPI->set_file_info($file_info);
    $str_file = '<span style="color:black; font-weight:bold;font-size:16px">' . $file_info['basename'] . ' </span>';
    $str_fileinfo = '<img src="' . MY_RESOURCES_URL . 'db_file.png" />' . $str_file . ' <b style="padding-left:30px;color:black">' . txt('last_mod') . ':</b> ' . date('Y.m.d. H:i', $file_info['modified_at']) . ', <b style="color:black">' . txt('filesystem') . ':</b> ' . txt('fs_' . $file_info['fs']);
    echo "<script>\$('#notepadform input[name=action]').val('save');</script>";
    //echo $layout->subtitle('<span style="color:black">'.$file_info['basename'].' </span>', MY_RESOURCES_URL.'db_file.png');
} else {
    $str_fileinfo = '<img src="' . MY_RESOURCES_URL . 'db_file.png" /><span style="color:black; font-weight:bold;font-size:16px">' . txt('app_notepad_new_unsaved') . '</span>';
}
$save_action = "\t\t\t\n\t\t\$('#notepadform input[name=action]').val('save');\n\t\t\$('#notepadform').submit(); \t\t\n\t\t";
$save_as_action = "\t\t\t\n\t\t\$('#notepadform input[name=action]').val('save_as');\n\t\t\$('#notepadform').submit(); \t\t\n\t\t";
$forma = new phpos_forms();
$forma->onsuccess($explorerAPI->savefile_dialog());
echo $forma->form_start('notepadform', '', array('app_params' => ''));
$forma->input('hidden', 'win_id', '', '', WIN_ID);
$forma->input('hidden', 'action', '', '', 'save_as');
$forma->reload_after_submit(array('n'));
$forma->texteditor('txt', null, null, $my_app->get_param('notepad'));
if (is_array($file_info)) {
    $forma->button(txt('save'), $save_action, 'filesave');
}
$forma->button(txt('save_as'), $save_as_action, 'edit_add');
$forma->status();
echo $forma->render();
echo $forma->form_end();
/*	
	echo '<pre>';
	print_r($_SESSION['phpos_savefiles_handler']);