ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCopyWizardPage Class Reference
+ Collaboration diagram for ilCopyWizardPage:

Public Member Functions

 __construct ($a_source_id, $a_item_type= '')
 Constructor.
 fillTreeSelection ($a_ref_id, $a_type, $a_depth)
 Fill selection template.
 getWizardPageBlockHTML ()
 Get wizard page block html.

Protected Member Functions

 initTemplate ()
 init template
 fillMainBlock ()
 protected
 fillItemBlock ()
 Fill item block.
 fillAdditionalOptions ()
 Fill additional options.
 readItems ()
 Read items.
 fetchSelected ($a_node_id)
 Check if it is checked.

Private Attributes

 $type
 $source_id
 $obj_id
 $item_type
 $tree
 $lng
 $objDefinition

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
$Id$

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

Constructor & Destructor Documentation

ilCopyWizardPage::__construct (   $a_source_id,
  $a_item_type = '' 
)

Constructor.

public

Parameters

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

References $lng, $objDefinition, and $tree.

{
global $ilObjDataCache,$tree,$lng,$objDefinition;
$this->source_id = $a_source_id;
$this->item_type = $a_item_type;
$this->obj_id = $ilObjDataCache->lookupObjId($this->source_id);
$this->type = $ilObjDataCache->lookupType($this->obj_id);
$this->tree = $tree;
$this->lng = $lng;
$this->objDefinition = $objDefinition;
}

Member Function Documentation

ilCopyWizardPage::fetchSelected (   $a_node_id)
protected

Check if it is checked.

protected

Definition at line 310 of file class.ilCopyWizardPage.php.

References $_POST, and ilCopyWizardOptions\COPY_WIZARD_COPY.

Referenced by fillItemBlock().

{
return $_POST['cp_options'][$a_node_id]['type'] ?
$_POST['cp_options'][$a_node_id]['type'] :
}

+ Here is the caller graph for this function:

ilCopyWizardPage::fillAdditionalOptions ( )
protected

Fill additional options.

protected

Definition at line 270 of file class.ilCopyWizardPage.php.

{
}
ilCopyWizardPage::fillItemBlock ( )
protected

Fill item block.

protected

Definition at line 211 of file class.ilCopyWizardPage.php.

References ilCopyWizardOptions\COPY_WIZARD_COPY, ilCopyWizardOptions\COPY_WIZARD_LINK, ilCopyWizardOptions\COPY_WIZARD_OMIT, and fetchSelected().

{
foreach($this->items as $node)
{
$selected = $this->fetchSelected($node['child']);
$this->tpl->setCurrentBlock('item_options');
$this->tpl->setVariable('ITEM_CHECK_NAME','cp_options['.$node['child'].'][type]');
$this->tpl->setVariable('ITEM_VALUE',ilCopyWizardOptions::COPY_WIZARD_OMIT);
$this->tpl->setVariable('ITEM_NAME_OPTION',$this->lng->txt('omit'));
{
$this->tpl->setVariable('ITEM_CHECKED','checked="checked"');
}
$this->tpl->setVariable('ITEM_ID',$this->item_type.'_'.ilCopyWizardOptions::COPY_WIZARD_OMIT);
$this->tpl->parseCurrentBlock();
if($this->objDefinition->allowCopy($this->item_type))
{
$this->tpl->setCurrentBlock('item_options');
{
$this->tpl->setVariable('ITEM_CHECKED','checked="checked"');
}
$this->tpl->setVariable('ITEM_CHECK_NAME','cp_options['.$node['child'].'][type]');
$this->tpl->setVariable('ITEM_VALUE',ilCopyWizardOptions::COPY_WIZARD_COPY);
$this->tpl->setVariable('ITEM_NAME_OPTION',$this->lng->txt('copy'));
$this->tpl->setVariable('ITEM_ID',$this->item_type.'_'.ilCopyWizardOptions::COPY_WIZARD_COPY);
$this->tpl->parseCurrentBlock();
}
if($this->objDefinition->allowLink($this->item_type))
{
$this->tpl->setCurrentBlock('item_options');
{
$this->tpl->setVariable('ITEM_CHECKED','checked="checked"');
}
$this->tpl->setVariable('ITEM_CHECK_NAME','cp_options['.$node['child'].'][type]');
$this->tpl->setVariable('ITEM_VALUE',ilCopyWizardOptions::COPY_WIZARD_LINK);
$this->tpl->setVariable('ITEM_NAME_OPTION',$this->lng->txt('link'));
$this->tpl->setVariable('ITEM_ID',$this->item_type.'_'.ilCopyWizardOptions::COPY_WIZARD_LINK);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('item_row');
$this->tpl->setVariable('ITEM_TITLE',$node['title']);
$this->tpl->setVariable('DESCRIPTION',$node['description']);
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

ilCopyWizardPage::fillMainBlock ( )
protected

protected

Definition at line 168 of file class.ilCopyWizardPage.php.

References ilCopyWizardOptions\COPY_WIZARD_COPY, ilCopyWizardOptions\COPY_WIZARD_LINK, ilCopyWizardOptions\COPY_WIZARD_OMIT, and ilUtil\getImagePath().

{
if(count($this->items) > 1)
{
$this->tpl->setCurrentBlock('obj_options');
$this->tpl->setVariable('NAME_OPTIONS',$this->lng->txt('omit_all'));
$this->tpl->setVariable('JS_FIELD',$this->item_type.'_'.ilCopyWizardOptions::COPY_WIZARD_OMIT);
$this->tpl->setVariable('JS_TYPE',$this->item_type.'_omit');
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('obj_options');
$this->tpl->setVariable('NAME_OPTIONS',$this->lng->txt('copy_all'));
$this->tpl->setVariable('OBJ_CHECKED','checked="checked"');
$this->tpl->setVariable('JS_FIELD',$this->item_type.'_'.ilCopyWizardOptions::COPY_WIZARD_COPY);
$this->tpl->setVariable('JS_TYPE',$this->item_type.'_copy');
$this->tpl->parseCurrentBlock();
if($this->objDefinition->allowLink($this->item_type))
{
$this->tpl->setCurrentBlock('obj_options');
$this->tpl->setVariable('NAME_OPTIONS',$this->lng->txt('link_all'));
$this->tpl->setVariable('JS_FIELD',$this->item_type.'_'.ilCopyWizardOptions::COPY_WIZARD_LINK);
$this->tpl->setVariable('JS_TYPE',$this->item_type.'_link');
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable('OPTION_CLASS','option_value');
}
else
{
$this->tpl->setVariable('OPTION_CLASS','option');
}
$this->tpl->setVariable('OBJ_IMG',ilUtil::getImagePath('icon_'.$this->item_type.'.gif'));
$this->tpl->setVariable('OBJ_ALT',$this->lng->txt('objs_'.$this->item_type));
$this->tpl->setVariable('ROWSPAN',count($this->items) + 1);
}

+ Here is the call graph for this function:

ilCopyWizardPage::fillTreeSelection (   $a_ref_id,
  $a_type,
  $a_depth 
)

Fill selection template.

public

Parameters
intref_id of node
stringtype of current node

Definition at line 74 of file class.ilCopyWizardPage.php.

References $tpl, ilCopyWizardOptions\COPY_WIZARD_COPY, ilCopyWizardOptions\COPY_WIZARD_LINK, ilCopyWizardOptions\COPY_WIZARD_OMIT, and elseif().

{
global $tpl,$ilAccess;
$this->tpl = $tpl;
$perm_copy = $ilAccess->checkAccess('copy','',$a_ref_id);
$copy = $this->objDefinition->allowCopy($a_type);
$perm_link = $ilAccess->checkAccess('write','',$a_ref_id);
$link = $this->objDefinition->allowLink($a_type);
// Show radio copy
if($perm_copy and $copy)
{
$this->tpl->setCurrentBlock('radio_copy');
$this->tpl->setVariable('TXT_COPY',$this->lng->txt('copy'));
$this->tpl->setVariable('NAME_COPY','cp_options['.$a_ref_id.'][type]');
$this->tpl->setVariable('VALUE_COPY',ilCopyWizardOptions::COPY_WIZARD_COPY);
$this->tpl->setVariable('ID_COPY',$a_depth.'_'.$a_type.'_'.$a_ref_id.'_copy');
$this->tpl->setVariable('COPY_CHECKED','checked="checked"');
$this->tpl->parseCurrentBlock();
}
elseif($copy)
{
$this->tpl->setCurrentBlock('missing_copy_perm');
$this->tpl->setVariable('TXT_MISSING_COPY_PERM',$this->lng->txt('missing_perm'));
$this->tpl->parseCurrentBlock();
}
// Show radio link
if($perm_link and $link)
{
$this->tpl->setCurrentBlock('radio_link');
$this->tpl->setVariable('TXT_LINK',$this->lng->txt('link'));
$this->tpl->setVariable('NAME_LINK','cp_options['.$a_ref_id.'][type]');
$this->tpl->setVariable('VALUE_LINK',ilCopyWizardOptions::COPY_WIZARD_LINK);
$this->tpl->setVariable('ID_LINK',$a_depth.'_'.$a_type.'_'.$a_ref_id.'_link');
if(!$copy or !$perm_copy)
{
$this->tpl->setVariable('LINK_CHECKED','checked="checked"');
}
$this->tpl->parseCurrentBlock();
}
elseif($link)
{
$this->tpl->setCurrentBlock('missing_link_perm');
$this->tpl->setVariable('TXT_MISSING_LINK_PERM',$this->lng->txt('missing_perm'));
$this->tpl->parseCurrentBlock();
}
// Radio omit
$this->tpl->setVariable('TXT_OMIT',$this->lng->txt('omit'));
$this->tpl->setVariable('NAME_OMIT','cp_options['.$a_ref_id.'][type]');
$this->tpl->setVariable('VALUE_OMIT',ilCopyWizardOptions::COPY_WIZARD_OMIT);
$this->tpl->setVariable('ID_OMIT',$a_depth.'_'.$a_type.'_'.$a_ref_id.'_omit');
if(((!$copy or !$perm_copy) and (!$link or !$perm_link)))
{
$this->tpl->setVariable('OMIT_CHECKED','checked="checked"');
}
}

+ Here is the call graph for this function:

ilCopyWizardPage::getWizardPageBlockHTML ( )

Get wizard page block html.

public

Definition at line 143 of file class.ilCopyWizardPage.php.

References readItems().

{
$this->readItems();
if(!count($this->items))
{
return '';
}
}

+ Here is the call graph for this function:

ilCopyWizardPage::initTemplate ( )
protected

init template

protected

Definition at line 158 of file class.ilCopyWizardPage.php.

{
$this->tpl = new ilTemplate('tpl.copy_wizard_block.html',true,true,'Services/CopyWizard');
}
ilCopyWizardPage::readItems ( )
protected

Read items.

protected

Definition at line 280 of file class.ilCopyWizardPage.php.

References $item_type.

Referenced by getWizardPageBlockHTML().

{
$nodes = $this->tree->getSubTree($this->tree->getNodeData($this->source_id),true,$this->item_type);
$this->items = array();
switch($nodes[0]['type'])
{
case 'fold':
case 'grp':
case 'crs':
case 'cat':
foreach($nodes as $node)
{
if($node['child'] != $this->source_id)
{
$this->items[] = $node;
}
}
break;
default:
$this->items = $nodes;
break;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilCopyWizardPage::$item_type
private

Definition at line 40 of file class.ilCopyWizardPage.php.

Referenced by readItems().

ilCopyWizardPage::$lng
private

Definition at line 43 of file class.ilCopyWizardPage.php.

Referenced by __construct().

ilCopyWizardPage::$obj_id
private

Definition at line 39 of file class.ilCopyWizardPage.php.

ilCopyWizardPage::$objDefinition
private

Definition at line 44 of file class.ilCopyWizardPage.php.

Referenced by __construct().

ilCopyWizardPage::$source_id
private

Definition at line 38 of file class.ilCopyWizardPage.php.

ilCopyWizardPage::$tree
private

Definition at line 42 of file class.ilCopyWizardPage.php.

Referenced by __construct().

ilCopyWizardPage::$type
private

Definition at line 37 of file class.ilCopyWizardPage.php.


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