summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 771471a)
raw | patch | inline | side by side (parent: 771471a)
| author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
| Thu, 28 Jan 2010 15:32:49 +0000 (15:32 +0000) | ||
| committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
| Thu, 28 Jan 2010 15:32:49 +0000 (15:32 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15426 594d385d-05f5-0310-b6e9-bd551577e9d8
| gosa-core/html/autocomplete.php | patch | blob | history | |
| gosa-core/html/themes/default/style.css | patch | blob | history | |
| gosa-core/include/class_baseSelector.inc | patch | blob | history |
index 76b026106e9746e66864ed184ab092f57cfbb1e6..fe3da73b8d599e326c8ab4fe0106357f35ac3fc6 100644 (file)
exit;
}
-$config = session::global_get('config');
-$ui = session::global_get('ui');
+/* Base completition or filter completition? */
+if (isset($_GET['type']) && $_GET['type'] == "base") {
+ if (session::is_set("pathMapping") && count($_POST) == 1) {
+ $res= "";
+ $pathMapping= session::get("pathMapping");
+ $search= current($_POST);
+ foreach ($pathMapping as $key => $value) {
+ if (mb_stristr($value, $search) !== false) {
+ $res.= "<li>$value</li>";
+ }
+ }
-/* Is there a filter object arround? */
-if (session::is_set("autocomplete")){
- $filter= session::get("autocomplete");
- $filter->processAutocomplete();
+ /* Return results */
+ if (!empty($res)) {
+ echo "<ul>$res</ul>";
+ }
+ }
+
+} else {
+
+ $config = session::global_get('config');
+ $ui = session::global_get('ui');
+
+ /* Is there a filter object arround? */
+ if (session::is_set("autocomplete")){
+ $filter= session::get("autocomplete");
+ $filter->processAutocomplete();
+ }
}
?>
index 9bbe1036655369c7a3937eceb94b3fa8bc4e36cb..54d78bc0c365eeaaa774d42ad36b749a343c261d 100644 (file)
border:1px solid #AAA;
margin:0;
padding:0;
+ z-index: 600;
}
div.autocomplete ul {
index 5ff4823981b8bbe166114248c8a951306e4c8098..0de55ac3293bfe7fe1bdaba67dfa349568d1375f 100644 (file)
private $base;
private $pid;
private $action;
+ private $submitButton= true;
protected $tree;
protected $pathMapping;
}
+ function setSubmitButton($flag)
+ {
+ $this->submitButton= $flag;
+ }
+
+
function setBase($base)
{
if (isset($this->pathMapping[$base])) {
die ("Base mismatch!");
}
}
+ } elseif (isset($_POST['bs_input_'.$this->pid])) {
+
+ // Check if base is available
+ foreach ($this->pathMapping as $key => $path) {
+ if (mb_strtolower($path) == mb_strtolower($_POST['bs_input_'.$this->pid])) {
+ $this->base= $key;
+ break;
+ }
+ }
+
}
/* Skip if there's no change */
}
$link= "href='?plug=".$_GET['plug']."&PID=".$this->pid."&REBASE=".base64_encode($config->current['BASE'])."'";
- $this->tree= "<input type='text' size='35' name='bs_input_".$this->pid."' id='bs_input_".$this->pid."' onfocus=\"\$('bs_".$this->pid."').hide()\" onmouseover=\"Element.clonePosition(\$('bs_".$this->pid."'), 'bs_input_".$this->pid."', {setHeight: false, setWidth: false, offsetTop:(Element.getHeight('bs_input_".$this->pid."'))});\$('bs_".$this->pid."').show();\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\" value='".$this->pathMapping[$this->base]."' readonly>";
+ $this->tree= "<input type='text' size='35' name='bs_input_".$this->pid."' id='bs_input_".$this->pid."' onkeydown=\"\$('bs_".$this->pid."').hide()\" onfocus=\"\$('bs_".$this->pid."').hide()\" onmouseover=\"Element.clonePosition(\$('bs_".$this->pid."'), 'bs_input_".$this->pid."', {setHeight: false, setWidth: false, offsetTop:(Element.getHeight('bs_input_".$this->pid."'))});\$('bs_".$this->pid."').show();\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\" value='".$this->pathMapping[$this->base]."'>";
+
+
+ // Autocompleter
+ $this->tree.= "<div id='autocomplete_".$this->pid."' class='autocomplete'></div>".
+ "<script type='text/javascript'>".
+ "new Ajax.Autocompleter('bs_input_".$this->pid."', 'autocomplete_".$this->pid."', 'autocomplete.php?type=base', { minChars: 3, frequency: 0.5 });".
+ "$('bs_input_".$this->pid."').observe('keypress', function(event) { if(event.keyCode == Event.KEY_RETURN) { $('submit_base_".$this->pid."').click(); } });".
+ "</script>";
$selected= $this->base == $config->current['BASE']?"Selected":"";
$this->tree.= "<div class='treeList' style='display:none' id='bs_".$this->pid."' onmouseover=\"window.clearTimeout(rtimer);\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\"><a class='treeList$selected' $link>/ ["._("Root")."]</a><ul class='treeList'>\n";
$this->tree.= "</li></ul>\n";
}
$this->tree.= "</div>\n";
+
+ // Draw submitter if required
+ if ($this->submitButton) {
+ $this->tree.= " <input class='center' type='image' src='images/lists/submit.png' align='middle' title='"._("Submit")."' name='submit_base_".$this->pid."' id='submit_base_".$this->pid."' alt='"._("Submit")."'>";
+ }
+
}
function render()