当前位置: 首页>>代码示例>>PHP>>正文


PHP lms_steam::get_extensionmanager方法代码示例

本文整理汇总了PHP中lms_steam::get_extensionmanager方法的典型用法代码示例。如果您正苦于以下问题:PHP lms_steam::get_extensionmanager方法的具体用法?PHP lms_steam::get_extensionmanager怎么用?PHP lms_steam::get_extensionmanager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lms_steam的用法示例。


在下文中一共展示了lms_steam::get_extensionmanager方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: enable

 /**
  * Enable an extension globally. This is done via the extensions persistent object.
  * Dependencies to other extensions are taken into account. If a required extension
  * is not active, activation will not be done.
  * @return boolean activation success or not
  */
 public function enable()
 {
     if (!$this->is_enabled()) {
         $can_be_enabled = TRUE;
         $em = lms_steam::get_extensionmanager();
         foreach ($this->requirements as $req_extension) {
             $req_extension = $em->get_extension($req_extension);
             if (!$req_extension->is_enabled()) {
                 $can_be_enabled = FALSE;
             }
         }
         if ($can_be_enabled) {
             // if no extension config object exists, then create one:
             if (!is_object($this->steam_object)) {
                 $this->steam_object = steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), "/config/koala/extensions/" . $this->get_name());
                 if (!is_object($this->steam_object)) {
                     $env = steam_factory::path_to_object($GLOBALS["STEAM"]->get_id(), "/config/koala/extensions");
                     $this->steam_object = steam_factory::create_object($GLOBALS["STEAM"]->get_id(), $this->get_name(), CLASS_OBJECT, $env);
                     $this->steam_object->set_attributes(array('OBJ_TYPE' => 'object_extension_koala', 'OBJ_DESC' => $this->description, 'EXTENSION_ENABLED' => 'TRUE'));
                 }
             }
             $this->set_attribute("EXTENSION_ENABLED", "TRUE");
             return TRUE;
         }
         return FALSE;
     }
 }
开发者ID:rolwi,项目名称:koala,代码行数:33,代码来源:koala_extension.class.php

示例2: __construct

 public function __construct($course = FALSE)
 {
     $this->containing_course = $course;
     $this->em = lms_steam::get_extensionmanager();
     $unittypes = $this->em->get_extensions_by_obj_type(NULL, "unit_koala");
     $this->installed_unittypes = array();
     foreach ($unittypes as $unit) {
         if (!$unit->is_enabled()) {
             continue;
         }
         $this->installed_unittypes[] = $unit;
     }
 }
开发者ID:rolwi,项目名称:koala,代码行数:13,代码来源:unitmanager.class.php

示例3: get_menu

 function get_menu($params = array())
 {
     if (!is_array($params) || !isset($params["owner"])) {
         throw new Exception("No 'owner' param provided.", E_PARAMETER);
     }
     $course = $params["owner"];
     if (!$course instanceof koala_group_course) {
         throw new Exception("The 'owner' param is not a koala_group_course.", E_PARAMETER);
     }
     $ext_tutorials = lms_steam::get_extensionmanager()->get_extension("tutorials");
     if (($course->is_member(lms_steam::get_current_user()) || $course->is_admin(lms_steam::get_current_user())) && $ext_tutorials->is_enabled($course)) {
         return array("name" => gettext("Tutorials"), "link" => $course->get_url() . "tutorials/");
     }
     return array();
 }
开发者ID:rolwi,项目名称:koala,代码行数:15,代码来源:tutorials.extension.class.php

示例4: execute


//.........这里部分代码省略.........
                         $learners_workroom->set_sanction_all($staff);
                         $learners_workroom->set_sanction_all($admins);
                         $learners_workroom->sanction_meta(SANCTION_ALL, $staff);
                         $learners_workroom->sanction_meta(SANCTION_ALL, $admins);
                         $koala_course = new \koala_group_course($new_course);
                         if (!isset($values["hislsf"]) || !$values["hislsf"]) {
                             $access = $values["access"];
                             $koala_course->set_access($access, $learners, $staff, $admins, KOALA_GROUP_ACCESS);
                             if (isset($values["password"]) && $access == PERMISSION_COURSE_PASSWORD) {
                                 $koala_course->get_group_learners()->set_password($values["password"]);
                             } else {
                                 $koala_course->get_group_learners()->set_password("");
                             }
                         } else {
                             $koala_course->set_access(PERMISSION_COURSE_HISLSF, $learners, $staff, $admins, KOALA_GROUP_ACCESS);
                         }
                         if ($max_members > -1) {
                             $learners->set_attribute(GROUP_MAXSIZE, $max_members);
                         }
                         // RIGHTS MANAGEMENT =======================================
                         // extensions:
                         if (isset($_POST["extensions_available"]) && !empty($_POST["extensions_available"])) {
                             $extensions_available = explode("/", $_POST["extensions_available"]);
                             if (isset($_POST["extensions_enabled"])) {
                                 $extensions_enabled = $_POST["extensions_enabled"];
                             } else {
                                 $extensions_enabled = array();
                             }
                             if (isset($_POST["extensions_enabled_add"])) {
                                 $extensions_enabled = array_merge($extensions_enabled, explode("/", $_POST["extensions_enabled_add"]));
                             }
                             if (is_array($extensions_available)) {
                                 foreach ($extensions_available as $extension_name) {
                                     $extension = \lms_steam::get_extensionmanager()->get_extension($extension_name);
                                     if (!is_object($extension)) {
                                         continue;
                                     }
                                     if (array_search($extension_name, $extensions_enabled) === FALSE) {
                                         $extension->disable_for($koala_course);
                                     } else {
                                         $extension->enable_for($koala_course);
                                     }
                                 }
                             }
                         }
                         $cache = get_cache_function("ORGANIZATION");
                         $cache->drop("lms_steam::semester_get_courses", $current_semester->get_id());
                         header("Location: " . PATH_URL . "semester/index" . "/" . $current_semester->get_name() . "/" . $new_course->get_name() . "/");
                         exit;
                     }
                 }
             }
         }
         if (!empty($problems)) {
             $frameResponseObject->setConfirmText($problems, $hints);
             //$portal->set_problem_description( $problems, $hints );
         }
     }
     if (!empty($_GET["lsf_course_id"])) {
         $lsf_client = new hislsf_soap();
         $course_infos = $lsf_client->get_course_information(SYNC_HISLSF_SEMESTER, $_GET["lsf_course_id"]);
         if (empty($course_infos) && empty($problems)) {
             $frameResponseObject->setConfirmText(gettext("Error getting course data from HIS/LSF."));
             //$portal->set_problem_description(gettext("Error getting course data from HIS/LSF.") );
         } else {
             if (empty($course_infos["course_dsc"])) {
开发者ID:rolwi,项目名称:koala,代码行数:67,代码来源:Create.class.php

示例5: Exception

<?php

require_once "../etc/koala.conf.php";
require_once PATH_LIB . "format_handling.inc.php";
require_once PATH_ETC . "permissions.def.php";
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
$user = lms_steam::get_current_user();
$em = lms_steam::get_extensionmanager();
if (!($steam_group = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["group"]))) {
    throw new Exception("Group not found: " . $_GET["id"]);
}
if (!$steam_group instanceof steam_group) {
    throw new Exception("Is not a group: " . $_GET["id"]);
}
$group = koala_object::get_koala_object($steam_group);
$backlink = $group->get_url();
//if the group is a tutorial and the course has exclusive subgroups for tutorials set, we have to
//see if we are already member in one of the other tutorials.
$already_member_and_exclusive = false;
if ($group instanceof koala_group_tutorial) {
    if ($group->get_course_group()->get_attribute("EXCLUSIVE_TUTORIAL_MEMBERSHIP") === "TRUE") {
        $course_learners_group = $steam_group->get_parent_group();
        $subgroups = $course_learners_group->get_subgroups();
        foreach ($subgroups as $sg) {
            if (($sg->get_attribute("OBJ_TYPE") === "course_tutorial" || $sg->get_attribute("OBJ_TYPE") === "group_tutorial_koala") && $sg->is_member($user) && $sg != $steam_group) {
                $already_member_and_exclusive = true;
                $in_group = $sg;
            }
        }
    }
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:group_subscribe.php

示例6: isset

        break;
    case $path[0] == "clipboard":
        if (CLIPBOARD) {
            // only the user herself and the admins may view her clipboard:
            $current_user = lms_steam::get_current_user();
            if ($user->get_id() != $current_user->get_id() && (!is_object($admin_group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "Admin")) || !$admin_group->is_member($current_user))) {
                $portal->set_problem_description(gettext("You are not permitted to view this folder."));
                $portal->show_html();
                exit;
            }
            $backlink .= "clipboard/";
            $documents_root = $user;
            $documents_path = isset($path[1]) ? array_slice($path, 1) : array();
            include "user_clipboard.php";
        } else {
            include "bad_link.php";
        }
        exit;
        break;
        // Try the extensions:
    // Try the extensions:
    case isset($path[0]) && !empty($path[0]):
        $extension_manager = lms_steam::get_extensionmanager();
        $extension_manager->handle_path($path, new koala_user($user), $portal);
        break;
}
if (YOUR_PROFILE) {
    include_once "user_profile.php";
} else {
    include "bad_link.php";
}
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:user_index.php

示例7: explode

     }
 }
 if ($max_members > -1) {
     $group->set_attribute(GROUP_MAXSIZE, $max_members);
 }
 // extensions:
 if (isset($_POST["extensions_available"]) && !empty($_POST["extensions_available"])) {
     $extensions_available = explode("/", $_POST["extensions_available"]);
     if (isset($_POST["extensions_enabled"])) {
         $extensions_enabled = array_keys($_POST["extensions_enabled"]);
     } else {
         $extensions_enabled = array();
     }
     if (is_array($extensions_available)) {
         foreach ($extensions_available as $extension_name) {
             $extension = lms_steam::get_extensionmanager()->get_extension($extension_name);
             if (!is_object($extension)) {
                 continue;
             }
             if (array_search($extension_name, $extensions_enabled) === FALSE) {
                 $extension->disable_for($group);
             } else {
                 $extension->enable_for($group);
             }
         }
     }
 }
 if ($create_new) {
     if ($is_public) {
         $_SESSION["confirmation"] = str_replace("%CATEGORY", $environment->get_name(), str_replace("%NAME", $values["name"], gettext("The public group '%NAME' has been created in '%CATEGORY'.")));
     } else {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:groups_edit.php

示例8: execute


//.........这里部分代码省略.........
                 $access = $values["access"];
                 $waspassword = 0;
                 $akt_access = $group->get_attribute(KOALA_GROUP_ACCESS);
                 if ($akt_access == PERMISSION_COURSE_PASSWORD) {
                     $waspassword = 1;
                 }
                 if (!$accessmergel) {
                     $group->set_access($access, $learners, $group->get_group_staff());
                 }
                 if (isset($values) && $waspassword == 1 && isset($values["password"]) && $values["password"] == "******" && $values["access"] == PERMISSION_COURSE_PASSWORD) {
                     // Do nothing in case of valid password dummy
                 } elseif ($values["access"] != PERMISSION_COURSE_PASSWORD) {
                     $learners->set_password("");
                 } else {
                     $learners->set_password(isset($values["password"]) ? trim($values["password"]) : "");
                 }
                 if ($max_members > -1) {
                     $learners->set_attribute(GROUP_MAXSIZE, $max_members);
                 }
             }
             // extensions:
             if (isset($_POST["extensions_available"]) && !empty($_POST["extensions_available"])) {
                 $extensions_available = explode("/", $_POST["extensions_available"]);
                 if (isset($_POST["extensions_enabled"])) {
                     $extensions_enabled = $_POST["extensions_enabled"];
                 } else {
                     $extensions_enabled = array();
                 }
                 if (isset($_POST["extensions_enabled_add"])) {
                     $extensions_enabled = array_merge($extensions_enabled, explode("/", $_POST["extensions_enabled_add"]));
                 }
                 if (is_array($extensions_available)) {
                     foreach ($extensions_available as $extension_name) {
                         $extension = \lms_steam::get_extensionmanager()->get_extension($extension_name);
                         if (!is_object($extension)) {
                             continue;
                         }
                         if (array_search($extension_name, $extensions_enabled) === FALSE) {
                             $extension->disable_for($group);
                         } else {
                             $extension->enable_for($group);
                         }
                     }
                 }
             }
             $cache = get_cache_function("ORGANIZATION");
             $cache->drop("lms_steam::semester_get_courses", $current_semester->get_id());
             $_SESSION["confirmation"] = gettext("The changes have been saved.");
             header("Location: " . $_SERVER["REQUEST_URI"]);
             exit;
         } else {
             //$portal->set_problem_description( $problems, $hints );
         }
     } elseif (isset($_POST["get_paul_course_data"])) {
         //at this time only the course name and short description are updated/changed
         $paul_client = new \paul_soap();
         $paul_course_id = h($group->get_attribute(OBJ_NAME));
         try {
             $paul_course_info = $paul_client->get_course_information($paul_course_id);
         } catch (Exception $exception) {
             $problem = $exception->getMessage();
             error_log($problem);
             throw new Exception("PAUL_SOAP exception: " . $problem);
         }
         //the same as in the following else-block
         $values = $group->get_attributes(array("OBJ_NAME", "OBJ_DESC", "COURSE_TUTORS", "COURSE_SHORT_DSC", "COURSE_LONG_DSC"));
开发者ID:rolwi,项目名称:koala,代码行数:67,代码来源:Edit.class.php

示例9: gettext

if (count($extensions) > 0) {
    $content->setCurrentBlock("BLOCK_EXTENSIONS");
    $content->setVariable("LABEL_EXTENSIONS", gettext("Extensions"));
    $extension_list = array();
    foreach ($extensions as $extension) {
        if ($extension->get_requirements() === array()) {
            $extension_name = $extension->get_name();
            $content->setCurrentBlock("BLOCK_EXTENSION");
            $content->setVariable("EXTENSION_ID", $extension_name);
            $content->setVariable("EXTENSION_NAME", $extension->get_display_name());
            $content->setVariable("EXTENSION_DESC", $extension->get_display_description());
            $extension_enabled = $extension->is_enabled($group);
            if ($extension_enabled) {
                $content->setVariable("EXTENSION_ENABLED", "checked='checked'");
            }
            $subextensions = lms_steam::get_extensionmanager()->get_dependent_extensions($extension);
            if (count($subextensions) > 0) {
                $content->setCurrentBlock("BLOCK_SUBEXTENSIONS");
                $content->setVariable("LABEL_SUBEXTENSIONS", str_replace("%EXTENSION", h($extension->get_display_name()), gettext("The following sub-extensions are available for %EXTENSION")));
                foreach ($subextensions as $subextension) {
                    $subextension_name = $subextension->get_name();
                    $content->setCurrentBlock("BLOCK_SUBEXTENSION");
                    $content->setVariable("PARENT_EXTENSION_ID", $extension_name);
                    $content->setVariable("SUBEXTENSION_ID", $subextension->get_name());
                    $content->setVariable("SUBEXTENSION_NAME", $subextension->get_display_name());
                    $content->setVariable("SUBEXTENSION_DESC", $subextension->get_display_description());
                    $checkbox_attributes = '';
                    if ($subextension->is_enabled_for($group)) {
                        $checkbox_attributes .= "checked='checked'";
                    }
                    if (!$extension_enabled || $subextension_name === "units_docpool") {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:courses_edit.php

示例10: get_extensions

 /**
  * Returns the extensions that are available for this koala_object. By
  * default, this function only retuns those extensions that haven't been
  * disabled for this object.
  * 
  * @param boolean $include_disabled FALSE: return only those extensions
  *   that are available for this object and have not been disabled. TRUE:
  *   return all extensions that are available for this object, including
  *   those that have been disabled for it.
  * @return array an array of the available extensions for this object
  */
 public function get_extensions($include_disabled = FALSE)
 {
     // TODO Code below triggers 24 !! Requests: Optimize this to cut down Server requests displaying courses
     //logging::log_requests("koala_object::get_extensions() 1");
     $extensions = array();
     $extension_manager = lms_steam::get_extensionmanager();
     foreach ($extension_manager->get_installed_extensions() as $extension) {
         if (!$extension->can_extend(get_class($this))) {
             continue;
         }
         //logging::log_requests("koala_object::get_extensions() 1,1");
         if (($include_disabled || $extension->is_enabled($this)) && $extension->is_enabled()) {
             //logging::log_requests("koala_object::get_extensions() 1,2");
             $extensions[] = $extension;
         }
     }
     //logging::log_requests("koala_object::get_extensions() 2");
     return $extensions;
 }
开发者ID:rolwi,项目名称:koala,代码行数:30,代码来源:koala_object.class.php


注:本文中的lms_steam::get_extensionmanager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。