24 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
57 $this->source_id = $a_source_id;
58 $this->item_type = $a_item_type;
59 $this->obj_id = $ilObjDataCache->lookupObjId($this->source_id);
60 $this->type = $ilObjDataCache->lookupType($this->obj_id);
76 global
$tpl,$ilAccess;
80 $perm_copy = $ilAccess->checkAccess(
'copy',
'', $a_ref_id);
81 $copy = $this->objDefinition->allowCopy(
$a_type);
82 $perm_link = $ilAccess->checkAccess(
'write',
'', $a_ref_id);
83 $link = $this->objDefinition->allowLink(
$a_type);
86 if ($perm_copy and $copy) {
87 $this->tpl->setCurrentBlock(
'radio_copy');
88 $this->tpl->setVariable(
'TXT_COPY', $this->lng->txt(
'copy'));
89 $this->tpl->setVariable(
'NAME_COPY',
'cp_options[' . $a_ref_id .
'][type]');
91 $this->tpl->setVariable(
'ID_COPY', $a_depth .
'_' .
$a_type .
'_' . $a_ref_id .
'_copy');
92 $this->tpl->setVariable(
'COPY_CHECKED',
'checked="checked"');
93 $this->tpl->parseCurrentBlock();
95 $this->tpl->setCurrentBlock(
'missing_copy_perm');
96 $this->tpl->setVariable(
'TXT_MISSING_COPY_PERM', $this->lng->txt(
'missing_perm'));
97 $this->tpl->parseCurrentBlock();
101 if ($perm_link and $link) {
102 $this->tpl->setCurrentBlock(
'radio_link');
103 $this->tpl->setVariable(
'TXT_LINK', $this->lng->txt(
'link'));
104 $this->tpl->setVariable(
'NAME_LINK',
'cp_options[' . $a_ref_id .
'][type]');
106 $this->tpl->setVariable(
'ID_LINK', $a_depth .
'_' .
$a_type .
'_' . $a_ref_id .
'_link');
107 if (!$copy or !$perm_copy) {
108 $this->tpl->setVariable(
'LINK_CHECKED',
'checked="checked"');
110 $this->tpl->parseCurrentBlock();
112 $this->tpl->setCurrentBlock(
'missing_link_perm');
113 $this->tpl->setVariable(
'TXT_MISSING_LINK_PERM', $this->lng->txt(
'missing_perm'));
114 $this->tpl->parseCurrentBlock();
118 $this->tpl->setVariable(
'TXT_OMIT', $this->lng->txt(
'omit'));
119 $this->tpl->setVariable(
'NAME_OMIT',
'cp_options[' . $a_ref_id .
'][type]');
121 $this->tpl->setVariable(
'ID_OMIT', $a_depth .
'_' .
$a_type .
'_' . $a_ref_id .
'_omit');
122 if (((!$copy or !$perm_copy) and (!$link or !$perm_link))) {
123 $this->tpl->setVariable(
'OMIT_CHECKED',
'checked="checked"');
139 if (!count($this->items)) {
151 if (count($this->items) > 1) {
152 $this->tpl->setCurrentBlock(
'obj_options');
153 $this->tpl->setVariable(
'NAME_OPTIONS', $this->lng->txt(
'omit_all'));
155 $this->tpl->setVariable(
'JS_TYPE', $this->item_type .
'_omit');
156 $this->tpl->parseCurrentBlock();
158 $this->tpl->setCurrentBlock(
'obj_options');
159 $this->tpl->setVariable(
'NAME_OPTIONS', $this->lng->txt(
'copy_all'));
160 $this->tpl->setVariable(
'OBJ_CHECKED',
'checked="checked"');
162 $this->tpl->setVariable(
'JS_TYPE', $this->item_type .
'_copy');
163 $this->tpl->parseCurrentBlock();
165 if ($this->objDefinition->allowLink($this->item_type)) {
166 $this->tpl->setCurrentBlock(
'obj_options');
167 $this->tpl->setVariable(
'NAME_OPTIONS', $this->lng->txt(
'link_all'));
169 $this->tpl->setVariable(
'JS_TYPE', $this->item_type .
'_link');
170 $this->tpl->parseCurrentBlock();
172 $this->tpl->setVariable(
'OPTION_CLASS',
'option_value');
174 $this->tpl->setVariable(
'OPTION_CLASS',
'option');
177 $this->tpl->setVariable(
'OBJ_ALT', $this->lng->txt(
'objs_' . $this->item_type));
178 $this->tpl->setVariable(
'ROWSPAN', count($this->items) + 1);
188 foreach ($this->items as $node) {
192 $this->tpl->setCurrentBlock(
'item_options');
193 $this->tpl->setVariable(
'ITEM_CHECK_NAME',
'cp_options[' . $node[
'child'] .
'][type]');
195 $this->tpl->setVariable(
'ITEM_NAME_OPTION', $this->lng->txt(
'omit'));
197 $this->tpl->setVariable(
'ITEM_CHECKED',
'checked="checked"');
200 $this->tpl->parseCurrentBlock();
203 if ($this->objDefinition->allowCopy($this->item_type)) {
204 $this->tpl->setCurrentBlock(
'item_options');
206 $this->tpl->setVariable(
'ITEM_CHECKED',
'checked="checked"');
208 $this->tpl->setVariable(
'ITEM_CHECK_NAME',
'cp_options[' . $node[
'child'] .
'][type]');
210 $this->tpl->setVariable(
'ITEM_NAME_OPTION', $this->lng->txt(
'copy'));
212 $this->tpl->parseCurrentBlock();
214 if ($this->objDefinition->allowLink($this->item_type)) {
215 $this->tpl->setCurrentBlock(
'item_options');
217 $this->tpl->setVariable(
'ITEM_CHECKED',
'checked="checked"');
219 $this->tpl->setVariable(
'ITEM_CHECK_NAME',
'cp_options[' . $node[
'child'] .
'][type]');
221 $this->tpl->setVariable(
'ITEM_NAME_OPTION', $this->lng->txt(
'link'));
223 $this->tpl->parseCurrentBlock();
227 $this->tpl->setCurrentBlock(
'item_row');
228 $this->tpl->setVariable(
'ITEM_TITLE', $node[
'title']);
229 $this->tpl->setVariable(
'DESCRIPTION', $node[
'description']);
230 $this->tpl->parseCurrentBlock();
250 $nodes = $this->tree->getSubTree($this->tree->getNodeData($this->source_id),
true,
$this->item_type);
252 $this->items =
array();
253 switch ($nodes[0][
'type']) {
258 foreach ($nodes as $node) {
259 if ($node[
'child'] != $this->source_id) {
260 $this->items[] = $node;
265 $this->items = $nodes;
277 return $_POST[
'cp_options'][$a_node_id][
'type'] ?
278 $_POST[
'cp_options'][$a_node_id][
'type'] :
__construct($a_source_id, $a_item_type='')
Constructor.
fetchSelected($a_node_id)
Check if it is checked.
fillAdditionalOptions()
Fill additional options.
getWizardPageBlockHTML()
Get wizard page block html.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
fillItemBlock()
Fill item block.
fillTreeSelection($a_ref_id, $a_type, $a_depth)
Fill selection template.