File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 5252 });
5353});
5454
55+ $(document).on("click", ".dropdown-menu li a", function () {
56+ var textValue = $(this).text();
57+ $.ajax({
58+ contentType: "application/x-www-form-urlencoded",
59+ data: "textValue="+textValue,
60+ url: " ' . api_get_path (WEB_AJAX_PATH ) . 'document.ajax.php?a=documentDestination",
61+ type: "POST"
62+ });
63+ });
64+
5565function setFocus() {
5666 $("#document_title").focus();
5767}
@@ -432,6 +442,20 @@ function document_exists($filename)
432442 $ values = $ form ->exportValues ();
433443 $ readonly = isset ($ values ['readonly ' ]) ? 1 : 0 ;
434444 $ values ['title ' ] = trim ($ values ['title ' ]);
445+
446+ $ textValue = $ _SESSION ['textValue ' ];
447+ $ homeDirectory = get_lang ('HomeDirectory ' );
448+ if ($ textValue === $ homeDirectory ){
449+ $ dir = "/ " ;
450+ } else if ($ dir != "/ " ) {
451+ $ posTextValue = strpos ($ textValue , '— ' );
452+ $ textValue = substr ($ textValue , ($ posTextValue + 4 ));
453+ foreach ($ folder_titles as $ dirValue => $ dirText ) {
454+ if ($ dirText === $ textValue ) {
455+ $ dir = $ dirValue ;
456+ }
457+ }
458+ }
435459
436460 if ($ dir [strlen ($ dir ) - 1 ] != '/ ' ) {
437461 $ dir .= '/ ' ;
Original file line number Diff line number Diff line change 7373 );
7474 }
7575 break ;
76+ case 'documentDestination ' :
77+ //obtained the bootstrap-select selected value via ajax
78+ $ textValue = isset ($ _POST ['textValue ' ]) ? $ _POST ['textValue ' ] : null ;
79+ $ _SESSION ['textValue ' ] = $ textValue ;
80+ break ;
7681}
7782exit ;
You can’t perform that action at this time.
0 commit comments