From: cajus Date: Sat, 30 Jan 2010 11:15:10 +0000 (+0000) Subject: * Removed "old" base selector X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=af70293b5e682561b4d510c2dc276fbd17f29b19;p=gosa.git * Removed "old" base selector * Removed js based width calculation * Updated first list template git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15485 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/html/include/focus.js b/gosa-core/html/include/focus.js index 52bcdcbbc..f67f8e616 100644 --- a/gosa-core/html/include/focus.js +++ b/gosa-core/html/include/focus.js @@ -323,12 +323,6 @@ function divGOsa_toggle(element) { } function adjust (e) { - adjust_height(e); - adjust_width(e); -} - -// Automatic resize (height) of divlists -function adjust_height(e) { if (!e) e=window.event; if (document.getElementById("menucell") && document.getElementById("d_scrollbody")) { var inner_height= window.innerHeight; @@ -388,110 +382,6 @@ function absTop(e) { return (e.offsetParent)?e.offsetTop+absTop(e.offsetParent) : e.offsetTop; } -// Automatic resize (width) of divlists -function adjust_width(e) -{ - - /* Get event ... it seems to be unused here ...*/ - if (!e) { - e=window.event; - } - - // Known to not work with IE - if(document.defaultView && document.getElementById("t_scrolltable")) { - - // Get current width of divlist - var div_width = parseInt(document.defaultView.getComputedStyle(document.getElementById("t_scrolltable"),"").getPropertyValue('width')); - - // Get window width - var width= parseInt(window.innerWidth); - - // Resize the body cells, 470 represents the info box and the navigation part - var save= 470; - if(document.getElementById('d_save')) { - save= document.getElementById('d_save').value; - } - var space= 600; - if(document.getElementById('d_space')) { - space= document.getElementById('d_space').value; - } - var diff= width - div_width - save; - - // window has been upscaled - if(div_width+diff>=space) { - if (width - save > space) { - document.getElementById('d_scrollbody').style.width=div_width+diff+"px"; - if (document.getElementById('t_scrollbody') != null) { - document.getElementById('t_scrollbody').style.width=(div_width-19)+diff+"px"; - } - - // Resize the Header cells (only the relative-width ones) - if (document.getElementById('t_scrollhead') != null) { - document.getElementById('t_scrollhead').style.width=div_width+diff+"px"; - } - } else { - document.getElementById('d_scrollbody').style.width=div_width+"px"; - if (document.getElementById('t_scrollbody') != null) { - document.getElementById('t_scrollbody').style.width=(div_width-19)+"px"; - } - - // Resize the Header cells (only the relative-width ones) - if (document.getElementById('t_scrollhead') != null) { - document.getElementById('t_scrollhead').style.width=div_width+"px"; - } - } - - // window has been downscaled, we must reset the div to 600px - } else if (width < 1200) { - // Reset layout (set width to 600px) - div_width=space; - document.getElementById('d_scrollbody').style.width=div_width+"px"; - if (document.getElementById('t_scrollbody') != null) { - document.getElementById('t_scrollbody').style.width=(div_width-19)+"px"; - } - - // Resize the Header cells (only the relative-width ones) - if (document.getElementById('t_scrollhead') != null) { - document.getElementById('t_scrollhead').style.width=div_width+"px"; - } - } - } else if(document.defaultView && document.getElementById("t_scrolltable_onlywidth")){ - // Resize the div - var div_width=parseInt(document.defaultView.getComputedStyle(document.getElementById("t_scrolltable_onlywidth"),"").getPropertyValue('width')); - var width= parseInt(window.innerWidth); - - // Resize the body cells - var diff= width-div_width-200; - - // window has been upscaled - if(div_width+diff>=600) { - if(document.getElementById('d_scrollbody_onlywidth')){ - document.getElementById('d_scrollbody_onlywidth').style.width=div_width+diff+"px"; - } - document.getElementById('t_scrollbody_onlywidth').style.width=(div_width-19)+diff+"px"; - - // Resize the Header cells (only the relative-width ones) - document.getElementById('t_scrollhead_onlywidth').style.width=div_width+diff+"px"; - - // window has been downscaled, we must reset the div to 600px - } else if (width < 930) { - // Reset layout (set width to 600px) - div_width=600; - if(document.getElementById('d_scrollbody_onlywidth')){ - document.getElementById('d_scrollbody_onlywidth').style.width=div_width+"px"; - } - document.getElementById('t_scrollbody_onlywidth').style.width=(div_width-19)+"px"; - - // Resize the Header cells (only the relative-width ones) - document.getElementById('t_scrollhead_onlywidth').style.width=div_width+"px"; - } - } else { - // IE - - } -} - - /* Set focus to first valid input field avoid IExplorer warning about hidding or disabled fields */ diff --git a/gosa-core/html/themes/default/style.css b/gosa-core/html/themes/default/style.css index 1eb0898b0..bac115c02 100644 --- a/gosa-core/html/themes/default/style.css +++ b/gosa-core/html/themes/default/style.css @@ -734,6 +734,7 @@ div.contentboxh { border-bottom-width:0px; height:26px; vertical-align:middle; + width:100%; } p.contentboxh { @@ -748,6 +749,7 @@ div.contentboxb { border:1px solid #b0b0b0; border-top-width:0px; vertical-align:middle; + width:100%; } p.contentboxb { @@ -1933,13 +1935,13 @@ div.listContainer { max-width:500px; } -td.nlistFooter { +div.nlistFooter { background-color:#E5E5E5; border-left:1px solid #C0C0C0; border-right:1px solid #C0C0C0; border-bottom:1px solid #C0C0C0; - padding:3px; - height:16px; + padding:0; + width:100%; } /* Sortable Lists */ diff --git a/gosa-core/ihtml/themes/default/baseSelect-filter.tpl b/gosa-core/ihtml/themes/default/baseSelect-filter.tpl deleted file mode 100644 index e9baf0ef5..000000000 --- a/gosa-core/ihtml/themes/default/baseSelect-filter.tpl +++ /dev/null @@ -1,34 +0,0 @@ -
-

- [F]{t}Filter{/t} -

-
- -
- -
- - {$SCOPE} - - - - - - - -
- - - {$NAME} -
- - - - - -
- {$APPLY} -
-
diff --git a/gosa-core/ihtml/themes/default/baseSelect-filter.xml b/gosa-core/ihtml/themes/default/baseSelect-filter.xml deleted file mode 100644 index eb64ae1e8..000000000 --- a/gosa-core/ihtml/themes/default/baseSelect-filter.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - departments - - true - - - - - BaseSelect - (&(objectClass=gosaDepartment)$NAME) - dn - objectClass - ou - description - - auto - - - - textfield - NAME - 18 - 60 - - - (|(ou=*$*)(dc=*$*)(c=*$*)(l=*$*)) - false - - BaseSelect - (&(objectClass=gosaDepartment)(|(ou=*$NAME*)(dc=*$NAME*)(l=*$NAME*)(c=*$NAME*))) - cn - dc - c - l - 0.5 - 3 - - - - diff --git a/gosa-core/ihtml/themes/default/baseSelect-list.tpl b/gosa-core/ihtml/themes/default/baseSelect-list.tpl deleted file mode 100644 index 109587341..000000000 --- a/gosa-core/ihtml/themes/default/baseSelect-list.tpl +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - -
-
-

 {$HEADLINE} {$SIZELIMIT}

-
- -
-
- - -
{$ROOT} {$BACK} {$HOME} {$RELOAD} {$SEPARATOR} {t}Base{/t} {$BASE} {$SEPARATOR}  {$ACTIONS}
-
-
- -
-
- - - {$LIST} -
- {$FILTER} -
- - diff --git a/gosa-core/ihtml/themes/default/baseSelect-list.xml b/gosa-core/ihtml/themes/default/baseSelect-list.xml deleted file mode 100644 index 88a09268b..000000000 --- a/gosa-core/ihtml/themes/default/baseSelect-list.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - false - false - true - true - - departments - - 1 - - - - domain - department - domain - plugins/departments/images/domain.png - - - - - dcObject - department - dcObject - plugins/departments/images/dc.png - - - - - country - department - country - plugins/departments/images/country.png - - - - - locality - department - locality - plugins/departments/images/locality.png - - - - - department - department - organization - plugins/departments/images/organization.png - - - - - organizationalUnit - department - department - images/lists/folder.png - - - - - |20px|||70px;r| - - - %{filter:objectType(dn,objectClass)} - - - - - ou - string - %{filter:depLabel(row,dn,"%s",ou,pid,base)} - true - - - - - description - string - %{filter:depLabel(row,dn,"%s",description,pid,base)} - true - - - - - %{filter:actions(dn,row,objectClass)} - - -
- - - - - - - - - edit - entry - - images/empty.png - - - - edit - entry - - images/lists/edit.png - - - - - -
diff --git a/gosa-core/include/class_baseSelectDialog.inc b/gosa-core/include/class_baseSelectDialog.inc deleted file mode 100644 index c358719d9..000000000 --- a/gosa-core/include/class_baseSelectDialog.inc +++ /dev/null @@ -1,157 +0,0 @@ -config = $config; - $this->ui = get_userinfo(); - $this->allowedBases = $onlyAllowThisBases; - session::set('filterBaseSelect_WhiteList', $this->allowedBases); - -# // Build filter -# if (session::global_is_set(get_class($this)."_filter")){ -# $filter= session::global_get(get_class($this)."_filter"); -# } else { - $filter = new filter(get_template_path("baseSelect-filter.xml")); -# } - $this->setFilter($filter); - - // Build headpage - $headpage = new listing(get_template_path("baseSelect-list.xml")); - $headpage->registerElementFilter("depLabel", "baseSelectDialog::filterDepLabel"); - $headpage->setFilter($filter); - $this->registerAction("open","openEntry"); - $this->registerAction("cancelBaseSelect","cancelBaseSelect"); - parent::__construct($config, $this->ui, "departments", $headpage); - } - - - // An action handler which enables to switch into deparmtment by clicking the names. - function openEntry($action,$entry) - { - $headpage = $this->getHeadpage(); - $headpage->setBase(array_pop($entry)); - } - - function execute() - { - $str = management::execute(); - $str.= "

 

-

- -

"; - return($str); - } - - - // A filter which allows to open a department by clicking on the departments name. - static function filterDepLabel($row,$dn,$params,$ou,$pid,$base) - { - $ou = $ou[0]; - if($dn == $base){ - $ou ="."; - } - $dn= LDAP::fix(func_get_arg(1)); - return("$ou"); - } - - - function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") - { - if(count($target) == 1){ - $this->BaseToUse = array_pop($target); - } - } - - function save_object() - { - // Damn ... , we've to call post detection manually & thus twice ... - // #FIXME - We should fix the class handling in the plugins to match the class_management style. - // - save_object isn't needed anymore, just call execute... - $this->handleActions($this->detectPostActions()); - } - - - function isClosed() - { - return($this->dialogClose); - } - - function isSelected() - { - return($this->BaseToUse); - } - - function setCurrentBase($base) - { - $headpage = $this->getHeadpage(); - $headpage->setBase = $base; - } - - function cancelBaseSelect() - { - $this->dialogClose = TRUE; - } - - function detectPostActions() - { - $action = management::detectPostActions(); - if(isset($_POST['cancelBaseSelect'])) $action['action'] = "cancelBaseSelect"; - return($action); - } -} - -class filterBaseSelect extends filterLDAP -{ - static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "") - { - $res= filterLDAP::query($base, $scope, $filter, $attributes, $category, $objectStorage); - return(filterBaseSelect::filterEntries($res)); - } - - static function filterEntries($res) - { - if(!session::is_set('filterBaseSelect_WhiteList')) return $res; - $list = session::get('filterBaseSelect_WhiteList'); - foreach($res as $key => $entry){ - if(!isset($list[$entry['dn']])) unset($res[$key]); - } - return(array_values($res)); - } -} -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?> diff --git a/gosa-core/include/class_baseSelector.inc b/gosa-core/include/class_baseSelector.inc index 81951f440..a766a4106 100644 --- a/gosa-core/include/class_baseSelector.inc +++ b/gosa-core/include/class_baseSelector.inc @@ -135,7 +135,6 @@ class baseSelector { $link= "onclick=\"\$('bs_rebase_".$this->pid."').value='".base64_encode($config->current['BASE'])."'; $('submit_tree_base_".$this->pid."').click();\""; $this->tree= "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=\"".preg_replace('/"/', '"',$this->pathMapping[$this->base])."\">"; - // Autocompleter $this->tree.= "
". "