summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 01994e8)
raw | patch | inline | side by side (parent: 01994e8)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Jun 2007 09:44:32 +0000 (09:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Jun 2007 09:44:32 +0000 (09:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6575 594d385d-05f5-0310-b6e9-bd551577e9d8
index 6bbc8b9c45e1433dcd0f9461b248272d0c072c94..7be1906dbf7d85e237d638f2122096d5b699bf3f 100644 (file)
$listhead .= " <input class='center' type='image' align='middle' src='images/edittrash.png'
title='"._("Remove selected fai objects")."' alt='"._("Remove fai objects")."' name='remove_multiple_fai_objects'> ";
+ /* Add multiple copy & cut icons */
+ if(is_object($this->parent->CopyPasteHandler)){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcopy.png'
+ title='"._("Copy selected objects")."' alt='"._("Copy fai objects")."' name='multiple_copy_fai'> ";
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcut.png'
+ title='"._("cut selected objects")."' alt='"._("Cut fai objects")."' name='multiple_cut_fai'> ";
+ $listhead .= "</div>";
+ }
+
$listhead .="</div>";;
index 52a9bbd122956820a166ad816599cef522a552b6..e95dc01c3ce685d2866f443ac2aa41faccffb344 100644 (file)
var $dispNewFreeze= false;
var $DivListFai;
+ var $start_pasting_copied_objects = FALSE;
+ var $CopyPasteHandler = FALSE;
/* construction/reconstruction
*/
"/create_variable/i"=>"new_variable", "/create_template/i"=>"new_template",
"/create_package/i"=>"new_package", "/create_profile/i"=>"new_profile",
"/edit_continue/"=>"select_class_name_finished",
-
+ "/^multiple_copy_fai/" => "copy_multiple",
+ "/^multiple_cut_fai/" => "cut_multiple",
"/^remove_multiple_fai_objects/" => "del_multiple");
foreach($_POST as $name => $value){
diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc
index 6ee3469aef97d478c14906eb33a75a1ad365378f..87b7bbaa4524b4e7c499c026164720767303b1b7 100755 (executable)
$listhead .= " <input class='center' type='image' align='middle' src='images/edittrash.png'
title='"._("Remove selected mimetype")."' alt='"._("Remove mimetype")."' name='remove_multiple_mimetypes'> ";
+ /* Add multiple copy & cut icons */
+ if(is_object($this->parent->CopyPasteHandler)){
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcopy.png'
+ title='"._("Copy selected object")."' alt='"._("Copy object")."' name='multiple_copy_mimetypes'> ";
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcut.png'
+ title='"._("cut selected object")."' alt='"._("Cut object")."' name='multiple_cut_mimetypes'> ";
+ }
+
$listhead .="</div>";;
$this->SetListHeader($listhead);
diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc
index 22b56bc94b123a13911905379c68c889bb7e0e83..df8c0d839f35ac9e679658e3b905c57cad787197 100644 (file)
function PrepareForCopyPaste($source)
{
plugin::PrepareForCopyPaste($source);
- $this->gotoMimeIcon = $this->iconData;
- $this->use_gotoMimeIcon = $source->use_gotoMimeIcon;
+
+ $source_o = new mimetype($this->config,$source['dn'],$this->parent);
+
+ foreach(array("gotoMimeEmbeddedApplication","gotoMimeApplication","gotoMimeFilePattern","use_gotoMimeFilePattern") as $name){
+ $this->$name = $source_o->$name;
+ }
+ foreach($this->attributes as $name){
+ $this->$name = $source_o->$name;
+ }
}
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/plugins/admin/mimetypes/class_mimetypeManagement.inc b/plugins/admin/mimetypes/class_mimetypeManagement.inc
index 4955d2fe7677f72c5a0fa187469c9730ee5161f0..793d7696155693870df2fd4d76fb20da8c7d3b6f 100755 (executable)
var $mimetabs = NULL;
var $snapDialog = NULL;
var $CopyPasteHandler = NULL;
+ var $start_pasting_copied_objects = FALSE;
+
function mimetypeManagement ($config, $ui)
{
$s_action="del_multiple";
}elseif(preg_match("/^editPaste.*/i",$key)){
$s_action="editPaste";
+ }elseif(preg_match("/^multiple_copy_mimetypes/",$key)){
+ $s_action = "copy_multiple";
+ }elseif(preg_match("/^multiple_cut_mimetypes/",$key)){
+ $s_action = "cut_multiple";
}
}
Copy & Paste handling
****************/
- /* Only perform copy / paste if it is enabled
- */
- if($this->CopyPasteHandler){
- if($str = $this->copyPasteHandling($s_action,$s_entry)){
- return($str);
- };
+ /* Display the copy & paste dialog, if it is currently open */
+ $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry);
+ if($ret){
+ return($ret);
}
}
- function copyPasteHandling($s_action,$s_entry)
+ function copyPasteHandling_from_queue($s_action,$s_entry)
{
- /* Paste copied/cutted object in here
- */
- if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){
- $this->CopyPasteHandler->save_object();
- $this->CopyPasteHandler->SetVar("base", $this->DivListMimeTypes->selectedBase);
-
- if($str = $this->CopyPasteHandler->execute()) {
- return($str);
- }
+ /* Check if Copy & Paste is disabled */
+ if(!is_object($this->CopyPasteHandler)){
+ return("");
}
- /* Copy current object to CopyHandler
- */
- if($s_action == "copy"){
- $this->CopyPasteHandler->Clear();
+ /* Add a single entry to queue */
+ if($s_action == "cut" || $s_action == "copy"){
+
+ /* Cleanup object queue */
+ $this->CopyPasteHandler->cleanup_queue();
$dn = $this->mimetypes[$s_entry]['dn'];
+ $this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes");
+ }
+
+ /* Add entries to queue */
+ if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
- /* Check acls */
- $acl_all= $this->ui->has_complete_category_acls($dn,"mimetypes");
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
- $obj = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes");
- $obj->set_acl_base($this->dn);
- $objNew = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], "new","mimetypes");
- $objNew->set_acl_base($this->dn);
- $this->CopyPasteHandler->Copy($obj,$objNew);
+ /* Cleanup object queue */
+ $this->CopyPasteHandler->cleanup_queue();
+
+ /* Add new entries to CP queue */
+ foreach($this->list_get_selected_items() as $id){
+ $dn = $this->mimetypes[$id]['dn'];
+
+ if($s_action == "copy_multiple"){
+ $this->CopyPasteHandler->add_to_queue($dn,"copy","mimetabs","MIMETABS","mimetypes");
+ }
+ if($s_action == "cut_multiple"){
+ $this->CopyPasteHandler->add_to_queue($dn,"cut","mimetabs","MIMETABS","mimetypes");
+ }
}
}
- /* Copy current object to CopyHandler
- */
- if($s_action == "cut"){
- $this->CopyPasteHandler->Clear();
- $dn = $this->mimetypes[$s_entry]['dn'];
+ /* Start pasting entries */
+ if($s_action == "editPaste"){
+ $this->start_pasting_copied_objects = TRUE;
+ }
+
+ /* Return C&P dialog */
+ if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
+
+ /* Load entry from queue and set base */
+ $this->CopyPasteHandler->load_entry_from_queue();
+ $this->CopyPasteHandler->SetVar("base",$this->DivListMimeTypes->selectedBase);
- /* Check acls */
- $acl_all= $this->ui->has_complete_category_acls($dn,"mimetypes");
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
- $obj = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn);
- $this->CopyPasteHandler->Cut($obj);
+ /* Get dialog */
+ $data = $this->CopyPasteHandler->execute();
+
+ /* Return dialog data */
+ if(!empty($data)){
+ return($data);
}
}
+
+ /* Automatically disable status for pasting */
+ if(!$this->CopyPasteHandler->entries_queued()){
+ $this->start_pasting_copied_objects = FALSE;
+ }
+ return("");
}
+
/* Check if the release management is activated. */
function IsReleaseManagementActivated()
{