summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3f44b1)
raw | patch | inline | side by side (parent: e3f44b1)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 1 Dec 2006 08:56:17 +0000 (08:56 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 1 Dec 2006 08:56:17 +0000 (08:56 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5282 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc
index f92e10a990e7fcea1544a1681aba58aea24772b1..b2464b1aaa5ff5b35fa3f804dbef45fd4865b2a3 100755 (executable)
}
}
- /* Get copy & paste icon */
- $ui = get_userinfo();
- $acl = $ui->get_permissions("cn=dummy,".$this->selectedBase,"application/application");
- $acl_all= $ui->has_complete_category_acls($this->selectedBase,"application");
+ /* Get acls */
+ $ui = get_userinfo();
+ $acl = $ui->get_permissions("cn=dummy,".$this->selectedBase,"application/application");
+ $acl_all = $ui->has_complete_category_acls($this->selectedBase,"application");
+
+ /* If this is true we have to add a seperator after
+ adding the special icons, just have a look at the lines below */
+ $add_sep = false;
+ /* Get copy & paste icon */
+ $Copy_Paste ="";
if((preg_match("/(c.*w|w.*c)/",$acl_all)) && ($this->parent->CopyPasteHandler)){
- $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
- }else{
- $Copy_Paste ="";
+ $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
+ $add_sep = true;
}
/* Create listhead, it will be shown on top of the divlist.
"title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'> ".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ /* Add snapshot header icons */
if(preg_match("/(c.*w|w.*c)/",$acl_all)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
+ $add_sep = true;
}
+ /* Add create icon */
if(preg_match("/c/",$acl)){
- $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_app.png' alt='"._("new")."'
+ $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_app.png' alt='"._("new")."'
title='"._("Create new application")."' name='appl_new'> ";
+ $add_sep = true;
+ }
+
+ /* Add copy & paste icon */
+ $listhead.= $Copy_Paste;
+
+ /* Add a seperator if required and the list will look perfectly */
+ if($add_sep){
+ $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
}
- $listhead.= $Copy_Paste.
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+ /* And the rest, a base selection box */
+ $listhead .= _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
"</div>";
diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc
index 7ea33e77518d3c22c64363495e2268cea1fed25c..712ba87905e36befccdc98b90b925b3f348facd9 100755 (executable)
}
- $listhead .= $acl." <img class='center' src='images/list_seperator.png' align='middle' ".
+ $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' ".
" alt='' height='16' width='1'> ".
" "._("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle' ".
diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc
index 13501175afdd82801501d87a52452395029a7f9e..2a270b34e20d20a8d6a3b00ecf21eed9ad5df17c 100644 (file)
}
}
+ /* Get acls */
$acls = $ui->get_permissions($this->selectedBase,"groups/group");
$acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups");
+ /* If this is true add a seperator after added c&p and snapshot icons to header */
+ $addsep = false;
+
/* Get copy & paste icon */
+ $Copy_Paste ="";
if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
$Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
- }else{
- $Copy_Paste ="";
+ $addsep = true;
}
// Managment
" <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
" <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'> ";
+ /* Add snapshot restore icon and force a following seperator */
if(preg_match("/(c.*w|w.*c)/",$acl_all)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
- }else{
- $listhead .= "<img class='center' src='images/restore_grey.png' alt=''> ";
+ $addsep = true;
}
+ /* Add Create group icon */
if(preg_match("/c/",$acls)) {
$listhead.=" <input type='image' class='center' src='images/list_new_group.png'
title='"._("Create new group")."' alt='"._("New")."' name='group_new'> ";
+ $addsep = true;
}
- $listhead.= $Copy_Paste.
- " <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'> ".
- _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+ /* Assign copy & paste icons */
+ $listhead.= $Copy_Paste;
+
+ /* Append an additional seperator */
+ if($addsep){
+ $listhead.=" <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'> ";
+ }
+
+ /* Add department selection */
+ $listhead .= _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input type='image' class='center' src='images/list_submit.png' title='"._("Submit department")."' name='submit_department' alt='"._("Submit").
"'> ".
"</div>";
diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc
index c538f6e94ae2dbb41909cb09d15345c756c432d3..b1fd3768eafe50a6136307d61bac184fb676825e 100755 (executable)
}
}
- $ui = get_userinfo();
- $acl = $ui->get_permissions("cn=dummy,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype");
+ /* Get acls */
+ $ui = get_userinfo();
+ $acl = $ui->get_permissions("cn=dummy,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype");
$acl_all = $ui->has_complete_category_acls($this->selectedBase,"mimetypes") ;
+
+ /* If this is true we add an additional seperator. Just look a few lines below */
+ $add_sep = false;
+
/* Get copy & paste icon */
+ $Copy_Paste ="";
if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
$Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
- }else{
- $Copy_Paste ="";
+ $add_sep = true;
}
/* Create listhead, it will be shown on top of the divlist.
"title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'> ".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ /* Create snapshot icons */
if(preg_match("/(c.*w|w.*c)/",$acl_all)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
+ $add_sep = true;
}
+ /* Add create icon */
if(preg_match("/c/",$acl)){
$listhead .= " <input class='center' type='image' align='middle' src='images/list_new_mime.png' alt='"._("new").
"' title='"._("Create new mime type")."' name='mime_new'> ";
+ $add_sep = true;
}
- $listhead .=
- $Copy_Paste.
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+ /* Add copy & paste icons */
+ $listhead .= $Copy_Paste;
+
+ /* Add a seperator ? */
+ if($add_sep) {
+ $listhead .= " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+ /* And at least add a department selection box */
+ $listhead .= _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
"</div>";
diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc
index 2609fda973ec6da4c266234459f2018d5e9b0e17..c661eb577a2a65fee27defd1cd2084d1c58b3070 100755 (executable)
}
}
+ /* Add a seperator after displaying c&p and snapshot icons ? */
+ $add_sep = false;
+
/* Get copy & paste icon */
$acls = $ui->get_permissions($this->selectedBase,"ogroups/ogroup");
$acl_all= $ui->has_complete_category_acls($this->selectedBase,"ogroups");
+ $Copy_Paste ="";
if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
$Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
- }else{
- $Copy_Paste ="";
+ $add_sep = true;
}
// Managment
title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'> ".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
-
+ /* Add snapshot restore icons */
if(preg_match("/(c.*w|w.*c)/",$acl_all)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
- }else{
- $listhead .= "<img class='center' src='images/restore_grey.png' alt=''> ";
+ $add_sep = true;
}
+ /* Create new ogroup icon */
if(preg_match("/c/",$acls)) {
$listhead .=" <input class='center' type='image' align='middle' src='images/list_new_ogroup.png'
title='"._("Create new object group")."' alt='"._("new")."' name='group_new'>";
+ $add_sep = true;
}
- $listhead .= $Copy_Paste.
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+ /* Add copy & paste icon */
+ $listhead .= $Copy_Paste;
+
+ /* Should we add a seperator here ? */
+ if($add_sep){
+ $listhead .=" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+ /* Add department selector */
+ $listhead .= _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
"</div>";
diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc
index d5ddeec8251cb9a44baa8ca68e6a2af0d04c645b..d624ec0ec6edbaab19937dea3ebd2b98093a704e 100644 (file)
$all_module_acls .= $ui->has_complete_category_acls($this->selectedBase,$module)." | ".$module."<br>";
}
+ /* Must we add an additional seperator */
+ $add_sep = false;
+
+ /* Add the basic icons for navigation */
$listhead = "<div style='background:#F0F0F9;padding:5px;'>".
" <input class='center' type='image' src='images/list_root.png' align='middle'
title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'> ".
" <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ /* Add snapshot icons */
if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
+ $add_sep = true;
}
-
+ /* Handle create icons */
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_terminal.png'
name='newsystem_terminal' alt='"._("New Terminal template")."' title='"._("New Terminal")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_workstation.png'
name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"server/servgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_server.png'
name='newsystem_server' alt='"._("New Server")."' title='"._("New Server")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_printer.png'
name='newsystem_printer' alt='"._("New Printer")."' title='"._("New Printer")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_phone.png'
name='newsystem_phone' alt='"._("New Phone")."' title='"._("New Phone")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_component.png'
name='newsystem_component' alt='"._("New Component")."' title='"._("New Component")."'> ";
}
- $listhead .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> "._("Base")." ".
- " <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+ /* Should we add a seperator ? */
+ if($add_sep){
+ $listhead .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+ /* Add base selection */
+ $listhead .= _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ".
"</div>";
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 021c75f9d0f5b6864dbd6fbe27e31abb6d306aac..7b55b0ed4d8475746fbc0120eb0f1d74bcfc3755 100644 (file)
var $description = "";
var $labeledURI = "";
var $gotoPrinterPPD = "";
+ var $initial_PPD = "";
var $orig_dn = "";
var $UserMember ="";
$this->gotoPrinterPPD = preg_replace("/^http.*ppd\//i","",$this->gotoPrinterPPD);
}
+ $this->initial_PPD = $this->gotoPrinterPPD;
+
/* Prepare different member types */
foreach(array("AddUser" =>"gotoUserPrinter",
"AddGroup" =>"gotoGroupPrinter",
unset($og->member[$this->dn]);
$og->save ();
}
+
+ /* Remove previously selected ppd file.*/
+ if(!empty($this->initial_PPD)){
+ $tmp = new printerPPDDialog($this->config, $this->dn,$this->initial_PPD);
+ $tmp->removeModifiedPPD();
+ }
}
}
$this->PPDdialogToSave->save_ppd();
}
+ /* Remove previously selected ppd file.*/
+ if($this->initial_PPD != $this->gotoPrinterPPD){
+ if(!empty($this->initial_PPD)){
+ $tmp = new printerPPDDialog($this->config, $this->dn,$this->initial_PPD);
+ $tmp->removeModifiedPPD();
+ }
+ }
+
if(preg_match("/https/i",$_SERVER['HTTP_REFERER'])){
$method="https://";
}else{
diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc
index 9296afe61985cfcd1585baae1e9ef623dcdb16c7..fd041b762aad8eed5f15933145a9b86a4de6b269 100644 (file)
}
return($str);
}
+
+ function removeModifiedPPD()
+ {
+ $path = $this->pathToPPD.$this->pathToModified.$this->selectedPPD['link'];
+
+ if(file_exists($path)){
+ if(is_writeable($path)){
+ if(!@unlink($path)){
+ print_red(sprintf(_("Removing old ppd file '%s' failed."),$path));
+ }
+ }else{
+ print_red(sprintf(_("Removing old ppd file '%s' failed. File is not accessible."),$path));
+ }
+ }else{
+ print_red(sprintf(_("Removing old ppd file '%s' failed. File does not exists or is not accessible."),$path));
+ }
+ }
function check()
{