本文整理汇总了PHP中get_cache_function函数的典型用法代码示例。如果您正苦于以下问题:PHP get_cache_function函数的具体用法?PHP get_cache_function怎么用?PHP get_cache_function使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_cache_function函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($parent_tmp, $steamObject_tmp, $xml)
{
$this->parent = $parent_tmp;
$this->steamObject = $steamObject_tmp;
$this->xml = $xml;
$this->cache = get_cache_function("unit_elearning", 3600);
}
示例2: get_headline
public function get_headline()
{
$cache = get_cache_function($this->koala_group->get_id());
$headline = array();
$group_url = PATH_URL . "groups/" . $this->koala_group->get_id() . "/";
if (($category = $this->koala_group->get_steam_object()->get_environment()) && $cache->call("lms_steam::group_is_public", $this->koala_group->get_id())) {
$headline[] = array("name" => h($category->get_name()), "link" => PATH_URL . "groups/?cat=" . $category->get_id());
$headline[] = array("name" => $this->koala_group->get_display_name(), "link" => $group_url);
} else {
$headline[] = array("name" => h($this->koala_group->get_name()));
}
if (is_string($context = $this->get_context())) {
switch ($context) {
case "documents":
//TODO: move this into documents extension somehow?
$headline[] = array("name" => gettext("Documents"), "link" => "");
break;
case "communication":
$headline[] = array("name" => gettext("Communication"), "link" => "");
break;
case "members":
$headline[] = array("name" => gettext("Members"), "link" => "");
break;
}
// try extensions:
foreach ($this->koala_group->get_extensions() as $extension) {
$tmp_headline = $extension->get_headline($headline, $this->get_context(), $this->get_context_params());
if (is_array($tmp_headline)) {
return $tmp_headline;
}
}
}
return $headline;
}
示例3: get_merged_items
/**
* function get_merged items:
* this function returns the rss_feed items from multiple url's sorted by
* Date/Time (latest first)
*
* @param array $urls array with the url's of the rss_feeds
*
* @return array the array with the rss-feed items sorted by Date/Time (latest first)
*/
public function get_merged_items($feeds = array())
{
if (!is_array($feeds)) {
return array();
}
$all_items = array();
foreach ($feeds as $feed) {
$cache = get_cache_function("rss", 600);
$items = $cache->call("lms_rss::get_items", $feed["link"]);
for ($j = 0; $j < count($items); $j++) {
$items[$j]["lms:type"] = $feed["type"];
$items[$j]["lms:source"] = $feed["name"];
$items[$j]["lms:rsslink"] = $feed["link"];
$items[$j]["lms:context_name"] = $feed["context_name"];
$items[$j]["lms:context_link"] = $feed["context_link"];
array_push($all_items, $items[$j]);
}
}
function compare($a, $b)
{
return strtotime($a["dc:date"]) < strtotime($b["dc:date"]) ? 1 : -1;
}
usort($all_items, "compare");
return $all_items;
}
示例4: remove_role
function remove_role()
{
$course_group_id = $this->get_context()->get_context_object();
$course_group = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $course_group_id);
$course_group_staff = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), $course_group->get_groupname() . ".staff");
$GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->removeUserFromGroup($this->get_userID(), $course_group_staff->get_id());
$cache = get_cache_function($course_group_staff->get_id());
$cache->drop("lms_steam::group_get_members", $course_group_staff->get_id());
}
示例5: __construct
function __construct($parent_tmp, $steamObject_tmp)
{
$this->parent = $parent_tmp;
$this->steamObject = $steamObject_tmp;
//get meta data
$this->cache = get_cache_function("unit_elearning", 3600);
$this->steam_object_path = $this->cache->call(array($this->steamObject, "get_path"));
$doc = $this->cache->call("steam_factory::get_object_by_name", $GLOBALS["STEAM"]->get_id(), $this->steam_object_path . "/chapter.xml");
$this->xml = simplexml_load_string($this->cache->call(array($doc, "get_content")));
}
示例6: __construct
function __construct($steam_object = FALSE)
{
self::$PATH = PATH_EXTENSIONS . "units_elearning/";
self::$DISPLAY_NAME = gettext("elearning course material");
self::$DISPLAY_DESCRIPTION = gettext("Here you can add elearning material");
parent::__construct(PATH_EXTENSIONS . "units_elearning.xml", $steam_object);
if (!defined("PATH_TEMPLATES_UNITS_ELEARNING")) {
define("PATH_TEMPLATES_UNITS_ELEARNING", PATH_EXTENSIONS . "units_elearning/templates/");
}
$this->cache = get_cache_function("unit_elearning", 3600);
}
示例7: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$path = $this->params;
$portal = \lms_portal::get_instance();
$user = \lms_steam::get_current_user();
if (!\lms_steam::is_steam_admin($user)) {
//TODO: REDIRECT!!
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$values = $_POST["values"];
$start_date = iso_to_unix($values["start"]);
$end_date = iso_to_unix($values["end"]);
// TODO PROBLEM CHECKING MISSING
$courses = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
$all_user = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
$new_semester = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), $values["name"], $courses, FALSE, $values["desc"]);
$new_semester_admins = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "admins", $new_semester, FALSE, "admin group for " . $values["desc"]);
$new_semester_admins->set_attribute("OBJ_TYPE", "semester_admins");
$new_semester_admins->add_member($user);
$new_semester->set_insert_access($new_semester_admins, TRUE);
$new_semester->set_read_access($all_user, TRUE);
$new_semester->set_attributes(array("SEMESTER_START_DATE" => $start_date, "SEMESTER_END_DATE" => $end_date));
// CACHE ZURÜCKSETZEN
$cache = get_cache_function("ORGANIZATION");
$cache->drop("lms_steam::get_semesters");
header("Location: " . PATH_URL . "semester/index/" . $values["name"] . "/all");
}
$content = \Semester::getInstance()->loadTemplate("semester_create.template.html");
$content->setVariable("INFO_TEXT", gettext("So, you want to start a new semester?") . " " . gettext("Please fill out the requested values on the right.") . "<br/><br/>" . str_replace("%SEMESTER", STEAM_CURRENT_SEMESTER, gettext("And don't forget to reset the current semester in the etc/koala.def.php, which is <b>%SEMESTER</b> at the moment.")));
$content->setVariable("LABEL_NAME", gettext("Shortname"));
$content->setVariable("INFO_NAME", gettext("IMPORTANT: Don't use any slashes, commas or dots in this name. Keep it short, like 'WS0607' or 'SS06'."));
$content->setVariable("LABEL_DESC", gettext("Name"));
$content->setVariable("INFO_DESC", gettext("Examples: 'Wintersemester 06/07', or 'Sommersemester 2006'"));
$content->setVariable("LABEL_START_DATE", gettext("Starting date of semester"));
$content->setVariable("LABEL_END_DATE", gettext("Ending date of semester"));
$content->setVariable("INFO_DATE_FORMAT", gettext("Please type in the date in the following format: YYYY-MM-DD"));
$content->setVariable("LABEL_CREATE", gettext("Create Semester"));
/* TODO: Portal anpassen
$portal->set_page_main(
array(array("link" => PATH_URL.SEMESTER_URL."/", "name" => gettext("Semester")), array("link" => "", "name" => gettext("Create new"))),
$content->get(),
""
);
*/
$rawHtml = new \Widgets\RawHtml();
$rawHtml->setHtml($content->get());
$frameResponseObject->addWidget($rawHtml);
return $frameResponseObject;
}
示例8: group_get_members
public function group_get_members($pGroup)
{
if (!$pGroup instanceof koala_group) {
throw new Exception("parameter is not an instance of koala_group", E_PARAM);
}
if (!$pGroup->is_admin(lms_steam::get_current_user())) {
throw new Exception("no admin rights.operation canceled.");
}
$cache = get_cache_function($pGroup->get_id(), CACHE_LIFETIME_STATIC);
switch (get_class($pGroup)) {
case "koala_group_course":
$group_name = $pGroup->get_course_id() . " - " . $pGroup;
$members = $cache->call("lms_steam::group_get_members", $pGroup->steam_group_learners->get_id());
break;
default:
$members = $cache->call("lms_steam::group_get_members", $pGroup->get_id());
break;
}
// INITIALIZATION
$course_id = $pLmsGroupCourse->get_course_id();
$course_name = $pLmsGroupCourse->get_course_dsc_short();
$semester = $pLmsGroupCourse->get_semester();
$excel = new Spreadsheet_Excel_Writer();
$excel->send($course_id . "_" . $semester->get_name());
$sheet =& $excel->addWorksheet(gettext("participants"));
// WRITE EXCEL SHEET
$sheet->writeString(0, 0, $course_id . " - " . $course_name());
$sheet->writeSting(1, 0, $semester->get_name());
$sheet->writeString(3, 0, gettext("student id"));
$sheet->writeString(3, 1, gettext("forename"));
$sheet->writeString(3, 2, gettext("surname"));
$no_members = count($members);
if ($no_members > 0) {
$row = 5;
for ($i = $start; $i < $end; $i++) {
$member = $members[$i];
$sheet->writeString($row, 1, $member["USER_FIRSTNAME"]);
$sheet->writeString($row, 2, $member["USER_FULLNAME"]);
$sheet->writeString($row, 3, $member["USER_EMAIL"]);
$sheet->writeString($row, 4, $member["USER_PROFILE_FACULTY"]);
$row++;
}
}
$excel->close();
}
示例9: clean_usericoncache
function clean_usericoncache($user)
{
if ($user instanceof steam_user) {
$user->delete_value("OBJ_ICON");
$icon = $user->get_attribute("OBJ_ICON");
clean_iconcache($icon);
// Clean Icon data from cache
require_once "Cache/Lite.php";
$cache = new Cache_Lite(array("cacheDir" => PATH_CACHE));
$cache->clean($user->get_name());
// Clean profile data from cache
$cache = get_cache_function($user->get_name(), 86400);
$cache->drop("lms_steam::user_get_profile", $user->get_name());
// TODO: In Menu "Your Desktop" some Icon data comes from lms_user
// stored in session => delete/refresh this value in session here
$portal = $GLOBALS["portal"];
$steam_user = $portal->get_user();
$steam_user->init_attributes();
}
}
示例10: viewer_authorized
function viewer_authorized($login, $user)
{
$cache = get_cache_function($user->get_name(), 3600);
$user_privacy = $cache->call("lms_steam::user_get_profile_privacy", $user->get_name());
isset($user_privacy["PRIVACY_GROUPS"]) ? $group_authorization = $user_privacy["PRIVACY_GROUPS"] : ($group_authorization = "");
$confirmed = $user->get_id() != $login->get_id() ? TRUE : FALSE;
$contacts = $cache->call("lms_steam::user_get_buddies", $user->get_name(), $confirmed);
$contact_ids = array();
foreach ($contacts as $contact) {
$contact_ids[] = $contact["OBJ_ID"];
}
$is_contact = in_array($login->get_id(), $contact_ids);
if (!($group_authorization & PROFILE_DENY_ALLUSERS)) {
return true;
}
if ($is_contact && !($group_authorization & PROFILE_DENY_CONTACTS)) {
return true;
}
return false;
}
示例11: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$portal = \lms_portal::get_instance();
$user = \lms_steam::get_current_user();
$frameResponseObject->setTitle(gettext("Your Desktop"));
// Cache for 7 Minutes
$cache = get_cache_function($user->get_name(), 420);
$feeds = $cache->call("koala_user::get_news_feeds_static", 0, 10, FALSE, $user);
$home = \Home::getInstance();
//$home->addJS();
$content = $home->loadTemplate("home.template.html");
$infobar = new \Widgets\InfoBar();
$infobar->setHeadline(gettext("Hallo") . " " . $portal->get_user()->get_forename() . " " . $portal->get_user()->get_surname() . "!");
$content->setVariable("INFOBAR", $infobar->getHtml());
$captionImage = new \Widgets\CaptionImage();
$captionImage->setLink(PATH_URL . "user/index/" . $user->get_name() . "/");
$captionImage->setLinkText(gettext("To your profile"));
$captionImage->setImageSrc(\lms_user::get_user_image_url(140, 185));
$captionImage->setImageAlt(gettext("Profile Image"));
$captionImage->setImageTitle(gettext("Complete your Profile"));
$content->setVariable("PROFILEIMAGE", $captionImage->getHtml());
$rawHtml = new \Widgets\RawHtml();
$rawHtml->addWidget($infobar);
$rawHtml->addWidget($captionImage);
$homeExtensions = \ExtensionMaster::getInstance()->getExtensionByType("IHomeExtension");
foreach ($homeExtensions as $homeExtension) {
$content->setCurrentBlock("HOME_EXTENSION");
$widget = $homeExtension->getWidget();
$rawHtml->addWidget($widget);
$content->setVariable("HOME_EXTENSION_CONTENT", $widget->getHtml());
$content->parse("HOME_EXTENSION");
}
$rawHtml->setHtml($content->get());
$frameResponseObject->addWidget($rawHtml);
return $frameResponseObject;
}
示例12: catch
lms_steam::delete($object);
} catch (Exception $ex3) {
logging::write_log(LOG_DEBUGLOG, "groups_delete:error deleting object from group workroom\t" . $login . " \t" . $group->get_display_name() . " \t" . $steam_group->get_id() . " \t" . $object->get_id());
}
}
}
if ($steam_group->delete()) {
$user->get_attributes(array(OBJ_NAME, USER_FIRSTNAME, USER_FULLNAME));
foreach ($members as $member) {
$cache = get_cache_function($member->get_name());
$cache->drop("lms_steam::user_get_groups", $member->get_name(), TRUE);
$cache->drop("lms_steam::user_get_groups", $member->get_name(), FALSE);
$cache->drop("lms_steam::user_get_profile", $member->get_name());
$cache->drop("lms_portal::get_menu_html", $member->get_name(), TRUE);
}
$cache = get_cache_function($steam_group->get_id());
$cache->drop("lms_steam::group_get_members", $steam_group->get_id());
foreach ($members as $member) {
lms_steam::mail($member, $user, PLATFORM_NAME . ": " . str_replace("%NAME", h($group_name), gettext("Group %NAME has been deleted.")), str_replace("%USER", $user->get_name() . " (" . $user->get_attribute(USER_FIRSTNAME) . " " . $user->get_attribute(USER_FULLNAME) . ")", str_replace("%NAME", h($group_name), gettext("The group '%NAME' has been deleted from he koaLA System by %USER."))) . "\n\n-- \n" . str_replace("%NAME", h($group_name), gettext("This system generated notification message was sent to you as a former member of the deleted group \"%NAME\"")));
}
$_SESSION["confirmation"] = str_replace("%NAME", h($group_name), gettext("The group '%NAME' has been deleted. A notification has been sent to former members."));
header("Location: " . $upper_link);
exit;
} else {
throw new Exception("Deletion of group failed");
}
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "group_delete.template.html");
$content->setVariable("FORM_ACTION", "");
$content->setVariable("LABEL_ARE_YOU_SURE", gettext("Are you sure?"));
示例13: execute
public function execute(\FrameResponseObject $frameResponseObject)
{
$user = \lms_steam::get_current_user();
$cache = get_cache_function($user->get_name(), 86400);
$user_profile = $cache->call("lms_steam::user_get_profile", $user->get_name());
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$values = $_POST["values"];
foreach ($values as $i => $val) {
$values[$i] = htmlspecialchars($val);
}
if (!empty($values["USER_PROFILE_WEBSITE_URI"]) && substr($values["USER_PROFILE_WEBSITE_URI"], 0, 7) != "http://") {
$values["USER_PROFILE_WEBSITE_URI"] = "http://" . $values["USER_PROFILE_WEBSITE_URI"];
}
$user->set_attributes($values);
if (!empty($values["USER_PROFILE_FACULTY"])) {
$old_fac_id = $user_profile["USER_PROFILE_FACULTY"];
$new_fac_id = $values["USER_PROFILE_FACULTY"];
if ($new_fac_id != $old_fac_id) {
if ($old_fac_id > 0) {
$old_faculty = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $old_fac_id, CLASS_GROUP);
$old_faculty->remove_member($user);
}
if ($new_fac_id > 0) {
$new_faculty = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $new_fac_id, CLASS_GROUP);
$new_faculty->add_member($user);
}
}
}
/*
require_once( "Cache/Lite.php" );
$cache = new Cache_Lite( array( "cacheDir" => PATH_CACHE ) );
$cache->clean( $user->get_name() );
$cache->clean( $user->get_id() );*/
if (!empty($values["USER_LANGUAGE"])) {
//var_dump($values["USER_LANGUAGE"]);die;
$lang_index = \language_support::get_language_index();
\language_support::choose_language($lang_index[$values["USER_LANGUAGE"]]);
}
$cache = get_cache_function(\lms_steam::get_current_user()->get_name());
$cache->drop("lms_portal::get_menu_html", \lms_steam::get_current_user()->get_name(), TRUE);
$cache = get_cache_function($user->get_name());
$cache->drop("lms_steam::user_get_profile", $user->get_name());
$_SESSION["confirmation"] = gettext("Your profile data has been saved.");
header("Location: " . PATH_URL . "profile/edit");
}
$content = \Profile::getInstance()->loadTemplate("profile_edit.template.html");
//$content = new \HTML_TEMPLATE_IT();
//$content->loadTemplateFile( PATH_TEMPLATES . "profile_edit.template.html" );
if (PLATFORM_ID == "bid") {
$content->setVariable("LABEL_INFO", "Hier können Sie Ihre persönlichen Kontaktdaten einrichten. Bis auf Ihren Namen sind alle Angaben freiwillig und können von Ihnen geändert werden. Klicken Sie auf den Button <b><i>Profil-Privatsphäre</i></b> um festzulegen, wem welche Informationen angezeigt werden sollen.");
} else {
$content->setVariable("LABEL_INFO", gettext("Please complete your profile. None of the fields are mandatory. Some of the fields can not be changed due to central identity management at the IMT.<br/><b>Note: With the button <i>Profile Privacy</i> you can control which information can be seen by other users.</b>"));
}
if (ENABLED_PROFILE_TITLE) {
$content->setVariable("LABEL_PROFILE", gettext("General Information"));
}
$content->setVariable("LABEL_LOOKING", gettext("Your buddy icon"));
$content->setVariable("LABEL_MAIL_PREFS", gettext("Your mail preferences"));
$content->setVariable("LABEL_PROFILE_PRIVACY", gettext("Profile Privacy"));
$content->setVariable("LINK_BUDDY_ICON", PATH_URL . "profile/image");
$content->setVariable("LINK_MAIL_PREFS", PATH_URL . "messages_prefs.php");
$content->setVariable("LINK_PROFILE_PRIVACY", PATH_URL . "profile/privacy");
if (ENABLED_FIRST_NAME) {
$content->setVariable("LABEL_FIRST_NAME", gettext("First name"));
}
if (ENABLED_FULL_NAME) {
$content->setVariable("LABEL_LAST_NAME", gettext("Last name"));
}
if (ENABLED_DEGREE) {
$content->setVariable("LABEL_TITLE", gettext("Academic title"));
$content->setVariable("LABEL_DEGREE", gettext("Academic degree"));
$content->setVariable("LABEL_IF_AVAILABLE", gettext("only if available"));
$academicTitle = (string) $user_profile["USER_ACADEMIC_TITLE"];
switch ($academicTitle) {
case "Dr.":
$content->setVariable("TITLE_DR_SELECTED", 'selected="selected"');
break;
case "PD Dr.":
$content->setVariable("TITLE_PRIVDOZDR_SELECTED", 'selected="selected"');
break;
case "Prof.":
$content->setVariable("TITLE_PROF_SELECTED", 'selected="selected"');
break;
case "Prof. Dr.":
$content->setVariable("TITLE_PROFDR_SELECTED", 'selected="selected"');
break;
default:
$content->setVariable("TITLE_NULL_SELECTED", 'selected="selected"');
break;
}
$content->setVariable("VALUE_ACADEMIC_DEGREE", $this->safe_string($user_profile["USER_ACADEMIC_DEGREE"]));
}
if (ENABLED_BID_DESCIPTION) {
$content->setVariable("LABEL_STATUS_BID", gettext("Description"));
}
if (ENABLED_STATUS) {
$content->setVariable("LABEL_STATUS", gettext("Status"));
}
if (ENABLED_GENDER) {
$content->setVariable("LABEL_GENDER", gettext("Gender"));
//.........这里部分代码省略.........
示例14: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$forum_id = $this->params[0];
$portal = \lms_portal::get_instance();
$user = \lms_steam::get_current_user();
$rss_feeds = $user->get_attribute("USER_RSS_FEEDS");
$author_id = isset($this->params[1]) ? $this->params[1] : null;
if (!($messageboard = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $forum_id))) {
include "bad_link.php";
exit;
}
if ($messageboard instanceof \steam_document) {
$thread = $messageboard;
$messageboard = $thread->get_annotating();
define("OBJ_ID", $thread->get_id());
if (!$thread->check_access_read($user)) {
throw new \Exception("No rights to view this.", E_USER_RIGHTS);
}
} else {
define("OBJ_ID", $messageboard->get_id());
if (!$messageboard->check_access_read($user)) {
throw new \Exception("No rights to view this.", E_USER_RIGHTS);
}
}
if (!$messageboard instanceof \steam_messageboard) {
include "bad_link.php";
exit;
}
$is_watching = FALSE;
if (is_array($rss_feeds)) {
foreach (array_keys($rss_feeds) as $item) {
if ($item == $messageboard->get_id()) {
$is_watching = TRUE;
}
}
}
$content = \Messageboard::getInstance()->loadTemplate("forum_all_topics.template.html");
$dsc = $messageboard->get_attribute("OBJ_DESC");
if (!empty($dsc)) {
$content->setCurrentBlock("BLOCK_DESCRIPTION");
$content->setVariable("FORUM_DESCRIPTION", get_formatted_output($dsc));
$content->parse("BLOCK_DESCRIPTION");
}
$grp = $messageboard->get_environment()->get_creator();
if ($grp->get_name() == "learners" && $grp->get_attribute(OBJ_TYPE) == "course_learners") {
$grp = $grp->get_parent_group();
}
$content->setVariable("CURRENT_DISCUSSIONS_LABEL", gettext("Current Thread"));
$content->setVariable("LABEL_SEARCH", gettext("Search"));
if (isset($_GET["action"]) && $_GET["action"] == "bookmark_rss") {
\lms_steam::user_add_rssfeed($messageboard->get_id(), PATH_URL . "services/feeds/forum_public.php?id=" . $messageboard->get_id(), "discussion board", \lms_steam::get_link_to_root($messageboard));
$_SESSION["confirmation"] = str_replace("%NAME", h($messageboard->get_name()), gettext("You are keeping an eye on '%NAME' from now on."));
header("Location: " . PATH_URL . "forums/" . $messageboard->get_id() . "/");
exit;
}
if (isset($_GET["action"]) && $_GET["action"] == "delete_bookmark") {
$user = \lms_steam::get_current_user();
$id = (int) $_GET["unsubscribe"];
$feeds = $user->get_attribute("USER_RSS_FEEDS");
if (!is_array($feeds)) {
$feeds = array();
}
unset($feeds[$id]);
$user->set_attribute("USER_RSS_FEEDS", $feeds);
$_SESSION["confirmation"] = str_replace("%NAME", h($messageboard->get_name()), gettext("subscription of '%NAME' canceled."));
header("Location: " . PATH_URL . "forums/" . $messageboard->get_id() . "/");
exit;
}
if (empty($_GET["pattern"]) && !isset($author_id)) {
$cache = get_cache_function(OBJ_ID, 300);
$discussions = $cache->call("lms_forum::get_discussions", OBJ_ID);
} elseif (isset($author_id)) {
$cache = get_cache_function(\lms_steam::get_current_user()->get_name(), 300);
$discussions = $cache->call("lms_forum::search_user_posts", $messageboard->get_id(), $author_id);
} else {
$cache = get_cache_function(\lms_steam::get_current_user()->get_name(), 300);
$discussions = $cache->call("lms_forum::search_pattern", $messageboard->get_id(), $_GET["pattern"]);
}
$content->setVariable("LABEL_ALL_TOPICS", gettext("All Threads"));
if ($messageboard->check_access_annotate(\lms_steam::get_current_user())) {
$content->setCurrentBlock("BLOCK_WRITE_ACCESS");
if (isset($author_id)) {
$content->setVariable("LABEL_THREADS_POSTED_IN", gettext("All Threads"));
// TODO: Passt der link?
$content->setVariable("LINK_AUTHOR", PATH_URL . "forums/" . $messageboard->get_id() . "/");
} else {
$content->setVariable("LABEL_THREADS_POSTED_IN", gettext("Threads you've posted in"));
// TODO: Passt der link?
$content->setVariable("LINK_AUTHOR", PATH_URL . "forums/" . $messageboard->get_id() . "/?author=" . \lms_steam::get_current_user()->get_name());
}
// TODO: Passt der link?
$content->setVariable("LINK_POST_NEW", PATH_URL . "messageboard/newDiscussion/" . $messageboard->get_id());
$content->setVariable("LABEL_POST_NEW_THREAD", gettext("Post a new thread"));
$content->parse("BLOCK_WRITE_ACCESS");
}
if ($messageboard->check_access_write(\lms_steam::get_current_user())) {
$content->setCurrentBlock("BLOCK_ADMIN");
$content->setVariable("LINK_EDIT", PATH_URL . "messageboard/editMessageboard/" . $messageboard->get_id());
$content->setVariable("LABEL_EDIT", gettext("Preferences"));
$content->setVariable("LINK_DELETE", PATH_URL . "messageboard/deleteMessageboard/" . $messageboard->get_id());
//.........这里部分代码省略.........
示例15: Cache_Lite
$wid = $object->get_id();
// Clean Cache for the deleted wiki
require_once "Cache/Lite.php";
$cache = new Cache_Lite(array("cacheDir" => PATH_CACHE));
$cache = get_cache_function($wid, 600);
$cache->drop("lms_steam::get_items", $wid);
// Handle Related Cache-Data
require_once "Cache/Lite.php";
$cache = new Cache_Lite(array("cacheDir" => PATH_CACHE));
$cache->clean($wid);
// clean wiki cache (not used by wiki)
$fcache = get_cache_function($object->get_id(), 600);
$fcache->drop("lms_wiki::get_items", $object->get_id());
// Clean communication summary cache für the group/course
if (is_object($workroom)) {
$cache = get_cache_function(lms_steam::get_current_user()->get_name(), 600);
$cache->drop("lms_steam::get_inventory_recursive", $workroom->get_id(), CLASS_CONTAINER | CLASS_ROOM, array("OBJ_TYPE", "WIKI_LANGUAGE"));
$cache->drop("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM);
}
header("Location: " . $values["return_to"]);
exit;
}
}
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "object_delete.template.html");
if ($object->check_access_write($user)) {
$content->setVariable("LABEL_ARE_YOU_SURE", str_replace("%NAME", h($object->get_name()), gettext("Are you sure you want to delete the wiki '%NAME' ?")));
$rootlink = lms_steam::get_link_to_root($object);
$content->setVariable("DELETE_BACK_LINK", $rootlink[1]["link"] . "communication/");
$content->setCurrentBlock("BLOCK_DELETE");
$content->setVariable("FORM_ACTION", $_SERVER["REQUEST_URI"]);