<?xml version="1.0" encoding="UTF-8"?>
<driver name="mysql" className="class.mysqlDriver.php">
	<actions>
		<action name="ls" dirDefault="true">			
			<gui text="32" title="32" src="fileopen.png"
				accessKey="folder_access_key">
				<context selection="true" dir="" recycle="false"
					actionBar="false" actionBarGroup="get" contextMenu="true" infoPanel="false">
				</context>
				<selectionContext dir="true" file="false" recycle="false"
					unique="true" allowedMimes="">
				</selectionContext>
			</gui>
			<rightsContext noUser="true" userLogged="only" read="true"
				write="false" adminOnly="false">
			</rightsContext>
			<processing>
				<clientCallback prepareModal="true"><![CDATA[
					var path;					
					if(window.actionArguments && window.actionArguments.length>0){
						path = window.actionArguments[0];
					}else{
						userSelection = ajaxplorer.getFilesList().getUserSelection();
						if(userSelection && userSelection.isUnique() && (userSelection.hasDir() || userSelection.hasMime(["zip"]))){
							path = userSelection.getUniqueFileName();
						}
					}
					if(path){
						ajaxplorer.getFoldersTree().goToDeepPath(path);
						ajaxplorer.filesList.loadXmlList(path);
						ajaxplorer.getActionBar().updateLocationBar(path);
					}
					]]></clientCallback>
				<serverCallback methodName="switchAction"></serverCallback>
			</processing>
		</action>
		<action name="set_query">
			<gui text="32" title="32" src="fileopen.png"
				accessKey="folder_access_key">
				<context selection="false" dir="" recycle="false"
					actionBar="false" actionBarGroup="get" contextMenu="false" infoPanel="false">
				</context>
				<selectionContext dir="true" file="true" recycle="false"
					unique="true" allowedMimes="">
				</selectionContext>
			</gui>
			<rightsContext noUser="true" userLogged="only" read="true"
				write="false" adminOnly="false">
			</rightsContext>
			<processing>
				<serverCallback methodName="switchAction"></serverCallback>
			</processing>
		</action>
		<action name="mkdir">			
			<gui text="267" title="268" src="sql_images/actions/ICON_SIZE/table_new.png" accessKey="folder_access_key" hasAccessKey="false">
				<context selection="false" dir="true" recycle="hidden" actionBar="true" contextMenu="true" infoPanel="false" actionBarGroup="put" inZip="false"></context>
			</gui>
			<rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
			<processing>
				<clientCallback prepareModal="true"><![CDATA[					
					var sTitle = MessageHash[187];
					var loadFunc = function(oForm){
						ajaxplorer.actionBar.sqlEditor = new SQLEditor(oForm);
						ajaxplorer.actionBar.sqlEditor.createTableEditor();
					};
					modal.showDialogForm('Create Table', 'mysql_edit_table', loadFunc, null, null, true, true);
					]]></clientCallback>
				<serverCallback methodName="switchAction"></serverCallback>
				</processing>
		</action>
		<action name="mkfile">
			<gui text="273" title="274" src="sql_images/actions/ICON_SIZE/table_record_new.png" accessKey="file_access_key" hasAccessKey="false">
				<context selection="false" dir="true" recycle="hidden"
					actionBar="true" contextMenu="true" infoPanel="false"
					actionBarGroup="change" inZip="false" root="false">
				</context></gui>
			<rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
			<processing>
				<clientCallback prepareModal="true"><![CDATA[
					var loadFunc = function(oForm){
						ajaxplorer.actionBar.sqlEditor = new SQLEditor(oForm);
						ajaxplorer.actionBar.sqlEditor.createRecordEditor();
					};
					var completeFunc = function(){
						ajaxplorer.actionBar.sqlEditor.submitRecordForm();
						return false;
					};
					modal.showDialogForm('Add Record', 'mysql_edit_record', loadFunc, completeFunc, null);
					]]></clientCallback>
				<serverCallback methodName="switchAction"></serverCallback>
				</processing>
		</action>
		<action name="edit_table">
			<gui text="269" title="270" src="sql_images/actions/ICON_SIZE/table_edit.png" accessKey="edit_access_key" hasAccessKey="false">
				<context selection="false" dir="true" recycle="hidden" 
					actionBar="true" contextMenu="true" infoPanel="true"
					actionBarGroup="put" inZip="false" root="false">
				</context>
				<selectionContext dir="true" file="true" recycle="false" unique="true" allowedMimes="pk" behaviour="hidden"></selectionContext></gui>
			<rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
			<processing>
				<clientCallback prepareModal="true"><![CDATA[
					var currentTable = ajaxplorer.filesList.getCurrentRep();
					var sTitle = MessageHash[187]+currentTable;
					var loadFunc = function(oForm){
						ajaxplorer.actionBar.sqlEditor = new SQLEditor(oForm);
						ajaxplorer.actionBar.sqlEditor.createTableEditor(currentTable);
					};
					modal.showDialogForm('Edit Table Columns', 'mysql_edit_table', loadFunc, null, null, true, true);
					]]></clientCallback>
				<clientForm id="mysql_edit_table"><![CDATA[
					<div id="mysql_edit_table" action="edit_table" box_width="800">
					</div>
					<div id="create_table_template" class="sqlForm">
						<table>
							<thead>
							<tr>
								<td new="false"></td>
								<td>Field Name</td>
								<td>Type</td>
								<td>Size or Set</td>
								<td>NULL</td>
								<td>Default</td>
								<td>Other Flags</td>
								<td edit="false">PK</td>
								<td edit="false">IDX</td>
								<td edit="false">UNIQ</td>
							</tr>
							</thead>
							<tbody>
								<tr>
									<td new="false"></td>
									<td><input name="field_name" type="text"/><input type="hidden" name="field_origname"/></td>
									<td><select name="field_type">
											<option value="tinyint">TINYINT</option>
											<option value="smallint">SMALLINT</option>
											<option value="mediumint">MEDIUMINT</option>
											<option value="int">INT</option>
											<option value="integer">INTEGER</option>
											<option value="bigint">BIGINT</option>
											<option value="real">REAL</option>
											<option value="double">DOUBLE</option>
											<option value="float">FLOAT</option>
											<option value="decimal">DECIMAL</option>
											<option value="numeric">NUMERIC</option>
											<option value="date">DATE</option>
											<option value="time">TIME</option>
											<option value="timestamp">TIMESTAMP</option>
											<option value="datetime">DATETIME</option>
											<option value="char">CHAR</option>
											<option value="varchar">VARCHAR</option>
											<option value="tinyblob">TINYBLOB</option>
											<option value="blob">BLOB</option>
											<option value="mediumblob">MEDIUMBLOB</option>
											<option value="longblob">LONGBLOB</option>
											<option value="tinytext">TINYTEXT</option>
											<option value="text">TEXT</option>
											<option value="mediumtext">MEDIUMTEXT</option>
											<option value="longtext">LONGTEXT</option>
											<option value="enum">ENUM</option>
											<option value="set">SET</option>
										</select>
									</td>
									<td><input name="field_size" type="text"/></td>
									<td>
										<select name="field_null">
											<option/>
											<option value="NULL">Yes</option>
											<option value="NOT NULL">No</option>
										</select>
									</td>
									<td><input name="field_default" type="text"/></td>
									<td><input name="field_flags" type="text"/></td>
									<td edit="false"><input name="field_pk" type="checkbox" value="1" class="checkbox"/></td>
									<td edit="false"><input name="field_index" type="checkbox" value="1" class="checkbox"/></td>
									<td edit="false"><input name="field_uniq" type="checkbox" value="1" class="checkbox"/></td>
								</tr>
							</tbody>
						</table>
					</div>
					<div id="replication_chooser">
					<fieldset>
						<legend>Step 1: Choose a number of fields</legend>
					<table class="sqlRecordForm">
						<tr>
						<td class="sqlLabelTd">Name of the table : </td><td class="sqlFieldTd"><input type="text" id="table_name"/></td>
						</tr>
						<tr>
						<td class="sqlLabelTd">Number of fields : </td><td class="sqlFieldTd"><input style="width:30px !important;" type="text" id="fields_number"/></td>
						</tr>
					</table>
					<div class="dialogButtons">					
						<input type="button" id="can" value="Cancel" class="dialogButton"/>
						<input type="button" id="toNext" value="Next &gt;&gt;" class="dialogButton"/>
					</div>
					</fieldset>
					</div>
				]]></clientForm>
				<serverCallback methodName="switchAction"></serverCallback>
				</processing>
		</action>
		<action name="edit_record">
			<gui text="51" title="276" src="sql_images/actions/ICON_SIZE/table_record_edit.png" accessKey="edit_access_key" hasAccessKey="false">
				<context selection="true" dir="" recycle="hidden" 
					actionBar="true" contextMenu="true" infoPanel="true"
					actionBarGroup="change" inZip="false" root="false">
				</context>
				<selectionContext dir="false" file="true" recycle="false" unique="true" allowedMimes="pk" behaviour="hidden"></selectionContext></gui>
			<rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
			<processing>
				<clientCallback prepareModal="true"><![CDATA[
					var userSelection =  ajaxplorer.getFilesList().getUserSelection();					
					var loadFunc = function(oForm){
						ajaxplorer.actionBar.sqlEditor = new SQLEditor(oForm);
						ajaxplorer.actionBar.sqlEditor.createRecordEditor(userSelection);
					};
					var completeFunc = function(){
						ajaxplorer.actionBar.sqlEditor.submitRecordForm();
						return false;
					};					
					modal.showDialogForm('Edit Online', 'mysql_edit_record', loadFunc, completeFunc, null);
					]]></clientCallback>
				<clientForm id="mysql_edit_record"><![CDATA[
					<div id="mysql_edit_record" action="edit_record" box_width="600">					
					</div>
				]]></clientForm>
				<serverCallback methodName="switchAction"></serverCallback>
				</processing>
		</action>
		<action name="delete_table">
			<gui text="271" title="272" src="sql_images/actions/ICON_SIZE/table_delete.png" accessKey="delete_access_key" hasAccessKey="false">
				<context selection="true" dir="true" recycle="false"
					actionBar="true" contextMenu="true" infoPanel="false"
					actionBarGroup="put" inZip="false">
				</context>
				<selectionContext dir="true" file="false" recycle="false" unique="false" allowedMimes="*" behaviour="hidden"></selectionContext></gui>
			<rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
			<processing>
				<clientCallback prepareModal="true"><![CDATA[
					var onLoad = function(oForm){
				    	var message = MessageHash[275];
		   		    	$(oForm).getElementsBySelector('span[id="delete_message"]')[0].innerHTML = message;
					};
					modal.showDialogForm('Delete', 'delete_form', onLoad, function(){
						var oForm = modal.getForm();
						ajaxplorer.filesList.getUserSelection().updateFormOrUrl(oForm);
						ajaxplorer.actionBar.submitForm(oForm);
						hideLightBox(true);
						return false;
					});
					]]></clientCallback>
				<clientForm id="delete_form"><![CDATA[
				<div id="delete_form" action="delete_table" box_width="280">
<span id="delete_message"></span>
</div>				]]></clientForm>
				<serverCallback methodName="switchAction"></serverCallback>
				</processing>
		</action>
		<action name="delete_record">
			<gui text="7" title="277" src="sql_images/actions/ICON_SIZE/table_record_delete.png" accessKey="delete_access_key" hasAccessKey="true">
				<context selection="true" dir="true" recycle="false"
					actionBar="true" contextMenu="true" infoPanel="false"
					actionBarGroup="change" inZip="false">
				</context>
				<selectionContext dir="false" file="true" recycle="false" unique="false" allowedMimes="pk" behaviour="hidden"></selectionContext></gui>
			<rightsContext noUser="true" userLogged="only" read="true" write="true" adminOnly=""></rightsContext>
			<processing>
				<clientCallback prepareModal="true"><![CDATA[
					var onLoad = function(oForm){
				    	var message = MessageHash[278];
		   		    	$(oForm).getElementsBySelector('span[id="delete_message"]')[0].innerHTML = message;
					};
					modal.showDialogForm('Delete', 'delete_record_form', onLoad, function(){
						var oForm = modal.getForm();
						ajaxplorer.filesList.getUserSelection().updateFormOrUrl(oForm);
						ajaxplorer.actionBar.submitForm(oForm);
						hideLightBox(true);
						return false;
					});
					]]></clientCallback>
				<clientForm id="delete_record_form"><![CDATA[
				<div id="delete_record_form" action="delete_record" box_width="280">
<span id="delete_message"></span>
</div>				]]></clientForm>
				<serverCallback methodName="switchAction"></serverCallback>
				</processing>
		</action>
	</actions>
	<infoPanels>
		<infoPanel mime="no_selection" attributes="">
			<messages>
				<message key="folders_string" id="279"/>
				<message key="files_string" id="280"/>
				<message key="totalsize_string" id="259"/>
			</messages>
			<html><![CDATA[
				<div style="padding:10px;">
					<big style="font-weight: bold; font-size: 14px; color:#79f;display: block; text-align:center; padding-bottom:20px;">#{current_folder}</big>
					<div id="filelist_folders_count"><b>#{folders_string}</b> : #{filelist_folders_count}</div>
					<div id="filelist_files_count"><b>#{files_string}</b> : #{filelist_files_count}</div>
					<div id="filelist_totalsize"><b>#{totalsize_string}</b> #{filelist_totalsize}</div>
				</div>
			]]></html>
		</infoPanel>
		<infoPanel mime="table" attributes="count,text">
			<messages>
				<message key="files_string" id="280"/>
			</messages>
			<html><![CDATA[
				<div style="padding:10px;">
					<big style="font-weight: bold; font-size: 14px; color:#79f;display: block; text-align:center; padding-bottom:20px;">#{text}</big>
					<div><b>#{files_string}</b> : #{count}</div>
				</div>
			]]></html>
		</infoPanel>
	<!--
		<infoPanel mime="generic_file" attributes="basename,icon,filesize,mimestring,modiftime">
			<messages>
				<message key="name_string" id="133"/>
				<message key="size_string" id="127"/>
				<message key="type_string" id="134"/>
				<message key="modif_string" id="138"/>
			</messages>
			<html><![CDATA[
			<div style="padding:10px;">
				<div class="folderImage">
					<img src="AJXP_CLIENT_RESOURCES_FOLDER/images/crystal/mimes/64/#{icon}" height="64" width="64">
				</div>
				<b>#{name_string}</b> : #{basename}
				<br><b>#{size_string}</b> : #{filesize}
				<br><b>#{type_string}</b> : #{mimestring}
				<br><b>#{modif_string}</b> : #{modiftime}
			</div>
			]]></html>
		</infoPanel>
		<infoPanel mime="generic_dir" attributes="basename,icon,modiftime">
			<messages>
				<message key="name_string" id="133"/>
				<message key="modif_string" id="138"/>
			</messages>
			<html><![CDATA[
				<div style="padding:10px;">
					<div class="folderImage">
						<img src="AJXP_CLIENT_RESOURCES_FOLDER/images/crystal/mimes/64/#{icon}" height="64" width="64">
					</div>
					<b>#{name_string}</b> : #{basename}
					<br><b>#{modif_string}</b> : #{modiftime}
				</div>
			]]></html>
		</infoPanel>
	-->
	</infoPanels>
</driver>
