ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjectCopyGUI Class Reference

GUI class for the workflow of copying objects. More...

+ Collaboration diagram for ilObjectCopyGUI:

Public Member Functions

 __construct ($a_parent_gui)
 Constructor. More...
 
 executeCommand ()
 Control class handling. More...
 
 showTargetSelectionTree ()
 Show target selection. More...
 
 showSourceSelectionTree ()
 Show target selection. More...
 
 setMode ($a_mode)
 set copy mode More...
 
 getMode ()
 get copy mode More...
 
 getParentObject ()
 Get parent gui object. More...
 
 getType ()
 Returns $type. More...
 
 setType ($type)
 Sets $type. More...
 
 setSource ($a_source_id)
 Set source id. More...
 
 getSource ()
 Get source id. More...
 
 setTarget ($a_target)
 Set target id. More...
 
 getTarget ()
 Get copy target. More...
 
 keepObjectsInClipboard ()
 Keep objects in clipboard. More...
 
 copyMultipleNonContainer ($a_sources)
 Copy multiple non container. More...
 
 showSourceSearch ($a_tplvar)
 Show init screen Normally shown below the create and import form when creating a new object. More...
 

Data Fields

const SOURCE_SELECTION = 1
 
const TARGET_SELECTION = 2
 
const SEARCH_SOURCE = 3
 

Protected Member Functions

 init ()
 Init return, mode. More...
 
 initTargetSelection ()
 Init copy from repository/search list commands. More...
 
 initSourceSelection ()
 Init source selection. More...
 
 saveTarget ()
 Save target selection. More...
 
 cancel ()
 Cancel workflow. More...
 
 searchSource ()
 Search source. More...
 
 saveSource ()
 select source object More...
 
 showItemSelection ()
 
 copySingleObject ()
 Start cloning a single (not container) object. More...
 
 copyContainer ()
 Copy a container. More...
 
 sourceExists ()
 Check if there is any source object. More...
 
 initFormSearch ()
 Init search form. More...
 
 unsetSession ()
 Unset session variables. More...
 

Private Attributes

 $mode = 0
 
 $lng
 
 $parent_obj = null
 
 $type = ''
 
 $source = 0
 
 $target = 0
 

Detailed Description

GUI class for the workflow of copying objects.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilObjectCopyGUI:

Definition at line 14 of file class.ilObjectCopyGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectCopyGUI::__construct (   $a_parent_gui)

Constructor.

Returns

Definition at line 35 of file class.ilObjectCopyGUI.php.

References $ilCtrl, and $lng.

36  {
37  global $ilCtrl,$lng;
38 
39  $this->lng = $lng;
40  $this->lng->loadLanguageModule('search');
41  $this->lng->loadLanguageModule('obj');
42 
43  $this->parent_obj = $a_parent_gui;
44 
45  // this parameter may be filled in "manage" view
46  $ilCtrl->saveParameter($this, array("source_ids"));
47  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ cancel()

ilObjectCopyGUI::cancel ( )
protected

Cancel workflow.

Definition at line 520 of file class.ilObjectCopyGUI.php.

References $ilCtrl.

521  {
522  global $ilCtrl;
523  $ilCtrl->returnToParent($this);
524  }
global $ilCtrl
Definition: ilias.php:18

◆ copyContainer()

ilObjectCopyGUI::copyContainer ( )
protected

Copy a container.

Returns

Definition at line 848 of file class.ilObjectCopyGUI.php.

References $_COOKIE, $_POST, $_SESSION, $ilCtrl, $ilErr, $ilLog, $ilUser, $options, $result, $target_type, ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjectFactory\getInstanceByRefId(), getSource(), getTarget(), getType(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

849  {
850  global $ilLog, $ilCtrl;
851 
852  include_once('./Services/Link/classes/class.ilLink.php');
853  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
854 
855  global $ilAccess,$ilErr,$rbacsystem,$tree,$ilUser,$ilCtrl;
856 
857  // Workaround for course in course copy
858 
860  $source_type = ilObject::_lookupType(ilObject::_lookupObjId($this->getSource()));
861 
862  if($target_type != $source_type or $target_type != 'crs')
863  {
864  if(!$rbacsystem->checkAccess('create', $this->getTarget(),$this->getType()))
865  {
866  ilUtil::sendFailure($this->lng->txt('permission_denied'),true);
867  $ilCtrl->returnToParent($this);
868  }
869  }
870  if(!$this->getSource())
871  {
872  ilUtil::sendFailure($this->lng->txt('select_one'),true);
873  $ilCtrl->returnToParent($this);
874  return false;
875  }
876 
877  $options = $_POST['cp_options'] ? $_POST['cp_options'] : array();
879  $result = $orig->cloneAllObject($_COOKIE['PHPSESSID'], $_COOKIE['ilClientId'], $this->getType(), $this->getTarget(), $this->getSource(), $options);
880 
881 
882  unset($_SESSION["clipboard"]["ref_ids"]);
883  unset($_SESSION["clipboard"]["cmd"]);
884 
885  // Check if copy is in progress
886  if ($result == $this->getTarget())
887  {
888  ilUtil::sendInfo($this->lng->txt("object_copy_in_progress"),true);
889  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
890  $this->getTarget());
891  $ilCtrl->redirectByClass("ilrepositorygui", "");
892  }
893  else
894  {
895  ilUtil::sendSuccess($this->lng->txt("object_duplicated"),true);
896  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
897  $result);
898  $ilCtrl->redirectByClass("ilrepositorygui", "");
899  }
900  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getTarget()
Get copy target.
$_POST['username']
Definition: cron.php:12
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$target_type
Definition: goto.php:87
$result
$_COOKIE["ilClientId"]
Definition: cron.php:11
getType()
Returns $type.
getSource()
Get source id.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ copyMultipleNonContainer()

ilObjectCopyGUI::copyMultipleNonContainer (   $a_sources)

Copy multiple non container.

Parameters
array$a_sourcesarray of source ref ids

Definition at line 763 of file class.ilObjectCopyGUI.php.

References $_SESSION, $ilCtrl, $ilUser, ilCopyWizardOptions\_allocateCopyId(), ilCopyWizardOptions\_getInstance(), ilLink\_getLink(), ilObject\_lookupType(), ilRbacLog\add(), ilRbacLog\COPY_OBJECT, ilRbacLog\gatherFaPa(), ilObjectFactory\getInstanceByRefId(), getTarget(), ilRbacLog\isActive(), ilUtil\redirect(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

Referenced by copySingleObject(), and saveTarget().

764  {
765  global $ilAccess,$objDefinition,$rbacsystem,$ilUser,$ilCtrl,$rbacreview;
766 
767 
768  include_once('./Services/Link/classes/class.ilLink.php');
769  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
770 
771  // check permissions
772  foreach ($a_sources as $source_ref_id)
773  {
774  $source_type = ilObject::_lookupType($source_ref_id, true);
775 
776  // Create permission
777  if(!$rbacsystem->checkAccess('create', $this->getTarget(), $source_type))
778  {
779  ilUtil::sendFailure($this->lng->txt('permission_denied'),true);
780  $ilCtrl->returnToParent($this);
781  }
782 
783  // Copy permission
784  if(!$ilAccess->checkAccess('copy','',$source_ref_id))
785  {
786  ilUtil::sendFailure($this->lng->txt('permission_denied'),true);
787  $ilCtrl->returnToParent($this);
788  }
789 
790  // check that these objects are really not containers
791  if($objDefinition->isContainer($source_type))
792  {
793  ilUtil::sendFailure($this->lng->txt('cntr_container_only_on_their_own'),true);
794  $ilCtrl->returnToParent($this);
795  }
796  }
797 
798  reset($a_sources);
799 
800  // clone
801  foreach ($a_sources as $source_ref_id)
802  {
803  // Save wizard options
805  $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
806  $wizard_options->saveOwner($ilUser->getId());
807  $wizard_options->saveRoot((int) $source_ref_id);
808 
809  $wizard_options->read();
810 
811  $orig = ilObjectFactory::getInstanceByRefId((int) $source_ref_id);
812  $new_obj = $orig->cloneObject($this->getTarget(),$copy_id);
813 
814  // Delete wizard options
815  $wizard_options->deleteAll();
816 
817  // rbac log
818  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
819  if(ilRbacLog::isActive())
820  {
821  $rbac_log_roles = $rbacreview->getParentRoleIds($new_obj->getRefId(), false);
822  $rbac_log = ilRbacLog::gatherFaPa($new_obj->getRefId(), array_keys($rbac_log_roles), true);
823  ilRbacLog::add(ilRbacLog::COPY_OBJECT, $new_obj->getRefId(), $rbac_log, (int)$source_ref_id);
824  }
825  }
826 
827  unset($_SESSION["clipboard"]["ref_ids"]);
828  unset($_SESSION["clipboard"]["cmd"]);
829 
830  if (count($a_sources) == 1)
831  {
832  ilUtil::sendSuccess($this->lng->txt("object_duplicated"),true);
833  ilUtil::redirect(ilLink::_getLink($new_obj->getRefId()));
834  }
835  else
836  {
837  ilUtil::sendSuccess($this->lng->txt("objects_duplicated"),true);
839  }
840 
841  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getTarget()
Get copy target.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static isActive()
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
global $ilCtrl
Definition: ilias.php:18
static _getInstance($a_copy_id)
Get instance of copy wizard options.
const COPY_OBJECT
static _allocateCopyId()
Allocate a copy for further entries.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copySingleObject()

ilObjectCopyGUI::copySingleObject ( )
protected

Start cloning a single (not container) object.

Returns

Definition at line 682 of file class.ilObjectCopyGUI.php.

References $ilCtrl, $ilErr, $ilUser, ilCopyWizardOptions\_allocateCopyId(), ilCopyWizardOptions\_getInstance(), ilLink\_getLink(), ilRbacLog\add(), ilRbacLog\COPY_OBJECT, copyMultipleNonContainer(), ilRbacLog\gatherFaPa(), ilObjectFactory\getInstanceByRefId(), getSource(), getTarget(), getType(), ilRbacLog\isActive(), ilUtil\redirect(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

Referenced by saveSource(), and saveTarget().

683  {
684  include_once('./Services/Link/classes/class.ilLink.php');
685  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
686 
687  global $ilAccess,$ilErr,$rbacsystem,$ilUser,$ilCtrl,$rbacreview;
688 
689  // Source defined
690  if(!$this->getSource())
691  {
692  ilUtil::sendFailure($this->lng->txt('select_one'),true);
693  $ilCtrl->returnToParent($this);
694  }
695 
696  $this->copyMultipleNonContainer(array($this->getSource()));
697 
698  return;
699 
700  // old implementation
701 
702 
703 
704  // Create permission
705  if(!$rbacsystem->checkAccess('create', $this->getTarget(), $this->getType()))
706  {
707  ilUtil::sendFailure($this->lng->txt('permission_denied'),true);
708  $ilCtrl->returnToParent($this);
709  }
710  // Source defined
711  if(!$this->getSource())
712  {
713  ilUtil::sendFailure($this->lng->txt('select_one'),true);
714  $ilCtrl->returnToParent($this);
715  }
716  // Copy permission
717  if(!$ilAccess->checkAccess('copy','',$this->getSource()))
718  {
719  ilUtil::sendFailure($this->lng->txt('permission_denied'),true);
720  $ilCtrl->returnToParent($this);
721  }
722 
723  // Save wizard options
725  $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
726  $wizard_options->saveOwner($ilUser->getId());
727  $wizard_options->saveRoot((int) $this->getSource());
728 
729  /*
730  $options = $_POST['cp_options'] ? $_POST['cp_options'] : array();
731  foreach($options as $source_id => $option)
732  {
733  $wizard_options->addEntry($source_id,$option);
734  }
735  */
736 
737  $wizard_options->read();
738 
739  $orig = ilObjectFactory::getInstanceByRefId((int) $this->getSource());
740  $new_obj = $orig->cloneObject($this->getTarget(),$copy_id);
741 
742  // Delete wizard options
743  $wizard_options->deleteAll();
744 
745  // rbac log
746  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
747  if(ilRbacLog::isActive())
748  {
749  $rbac_log_roles = $rbacreview->getParentRoleIds($new_obj->getRefId(), false);
750  $rbac_log = ilRbacLog::gatherFaPa($new_obj->getRefId(), array_keys($rbac_log_roles), true);
751  ilRbacLog::add(ilRbacLog::COPY_OBJECT, $new_obj->getRefId(), $rbac_log, (int)$this->getSource());
752  }
753 
754  ilUtil::sendSuccess($this->lng->txt("object_duplicated"),true);
755  ilUtil::redirect(ilLink::_getLink($new_obj->getRefId()));
756  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getTarget()
Get copy target.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static isActive()
getType()
Returns $type.
getSource()
Get source id.
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
global $ilCtrl
Definition: ilias.php:18
static _getInstance($a_copy_id)
Get instance of copy wizard options.
const COPY_OBJECT
static _allocateCopyId()
Allocate a copy for further entries.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
copyMultipleNonContainer($a_sources)
Copy multiple non container.
global $ilUser
Definition: imgupload.php:15
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjectCopyGUI::executeCommand ( )

Control class handling.

Returns

Definition at line 53 of file class.ilObjectCopyGUI.php.

References $cmd, $ilCtrl, and init().

54  {
55  global $ilCtrl;
56 
57  $this->init();
58 
59  $next_class = $ilCtrl->getNextClass($this);
60  $cmd = $ilCtrl->getCmd();
61 
62 
63  switch($next_class)
64  {
65  default:
66  $this->$cmd();
67  break;
68  }
69  }
init()
Init return, mode.
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ getMode()

ilObjectCopyGUI::getMode ( )

get copy mode

Returns

Definition at line 440 of file class.ilObjectCopyGUI.php.

References $mode.

Referenced by showItemSelection().

441  {
442  return $this->mode;
443  }
+ Here is the caller graph for this function:

◆ getParentObject()

ilObjectCopyGUI::getParentObject ( )

Get parent gui object.

Returns
object parent gui

Definition at line 449 of file class.ilObjectCopyGUI.php.

References $parent_obj.

450  {
451  return $this->parent_obj;
452  }

◆ getSource()

ilObjectCopyGUI::getSource ( )

Get source id.

Returns

Definition at line 489 of file class.ilObjectCopyGUI.php.

References $_GET, and $_SESSION.

Referenced by copyContainer(), copySingleObject(), init(), initTargetSelection(), keepObjectsInClipboard(), saveTarget(), searchSource(), showItemSelection(), showSourceSelectionTree(), and showTargetSelectionTree().

490  {
491  if ($_GET["source_ids"] != "")
492  {
493  return "";
494  }
495  return $_SESSION['copy_source'];
496  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getTarget()

ilObjectCopyGUI::getTarget ( )

Get copy target.

Returns

Definition at line 512 of file class.ilObjectCopyGUI.php.

References $_SESSION.

Referenced by copyContainer(), copyMultipleNonContainer(), copySingleObject(), initSourceSelection(), and saveTarget().

513  {
514  return $_SESSION['copy_target'];
515  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ getType()

ilObjectCopyGUI::getType ( )

Returns $type.

See also
ilObjectCopyGUI::$type

Definition at line 459 of file class.ilObjectCopyGUI.php.

References $type.

Referenced by copyContainer(), copySingleObject(), init(), initFormSearch(), showItemSelection(), showTargetSelectionTree(), and sourceExists().

460  {
461  return $this->type;
462  }
+ Here is the caller graph for this function:

◆ init()

ilObjectCopyGUI::init ( )
protected

Init return, mode.

Returns

Definition at line 75 of file class.ilObjectCopyGUI.php.

References $_GET, $_REQUEST, $ilCtrl, ilObject\_lookupObjId(), ilObject\_lookupType(), getSource(), getType(), setMode(), setTarget(), and setType().

Referenced by executeCommand().

76  {
77  global $ilCtrl;
78 
79  if($_REQUEST['new_type'])
80  {
81  $this->setMode(self::SEARCH_SOURCE);
82 
83  $ilCtrl->setParameter($this,'new_type',$this->getType());
84  $ilCtrl->setParameterByClass(get_class($this->parent_obj), 'new_type', $this->getType());
85  $ilCtrl->setParameterByClass(get_class($this->parent_obj), 'cpfl', 1);
86  $ilCtrl->setReturnByClass(get_class($this->parent_obj), 'create');
87  }
88  elseif($_REQUEST['selectMode'] == self::SOURCE_SELECTION)
89  {
90  $this->setMode(self::SOURCE_SELECTION);
91 
92  $ilCtrl->setParameterByClass(get_class($this->parent_obj), 'selectMode', self::SOURCE_SELECTION);
93  $this->setTarget((int) $_GET['ref_id']);
94  $ilCtrl->setReturnByClass(get_class($this->parent_obj), '');
95  }
96  else
97  {
98  $this->setMode(self::TARGET_SELECTION);
99  $ilCtrl->setReturnByClass(get_class($this->parent_obj),'');
100 
101  if ($_GET["source_ids"] == "")
102  {
103  $this->setType(
105  );
106  }
107  }
108  }
setMode($a_mode)
set copy mode
setTarget($a_target)
Set target id.
$_GET["client_id"]
getType()
Returns $type.
getSource()
Get source id.
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setType($type)
Sets $type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSearch()

ilObjectCopyGUI::initFormSearch ( )
protected

Init search form.

Returns

Definition at line 950 of file class.ilObjectCopyGUI.php.

References $ilCtrl, $lng, getType(), and ilTextInputGUI\setSize().

Referenced by searchSource(), and showSourceSearch().

951  {
952  global $lng,$ilCtrl;
953 
954  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
955  $this->form = new ilPropertyFormGUI();
956  $this->form->setTableWidth('600px');
957  $ilCtrl->setParameter($this,'new_type',$this->getType());
958  #$ilCtrl->setParameter($this, 'cp_mode', self::SOURCE_SELECTION);
959  $this->form->setFormAction($ilCtrl->getFormAction($this));
960  $this->form->setTitle($lng->txt($this->getType().'_copy'));
961 
962  $this->form->addCommandButton('searchSource', $lng->txt('btn_next'));
963 
964  $tit = new ilTextInputGUI($lng->txt('title'),'tit');
965  $tit->setSize(40);
966  $tit->setMaxLength(70);
967  $tit->setRequired(true);
968  $tit->setInfo($lng->txt('wizard_title_info'));
969  $this->form->addItem($tit);
970  }
This class represents a property form user interface.
getType()
Returns $type.
global $ilCtrl
Definition: ilias.php:18
setSize($a_size)
Set Size.
This class represents a text property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSourceSelection()

ilObjectCopyGUI::initSourceSelection ( )
protected

Init source selection.

Returns

Definition at line 155 of file class.ilObjectCopyGUI.php.

References $_GET, $_SESSION, $ilCtrl, $path, getTarget(), setMode(), setSource(), setTarget(), and showSourceSelectionTree().

156  {
157  global $ilCtrl,$tree;
158 
159  // empty session on init
160  $_SESSION['paste_copy_repexpand'] = array();
161 
162  // copy opened nodes from repository explorer
163  $_SESSION['paste_copy_repexpand'] = is_array($_SESSION['repexpand']) ? $_SESSION['repexpand'] : array();
164 
165  $this->setMode(self::SOURCE_SELECTION);
166  $this->setSource(0);
167  $this->setTarget((int) $_GET['ref_id']);
168 
169  // open current position
170  $path = $tree->getPathId($this->getTarget());
171  foreach((array) $path as $node_id)
172  {
173  if(!in_array($node_id, $_SESSION['paste_copy_repexpand']))
174  $_SESSION['paste_copy_repexpand'][] = $node_id;
175  }
176 
177  $ilCtrl->setReturnByClass(get_class($this->parent_obj),'');
178  $this->showSourceSelectionTree();
179  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
getTarget()
Get copy target.
setMode($a_mode)
set copy mode
setTarget($a_target)
Set target id.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
showSourceSelectionTree()
Show target selection.
setSource($a_source_id)
Set source id.
$path
Definition: index.php:22
+ Here is the call graph for this function:

◆ initTargetSelection()

ilObjectCopyGUI::initTargetSelection ( )
protected

Init copy from repository/search list commands.

Returns

Definition at line 114 of file class.ilObjectCopyGUI.php.

References $_GET, $_SESSION, $ilCtrl, $path, ilObject\_lookupObjId(), ilObject\_lookupType(), getSource(), setMode(), setSource(), setTarget(), setType(), and showTargetSelectionTree().

115  {
116  global $ilCtrl, $tree;
117 
118  // empty session on init
119  $_SESSION['paste_copy_repexpand'] = array();
120 
121  // copy opened nodes from repository explorer
122  $_SESSION['paste_copy_repexpand'] = is_array($_SESSION['repexpand']) ? $_SESSION['repexpand'] : array();
123 
124 
125  $this->setMode(self::TARGET_SELECTION);
126  $this->setTarget(0);
127 
128  // note that source_id is empty, if source_ids are given
129  if ($_GET['source_id'] > 0)
130  {
131  // open current position
132  $path = $tree->getPathId((int)$_GET['source_id']);
133  foreach((array)$path as $node_id)
134  {
135  if(!in_array($node_id, $_SESSION['paste_copy_repexpand']))
136  $_SESSION['paste_copy_repexpand'][] = $node_id;
137  }
138 
139  $this->setSource((int) $_GET['source_id']);
140 
141  $this->setType(
143  );
144  }
145 
146  $ilCtrl->setReturnByClass(get_class($this->parent_obj),'');
147 
148  $this->showTargetSelectionTree();
149  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setMode($a_mode)
set copy mode
setTarget($a_target)
Set target id.
$_GET["client_id"]
getSource()
Get source id.
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
showTargetSelectionTree()
Show target selection.
setSource($a_source_id)
Set source id.
$path
Definition: index.php:22
setType($type)
Sets $type.
+ Here is the call graph for this function:

◆ keepObjectsInClipboard()

ilObjectCopyGUI::keepObjectsInClipboard ( )

Keep objects in clipboard.

Definition at line 529 of file class.ilObjectCopyGUI.php.

References $_GET, $_SESSION, $ilCtrl, and getSource().

530  {
531  global $ilCtrl;
532  $_SESSION['clipboard']['cmd'] = "copy";
533  if ($_GET["source_ids"] == "")
534  {
535  $_SESSION['clipboard']['ref_ids'] = array((int) $this->getSource());
536  }
537  else
538  {
539  $_SESSION['clipboard']['ref_ids'] = explode("_", $_GET["source_ids"]);
540  }
541  $ilCtrl->returnToParent($this);
542  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
getSource()
Get source id.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveSource()

ilObjectCopyGUI::saveSource ( )
protected

select source object

Returns

Definition at line 609 of file class.ilObjectCopyGUI.php.

References $_POST, copySingleObject(), searchSource(), ilUtil\sendFailure(), setSource(), and showItemSelection().

610  {
611  global $objDefinition;
612 
613  if(isset($_POST['source']))
614  {
615  $this->setSource($_POST['source']);
616  }
617  else
618  {
619  ilUtil::sendFailure($this->lng->txt('select_one'));
620  $this->searchSource();
621  return false;
622  }
623 
624  if($objDefinition->isContainer($this->getType()))
625  {
626  $this->showItemSelection();
627  }
628  else
629  {
630  $this->copySingleObject();
631  }
632  }
$_POST['username']
Definition: cron.php:12
copySingleObject()
Start cloning a single (not container) object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
setSource($a_source_id)
Set source id.
searchSource()
Search source.
+ Here is the call graph for this function:

◆ saveTarget()

ilObjectCopyGUI::saveTarget ( )
protected

Save target selection.

Returns

Definition at line 375 of file class.ilObjectCopyGUI.php.

References $_GET, $_REQUEST, ilObject\_lookupObjId(), ilObject\_lookupTitle(), copyMultipleNonContainer(), copySingleObject(), getSource(), getTarget(), ilUtil\sendFailure(), setTarget(), showItemSelection(), and showTargetSelectionTree().

376  {
377  global $objDefinition, $tree;
378 
379 
380  if(isset($_REQUEST['target']))
381  {
382  $this->setTarget((int) $_REQUEST['target']);
383  }
384  else
385  {
386  ilUtil::sendFailure($this->lng->txt('select_one'));
387  $this->showTargetSelectionTree();
388  return false;
389  }
390 
391  if($_GET["source_ids"] == "" && $objDefinition->isContainer($this->getType()))
392  {
393  // check, if object should be copied into itself
394  $is_child = array();
395  if ($tree->isGrandChild($this->getSource(), $this->getTarget()))
396  {
398  }
399  if ($this->getSource() == $this->getTarget())
400  {
402  }
403  if (count($is_child) > 0)
404  {
405  ilUtil::sendFailure($this->lng->txt("msg_not_in_itself")." ".implode(',',$is_child));
406  $this->showTargetSelectionTree();
407  return false;
408  }
409 
410  $this->showItemSelection();
411  }
412  else
413  {
414  if ($_GET["source_ids"] == "")
415  {
416  $this->copySingleObject();
417  }
418  else
419  {
420  $source_ids = explode("_", $_GET["source_ids"]);
421  $this->copyMultipleNonContainer($source_ids);
422  }
423  }
424  }
getTarget()
Get copy target.
setTarget($a_target)
Set target id.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
getSource()
Get source id.
static _lookupObjId($a_id)
copySingleObject()
Start cloning a single (not container) object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
showTargetSelectionTree()
Show target selection.
copyMultipleNonContainer($a_sources)
Copy multiple non container.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ searchSource()

ilObjectCopyGUI::searchSource ( )
protected

Search source.

Returns

Definition at line 549 of file class.ilObjectCopyGUI.php.

References $_POST, $_REQUEST, $_SESSION, $ilCtrl, $lng, $res, $results, $tpl, getSource(), initFormSearch(), QP_COMBINATION_AND, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilQueryParser\setMinWordLength().

Referenced by saveSource(), and showItemSelection().

550  {
551  global $tree,$ilObjDataCache,$lng,$ilCtrl,$tpl;
552 
553  if(isset($_POST['tit']))
554  {
555  ilUtil::sendInfo($this->lng->txt('wizard_search_list'));
556  $_SESSION['source_query'] = $_POST['tit'];
557  }
558  else
559  {
560  $_POST['tit'] = $_SESSION['source_query'];
561  }
562 
563  $this->initFormSearch();
564  $this->form->setValuesByPost();
565 
566  if(!$this->form->checkInput())
567  {
568  ilUtil::sendFailure($lng->txt('msg_no_search_string'),true);
569  $ilCtrl->returnToParent($this);
570  return false;
571  }
572 
573  include_once './Services/Search/classes/class.ilQueryParser.php';
574  $query_parser = new ilQueryParser($this->form->getInput('tit'));
575  $query_parser->setMinWordLength(1,true);
576  $query_parser->setCombination(QP_COMBINATION_AND);
577  $query_parser->parse();
578  if(!$query_parser->validate())
579  {
580  ilUtil::sendFailure($query_parser->getMessage(),true);
581  $ilCtrl->returnToParent($this);
582  }
583 
584  // only like search since fulltext does not support search with less than 3 characters
585  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
586  $object_search = new ilLikeObjectSearch($query_parser);
587  $object_search->setFilter(array($_REQUEST['new_type']));
588  $res = $object_search->performSearch();
589  $res->setRequiredPermission('copy');
590  $res->filter(ROOT_FOLDER_ID,true);
591 
592  if(!count($results = $res->getResultsByObjId()))
593  {
594  ilUtil::sendFailure($this->lng->txt('search_no_match'),true);
595  $ilCtrl->returnToParent($this);
596  }
597 
598  include_once './Services/Object/classes/class.ilObjectCopySearchResultTableGUI.php';
599  $table = new ilObjectCopySearchResultTableGUI($this,'searchSource',$_REQUEST['new_type']);
600  $table->setSelectedReference($this->getSource());
601  $table->parseSearchResults($results);
602  $tpl->setContent($table->getHTML());
603  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
initFormSearch()
Init search form.
getSource()
Get source id.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$results
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const QP_COMBINATION_AND
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setMinWordLength($a_length, $a_force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMode()

ilObjectCopyGUI::setMode (   $a_mode)

set copy mode

Parameters
int$a_mode
Returns

Definition at line 431 of file class.ilObjectCopyGUI.php.

Referenced by init(), initSourceSelection(), and initTargetSelection().

432  {
433  $this->mode = $a_mode;
434  }
+ Here is the caller graph for this function:

◆ setSource()

ilObjectCopyGUI::setSource (   $a_source_id)

Set source id.

Parameters
int$a_source_id
Returns

Definition at line 480 of file class.ilObjectCopyGUI.php.

References $_SESSION.

Referenced by initSourceSelection(), initTargetSelection(), saveSource(), and unsetSession().

481  {
482  $_SESSION['copy_source'] = $a_source_id;
483  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ setTarget()

ilObjectCopyGUI::setTarget (   $a_target)

Set target id.

Parameters
int$a_target
Returns

Definition at line 503 of file class.ilObjectCopyGUI.php.

References $_SESSION.

Referenced by init(), initSourceSelection(), initTargetSelection(), and saveTarget().

504  {
505  $_SESSION['copy_target'] = $a_target;
506  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ setType()

ilObjectCopyGUI::setType (   $type)

Sets $type.

Parameters
object$type
See also
ilObjectCopyGUI::$type

Definition at line 470 of file class.ilObjectCopyGUI.php.

References $type.

Referenced by init(), and initTargetSelection().

471  {
472  $this->type = $type;
473  }
+ Here is the caller graph for this function:

◆ showItemSelection()

ilObjectCopyGUI::showItemSelection ( )
protected
Returns

Definition at line 640 of file class.ilObjectCopyGUI.php.

References $tpl, getMode(), getSource(), getType(), searchSource(), ilUtil\sendFailure(), and ilUtil\sendInfo().

Referenced by saveSource(), and saveTarget().

641  {
642  global $tpl;
643 
644  if(!$this->getSource())
645  {
646  ilUtil::sendFailure($this->lng->txt('select_one'));
647  $this->searchSource();
648  return false;
649  }
650 
651  ilUtil::sendInfo($this->lng->txt($this->getType().'_copy_threads_info'));
652  include_once './Services/Object/classes/class.ilObjectCopySelectionTableGUI.php';
653 
654  $tpl->addJavaScript('./Services/CopyWizard/js/ilContainer.js');
655  $tpl->setVariable('BODY_ATTRIBUTES','onload="ilDisableChilds(\'cmd\');"');
656 
657  switch($this->getMode())
658  {
659  case self::SOURCE_SELECTION:
660  $back_cmd = 'showSourceSelectionTree';
661  break;
662 
663  case self::TARGET_SELECTION:
664  $back_cmd = 'showTargetSelectionTree';
665  break;
666 
667  case self::SEARCH_SOURCE:
668  $back_cmd = 'searchSource';
669  break;
670  }
671 
672  $table = new ilObjectCopySelectionTableGUI($this,'showItemSelection',$this->getType(),$back_cmd);
673  $table->parseSource($this->getSource());
674 
675  $tpl->setContent($table->getHTML());
676  }
getType()
Returns $type.
getSource()
Get source id.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getMode()
get copy mode
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
searchSource()
Search source.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSourceSearch()

ilObjectCopyGUI::showSourceSearch (   $a_tplvar)

Show init screen Normally shown below the create and import form when creating a new object.

Parameters
string$a_tplvarThe tpl variable to fill
Returns

Definition at line 911 of file class.ilObjectCopyGUI.php.

References $tpl, initFormSearch(), and unsetSession().

912  {
913  global $tpl;
914 
915  // Disabled for performance
916  #if(!$this->sourceExists())
917  #{
918  # return false;
919  #}
920 
921  $this->unsetSession();
922  $this->initFormSearch();
923 
924  if($a_tplvar)
925  {
926  $tpl->setVariable($a_tplvar,$this->form->getHTML());
927  }
928  else
929  {
930  return $this->form;
931  }
932  }
initFormSearch()
Init search form.
unsetSession()
Unset session variables.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:

◆ showSourceSelectionTree()

ilObjectCopyGUI::showSourceSelectionTree ( )

Show target selection.

Definition at line 317 of file class.ilObjectCopyGUI.php.

References $_GET, $ilCtrl, $tpl, getSource(), ilPasteIntoMultipleItemsExplorer\SEL_TYPE_RADIO, and ilUtil\sendInfo().

Referenced by initSourceSelection().

318  {
319  global $ilTabs, $ilToolbar, $ilCtrl, $tree, $tpl, $objDefinition;
320 
321  $this->tpl = $tpl;
322  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.paste_into_multiple_objects.html',
323  "Services/Object");
324 
325  ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard_source'));
326  include_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
329  'ilias.php?baseClass=ilRepositoryGUI&amp;cmd=goto', 'paste_copy_repexpand');
330  $exp->setRequiredFormItemPermission('visible,read,copy');
331 
332  $ilCtrl->setParameter($this, 'selectMode', self::SOURCE_SELECTION);
333  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'showSourceSelectionTree'));
334  $exp->setTargetGet('ref_id');
335  $exp->setPostVar('source');
336  $exp->setCheckedItems(array($this->getSource()));
337  #$exp->setNotSelectableItems(array($this->getTarget()));
338 
339  // Filter to container
340  foreach(array('cat','root','grp','fold') as $container)
341  {
342  $exp->removeFormItemForType($container);
343  }
344 
345 
346  if($_GET['paste_copy_repexpand'] == '')
347  {
348  $expanded = $tree->readRootId();
349  }
350  else
351  {
352  $expanded = $_GET['paste_copy_repexpand'];
353  }
354 
355  $this->tpl->setVariable('FORM_TARGET', '_self');
356  $this->tpl->setVariable('FORM_ACTION', $ilCtrl->getFormAction($this, 'copySelection'));
357 
358  $exp->setExpand($expanded);
359  // build html-output
360  $exp->setOutput(0);
361  $output = $exp->getOutput();
362 
363  $this->tpl->setVariable('OBJECT_TREE', $output);
364 
365  $this->tpl->setVariable('CMD_SUBMIT', 'saveSource');
366  $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('btn_next'));
367 
368  $ilToolbar->addButton($this->lng->txt('cancel'), $ilCtrl->getLinkTarget($this,'cancel'));
369  }
$_GET["client_id"]
getSource()
Get source id.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTargetSelectionTree()

ilObjectCopyGUI::showTargetSelectionTree ( )

Show target selection.

Definition at line 184 of file class.ilObjectCopyGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, $t, $tpl, ilUtil\getImagePath(), ilPlugin\getPluginObject(), getSource(), getType(), IL_COMP_SERVICE, ilPlugin\lookupNameForId(), ilPasteIntoMultipleItemsExplorer\SEL_TYPE_RADIO, and ilUtil\sendInfo().

Referenced by initTargetSelection(), and saveTarget().

185  {
186  global $ilTabs, $ilToolbar, $ilCtrl, $tree, $tpl, $objDefinition, $lng;
187 
188  $this->tpl = $tpl;
189 
190  ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard'));
191 
192  //
193  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
194  $exp = new ilRepositorySelectorExplorerGUI($this, "showTargetSelectionTree");
195  $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "fold"));
196  $exp->setSelectMode("target", false);
197  if ($exp->handleCommand())
198  {
199  return;
200  }
201  $output = $exp->getHTML();
202 
203  // toolbars
204  $t = new ilToolbarGUI();
205  $t->setFormAction($ilCtrl->getFormAction($this, "saveTarget"));
206  if($objDefinition->isContainer($this->getType()))
207  {
208  $t->addFormButton($lng->txt("btn_next"), "saveTarget");
209  }
210  else
211  {
212  $t->addFormButton($lng->txt("copy"), "saveTarget");
213  }
214  $t->addSeparator();
215  $t->addFormButton($lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard");
216  $t->addFormButton($lng->txt("cancel"), "cancel");
217  $t->setCloseFormTag(false);
218  $t->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), " ");
219  $output = $t->getHTML().$output;
220  $t->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), " ");
221  $t->setCloseFormTag(true);
222  $t->setOpenFormTag(false);
223  $output.= "<br />".$t->getHTML();
224 
225  $this->tpl->setContent($output);
226 
227  return;
228 
229  // old implementation
230 
231  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.paste_into_multiple_objects.html',
232  "Services/Object");
233 
234  include_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
237  'ilias.php?baseClass=ilRepositoryGUI&amp;cmd=goto', 'paste_copy_repexpand');
238 
239  // Target selection should check for create permission
240  $required_perm = 'visible';
241  $create_perm = 'create_'.ilObject::_lookupType($this->getSource(), true);
242  if($create_perm)
243  {
244  $required_perm .= (','.$create_perm);
245  }
246  $exp->setRequiredFormItemPermission($required_perm);
247  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'showTargetSelectionTree'));
248  $exp->setTargetGet('ref_id');
249  $exp->setPostVar('target');
250  $exp->highlightNode($_GET['ref_id']);
251  $exp->setCheckedItems(array((int) $_POST['target']));
252 
253  // Filter to container
254  foreach(array('cat','root','crs','grp','fold') as $container)
255  {
256  /*
257  if($this->getType() == 'crs' and $container == 'crs')
258  {
259  continue;
260  }
261  */
262  $sub = $objDefinition->getSubObjects($container);
263  if(!isset($sub[$this->getType()]))
264  {
265  $exp->removeFormItemForType($container);
266  }
267  }
268 
269  if($_GET['paste_copy_repexpand'] == '')
270  {
271  $expanded = $tree->readRootId();
272  }
273  else
274  {
275  $expanded = $_GET['paste_copy_repexpand'];
276  }
277 
278  $this->tpl->setVariable('FORM_TARGET', '_self');
279  $this->tpl->setVariable('FORM_ACTION', $ilCtrl->getFormAction($this, 'copySelection'));
280 
281  $exp->setExpand($expanded);
282  // build html-output
283  $exp->setOutput(0);
284  $output = $exp->getOutput();
285 
286  $this->tpl->setVariable('OBJECT_TREE', $output);
287 
288  $this->tpl->setVariable('CMD_SUBMIT', 'saveTarget');
289 
290  if($objDefinition->isContainer($this->getType()))
291  {
292  $this->tpl->setVariable('TXT_SUBMIT',$this->lng->txt('btn_next'));
293  }
294  else
295  {
296  if(!$objDefinition->isPlugin($this->getType()))
297  {
298  $submit = $this->lng->txt('obj_'.$this->getType().'_duplicate');
299  }
300  else
301  {
302  // get plugin instance
303  include_once "Services/Component/classes/class.ilPlugin.php";
304  $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj",
305  ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType()));
306  $submit = $plugin->txt('obj_'.$this->getType().'_duplicate');
307  }
308  $this->tpl->setVariable('TXT_SUBMIT', $submit);
309  }
310 
311  $ilToolbar->addButton($this->lng->txt('cancel'), $ilCtrl->getLinkTarget($this,'cancel'));
312  }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$_POST['username']
Definition: cron.php:12
Explorer for selecting repository items.
$_GET["client_id"]
lookupNameForId($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
Lookup name for id.
getType()
Returns $type.
getSource()
Get source id.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
const IL_COMP_SERVICE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sourceExists()

ilObjectCopyGUI::sourceExists ( )
protected

Check if there is any source object.

Returns
bool

Definition at line 939 of file class.ilObjectCopyGUI.php.

References $ilUser, ilUtil\_getObjectsByOperations(), and getType().

940  {
941  global $ilUser;
942 
943  return (bool) ilUtil::_getObjectsByOperations($this->getType(),'copy',$ilUser->getId(),1);
944  }
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive, instead it parses the serialized rbac_pa entries.
getType()
Returns $type.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ unsetSession()

ilObjectCopyGUI::unsetSession ( )
protected

Unset session variables.

Returns

Definition at line 976 of file class.ilObjectCopyGUI.php.

References $_SESSION, and setSource().

Referenced by showSourceSearch().

977  {
978  unset($_SESSION['source_query']);
979  $this->setSource(0);
980  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setSource($a_source_id)
Set source id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $lng

ilObjectCopyGUI::$lng
private

◆ $mode

ilObjectCopyGUI::$mode = 0
private

Definition at line 20 of file class.ilObjectCopyGUI.php.

Referenced by getMode().

◆ $parent_obj

ilObjectCopyGUI::$parent_obj = null
private

Definition at line 24 of file class.ilObjectCopyGUI.php.

Referenced by getParentObject().

◆ $source

ilObjectCopyGUI::$source = 0
private

Definition at line 27 of file class.ilObjectCopyGUI.php.

◆ $target

ilObjectCopyGUI::$target = 0
private

Definition at line 28 of file class.ilObjectCopyGUI.php.

◆ $type

ilObjectCopyGUI::$type = ''
private

Definition at line 26 of file class.ilObjectCopyGUI.php.

Referenced by getType(), and setType().

◆ SEARCH_SOURCE

const ilObjectCopyGUI::SEARCH_SOURCE = 3

Definition at line 18 of file class.ilObjectCopyGUI.php.

◆ SOURCE_SELECTION

const ilObjectCopyGUI::SOURCE_SELECTION = 1

Definition at line 16 of file class.ilObjectCopyGUI.php.

◆ TARGET_SELECTION

const ilObjectCopyGUI::TARGET_SELECTION = 2

Definition at line 17 of file class.ilObjectCopyGUI.php.


The documentation for this class was generated from the following file: