/** * * @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')); }
/** * 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 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() . "."); } }
/** * 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(); } }
/** * 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() . "."); } }
/** * 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); } }
/** * 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, ''); }
/** * 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(); }
/** * 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; } }
/** * @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'); }
<?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);
/** * imports question(s) into the questionpool */ function uploadQplObject($questions_only = false) { $this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']); if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK) { ilUtil::sendFailure($this->lng->txt("error_upload"), true); if (!$questions_only) { $this->ctrl->redirect($this, 'create'); } return false; } // create import directory include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"; $basedir = ilObjQuestionPool::_createImportDirectory(); // copy uploaded file to import directory $file = pathinfo($_FILES["xmldoc"]["name"]); $full_path = $basedir . "/" . $_FILES["xmldoc"]["name"]; $GLOBALS['ilLog']->write(__METHOD__ . ": full path " . $full_path); include_once "./Services/Utilities/classes/class.ilUtil.php"; ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path); $GLOBALS['ilLog']->write(__METHOD__ . ": full path " . $full_path); if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0) { $qti_file = $full_path; ilObjTest::_setImportDirectory($basedir); } else { // unzip file ilUtil::unzip($full_path); // determine filenames of xml files $subdir = basename($file["basename"], "." . $file["extension"]); ilObjQuestionPool::_setImportDirectory($basedir); $xml_file = ilObjQuestionPool::_getImportDirectory() . '/' . $subdir . '/' . $subdir . ".xml"; $qti_file = ilObjQuestionPool::_getImportDirectory() . '/' . $subdir . '/' . str_replace("qpl", "qti", $subdir) . ".xml"; } // start verification of QTI files include_once "./Services/QTI/classes/class.ilQTIParser.php"; $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, ""); $result = $qtiParser->startParsing(); $founditems =& $qtiParser->getFoundItems(); if (count($founditems) == 0) { // nothing found // delete import directory ilUtil::delDir($basedir); ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true); if (!$questions_only) { $this->ctrl->redirect($this, 'create'); } return false; } $complete = 0; $incomplete = 0; foreach ($founditems as $item) { if (strlen($item["type"])) { $complete++; } else { $incomplete++; } } if ($complete == 0) { // delete import directory ilUtil::delDir($basedir); ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true); if (!$questions_only) { $this->ctrl->redirect($this, 'create'); } return false; } $_SESSION["qpl_import_xml_file"] = $xml_file; $_SESSION["qpl_import_qti_file"] = $qti_file; $_SESSION["qpl_import_subdir"] = $subdir; // display of found questions $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html", "Modules/TestQuestionPool"); $row_class = array("tblrow1", "tblrow2"); $counter = 0; foreach ($founditems as $item) { $this->tpl->setCurrentBlock("verification_row"); $this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]); $this->tpl->setVariable("QUESTION_TITLE", $item["title"]); $this->tpl->setVariable("QUESTION_IDENT", $item["ident"]); include_once "./Services/QTI/classes/class.ilQTIItem.php"; switch ($item["type"]) { case CLOZE_TEST_IDENTIFIER: $type = $this->lng->txt("assClozeTest"); break; case IMAGEMAP_QUESTION_IDENTIFIER: $type = $this->lng->txt("assImagemapQuestion"); break; case JAVAAPPLET_QUESTION_IDENTIFIER: $type = $this->lng->txt("assJavaApplet"); break; case MATCHING_QUESTION_IDENTIFIER: $type = $this->lng->txt("assMatchingQuestion"); break; case MULTIPLE_CHOICE_QUESTION_IDENTIFIER: $type = $this->lng->txt("assMultipleChoice"); break; case KPRIM_CHOICE_QUESTION_IDENTIFIER: $type = $this->lng->txt("assKprimChoice"); break; case SINGLE_CHOICE_QUESTION_IDENTIFIER: $type = $this->lng->txt("assSingleChoice"); break; case ORDERING_QUESTION_IDENTIFIER: $type = $this->lng->txt("assOrderingQuestion"); break; case TEXT_QUESTION_IDENTIFIER: $type = $this->lng->txt("assTextQuestion"); break; case NUMERIC_QUESTION_IDENTIFIER: $type = $this->lng->txt("assNumeric"); break; case TEXTSUBSET_QUESTION_IDENTIFIER: $type = $this->lng->txt("assTextSubset"); break; default: $type = $this->lng->txt($item["type"]); break; } if (strcmp($type, "-" . $item["type"] . "-") == 0) { global $ilPluginAdmin; $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst"); foreach ($pl_names as $pl_name) { $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name); if (strcmp($pl->getQuestionType(), $item["type"]) == 0) { $type = $pl->getQuestionTypeTranslation(); } } } $this->tpl->setVariable("QUESTION_TYPE", $type); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("import_qpl"); if (is_file($xml_file)) { // read file into a string $fh = @fopen($xml_file, "r") or die(""); $xml = @fread($fh, filesize($xml_file)); @fclose($fh); if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches)) { $this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]); } } $this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl")); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("adm_content"); $this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type")); $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title")); $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions")); if ($questions_only) { $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl")); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); } else { $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl")); $this->ctrl->setParameter($this, "new_type", $this->type); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); //$this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".$_GET["ref_id"]."&new_type=".$this->type)); } $this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.svg")); $this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import")); $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel")); $value_questions_only = 0; if ($questions_only) { $value_questions_only = 1; } $this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only); $this->tpl->parseCurrentBlock(); return true; }
/** * Refresh all installed languages */ static function refreshAll() { global $ilPluginAdmin; $languages = ilObject::_getObjectsByType("lng"); foreach ($languages as $lang) { $langObj = new ilObjLanguage($lang["obj_id"], false); if ($langObj->isInstalled() == true) { if ($langObj->check()) { $langObj->flush('keep_local'); $langObj->insert(); $langObj->setTitle($langObj->getKey()); $langObj->setDescription($langObj->getStatus()); $langObj->update(); $langObj->optimizeData(); if ($langObj->isLocal() == true) { if ($langObj->check('local')) { $langObj->insert('local'); $langObj->setTitle($langObj->getKey()); $langObj->setDescription($langObj->getStatus()); $langObj->update(); $langObj->optimizeData(); } } } } unset($langObj); } // refresh languages of activated plugins include_once "./Services/Component/classes/class.ilPluginSlot.php"; $slots = ilPluginSlot::getAllSlots(); foreach ($slots as $slot) { $act_plugins = $ilPluginAdmin->getActivePluginsForSlot($slot["component_type"], $slot["component_name"], $slot["slot_id"]); foreach ($act_plugins as $plugin) { include_once "./Services/Component/classes/class.ilPlugin.php"; $pl = ilPlugin::getPluginObject($slot["component_type"], $slot["component_name"], $slot["slot_id"], $plugin); if (is_object($pl)) { $pl->updateLanguages(); } } } }
/** * Refresh Languages */ function refreshLanguages() { global $ilCtrl; include_once "./Services/Component/classes/class.ilPlugin.php"; $pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"], $_GET["slot_id"], $_GET["pname"]); $result = $pl->updateLanguages(); if ($result !== true) { ilUtil::sendFailure($result, true); } $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]); $ilCtrl->setParameter($this, "cname", $_GET["cname"]); $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]); if ($_GET["plugin_id"]) { $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]); $ilCtrl->redirect($this, "showPlugin"); } else { $ilCtrl->redirect($this, "listPlugins"); } }
/** * Constructor * @access public */ public function __construct($a_ref_id = 0) { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; parent::__construct($a_ref_id); $this->ref_id = $a_ref_id; $this->pluginObj = ilPlugin::getPluginObject('Services', 'Repository', 'robj', 'AdobeConnect'); if (!$ilCtrl->isAsynch()) { $this->pluginObj->includeClass('class.ilAdobeConnectContents.php'); $this->contents = new ilAdobeConnectContents(); } $instance = ilAdobeConnectServer::_getInstance(); $this->adminLogin = $instance->getLogin(); $this->adminPass = $instance->getPasswd(); $this->externalLogin = $this->checkExternalUser(); $this->xmlApi = ilXMLApiFactory::getApiByAuthMode(); }
/** * Initialize the table filters. * * This method is called internally to initialize * the filters from present on the top of the table. */ public function initFilter() { include_once 'Services/Form/classes/class.ilTextInputGUI.php'; include_once 'Services/Form/classes/class.ilSelectInputGUI.php'; include_once ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'TestOverview')->getDirectory() . "/classes/mapper/class.ilOverviewMapper.php"; /* Configure participant name filter (input[type=text]) */ $pname = new ilTextInputGUI($this->lng->txt('rep_robj_xtov_overview_flt_participant_name'), 'flt_participant_name'); $pname->setSubmitFormOnEnter(true); /* Configure participant group name filter (select) */ $mapper = new ilOverviewMapper(); $groups = $mapper->getGroupPairs($this->getParentObject()->object->getId()); $groups = array("" => "-- Select --") + $groups; $gname = new ilSelectInputGUI($this->lng->txt("rep_robj_xtov_overview_flt_group_name"), 'flt_group_name'); $gname->setOptions($groups); /* Configure filter form */ $this->addFilterItem($pname); $this->addFilterItem($gname); $pname->readFromSession(); $gname->readFromSession(); $this->filter['flt_participant_name'] = $pname->getValue(); $this->filter['flt_group_name'] = $gname->getValue(); }
/** * Return the translation for a given question type tag * * @param string $type_tag The type tag of the question type * @access public */ static function _getQuestionTypeName($type_tag) { if (file_exists("./Modules/SurveyQuestionPool/classes/class." . $type_tag . ".php")) { global $lng; return $lng->txt($type_tag); } else { global $ilPluginAdmin; $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(), $type_tag) == 0) { return $pl->getQuestionTypeTranslation(); } } } return ""; }
/** * Show target selection * @return */ public function showTargetSelectionTree() { global $ilTabs, $ilToolbar, $ilCtrl, $tree, $tpl, $objDefinition; $this->tpl = $tpl; $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.paste_into_multiple_objects.html', "Services/Object"); ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard')); include_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php'; $exp = new ilPasteIntoMultipleItemsExplorer(ilPasteIntoMultipleItemsExplorer::SEL_TYPE_RADIO, 'ilias.php?baseClass=ilRepositoryGUI&cmd=goto', 'paste_copy_repexpand'); $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'showTargetSelectionTree')); $exp->setTargetGet('ref_id'); $exp->setPostVar('target'); $exp->setCheckedItems(array((int) $_POST['target'])); // Filter to container foreach (array('cat', 'root', 'crs', 'grp', 'fold') as $container) { /* if($this->getType() == 'crs' and $container == 'crs') { continue; } */ $sub = $objDefinition->getSubObjects($container); if (!isset($sub[$this->getType()])) { $exp->removeFormItemForType($container); } } if ($_GET['paste_copy_repexpand'] == '') { $expanded = $tree->readRootId(); } else { $expanded = $_GET['paste_copy_repexpand']; } $this->tpl->setVariable('FORM_TARGET', '_self'); $this->tpl->setVariable('FORM_ACTION', $ilCtrl->getFormAction($this, 'copySelection')); $exp->setExpand($expanded); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); $this->tpl->setVariable('OBJECT_TREE', $output); $this->tpl->setVariable('CMD_SUBMIT', 'saveTarget'); if ($objDefinition->isContainer($this->getType())) { $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('btn_next')); } else { if (!$objDefinition->isPlugin($this->getType())) { $submit = $this->lng->txt('obj_' . $this->getType() . '_duplicate'); } else { // get plugin instance include_once "Services/Component/classes/class.ilPlugin.php"; $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType())); $submit = $plugin->txt('obj_' . $this->getType() . '_duplicate'); } $this->tpl->setVariable('TXT_SUBMIT', $submit); } $ilToolbar->addButton($this->lng->txt('cancel'), $ilCtrl->getLinkTarget($this, 'cancel')); }
/** * Constructor * * @param object parent object * @param string parent command */ function __construct($a_parent_obj, $a_parent_cmd = '', $a_template_context = '') { // this uses the cached plugin object $this->plugin_object = ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'ExternalContent'); parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context); }
/** * Include a class implemented by this plugin. * * The includePluginClasses() method can be used to * include classes which are located in the plugin's * directory. * * @params array $classes List of classes to be included * * @throws InvalidArgumentException on invalid class name. (File not found) */ private function includePluginClasses(array $classes) { $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'TestOverview'); $pluginDirectory = $plugin->getDirectory(); foreach ($classes as $class) { if (class_exists($class)) { continue; } $additionalFolder = ""; if (strrpos($class, "Mapper") !== false) { /* Custom mapper classes */ $additionalFolder = "mapper/"; } elseif (strpos($class, "ilObj") === false && strrpos($class, "GUI") !== false) { /* Custom GUI classes (Not a plugin GUI controller) */ $additionalFolder = "GUI/"; } $classFile = $pluginDirectory . "/classes/{$additionalFolder}class.{$class}.php"; if (!file_exists($classFile)) { throw new InvalidArgumentException(); } require_once $classFile; } }
/** * Get Plugin Object * * @param string $a_ctype Component Type * @param string $a_cname Component Name * @param string $a_slot_id Slot ID * @param string $a_pname Plugin Name * @return ilPlugin the plugin */ static function includeClass($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_class_file_name) { // cache the plugin objects if (!isset(self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname])) { self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname] = ilPlugin::getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname); } $pl = self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname]; $pl->includeClass($a_class_file_name); }
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; }
/** * Show target selection */ public function showTargetSelectionTree() { global $ilTabs, $ilToolbar, $ilCtrl, $tree, $tpl, $objDefinition, $lng; $this->tpl = $tpl; if ($objDefinition->isContainer($this->getType())) { ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard_container')); } else { ilUtil::sendInfo($this->lng->txt('msg_copy_clipboard')); } // include_once "./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php"; $exp = new ilRepositorySelectorExplorerGUI($this, "showTargetSelectionTree"); $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "fold")); $exp->setSelectMode("target", false); if ($exp->handleCommand()) { return; } $output = $exp->getHTML(); // toolbars $t = new ilToolbarGUI(); $t->setFormAction($ilCtrl->getFormAction($this, "saveTarget")); if ($objDefinition->isContainer($this->getType())) { $t->addFormButton($lng->txt("btn_next"), "saveTarget"); } else { $t->addFormButton($lng->txt("paste"), "saveTarget"); } $t->addSeparator(); $t->addFormButton($lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard"); $t->addFormButton($lng->txt("cancel"), "cancel"); $t->setCloseFormTag(false); $t->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), " "); $output = $t->getHTML() . $output; $t->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), " "); $t->setCloseFormTag(true); $t->setOpenFormTag(false); $output .= "<br />" . $t->getHTML(); $this->tpl->setContent($output); return; // old implementation $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.paste_into_multiple_objects.html', "Services/Object"); include_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php'; $exp = new ilPasteIntoMultipleItemsExplorer(ilPasteIntoMultipleItemsExplorer::SEL_TYPE_RADIO, 'ilias.php?baseClass=ilRepositoryGUI&cmd=goto', 'paste_copy_repexpand'); // Target selection should check for create permission $required_perm = 'visible'; $create_perm = 'create_' . ilObject::_lookupType($this->getSource(), true); if ($create_perm) { $required_perm .= ',' . $create_perm; } $exp->setRequiredFormItemPermission($required_perm); $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'showTargetSelectionTree')); $exp->setTargetGet('ref_id'); $exp->setPostVar('target'); $exp->highlightNode($_GET['ref_id']); $exp->setCheckedItems(array((int) $_POST['target'])); // Filter to container foreach (array('cat', 'root', 'crs', 'grp', 'fold') as $container) { /* if($this->getType() == 'crs' and $container == 'crs') { continue; } */ $sub = $objDefinition->getSubObjects($container); if (!isset($sub[$this->getType()])) { $exp->removeFormItemForType($container); } } if ($_GET['paste_copy_repexpand'] == '') { $expanded = $tree->readRootId(); } else { $expanded = $_GET['paste_copy_repexpand']; } $this->tpl->setVariable('FORM_TARGET', '_self'); $this->tpl->setVariable('FORM_ACTION', $ilCtrl->getFormAction($this, 'copySelection')); $exp->setExpand($expanded); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); $this->tpl->setVariable('OBJECT_TREE', $output); $this->tpl->setVariable('CMD_SUBMIT', 'saveTarget'); if ($objDefinition->isContainer($this->getType())) { $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('btn_next')); } else { if (!$objDefinition->isPlugin($this->getType())) { $submit = $this->lng->txt('obj_' . $this->getType() . '_duplicate'); } else { // get plugin instance include_once "Services/Component/classes/class.ilPlugin.php"; $plugin = ilPlugin::getPluginObject(IL_COMP_SERVICE, "Repository", "robj", ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $this->getType())); $submit = $plugin->txt('obj_' . $this->getType() . '_duplicate'); } $this->tpl->setVariable('TXT_SUBMIT', $submit); } $ilToolbar->addButton($this->lng->txt('cancel'), $ilCtrl->getLinkTarget($this, 'cancel')); }