function theme_cmis_browser_folder_picker in CMIS API 6.3
Same name and namespace in other branches
- 6.4 cmis_browser/cmis_browser.theme.inc \theme_cmis_browser_folder_picker()
- 7.2 cmis_browser/cmis_browser.theme.inc \theme_cmis_browser_folder_picker()
- 7 cmis_browser/cmis_browser.theme.inc \theme_cmis_browser_folder_picker()
Theme for cmis_browser folder picker widget.
Parameters
$textfield_element:
1 theme call to theme_cmis_browser_folder_picker()
- cmis_browser_browse_form in cmis_browser/
cmis_browser.module - Implementation of hook_form().
File
- cmis_browser/
cmis_browser.theme.inc, line 131
Code
function theme_cmis_browser_folder_picker($textfield_element) {
drupal_add_css(drupal_get_path('module', 'cmis_browser') . '/css/cmis_browser.css');
drupal_add_js(drupal_get_path('module', 'cmis_browser') . '/js/jquery.tree.min.js');
drupal_add_js('
$(document).ready(function(){
$("#' . $textfield_element['#id'] . '-cmis-picker")
.find("div.form-item").css("display","inline").end()
.find("a:first").click(function() {
$(".tree",$(this).parent()).toggle();
}).end()
.find(".tree").tree({
callback: {
onselect: function(node, tree) {
var text_element = $("#' . $textfield_element['#id'] . '");
text_element.attr("value", "/");
($(node).attr("rel")=="folder"?$(node).children():$(node))
.parents("li").map(function(el){
text_element.attr("value",
"/" + $.trim($("a:first", $(this)).text()) + text_element.attr("value"));
}); tree.container.toggle();
}
},
ui:{dots:false},
data:{
type: "json", async:true, opts: {url: "' . url('cmis/tree') . '"}
},
types:{
"default": {draggable: false, deletable: false, renameable: false},
"folder": {
valid_children : [ "document" ],
icon: {
image: "' . url(drupal_get_path('module', 'cmis_browser')) . '/images/space.gif"
}
},
"document": {
valid_children: "none", max_children: 0, max_depth: 0,
icon: {
image: "' . url(drupal_get_path('module', 'cmis_browser')) . '/images/file.png"
},
}
}
}).css("width", $("#' . $textfield_element['#id'] . '").attr("offsetWidth").toString()+"px")
});', 'inline');
return '<div id="' . $textfield_element['#id'] . '-cmis-picker" style="display:block">' . theme('textfield', $textfield_element) . '<a href="#"> Tree </a>' . '<div class="tree" style="display:none"></div>' . '</div>';
}