Example #1
0
 /**
  * @param          $record_type
  * @param ilPlugin $plugin_object
  */
 public function __construct($record_type, ilPlugin $plugin_object = NULL)
 {
     global $tpl, $ilCtrl, $ilAccess, $lng;
     $this->lng = $lng;
     if ($plugin_object) {
         $this->setLngPrefix($plugin_object->getPrefix());
         $plugin_object->loadLanguageModule();
     }
     $this->tpl = $tpl;
     $this->ctrl = $ilCtrl;
     $this->access = $ilAccess;
     $this->plugin_object = $plugin_object;
     $this->record_type = $record_type;
     $this->ar = new $record_type();
 }
 /**
  *	Constructor logic.
  *
  *	This table GUI constructor method initializes the
  *	object and configures the table rendering.
  */
 public function __construct(ilObjectGUI $a_parent_obj, $a_parent_cmd)
 {
     /**
      *	@var ilCtrl $ilCtrl
      */
     global $ilCtrl;
     /* Pre-configure table */
     $this->setId(sprintf('test_overview_test_list_%d', $a_parent_obj->object->getId()));
     $this->setDefaultOrderDirection('ASC');
     $this->setDefaultOrderField('title');
     // ext ordering with db is ok, but ext limiting with db is not possible,
     // since the rbac filtering is downstream to the db query
     $this->setExternalSorting(true);
     $this->setExternalSegmentation(true);
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->setTitle(sprintf($this->lng->txt('rep_robj_xtov_test_list_table_title'), $a_parent_obj->object->getTitle()));
     $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'TestOverview');
     $this->setRowTemplate('tpl.simple_object_row.html', $plugin->getDirectory());
     $this->addColumn($this->lng->txt(''), '', '1px', true);
     $this->addColumn($this->lng->txt('rep_robj_xtov_test_list_hdr_test_title'), 'title');
     $this->addColumn($this->lng->txt('rep_robj_xtov_test_list_hdr_test_info'), '');
     $this->setDescription($this->lng->txt('rep_robj_xtov_test_list_description'));
     $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), 'updateSettings'));
     $this->addCommandButton('initSelectTests', $this->lng->txt('rep_robj_xtov_add_tsts_to_overview'));
     $this->addMultiCommand('removeTests', $this->lng->txt('rep_robj_xtov_remove_from_overview'));
     $this->setShowRowsSelector(true);
     $this->setSelectAllCheckbox('test_ids[]');
     $this->initFilter();
     $this->setFilterCommand('applyTestsFilter');
     $this->setResetCommand('resetTestsFilter');
 }
 /**
  * constructor
  */
 function ilPluginDBUpdate($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_db_handler, $tmp_flag, $a_db_prefix)
 {
     $this->db_prefix = $a_db_prefix;
     // workaround to allow setup migration
     if ($a_db_handler) {
         $this->db =& $a_db_handler;
         if ($tmp_flag) {
             $this->PATH = "./";
         } else {
             $this->PATH = "../";
         }
     } else {
         global $mySetup;
         $this->db = $mySetup->db;
         $this->PATH = "./";
     }
     $this->ctype = $a_ctype;
     $this->cname = $a_cname;
     $this->slot_id = $a_slot_id;
     $this->pname = $a_pname;
     include_once "./Services/Component/classes/class.ilPluginSlot.php";
     $this->slot_name = ilPluginSlot::lookupSlotName($this->ctype, $this->cname, $this->slot_id);
     $this->getCurrentVersion();
     // get update file for current version
     $updatefile = $this->getFileForStep($this->currentVersion + 1);
     $this->current_file = $updatefile;
     $this->DB_UPDATE_FILE = $this->PATH . ilPlugin::getDBUpdateScriptName($this->ctype, $this->cname, $this->slot_name, $this->pname);
     //
     // NOTE: multiple update files for plugins are not supported yet
     //
     $this->LAST_UPDATE_FILE = $this->PATH . ilPlugin::getDBUpdateScriptName($this->ctype, $this->cname, $this->slot_name, $this->pname);
     $this->readDBUpdateFile();
     $this->readLastUpdateFile();
     $this->readFileVersion();
 }
 function listObjects()
 {
     global $tpl, $ilToolbar, $lng, $ilCtrl, $objDefinition;
     $objects = ilObject::getAllOwnedRepositoryObjects($this->user_id);
     if (sizeof($objects)) {
         include_once "Services/Form/classes/class.ilSelectInputGUI.php";
         $sel = new ilSelectInputGUI($lng->txt("type"), "type");
         $ilToolbar->addInputItem($sel, true);
         $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "listObjects"));
         $ilToolbar->addFormButton($lng->txt("ok"), "listObjects");
         $options = array();
         foreach (array_keys($objects) as $type) {
             // #11050
             if (!$objDefinition->isPlugin($type)) {
                 $options[$type] = $lng->txt("obj_" . $type);
             } else {
                 include_once "./Services/Component/classes/class.ilPlugin.php";
                 $options[$type] = ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type);
             }
         }
         asort($options);
         $sel->setOptions($options);
         $sel_type = (string) $_REQUEST["type"];
         if ($sel_type) {
             $sel->setValue($sel_type);
         } else {
             $sel_type = array_keys($options);
             $sel_type = array_shift($sel_type);
         }
         $ilCtrl->setParameter($this, "type", $sel_type);
     }
     include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
     $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id, $objects[$sel_type]);
     $tpl->setContent($tbl->getHTML());
 }
 /**
  * 
  * @param object $a_parent_class
  * @param string $a_parent_cmd
  * @return 
  */
 public function __construct($a_parent_class, $a_parent_cmd, $a_type)
 {
     global $lng, $ilCtrl, $ilUser, $objDefinition;
     parent::__construct($a_parent_class, $a_parent_cmd);
     $this->type = $a_type;
     $this->lng = $lng;
     $this->ctrl = $ilCtrl;
     if (!$objDefinition->isPlugin($this->type)) {
         $title = $this->lng->txt('obj_' . $this->type . '_duplicate');
     } else {
         include_once "Services/Component/classes/class.ilPlugin.php";
         $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->type));
         $title = $plugin->txt('obj_' . $this->type . '_duplicate');
     }
     $this->setTitle($title);
     $ilUser->getPref('search_max_hits');
     $this->addColumn($this->lng->txt('search_title_description'), 'title', '99%');
     $this->setEnableHeader(true);
     $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
     $this->setRowTemplate("tpl.obj_copy_search_result_row.html", "Services/Object");
     $this->setEnableTitle(true);
     $this->setEnableNumInfo(true);
     $this->setDefaultOrderField('title');
     if ($objDefinition->isContainer($this->type)) {
         $this->addCommandButton('saveSource', $this->lng->txt('btn_next'));
     } else {
         $this->addCommandButton('saveSource', $title);
     }
     $this->addCommandButton('cancel', $this->lng->txt('btn_back'));
 }
 /**
  * Get class name
  */
 function _getName($a_id)
 {
     $name = ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $a_id);
     if ($name != "") {
         return $name;
     }
 }
 /**
  *	Constructor logic.
  *
  *	This table GUI constructor method initializes the
  *	object and configures the table rendering.
  */
 public function __construct(ilObjectGUI $a_parent_obj, $a_parent_cmd)
 {
     /**
      *	@var ilCtrl	$ilCtrl
      */
     global $ilCtrl;
     /* Pre-configure table */
     $this->setId(sprintf("test_overview_membership_list_%d", $a_parent_obj->object->getId()));
     $this->setDefaultOrderDirection('ASC');
     $this->setDefaultOrderField('title');
     $this->setExternalSorting(true);
     $this->setExternalSegmentation(true);
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->setTitle(sprintf($this->lng->txt('rep_robj_xtov_membership_list_table_title'), $a_parent_obj->object->getTitle()));
     $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'TestOverview');
     $this->setRowTemplate('tpl.simple_object_row.html', $plugin->getDirectory());
     $this->addColumn($this->lng->txt(""), '', '1px', true);
     $this->addColumn($this->lng->txt("rep_robj_xtov_membership_list_hdr_membership_title"), 'title');
     $this->addColumn($this->lng->txt("rep_robj_xtov_membership_list_hdr_membership_info"), '');
     $this->addColumn($this->lng->txt("rep_robj_xtov_item_chosen"), '');
     $this->setDescription($this->lng->txt("rep_robj_xtov_membership_list_description"));
     $this->setFormAction($ilCtrl->getFormAction($this->getParentObject(), 'updateSettings'));
     $this->addMultiCommand('addMemberships', $this->lng->txt('rep_robj_xtov_add_to_overview'));
     $this->addMultiCommand('removeMemberships', $this->lng->txt('rep_robj_xtov_remove_from_overview'));
     $this->setShowRowsSelector(true);
     /* Add 'Select All', configure filters */
     $this->setSelectAllCheckbox('membership_ids[]');
     $this->initFilter();
     $this->setFilterCommand("applyGroupsFilter");
     $this->setResetCommand("resetGroupsFilter");
 }
 /**
  * @return object The plugin object
  */
 public function getPlugin()
 {
     if ($this->plugin == null) {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $this->plugin = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", "assAccountingQuestion");
     }
     return $this->plugin;
 }
 /**
  * Constructor.
  */
 function __construct($a_ref_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 {
     parent::__construct($a_ref_id, $a_id_type, $a_parent_node_id);
     $this->plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType()));
     if (!is_object($this->plugin)) {
         die("ilObjectPluginGUI: Could not instantiate plugin object for type " . $this->getType() . ".");
     }
 }
Example #10
0
 /**
  * Constructor.
  */
 function __construct($a_ref_id = 0)
 {
     $this->initType();
     parent::__construct($a_ref_id, true);
     $this->plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType()));
     if (!is_object($this->plugin)) {
         die("ilObjectPluginGUI: Could not instantiate plugin object for type " . $this->getType() . ".");
     }
 }
 /**
  * Constructor
  *
  * @access public
  */
 public function __construct($a_type_id = 0)
 {
     // this uses the cached plugin object
     $this->plugin_object = ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'ExternalContent');
     if ($a_type_id) {
         $this->type_id = $a_type_id;
         $this->read();
     }
 }
 public function getPluginTablePrefix()
 {
     $id = $this->getId();
     if (!$id) {
         $rec = ilPlugin::getPluginRecord($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $this->getPluginName());
         $id = $rec['plugin_id'];
     }
     return $this->getSlotObject()->getPrefix() . "_" . $id;
 }
 /**
  *  Add a content to the container
  *
  * @param array $attributes
  */
 public function addContent($attributes)
 {
     /**
      * @var $pluginObj ilPlugin
      *
      */
     $pluginObj = ilPlugin::getPluginObject('Services', 'Repository', 'robj', 'AdobeConnect');
     $pluginObj->includeClass('class.ilAdobeConnectContent.php');
     $this->contents[] = new ilAdobeConnectContent($attributes);
 }
 /**
  * assJSMEQuestionGUI constructor	
  * The constructor takes possible arguments an creates an instance of the assJSMEQuestionGUI object.
  *
  * @param integer $id The database id of a TemplateQuestion question object
  * @access public
  */
 function __construct($id = -1)
 {
     parent::__construct();
     include_once "./Services/Component/classes/class.ilPlugin.php";
     $plugin = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", "assJSMEQuestion");
     $plugin->includeClass("class.assJSMEQuestion.php");
     $this->object = new assJSMEQuestion();
     if ($id >= 0) {
         $this->object->loadFromDb($id);
     }
 }
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng, $objDefinition;
     $img = ilObject::_getIcon($obj_id, "small", $a_set["type"]);
     if (is_file($img)) {
         $alt = $objDefinition->isPlugin($a_set["type"]) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $a_set["type"], "obj_" . $a_set["type"]) : $lng->txt("icon") . " " . $lng->txt("obj_" . $a_set["type"]);
         $this->tpl->setVariable("IMG_TYPE", ilUtil::img($img, $alt));
     }
     $this->tpl->setVariable("ID", $a_set["ref_id"]);
     $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
     $this->tpl->setVariable("VAL_LAST_CHANGE", $a_set["last_update"]);
 }
 /**
  * initialisation
  */
 final function init()
 {
     $this->delete_enabled = true;
     $this->cut_enabled = true;
     $this->subscribe_enabled = true;
     $this->link_enabled = true;
     $this->payment_enabled = false;
     $this->info_screen_enabled = true;
     $this->initType();
     $this->plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType()));
     $this->gui_class_name = $this->getGuiClass();
     $this->commands = $this->initCommands();
 }
 /**
  * assAccountingQuestionGUI constructor
  *
  * The constructor takes possible arguments and creates an instance of the assAccountingQuestionGUI object.
  *
  * @param integer $id The database id of a question object
  * @access public
  */
 public function __construct($id = -1)
 {
     parent::__construct();
     include_once "./Services/Component/classes/class.ilPlugin.php";
     $this->plugin = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", "assAccountingQuestion");
     $this->plugin->includeClass("class.assAccountingQuestion.php");
     $this->object = new assAccountingQuestion();
     $this->newUnitId = null;
     if ($id >= 0) {
         $this->object->loadFromDb($id);
     }
     $this->tpl->addCss($this->plugin->getStyleSheetLocation('accqstStyles.css') . self::URL_SUFFIX, '');
 }
 /**
  * Handles all commmands, default is "configure"
  * 
  * @access	public
  */
 public function performCommand($cmd)
 {
     global $ilTabs;
     $this->pluginObj = ilPlugin::getPluginObject('Services', 'Repository', 'robj', 'AdobeConnect');
     $this->pluginObj->includeClass('class.ilAdobeConnectServer.php');
     $this->pluginObj->includeClass('class.ilXAVCPermissions.php');
     $this->tabs = $ilTabs;
     $this->getTabs();
     switch ($cmd) {
         default:
             $this->{$cmd}();
             break;
     }
 }
 /**
  * Forward command to plugin
  */
 function forward()
 {
     global $ilCtrl;
     $type = ilObject::_lookupType($_GET["ref_id"], true);
     if ($type != "") {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $pl_name = ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $type);
         if ($pl_name != "") {
             $gui_cn = "ilObj" . $pl_name . "GUI";
             $ilCtrl->setParameterByClass($gui_cn, "ref_id", $_GET["ref_id"]);
             $ilCtrl->redirectByClass($gui_cn, $_GET["forwardCmd"]);
         }
     }
 }
 /**
  * Check whether a repository type is a plugin which has active learning progress
  * 
  * @param string $a_type
  * @param bool $a_active_status
  * @return boolean
  */
 static function isTypePluginWithLP($a_type, $a_active_status = true)
 {
     global $ilPluginAdmin;
     include_once "./Services/Component/classes/class.ilPlugin.php";
     $pname = ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $a_type);
     if ($pname == "") {
         return false;
     }
     if ($ilPluginAdmin->exists(IL_COMP_SERVICE, "Repository", "robj", $pname)) {
         if (!$a_active_status || $ilPluginAdmin->isActive(IL_COMP_SERVICE, "Repository", "robj", $pname)) {
             if ($ilPluginAdmin->hasLearningProgress(IL_COMP_SERVICE, "Repository", "robj", $pname)) {
                 return true;
             }
         }
     }
     return false;
 }
 /**
  * Show delete confirmation table
  */
 function showDeleteConfirmation($a_ids, $a_supress_message = false)
 {
     global $lng, $ilSetting, $ilCtrl, $tpl, $objDefinition;
     if (!is_array($a_ids) || count($a_ids) == 0) {
         ilUtil::sendFailure($lng->txt("no_checkbox"), true);
         return false;
     }
     // Remove duplicate entries
     $a_ids = array_unique((array) $a_ids);
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     $cgui = new ilConfirmationGUI();
     if (!$a_supress_message) {
         $msg = $lng->txt("info_delete_sure");
         if (!$ilSetting->get('enable_trash')) {
             $msg .= "<br/>" . $lng->txt("info_delete_warning_no_trash");
         }
         $cgui->setHeaderText($msg);
     }
     $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
     $cgui->setCancel($lng->txt("cancel"), "cancelDelete");
     $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
     $form_name = "cgui_" . md5(uniqid());
     $cgui->setFormName($form_name);
     $deps = array();
     foreach ($a_ids as $ref_id) {
         $obj_id = ilObject::_lookupObjId($ref_id);
         $type = ilObject::_lookupType($obj_id);
         $title = call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id);
         $alt = $objDefinition->isPlugin($type) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type) : $lng->txt("icon") . " " . $lng->txt("obj_" . $type);
         $title .= $this->handleMultiReferences($obj_id, $ref_id, $form_name);
         $cgui->addItem("id[]", $ref_id, $title, ilObject::_getIcon($obj_id, "small", $type), $alt);
         ilObject::collectDeletionDependencies($deps, $ref_id, $obj_id, $type);
     }
     $deps_html = "";
     if (is_array($deps) && count($deps) > 0) {
         include_once "./Services/Repository/classes/class.ilRepDependenciesTableGUI.php";
         $tab = new ilRepDependenciesTableGUI($deps);
         $deps_html = "<br/><br/>" . $tab->getHTML();
     }
     $tpl->setContent($cgui->getHTML() . $deps_html);
     return true;
 }
 public function fillRow($row)
 {
     global $lng, $objDefinition;
     // #11050
     if (!$objDefinition->isPlugin($row["type"])) {
         $txt_type = $lng->txt("obj_" . $row["type"]);
     } else {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $txt_type = ilPlugin::lookupTxt("rep_robj", $row["type"], "obj_" . $row["type"]);
     }
     $this->tpl->setVariable("TITLE", $row["title"]);
     $this->tpl->setVariable("ALT_ICON", $txt_type);
     $this->tpl->setVariable("SRC_ICON", ilObject::_getIcon("", "tiny", $row["type"]));
     $this->tpl->setVariable("PATH", $row["path"]);
     if ($row["readable"]) {
         $this->tpl->setCurrentBlock("actions");
         $this->tpl->setVariable("ACTIONS", $this->buildActions($row["ref_id"], $row["type"]));
         $this->tpl->parseCurrentBlock();
     }
 }
 /**
  * @return mixed
  */
 public function getGalleryUsers()
 {
     $this->pluginObj = ilPlugin::getPluginObject('Services', 'Repository', 'robj', 'AdobeConnect');
     $this->pluginObj->includeClass('class.ilAdobeConnectRoles.php');
     $xavcRoles = new ilAdobeConnectRoles($_GET['ref_id']);
     $members = $xavcRoles->getUsers();
     // MEMBERS
     if (count($members)) {
         foreach ($members as $member_id) {
             if (!($usr_obj = ilObjectFactory::getInstanceByObjId($member_id, false))) {
                 continue;
             }
             if (!$usr_obj->getActive()) {
                 continue;
             }
             $user_data[$usr_obj->getId()] = array('id' => $usr_obj->getId(), 'user' => $usr_obj);
         }
     }
     return $user_data;
 }
 /**
  * Initialisation
  */
 protected function afterConstructor()
 {
     /**
      * @var $tpl $tpl
      * @var $ilUser ilObjUser
      * @var $ilTabs ilTabsGUI
      * @var $ilCtrl ilCtrl
      * @var $ilAccess ilAccessHandler
      * @var $lng $lng
      */
     global $ilUser, $ilTabs, $ilCtrl, $ilAccess, $tpl, $lng;
     $this->pluginObj = ilPlugin::getPluginObject('Services', 'Repository', 'robj', 'AdobeConnect');
     $this->form = new ilPropertyFormGUI();
     $this->tabs = $ilTabs;
     $this->ctrl = $ilCtrl;
     $this->access = $ilAccess;
     $this->tpl = $tpl;
     if (is_object($this->object)) {
         $tpl->setDescription($this->object->getLongDescription());
     }
     $this->lng = $lng;
     $this->user = $ilUser;
 }
 /**
  * @param        $a_parent_obj
  * @param string $a_parent_cmd
  */
 public function __construct($a_parent_obj, $a_parent_cmd)
 {
     /**
      * @var $ilCtrl ilCtrl
      */
     global $ilCtrl, $tpl;
     $this->ctrl = $ilCtrl;
     $tpl->addJavascript("./Customizing/global/plugins/Services/Repository/RepositoryObject/AdobeConnect/templates/js/plugin.js");
     $this->setId('xavc_participants');
     $this->setDefaultOrderDirection('ASC');
     $this->setDefaultOrderField('');
     $this->setExternalSorting(false);
     $this->setExternalSegmentation(false);
     $this->pluginObj = ilPlugin::getPluginObject('Services', 'Repository', 'robj', 'AdobeConnect');
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->setEnableNumInfo(true);
     $this->setTitle($a_parent_obj->pluginObj->txt("participants"));
     $this->addColumns();
     $this->addMultiCommands();
     $this->setSelectAllCheckbox('usr_id[]');
     $this->setShowRowsSelector(true);
     $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
     $this->setRowTemplate($a_parent_obj->pluginObj->getDirectory() . '/templates/default/tpl.xavc_active_user_row.html');
 }
 /**
  * adds a header row to a block template
  *
  * @param	object		$a_tpl		block template
  * @param	string		$a_type		object type
  * @access	private
  */
 function addHeaderRow(&$a_tpl, $a_type, $a_show_image = true)
 {
     global $objDefinition;
     $icon = ilUtil::getImagePath("icon_" . $a_type . ".png");
     if (!$objDefinition->isPlugin($a_type)) {
         $title = $this->lng->txt("objs_" . $a_type);
     } else {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $title = ilPlugin::lookupTxt("rep_robj", $a_type, "objs_" . $a_type);
     }
     $header_id = "th_" . $a_type;
     if ($a_show_image) {
         $a_tpl->setCurrentBlock("container_header_row_image");
         $a_tpl->setVariable("HEADER_IMG", $icon);
         $a_tpl->setVariable("HEADER_ALT", $title);
     } else {
         $a_tpl->setCurrentBlock("container_header_row");
     }
     $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
     $a_tpl->setVariable("BLOCK_HEADER_ID", $header_id);
     $a_tpl->parseCurrentBlock();
     $a_tpl->touchBlock("container_row");
 }
 public static function &_getQuestionTypeTranslations()
 {
     global $ilDB;
     global $lng;
     global $ilLog;
     global $ilPluginAdmin;
     $lng->loadLanguageModule("survey");
     $result = $ilDB->query("SELECT * FROM svy_qtype");
     $types = array();
     while ($row = $ilDB->fetchAssoc($result)) {
         if ($row["plugin"] == 0) {
             $types[$row['type_tag']] = $lng->txt($row["type_tag"]);
         } else {
             $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "SurveyQuestionPool", "svyq");
             foreach ($pl_names as $pl_name) {
                 $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "SurveyQuestionPool", "svyq", $pl_name);
                 if (strcmp($pl->getQuestionType(), $row["type_tag"]) == 0) {
                     $types[$row['type_tag']] = $pl->getQuestionTypeTranslation();
                 }
             }
         }
     }
     ksort($types);
     return $types;
 }
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng, $objDefinition;
     $obj_id = $a_set["obj_id"];
     $ref_id = $a_set["ref_id"];
     $type = $a_set['type'];
     $title = $a_set['title'];
     $description = $a_set['description'];
     $relevance = $a_set['relevance'];
     if (!$type) {
         return false;
     }
     include_once './Services/Search/classes/Lucene/class.ilLuceneSearchObjectListGUIFactory.php';
     $item_list_gui = ilLuceneSearchObjectListGUIFactory::factory($type);
     $item_list_gui->initItem($ref_id, $obj_id, $title, $description);
     $item_list_gui->setContainerObject($this->parent_obj);
     $item_list_gui->setSearchFragment($this->presenter->lookupContent($obj_id, 0));
     $item_list_gui->setSeparateCommands(true);
     ilObjectActivation::addListGUIActivationProperty($item_list_gui, $a_set);
     $this->presenter->appendAdditionalInformation($item_list_gui, $ref_id, $obj_id, $type);
     $this->tpl->setVariable("ACTION_HTML", $item_list_gui->getCommandsHTML());
     if ($html = $item_list_gui->getListItemHTML($ref_id, $obj_id, $title, $description)) {
         $item_html[$ref_id]['html'] = $html;
         $item_html[$ref_id]['type'] = $type;
     }
     $this->tpl->setVariable("HREF_IMG", $item_list_gui->default_command["link"]);
     global $lng;
     if ($this->enabledRelevance()) {
         $width1 = (int) ((int) $relevance / 2);
         $width2 = (int) (50 - $width1);
         $this->tpl->setCurrentBlock('relev');
         $this->tpl->setVariable('VAL_REL', sprintf("%d %%", $relevance));
         $this->tpl->setVariable('WIDTH_A', $width1);
         $this->tpl->setVariable('WIDTH_B', $width2);
         $this->tpl->setVariable('IMG_A', ilUtil::getImagePath("relevance_blue.png"));
         $this->tpl->setVariable('IMG_B', ilUtil::getImagePath("relevance_dark.png"));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("ITEM_HTML", $html);
     if (!$objDefinition->isPlugin($type)) {
         $type_txt = $lng->txt('icon') . ' ' . $lng->txt('obj_' . $type);
         $icon = ilUtil::getImagePath('icon_' . $type . '.png');
     } else {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $type_txt = ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type);
         $icon = ilObject::_getIcon($obj_id, 'small', $type);
     }
     $this->tpl->setVariable("TYPE_IMG", ilUtil::img($icon, $type_txt));
 }
<?php

/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
/**
 *	@package	TestOverview repository plugin
 *	@category	Core
 *	@author		Greg Saive <*****@*****.**>
 */
/* Internal : */
require_once ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'TestOverview')->getDirectory() . '/classes/mapper/class.ilDataMapper.php';
class ilOverviewMapper extends ilDataMapper
{
    /**
     *	@var string
     */
    protected $tableName = "rep_robj_xtov_overview overview";
    /**
     *	@see ilDataMapper::getSelectPart()
     */
    public function getSelectPart()
    {
        $fields = array("participants.obj_id_grpcrs obj_id");
        return implode(', ', $fields);
    }
    /**
     *	@see ilDataMapper::getFromPart()
     */
    public function getFromPart()
    {
        $joins = array("JOIN rep_robj_xtov_p2o participants\n\t\t\t\tON (overview.obj_id = participants.obj_id_overview)");
        return $this->tableName . " " . implode(' ', $joins);
 /**
  * Fill row template
  * @return 
  */
 public function fillRow($row)
 {
     global $objDefinition;
     if (isset($row['show_ce'])) {
         $this->tpl->setCurrentBlock('ce_td');
         $this->tpl->setVariable('CE_TYPE', $this->getTemplateType());
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock('ce_desc_td');
         $this->tpl->setVariable('CE_DESC_TYPE', $this->getTemplateType());
         $this->tpl->setVariable('CE_LONG', $this->lng->txt('change_existing_object_type_desc'));
         if ($objDefinition->isSystemObject($this->getTemplateType())) {
             $this->tpl->setVariable("TXT_CE", $this->lng->txt("change_existing_prefix_single") . " " . $this->lng->txt("obj_" . $this->getTemplateType()) . " " . $this->lng->txt("change_existing_suffix_single"));
         } else {
             $pl_txt = $objDefinition->isPlugin($this->getTemplateType()) ? ilPlugin::lookupTxt("rep_robj", $this->getTemplateType(), "objs_" . $this->getTemplateType()) : $this->lng->txt('objs_' . $this->getTemplateType());
             $this->tpl->setVariable('TXT_CE', $this->lng->txt('change_existing_prefix') . ' ' . $pl_txt . ' ' . $this->lng->txt('change_existing_suffix'));
             $this->tpl->parseCurrentBlock();
         }
         return true;
     } else {
         $this->tpl->setCurrentBlock('perm_td');
         $this->tpl->setVariable('OBJ_TYPE', $this->getTemplateType());
         $this->tpl->setVariable('PERM_PERM_ID', $row['ops_id']);
         $this->tpl->setVariable('PERM_CHECKED', $row['set'] ? 'checked="checked"' : '');
         if ($this->getRoleId() == SYSTEM_ROLE_ID) {
             $this->tpl->setVariable('PERM_DISABLED', 'disabled="disabled"');
         }
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock('perm_desc_td');
         $this->tpl->setVariable('DESC_TYPE', $this->getTemplateType());
         $this->tpl->setVariable('DESC_PERM_ID', $row['ops_id']);
         if ($row["create_type"] != "" && $objDefinition->isPlugin($row['create_type'])) {
             $this->tpl->setVariable('TXT_PERMISSION', ilPlugin::lookupTxt("rep_robj", $row['create_type'], $this->getTemplateType() . "_" . $row['name']));
         } else {
             if ($row["create_type"] == "" && $objDefinition->isPlugin($this->getTemplateType())) {
                 $this->tpl->setVariable('TXT_PERMISSION', ilPlugin::lookupTxt("rep_robj", $this->getTemplateType(), $this->getTemplateType() . "_" . $row['name']));
             } else {
                 if (substr($row['name'], 0, 6) == 'create') {
                     #$perm = $this->lng->txt($this->getTemplateType().'_'.$row['name']);
                     $perm = $this->lng->txt('rbac' . '_' . $row['name']);
                 } elseif ($this->lng->exists($this->getTemplateType() . '_' . $row['name'] . '_short')) {
                     $perm = $this->lng->txt($this->getTemplateType() . '_' . $row['name'] . '_short') . ': ' . $this->lng->txt($this->getTemplateType() . '_' . $row['name']);
                 } else {
                     $perm = $this->lng->txt($row['name']) . ': ' . $this->lng->txt($this->getTemplateType() . '_' . $row['name']);
                 }
                 $this->tpl->setVariable('TXT_PERMISSION', $perm);
             }
         }
         $this->tpl->parseCurrentBlock();
         return true;
     }
 }