ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLocalUnitConfigurationGUI Class Reference

Class ilLocalUnitConfigurationGUI. More...

+ Inheritance diagram for ilLocalUnitConfigurationGUI:
+ Collaboration diagram for ilLocalUnitConfigurationGUI:

Public Member Functions

 getUnitCategoryOverviewCommand ()
 isCRUDContext ()
 getUniqueId ()
 executeCommand ()
- Public Member Functions inherited from ilUnitConfigurationGUI
 deleteUnits ()

Data Fields

const REQUEST_PARAM_SUB_CONTEXT_ID = 'question_fi'

Protected Member Functions

 getDefaultCommand ()
 showUnitCategories (array $categories)
 confirmImportGlobalCategory ()
 confirmImportGlobalCategories ()
 importGlobalCategories ()
- Protected Member Functions inherited from ilUnitConfigurationGUI
 getCategoryById ($id, $for_CRUD=true)
 handleSubtabs ()
 checkPermissions ($cmd)
 confirmDeleteUnit ()
 confirmDeleteUnits ()
 saveOrder ()
 saveUnit ()
 Save a unit.
 showUnitModificationForm ()
 addUnit ()
 Adds a new unit.
 showUnitCreationForm ()
 confirmDeleteCategory ()
 confirmDeleteCategories ()
 deleteCategories ()
 initUnitCategoryForm (assFormulaQuestionUnitCategory $cat=null)
 addCategory ()
 showUnitCategoryCreationForm ()
 saveCategory ()
 showUnitCategoryModificationForm ()

Additional Inherited Members

- Protected Attributes inherited from ilUnitConfigurationGUI
 $unit_cat_form
 $unit_form
 $repository = null
 $tpl
 $lng
 $ctrl

Detailed Description

Member Function Documentation

ilLocalUnitConfigurationGUI::confirmImportGlobalCategories ( )
protected

Definition at line 170 of file class.ilLocalUnitConfigurationGUI.php.

References $_POST, and importGlobalCategories().

Referenced by confirmImportGlobalCategory().

{
if(!isset($_POST['category_ids']) || !is_array($_POST['category_ids']))
{
$this->showGlobalUnitCategories();
return;
}
// @todo: Confirmation Currently not implemented, so forward to import
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLocalUnitConfigurationGUI::confirmImportGlobalCategory ( )
protected

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

References $_GET, $_POST, and confirmImportGlobalCategories().

{
if(!isset($_GET['category_id']))
{
$this->showGlobalUnitCategories();
return;
}
$_POST['category_ids'] = array($_GET['category_id']);
}

+ Here is the call graph for this function:

ilLocalUnitConfigurationGUI::executeCommand ( )

Reimplemented from ilUnitConfigurationGUI.

Definition at line 73 of file class.ilLocalUnitConfigurationGUI.php.

{
$this->ctrl->saveParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID);
}
ilLocalUnitConfigurationGUI::getDefaultCommand ( )
protected
Returns
string

Reimplemented from ilUnitConfigurationGUI.

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

Referenced by importGlobalCategories().

{
return 'showLocalUnitCategories';
}

+ Here is the caller graph for this function:

ilLocalUnitConfigurationGUI::getUniqueId ( )
Returns
string

Reimplemented from ilUnitConfigurationGUI.

Definition at line 54 of file class.ilLocalUnitConfigurationGUI.php.

References isCRUDContext().

{
$id = $this->repository->getConsumerId();
if($this->isCRUDContext())
{
$id .= '_local';
}
else
{
$id .= '_global';
}
return $id;
}

+ Here is the call graph for this function:

ilLocalUnitConfigurationGUI::getUnitCategoryOverviewCommand ( )
Returns
string

Reimplemented from ilUnitConfigurationGUI.

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

References isCRUDContext().

Referenced by showUnitCategories().

{
if($this->isCRUDContext())
{
return 'showLocalUnitCategories';
}
else
{
return 'showGlobalUnitCategories';
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLocalUnitConfigurationGUI::importGlobalCategories ( )
protected

Definition at line 185 of file class.ilLocalUnitConfigurationGUI.php.

References $_POST, getDefaultCommand(), isCRUDContext(), and ilUtil\sendSuccess().

Referenced by confirmImportGlobalCategories().

{
if($this->isCRUDContext())
{
$this->{$this->getDefaultCommand()}();
return;
}
if(!isset($_POST['category_ids']) || !is_array($_POST['category_ids']))
{
$this->showGlobalUnitCategories();
return;
}
$i = 0;
foreach($_POST['category_ids'] as $category_id)
{
try
{
$category = $this->repository->getUnitCategoryById((int)$category_id);
}
catch(ilException $e)
{
continue;
}
// Copy admin-category to custom-category (with question_fi)
$new_cat_id = $this->repository->copyCategory($category->getId(), $this->repository->getConsumerId());
// Copy units to custom_category
$this->repository->copyUnitsByCategories($category->getId(), $new_cat_id, $this->repository->getConsumerId());
++$i;
}
if($i)
{
ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
}
$this->ctrl->setParameter($this, 'question_fi', 0);
$this->ctrl->redirect($this, 'showLocalUnitCategories');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLocalUnitConfigurationGUI::isCRUDContext ( )
Returns
boolean

Reimplemented from ilUnitConfigurationGUI.

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

References $_GET.

Referenced by getUniqueId(), getUnitCategoryOverviewCommand(), and importGlobalCategories().

{
if(!isset($_GET[self::REQUEST_PARAM_SUB_CONTEXT_ID]) || $_GET[self::REQUEST_PARAM_SUB_CONTEXT_ID] == $this->repository->getConsumerId())
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

ilLocalUnitConfigurationGUI::showUnitCategories ( array  $categories)
protected
Parameters
array$categories

Reimplemented from ilUnitConfigurationGUI.

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

References getUnitCategoryOverviewCommand().

{
require_once 'Modules/TestQuestionPool/classes/tables/class.ilLocalUnitCategoryTableGUI.php';
$table->setData($categories);
$this->tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

Field Documentation

const ilLocalUnitConfigurationGUI::REQUEST_PARAM_SUB_CONTEXT_ID = 'question_fi'

Definition at line 11 of file class.ilLocalUnitConfigurationGUI.php.


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