EyeDialog
From eyeOS Wiki
Contents |
Description
eyeDialog is one of the eyeOS base apps. It can be used for selecting files, select destination, and so on. It's used in many base apps and also other apps that community's developers have made. The eyeDialog beta version 1.2 is improved version from current eyeDialog. It has so called "quickaccess"-panel where you can easily and quickly change current folder and also you will be able to open and save files straight to/from your groups directory groups (like public) and other groups that you have access. Here is the improved versions screenshot of eyeDialog v1.2 beta.
I'm drafting new version of eyeDialog for eyeOS v1.5 That screenshot will be included here when I have designed new look to it.
How it works
It returns a string that contains path and filename/foldername of selection. If selection is from your GROUPS_DIR, it returns the string of selection and adds /GROUPS_DIR to beginning of the string.
Example of use
To get value, example what file should open or where should some file to save, you can call eyeDialog to get that value: Code:
function eyeTest_on_Open($params=null) {
global $checknum;
$options = array( //Here are options line for eyeDialog
0, //Type of dialog, 0=Open, 1=Save
'FileToOpen', //Function to call after selection in eyeDialog
$checknum, //This is needed later to handle signal that eyeDialog sends.
1, //This is needed to use and display groups in eyeDialog.
);
service('proc','launch',array('eyeDialog',$options)); //Run eyeDialog with $options
}
eyeDialog returns file and it's path depending is it in user's home directory, or is it in some groups directory.
If choose is from user's home (and there under the Documents dir), the return of eyeDialog is: /Documents/some_selected_file.some
If choose is from groups directory (like example some wallpaper under the Public-directory) the return is: /groups/Public/wallpaper.png
How to check in your app, was the file selected from groups or from user's home, you can do that easily by making code that checks does the return start with words /GROUPS_DIR (GROUPS_DIR is defined in settings.php). If the begin of return is anything else, the file is from user's home directory.
Example how to check it
if(substr($ReturnStringFromEyeDialog,0,strlen('/'.GROUPS_DIR.'/')) == '/'.GROUPS_DIR.'/') {
echo "Returned value is from your groups directory";
} else {
echo "Returned value is from your home directory";
}
Changes
These changes doesn't effect for any application, so developpers DON'T HAVE TO CHANGE THEIR CODE. Everything works just like before. In the new version of eyeDialog is only improved user interface for normal users. For developpers, it gives a way to use groups directories in their applications. If you are a developper, please take a look above what eyeDialog returns on different cases.
Easily to said, before: it returned only values from user's home. and now: it does that too, but it can also return values from groups directories that user belongs to.
To identify is selection from some group directory (like Public), check the begin of eyeDialog's return value, is it your '/'.GROUPS_DIR or is it not.
Example values it returns
Here are example values about different cases:
- Userhome values:
- /Documents/readme.eyedoc
- /Pictures/summer.jpg
- Groups directories values:
- /groups/Public/Shared_Documents/ReadAboutSharing.eyedoc
- /groups/Public/Shared_Pictures/eyeOSwallpaper2.png
- (let's imaging that there is group named Developers)
- /groups/Developers/Codes/news.php
- /groups/Developers/Images/eyeOSlogo.png
--vilu 05:08, 4 February 2008 (EST)


