Commit e1fc8aca authored by Jerome Mariette's avatar Jerome Mariette
Browse files

download look

parent 0afa1500
......@@ -81,13 +81,11 @@ class tx_nG6_pi5 extends tslib_pibase {
$tmp_url = substr($this->conf["temp"], strpos($this->conf["temp"], "fileadmin"));
$content = '<h2>'.$this->getFieldHeader('title').'</h2>';
$content .= '<p>'.$this->getFieldHeader('msg').'</p>';
$content .= '<script type="text/javascript" class="source">
$(function () {
$("#download_tree").jstree({
"themes" : {
"theme" : "default",
"dots" : false,
"icons" : false
},
"html_data" : {
......@@ -106,6 +104,25 @@ class tx_nG6_pi5 extends tslib_pibase {
}
},
"plugins" : [ "themes", "html_data", "ui", "checkbox" ]
}).bind("change_state.jstree", function(event, data) {
var nb_selected = 0;
$("#download_list").html("<ul>");
$(".jstree-checked > ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked").each(function(){
nb_selected += 1;
if ($(this).attr("id").split("_")[0] == "run") {
$("#download_list > ul").append("<li>"+$(this).attr("id")+"</li>");
//alert($(this).html());
} else if ($(this).attr("id").split("_")[0] == "analyse") {
$("#download_list > ul").append("<li>"+$(this).html()+"</li>");
//alert($(this).html());
}
});
if (nb_selected == 0) {
$("#download_btn").addClass("tx-nG6-pi5-download-disable");
$("#download_list > ul").append("<li>'.$this->getFieldHeader('download_list_no_select').'</li>");
} else {
$("#download_btn").removeClass("tx-nG6-pi5-download-disable");
}
});
$("#download_dialog").dialog({
autoOpen: false,
......@@ -118,37 +135,46 @@ class tx_nG6_pi5 extends tslib_pibase {
opacity: 0.5
}
});
$("#download_btn").click(function(){
var url_val = "index.php?eID=tx_nG6&type=download&data_folder='.$this->conf["data"].'&tmp_folder='.$this->conf["temp"].'&ids=";
$(".jstree-checked > ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked").each(function(){
url_val += $(this).attr("id")+";";
});
$("#download_dialog").dialog("option", "title", "'.$this->getFieldHeader('download_dialog_title').'");
$("#download_dialog").html(\'<img src="fileadmin/templates/nG6template/images/light_wait.gif"/> '.$this->getFieldHeader('download_dialog_msg').'\').dialog("open");
$("#download_btn").click(function() {
if (!$(this).hasClass("tx-nG6-pi5-download-disable")) {
var url_val = "index.php?eID=tx_nG6&type=download&data_folder='.$this->conf["data"].'&tmp_folder='.$this->conf["temp"].'&ids=";
$(".jstree-checked > ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked").each(function(){
url_val += $(this).attr("id")+";";
});
$("#download_dialog").dialog("option", "title", "'.$this->getFieldHeader('download_dialog_title').'");
$("#download_dialog").html(\'<img src="fileadmin/templates/nG6template/images/light_wait.gif"/> '.$this->getFieldHeader('download_dialog_msg').'\').dialog("open");
$.ajax({
url: url_val,
success: function(val) {
$("#download_dialog").dialog("close");
url: url_val,
success: function(val) {
$("#download_dialog").dialog("close");
location.href = "'.$tmp_url.'/"+val;
}
}
});
}
});
});
</script> ';
// Build the lists of all elements */
$arrayProject = $this->get_project_list();
$content .= '<div id="download_dialog" title=""></div>'.
'<div id="download_tree"></div>';
$html_tree = "<input type='hidden' name = 'html_tree' id='html_tree' value='";
foreach($arrayProject as $project_id => $project_array) {
$html_tree .= "<li class=\"jstree-closed\" id=\"".$project_id."\"> <a href=\"#\">".
str_replace(array('###SPAN_NAME###'), array($project_array['name']), $this->getFieldHeader('project_description'))."</a></li>";
}
$content .= $html_tree."' />";
$html_tree .= "' />";
$content .= '<input class="tx-nG6-pi5-download" id="download_btn" type="button" value="'.$this->getFieldHeader('download_btn_label').'" />';
$content .= '<div '.$this->pi_classParam('download-builder-tree').'> <div '.$this->pi_classParam('download-builder-header').'> <h3> <img src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/img/download_builder.png" alt="" width="91" height="88" />'.$this->getFieldHeader('msg').'</h3></div> <div id="download_dialog" title=""></div>'.$html_tree;
$content .= '<div id="download_tree"></div></div>';
$content .= '<div '.$this->pi_classParam('download-builder').'> ';
$content .= '<div '.$this->pi_classParam('download-builder-group').'> <h2>'.$this->getFieldHeader('download_list_title').'<h2> <div id="download_list"> <ul><li>'.$this->getFieldHeader('download_list_no_select').'</li></ul></div></div>';
$content .= '<div '.$this->pi_classParam('download-builder-group').'> <h2>'.$this->getFieldHeader('download_format_title').'</h2>';
$content .= '<input type="radio" name="format" value="tar.gz"> .tar.gz <br /><input type="radio" name="format" value="zip"> .zip</div>';
$content .= '<div '.$this->pi_classParam('download-builder-group').' style="border-bottom: 0;margin-top: 0;margin-bottom:0;padding-bottom:0;"> <input class="tx-nG6-pi5-download tx-nG6-pi5-download-disable" id="download_btn" type="button" value="'.$this->getFieldHeader('download_btn_label').'" /> </div> </div>';
return $content;
}
......
......@@ -15,6 +15,9 @@
<label index="listFieldHeader_download_dialog_msg">File creation in progress ...</label>
<label index="listFieldHeader_title">Download center</label>
<label index="listFieldHeader_msg">First select all data you want to download, then click on the download button.</label>
<label index="listFieldHeader_download_list_title">Download Files list :</label>
<label index="listFieldHeader_download_format_title">Download format :</label>
<label index="listFieldHeader_download_list_no_select">No file selected.</label>
</languageKey>
<languageKey index="fr" type="array">
<label index="listFieldHeader_download_btn_label">T&amp;eacute;l&amp;eacute;charger</label>
......@@ -26,6 +29,9 @@
<label index="listFieldHeader_download_dialog_msg">Cr&amp;eacute;ation en cours ...</label>
<label index="listFieldHeader_title">T&amp;eacute;l&amp;eacute;chargement de vos donn&amp;eacute;es</label>
<label index="listFieldHeader_msg">S&amp;eacute;lectionner les donn&amp;eacute;es que vous souhaitez t&amp;eacute;l&amp;eacute;charger puis cliquer sur le bouton de t&amp;eacute;l&amp;eacute;chargement.</label>
<label index="listFieldHeader_download_list_title">Liste des fichiers &amp;agrave; t&amp;eacute;l&amp;eacute;charger :</label>
<label index="listFieldHeader_download_format_title">Format :</label>
<label index="listFieldHeader_download_list_no_select">Aucun fichier s&amp;eacute;l&amp;eacute;ctionn&amp;eacute;.</label>
</languageKey>
</data>
</T3locallang>
\ No newline at end of file
ui/nG6/res/js/themes/default/d.png

7.46 KB | W: | H:

ui/nG6/res/js/themes/default/d.png

7.56 KB | W: | H:

ui/nG6/res/js/themes/default/d.png
ui/nG6/res/js/themes/default/d.png
ui/nG6/res/js/themes/default/d.png
ui/nG6/res/js/themes/default/d.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -17,8 +17,6 @@
.jstree-default a .jstree-icon { background-position:-56px -19px; }
.jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
.jstree-default.jstree-focused { background:#ffffee; }
.jstree-default .jstree-no-dots li,
.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment