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


PHP steam_factory::load_attributes方法代码示例

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


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

示例1: group_get_subgroups

 public function group_get_subgroups($group_id)
 {
     if (!($group = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $group_id))) {
         throw new Exception("No valid object id ({$group_id}).", E_PARAMETER);
     }
     if (!$group instanceof steam_group) {
         throw new Exception("Object is not a group ({$group_id}).", E_PAREMETER);
     }
     $subgroups = $group->get_subgroups();
     $result = array();
     $i = 0;
     $attributes = array(OBJ_NAME, OBJ_DESC, OBJ_CREATION_TIME);
     steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $subgroups, $attributes);
     foreach ($subgroups as $subgroup) {
         $result[$i]["OBJ_ID"] = $subgroup->get_id();
         $result[$i]["OBJ_NAME"] = $subgroup->get_name();
         $result[$i]["OBJ_DESC"] = $subgroup->get_attribute("OBJ_DESC");
         $result[$i]["NO_MEMBERS"] = $subgroup->count_members();
         $result[$i]["OBJ_CREATION_TIME"] = $subgroup->get_attribute("OBJ_CREATION_TIME");
         $subsub = $subgroup->get_subgroups();
         $result[$i]["NO_SUBGROUPS"] = count($subsub);
         $i++;
     }
     return $result;
 }
开发者ID:rolwi,项目名称:koala,代码行数:25,代码来源:lms_steam.class.php

示例2: array

$result = $steam->buffer_flush();
$creators = array();
$linktargets = array();
$accessresult = array();
$sizeresult = array();
foreach ($inventory as $item) {
    $creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]];
    $accessresult[$item->get_id()] = $result[$tnr[$item->get_id()]["writeaccess"]];
    if ($item instanceof steam_document) {
        $sizeresult[$item->get_id()] = $result[$tnr[$item->get_id()]["contentsize"]];
    }
    if ($item instanceof steam_link) {
        $linktargets[$item->get_id()] = $result[$tnr[$item->get_id()]["link_object"]];
    }
}
steam_factory::load_attributes($steam, $creators, array(OBJ_NAME));
// If you want to use further Methods of caching e.g. PHP PEARs Cache_Lite
// insert caching mechanisms in here...
// below this, the steam connector is no longer used...
$tags = array();
foreach ($inventory as $item) {
    if (!$item instanceof steam_trashbin) {
        $itemname = $item->get_attribute(OBJ_NAME);
        $itemdescription = $item->get_attribute(OBJ_DESC);
        $itemmimetype = $item->get_attribute(DOC_MIME_TYPE);
        $lastchanged = $item->get_attribute(DOC_LAST_MODIFIED);
        if ($lastchanged === 0) {
            $lastchanged = $item->get_attribute(OBJ_CREATION_TIME);
        }
        // set display name
        if ($itemdescription != "") {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:taggedFolder.php

示例3: foreach

foreach ($inventory as $item) {
    $tnr[$item->get_id()] = array();
    $tnr[$item->get_id()]["creator"] = $item->get_creator(1);
    $tnr[$item->get_id()]["item_write_access"] = $item->check_access_write($steam->get_login_user(), 1);
    $tnr[$item->get_id()]["item_read_access"] = $item->check_access_read($steam->get_login_user(), 1);
}
$result = $steam->buffer_flush();
$creators = array();
$item_write_access = array();
$item_read_access = array();
foreach ($inventory as $item) {
    $creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]];
    $item_write_access[$item->get_id()] = $result[$tnr[$item->get_id()]["item_write_access"]];
    $item_read_access[$item->get_id()] = $result[$tnr[$item->get_id()]["item_read_access"]];
}
steam_factory::load_attributes($steam, $inventory, array(OBJ_NAME, OBJ_DESC, OBJ_KEYWORDS, DOC_MIME_TYPE, "bid:description"));
// If you want to use further Methods of caching e.g. PHP PEARs Cache_Lite
// insert caching mechanisms in here...
// below this, the steam connector is no longer used...
$undisplayed_pic_count = 0;
for ($i = 0; $i < count($inventory); $i += 1) {
    $item = $inventory[$i];
    // Skip image if rights are insufficient
    if (!$item_read_access[$item->get_id()]) {
        $undisplayed_pic_count++;
        continue;
    }
    $itemname = $item->get_attribute(OBJ_NAME);
    $itemdescription = $item->get_attribute(OBJ_DESC);
    $itemkeywords = implode(", ", $item->get_attribute(OBJ_KEYWORDS));
    $itemmimetype = $item->get_attribute(DOC_MIME_TYPE);
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:gallery.php

示例4: header

$user = lms_steam::get_current_user();
$admin_group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "admin");
if (!is_object($admin_group) || !$admin_group->is_member($user)) {
    header("location:/");
    exit;
}
$portal_user = $portal->get_user();
$path = url_parse_rewrite_path(isset($_GET["path"]) ? $_GET["path"] : "");
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "admin_paul.template.html");
$paulsync_folder = steam_factory::path_to_object($GLOBALS["STEAM"]->get_id(), "/home/root/documents/paulsync");
if (!is_object($paulsync_folder)) {
    throw new Exception("Paul sync log folder /home/root/documents/paulsync not found", E_CONFIGURATION);
    exit;
}
steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), array($paulsync_folder), array("PAUL_SYNC_STARTTIME", "PAUL_SYNC_ENDTIME", "PAUL_SYNC_RUNNING"));
$content->setCurrentBlock("BLOCK_BLOCK");
$content->setVariable("LABEL_BLOCK", "PAUL synchronisation");
$content->setCurrentBlock("ENTRY");
$content->setVariable("LABEL", "Sync Status");
$content->setVariable("VALUE", $paulsync_folder->get_attribute("PAUL_SYNC_RUNNING") === "TRUE" ? gettext("Running") : gettext("Not running"));
$content->parse("ENTRY");
$content->setCurrentBlock("ENTRY");
$content->setVariable("LABEL", "Last sync start time");
$content->setVariable("VALUE", date("d.m.y, H:i:s", $paulsync_folder->get_attribute("PAUL_SYNC_STARTTIME")));
$content->parse("ENTRY");
$content->setCurrentBlock("ENTRY");
$content->setVariable("LABEL", "Last sync end time");
$content->setVariable("VALUE", date("d.m.y, H:i:s", $paulsync_folder->get_attribute("PAUL_SYNC_ENDTIME")));
$content->parse("ENTRY");
/*
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:admin_paul.php

示例5: Exception

                 $parent = $group->get_steam_group()->get_parent_group();
                 if (is_object($parent)) {
                     $pgroup_id = $parent->get_id();
                 } else {
                     $pgroup_id = -1;
                 }
                 // no koala group. its a steam only group
             }
             if ($pgroup_id != -1) {
                 $parentgroup = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $pgroup_id);
                 if (!is_object($parentgroup) || !$parentgroup instanceof steam_group) {
                     throw new Exception("Configuration Error: Invalid Public or Private Group Setting. False Group id=" . $pgroup_id, E_CONFIGURATION);
                     exit;
                 }
                 $siblings = $parentgroup->get_subgroups();
                 steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $siblings, array(OBJ_NAME));
                 foreach ($siblings as $sibling) {
                     if (strtolower($sibling->get_name()) == strtolower($values["name"])) {
                         if ($create_new || $sibling->get_id() != $group->get_steam_group()->get_id()) {
                             $problems .= gettext("The groupname you've choosen is used for another group already.") . " ";
                             $hints .= gettext("Please choose another groupname.") . " ";
                             break;
                         }
                     }
                 }
             }
         }
     }
 }
 if (empty($values["short_dsc"])) {
     $problems .= gettext("The short description is missing.") . " ";
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:groups_edit.php

示例6: getHtmlForObjectId


//.........这里部分代码省略.........
     $pagemin = max($pagemin, 0);
     //Navigation
     $backlink = "<a href=\"" . PATH_URL . "gallery/index/" . $objectId . "/" . $pagemin . "\" class=\"pagingleft\"><img alt=\"Zurück\" title=\"Zurück\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_prev_on.gif\"></a>";
     if ($from == 0) {
         $backlink = "<a href=\"\" class=\"pagingleft\"><img alt=\"Zurück\" title=\"Zur&uuml;ck\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_prev_off.gif\"></a>";
         $tpl->setVariable("BACKLINK", $backlink);
     } else {
         $tpl->setVariable("BACKLINK", $backlink);
     }
     $pagemax = min($to, $picCount - 1);
     $forwardlink = "<a href=\"" . PATH_URL . "gallery/index/" . $objectId . "/" . ($pagemax + 1) . "\" class=\"pagingleft\"><img alt=\"Zurück\" title=\"Zurück\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_next_on.gif\"></a>";
     if ($to >= $picCount - 1) {
         $forwardlink = "<a href=\"\" class=\"pagingright\"><img alt=\"Vor\" title=\"Vor\" src=\"" . \Gallery::getInstance()->getAssetUrl() . "/icons/top_seq_next_off.gif\">";
         $tpl->setVariable("FORWARDLINK", $forwardlink);
     } else {
         $tpl->setVariable("FORWARDLINK", $forwardlink);
     }
     //Rights
     foreach ($inventory as $item) {
         $tnr[$item->get_id()] = array();
         $tnr[$item->get_id()]["creator"] = $item->get_creator(1);
         $tnr[$item->get_id()]["item_write_access"] = $item->check_access_write($GLOBALS["STEAM"]->get_current_steam_user(), 1);
         $tnr[$item->get_id()]["item_read_access"] = $item->check_access_read($GLOBALS["STEAM"]->get_current_steam_user(), 1);
     }
     $result = $GLOBALS["STEAM"]->buffer_flush();
     $creators = array();
     $itemWriteAccess = array();
     $itemReadAccess = array();
     foreach ($inventory as $item) {
         $creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]];
         $itemWriteAccess[$item->get_id()] = $result[$tnr[$item->get_id()]["item_write_access"]];
         $itemReadAccess[$item->get_id()] = $result[$tnr[$item->get_id()]["item_read_access"]];
     }
     \steam_factory::load_attributes($steam, $inventory, array(OBJ_NAME, OBJ_DESC, OBJ_KEYWORDS, DOC_MIME_TYPE, "bid:description"));
     // If you want to use further Methods of caching e.g. PHP PEARs Cache_Lite
     // insert caching mechanisms in here...
     // below this, the steam connector is no longer used...
     $undisplayedPicCount = 0;
     //GET RIGHTS
     $sanction = $currentRoom->get_sanction();
     $attrib = $this->object->get_attributes(array(OBJ_NAME, OBJ_DESC, "bid:doctype"));
     $bid_doctype = isset($attrib["bid:doctype"]) ? $attrib["bid:doctype"] : "";
     $docTypeQuestionary = strcmp($attrib["bid:doctype"], "questionary") == 0;
     $docTypeMessageBoard = $this->object instanceof \steam_messageboard;
     // in questionaries the write right is limited to insert rights only
     if ($docTypeQuestionary) {
         $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_INSERT;
     } else {
         if ($docTypeMessageBoard) {
             $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_ANNOTATE;
         } else {
             $SANCTION_WRITE_FOR_CURRENT_OBJECT = SANCTION_WRITE | SANCTION_EXECUTE | SANCTION_MOVE | SANCTION_INSERT | SANCTION_ANNOTATE;
         }
     }
     $sanctionFlag = false;
     if (isset($sanction[$steamUserId])) {
         if ($sanction[$steamUserId] >= $SANCTION_WRITE_FOR_CURRENT_OBJECT) {
             $sanctionFlag = true;
         }
     }
     $env = $currentRoom->get_environment();
     if ($env instanceof \steam_room) {
         $envSanction = $env->get_sanction();
         if (isset($envSanction[$steamUserId])) {
             if ($envSanction[$steamUserId] >= $SANCTION_WRITE_FOR_CURRENT_OBJECT) {
                 $sanctionFlag = true;
开发者ID:rolwi,项目名称:koala,代码行数:67,代码来源:Index.class.php

示例7: execute

 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //		$portal = \lms_portal::get_instance();
     //	$portal->initialize( GUEST_NOT_ALLOWED );
     $user = \lms_steam::get_current_user();
     //	$path = $request->getPath();
     $STEAM = $GLOBALS["STEAM"];
     $weblogId = $this->params[0];
     if (!defined("OBJ_ID")) {
         define("OBJ_ID", $weblogId);
     }
     $weblog = \steam_factory::get_object($STEAM->get_id(), $weblogId);
     //if ( ! $weblog = steam_factory::get_object( $STEAM->get_id(), $_GET[ "id" ] ) )
     //{
     //	include( "bad_link.php" );
     //	exit;
     //}
     if (!$weblog instanceof \steam_calendar) {
         if ($weblog instanceof \steam_container) {
             $category = $weblog;
             $categories = $category->get_environment();
             $weblog = new \steam_weblog($GLOBALS["STEAM"]->get_id(), $categories->get_environment()->get_id());
         } elseif ($weblog instanceof \steam_date) {
             $date = $weblog;
             $weblog = new \steam_weblog($GLOBALS["STEAM"]->get_id(), $date->get_environment()->get_id());
         } else {
             header("location: /404/");
             exit;
         }
     } else {
         $weblog = new \steam_weblog($GLOBALS["STEAM"]->get_id(), $weblogId);
         //define( "OBJ_ID",	$weblogId );
         if (!$weblog->check_access_read($user)) {
             throw new \Exception("No rights to view this.", E_USER_RIGHTS);
         }
     }
     $weblog_html_handler = new \lms_weblog($weblog);
     //var_dump($weblog_html_handler);die;
     $weblog_html_handler->set_menu("entries");
     $grp = $weblog->get_environment()->get_creator();
     \steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), array($grp), array(OBJ_NAME, OBJ_TYPE));
     if ($grp->get_name() == "learners" && $grp->get_attribute(OBJ_TYPE) == "course_learners") {
         $grp = $grp->get_parent_group();
     }
     $weblog_html_handler->set_widget_categories();
     $all_date_objects = $weblog->get_date_objects();
     usort($all_date_objects, "sort_dates");
     //sort_dates defined in steam_calendar.class
     $weblog_html_handler->set_widget_archive(5);
     $weblog_html_handler->set_widget_blogroll();
     $weblog_html_handler->set_widget_access($grp);
     if (isset($_GET["action"]) && $_GET["action"] == "bookmark_rss") {
         \lms_steam::user_add_rssfeed($weblog->get_id(), PATH_URL . "services/feeds/weblog_public.php?id=" . $weblog->get_id(), "weblog", lms_steam::get_link_to_root($weblog));
         $_SESSION["confirmation"] = str_replace("%NAME", h($weblog->get_name()), gettext("You are keeping an eye on '%NAME' from now on."));
         header("Location: " . PATH_URL . "weblog/index/" . $weblog->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($weblog->get_name()), gettext("subscription of '%NAME' canceled."));
         header("Location: " . PATH_URL . "weblog/index/" . $weblog->get_id() . "/");
         exit;
     }
     //TODO what is the reason for this structure?
     switch (TRUE) {
         case isset($date) && $date:
             $weblog_html_handler->print_entries(array($date), FALSE);
             break;
         default:
             $weblog_html_handler->print_entries($all_date_objects);
             break;
     }
     $weblog_html_handler->set_podcast_link();
     //$portal->set_rss_feed( PATH_URL . "services/feeds/weblog_public.php?id=" . OBJ_ID , gettext( "Feed" ), str_replace( "%l", isset($login)?$login:'', gettext( "Subscribe to this forum's Newsfeed" ) ) );
     $rootlink = \lms_steam::get_link_to_root($weblog);
     //var_dump($rootlink);die;
     //var_dump($rootlink);die;
     $headline = array($rootlink[0], $rootlink[1], array("link" => $rootlink[1]["link"] . "communication/", "name" => gettext("Communication")), array("link" => "", "name" => h($weblog->get_name())));
     //$portal->set_page_main(
     //$headline,
     //$weblog_html_handler->get_html()
     //);
     //var_dump($portal);die;
     //return $portal->get_html();
     $frameResponseObject->setHeadline($headline);
     $widget = new \Widgets\RawHtml();
     $widget->setHtml($weblog_html_handler->get_html());
     $frameResponseObject->addWidget($widget);
     return $frameResponseObject;
 }
开发者ID:rolwi,项目名称:koala,代码行数:97,代码来源:Index.class.php

示例8: getHtmlForUrl

 public function getHtmlForUrl(UrlRequestObject $urlRequestObject)
 {
     $steam = $GLOBALS["STEAM"];
     //current room steam object
     if (isset($object) && (int) $object != 0) {
         $current_room = steam_factory::get_object($steam->get_id(), $object);
     } else {
         $current_room = $steam->get_current_steam_user()->get_workroom();
     }
     //current room steam object
     //$current_room = ($object != 0)?new steam_object($object):$steam->get_workroom_user($steam->login_user);
     $current_room_path = $current_room->get_path(1);
     $current_room_data = $current_room->get_attributes(array(OBJ_NAME, OBJ_DESC, OBJ_LAST_CHANGED, "bid:tags", "bid:presentation", "bid:collectiontype", "bid:description"), 1);
     $current_room_creator = $current_room->get_creator(1);
     //check if user may write in this folder
     $write_allowed = $current_room->check_access_write($steam->get_current_steam_user(), 1);
     //get inventory and inventorys attributes if allowed to
     $allowed = $current_room->check_access_read($steam->get_current_steam_user(), 1);
     $result = $steam->buffer_flush();
     $write_allowed = $result[$write_allowed];
     $allowed = $result[$allowed];
     $current_room_path = $result[$current_room_path];
     $current_room_data = $result[$current_room_data];
     $current_room_creator = $result[$current_room_creator];
     $current_room_creator_name = $current_room_creator->get_name();
     $current_room_display_name = str_replace("'s workarea", "", stripslashes($current_room_data[OBJ_NAME]));
     if (isset($current_room_data[OBJ_DESC]) && $current_room_data[OBJ_DESC] != "") {
         $current_room_display_name = $current_room_data[OBJ_DESC];
     }
     $current_room_display_name = str_replace("s workroom.", "", $current_room_display_name);
     $current_room_display_name = str_replace("s workroom", "", $current_room_display_name);
     $current_room_display_name = preg_replace("/.*'s bookmarks/", "Lesezeichen", $current_room_display_name);
     if ($allowed && $current_room instanceof steam_container) {
         $inventory = $current_room->get_inventory("", array("DOC_MIME_TYPE", "DOC_LAST_MODIFIED", "CONT_LAST_MODIFIED", "OBJ_LAST_CHANGED", "bid:tags", "bid:presentation", "bid:collectiontype", "bid:hidden", "bid:doctype", "bid:description", "DOC_EXTERN_URL", "OBJ_CREATION_TIME"));
     } else {
         $inventory = array();
     }
     if (sizeof($inventory) > 0) {
         $hascontent = true;
     } else {
         $hascontent = false;
     }
     //get head mounted content if needed
     $head_mounted = $current_room_data["bid:presentation"] === "head" && is_array($inventory) && isset($inventory[0]) && $inventory[0] instanceof steam_document;
     if ($head_mounted) {
         $tmp_content = new doc_content($steam, $inventory[0]);
         $head_mounted_content = $tmp_content->get_content($config_webserver_ip);
     }
     //******************************************************
     //** Display Stuff
     //******************************************************
     //template stuff
     $contenttemplate = new HTML_TEMPLATE_IT();
     $contenttemplate->loadTemplateFile($this->getExtensionPath() . "ui/taggedfolder.template.html");
     $contenttemplate->setVariable("FOLDER_ID", $current_room->get_id());
     $contenttemplate->setVariable("FOLDER_NAME", $current_room_display_name);
     //$contenttemplate->setVariable("FOLDER_PATH", PATH_URL . $current_room_path . "/");
     //$contenttemplate->setVariable("FOLDER_ICON", (($current_room_data["bid:presentation"] === "index")?"$config_webserver_ip/icons/mimetype/folder_closed_index.gif":"$config_webserver_ip/icons/mimetype/folder_closed.gif"));
     $contenttemplate->setVariable("FOLDER_LAST_CHANGED", date("d.m.Y H:i", $current_room_data[OBJ_LAST_CHANGED]));
     if (sizeof($inventory) == 0) {
         $contenttemplate->setCurrentBlock("no_content");
         $contenttemplate->setVariable("LANGUAGE_NO_CONTENT", gettext("LANGUAGE_NO_CONTENT"));
         $contenttemplate->parse("no_content");
     }
     return $contenttemplate->get();
     //set menu to write mode, if the user's access rights allow so and the user is not the guest user
     if ($write_allowed && $steam->get_login_user()->get_name() != "guest") {
         //$tpl->set_var("MENU",derive_menu("contentframe", $current_room, $current_room_path, 2));
     }
     //display directory
     //$content = false;
     $tnr = array();
     foreach ($inventory as $item) {
         $tnr[$item->get_id()] = array();
         $tnr[$item->get_id()]["creator"] = $item->get_creator(1);
         $tnr[$item->get_id()]["writeaccess"] = $item->check_access_write($steam->get_login_user(), 1);
         if ($item instanceof steam_document) {
             $tnr[$item->get_id()]["contentsize"] = $item->get_content_size(1);
         }
         if ($item instanceof steam_link) {
             $tnr[$item->get_id()]["link_object"] = $item->get_link_object(1);
         }
     }
     $result = $steam->buffer_flush();
     $creators = array();
     $linktargets = array();
     $accessresult = array();
     $sizeresult = array();
     foreach ($inventory as $item) {
         $creators[$item->get_id()] = $result[$tnr[$item->get_id()]["creator"]];
         $accessresult[$item->get_id()] = $result[$tnr[$item->get_id()]["writeaccess"]];
         if ($item instanceof steam_document) {
             $sizeresult[$item->get_id()] = $result[$tnr[$item->get_id()]["contentsize"]];
         }
         if ($item instanceof steam_link) {
             $linktargets[$item->get_id()] = $result[$tnr[$item->get_id()]["link_object"]];
         }
     }
     steam_factory::load_attributes($steam, $creators, array(OBJ_NAME));
     // If you want to use further Methods of caching e.g. PHP PEARs Cache_Lite
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:TaggedFolder.extension.php

示例9: array

 for ($i = $start; $i < $end; $i++) {
     $mailto = $data_result[$data_tnr[$i]["ATTRIBUTES"]]["mailto"];
     // ensure that mailto is an array always
     if (!is_array($mailto)) {
         $mailto = array($mailto);
     }
     // store array for further use
     $mailtos[$i] = $mailto;
     foreach ($mailto as $receiver) {
         if (is_object($receiver)) {
             $receiver_mapping[$i . "-" . $receiver->get_id()] = $receiver;
         }
     }
 }
 // get needed attributes of the receivers at once
 steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), array_values($receiver_mapping), array(OBJ_NAME, OBJ_ICON, OBJ_TYPE));
 // Optimize server calls if receiver is a course
 $coursecount = 0;
 $course_tnr = array();
 for ($i = $start; $i < $end; $i++) {
     $mailto = $mailtos[$i];
     $receiver = $mailto[0];
     if (is_object($receiver)) {
         if ($receiver instanceof steam_object) {
             if ($receiver instanceof steam_group) {
                 $grouptype = $receiver->get_attribute(OBJ_TYPE);
                 if (!is_string($grouptype)) {
                     $grouptype = "";
                 }
                 if (stristr($grouptype, "course") || stristr($grouptype, "group_course")) {
                     $course_tnr[$receiver->get_id()] = $receiver->get_parent_group(TRUE);
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:messages.php

示例10: get_date_objects

 /**
  * function get_date_objects:
  * 
  * @param $pStart
  * @param $pEnd
  * @param $pType
  * 
  * @return 
  */
 public function get_date_objects($pStart = 0, $pEnd = 0, $pType = 0)
 {
     if ($pStart == 0 && $pEnd == 0) {
         $pEnd = mktime(0, 0, 0, 1, 1, 2050);
     }
     $date_objects = $this->steam_command($this, "get_all_entries", array((int) $pStart, (int) $pEnd, $pType), 0);
     steam_factory::load_attributes($this->steam_connectorID, $date_objects, array("DATE_START_DATE"));
     usort($date_objects, "sort_dates");
     return $date_objects;
 }
开发者ID:rolwi,项目名称:koala,代码行数:19,代码来源:steam_calendar.class.php

示例11: koala_html_course

    $portal->set_guest_allowed(GUEST_ALLOWED);
}
$current_user = lms_steam::get_current_user();
$um = unitmanager::create_unitmanager($course);
$html_handler = new koala_html_course($course);
$html_handler->set_context("units");
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES_UNITS_BASE . "units.template.html");
$container = $course->get_workroom();
$koala_container = new koala_container_units($container, $course->get_url() . 'units/');
$koala_container->set_owner($course);
$is_admin = $course->is_admin($current_user);
$units = array();
$units_tmp = $koala_container->get_inventory();
// Pre-load Atributes for all units to optimize requests
steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $units_tmp, array(OBJ_TYPE, OBJ_NAME, OBJ_ICON, OBJ_DESC, "UNIT_TYPE", "UNIT_DISPLAY_TYPE"));
foreach ($units_tmp as $unit) {
    $koala_unit = koala_object::get_koala_object($unit);
    if (is_object($koala_unit) && method_exists($koala_unit, 'get_unit')) {
        $unit_class = $koala_unit->get_unit();
        if (is_object($unit_class) && method_exists($unit_class, 'is_enabled_for') && !$unit_class->is_enabled_for($owner)) {
            continue;
        }
    }
    $units[] = $unit;
}
if ($is_admin) {
    //clipboard:
    $koala_user = new koala_html_user(new koala_user($current_user));
    $clipboard_menu = $koala_user->get_clipboard_menu($koala_container);
    $content->setCurrentBlock("BLOCK_CLIPBOARD");
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:units.php

示例12: get_items

 public function get_items($id)
 {
     $wiki = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id, CLASS_CONTAINER);
     $items = $wiki->get_inventory(CLASS_DOCUMENT, array(), SORT_NAME);
     $result = array();
     $i = 0;
     steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $items, array(OBJ_NAME, OBJ_CREATION_TIME, DOC_USER_MODIFIED, DOC_MIME_TYPE, DOC_LAST_MODIFIED));
     $authors = array();
     foreach ($items as $item) {
         if (!strstr($item->get_name(), ".wiki")) {
             continue;
         }
         $result[$i] = $item->get_attributes(array(OBJ_CREATION_TIME, DOC_USER_MODIFIED, DOC_MIME_TYPE, DOC_LAST_MODIFIED, OBJ_NAME));
         $author_obj = $item->get_attribute(DOC_USER_MODIFIED);
         if (is_object($author_obj)) {
             $authors[$author_obj->get_id()] = $item->get_attribute(DOC_USER_MODIFIED);
         }
         $result[$i]["OBJ_ID"] = $item->get_id();
         $i++;
     }
     steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), array_values($authors), array(OBJ_NAME, USER_FULLNAME, USER_FIRSTNAME));
     $i = 0;
     foreach ($items as $item) {
         if (!strstr($item->get_name(), ".wiki")) {
             continue;
         }
         // Comments are unused in wikis at the moment
         /*
         			$comments = $item->get_annotations();
         			if ( count( $comments ) > 0 )
         			{
         				$result[ $i ][ "COMMENTS_NO" ]   = count( $comments );
         				$result[ $i ][ "COMMENTS_LAST" ] = $comments[ 0 ]->get_attribute( "OBJ_CREATION_TIME" );
         				$author = $comments[ 0 ]->get_creator();
         				$result[ $i ][ "COMMENTS_LAST_AUTHOR" ] = $author->get_attribute( "USER_FIRSTNAME" ) . " " . $author->get_attribute( "USER_FULLNAME" );
         			}
         */
         $author = $item->get_attribute(DOC_USER_MODIFIED);
         if (is_object($author)) {
             $name = $authors[$author->get_id()]->get_attribute(USER_FIRSTNAME) . " " . $authors[$author->get_id()]->get_attribute(USER_FULLNAME);
             $result[$i][DOC_USER_MODIFIED] = $name;
         }
         $i++;
     }
     return $result;
 }
开发者ID:rolwi,项目名称:koala,代码行数:46,代码来源:lms_wiki.class.php

示例13: get_config_objects

 public static function get_config_objects()
 {
     $configs = array();
     $config_container = steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), "/config/koala/extensions/");
     if (is_object($config_container)) {
         $config_objects = $config_container->get_inventory_raw();
         steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $config_objects, array(OBJ_NAME));
     } else {
         $config_objects = array();
     }
     foreach ($config_objects as $co) {
         $configs[$co->get_name()] = $co;
     }
     return $configs;
 }
开发者ID:rolwi,项目名称:koala,代码行数:15,代码来源:extensionmanager.class.php

示例14: RssChannel

//lms_steam::connect(); //http_auth function is used instead
require_once PATH_LIB . "http_auth_handling.inc.php";
if (http_auth()) {
    if (!($discussion = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]))) {
        include PATH_PUBLIC . "bad_link.php";
        exit;
    }
    $rss_channel = new RssChannel($discussion->get_name(), PATH_URL . "doc/" . $_GET["id"] . "/", "");
    $rss_channel->generate_http_header();
    print $rss_channel->generate_xml_header();
    $object = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["id"]);
    if (is_object($object)) {
        $data_tnr["ATTRIBUTES"] = $object->get_attributes(array(OBJ_NAME, OBJ_CREATION_TIME, OBJ_DESC), TRUE);
        $data_tnr["CREATOR"] = $object->get_creator(TRUE);
        $data_result = $GLOBALS["STEAM"]->buffer_flush();
        $creator = $data_result[$data_tnr["CREATOR"]];
        steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), array($creator), array(USER_FULLNAME, USER_FIRSTNAME));
        print $rss_channel->generate_item($data_result[$data_tnr["ATTRIBUTES"]][OBJ_NAME] . " " . gettext("by") . " " . $creator->get_attribute(USER_FIRSTNAME) . " " . $creator->get_attribute(USER_FULLNAME), "", BBCode($data_result[$data_tnr["ATTRIBUTES"]][OBJ_DESC]), $creator->get_attribute(USER_FIRSTNAME) . " " . $creator->get_attribute(USER_FULLNAME), $data_result[$data_tnr["ATTRIBUTES"]][OBJ_CREATION_TIME], "", PATH_URL . "doc/" . $_GET["id"] . "/#comment" . $object->get_id());
    }
    $cache = get_cache_function($_GET["id"], 600);
    $discussions = $cache->call("lms_steam::get_annotations", $_GET["id"]);
    foreach ($discussions as $discussion) {
        print $rss_channel->generate_item(gettext("Post by ") . $discussion["OBJ_CREATOR"], "", BBCode($discussion["CONTENT"]), $discussion["OBJ_CREATOR"], $discussion["OBJ_CREATION_TIME"], "", PATH_URL . "doc/" . $_GET["id"] . "/#comment" . $discussion["OBJ_ID"]);
    }
    print $rss_channel->generate_xml_footer();
} else {
    $rss_channel = new PodcastRSS("Access denied", PATH_SERVER . $_SERVER["REQUEST_URI"], "You are not allowed to access this RSS Feed. Please check your username and password");
    $rss_channel->generate_http_header();
    $rss_channel->generate_xml_header(TRUE);
    exit;
}
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:document_public.php

示例15: frameResponse


//.........这里部分代码省略.........
             if (strpos($values['name'], '/')) {
                 $problems .= gettext("Please don't use the \"/\"-char in the groupname.") . ' ';
             }
             if (strpos($values['name'], '.')) {
                 $problems .= gettext("Please don't use the \".\"-char in the groupname.") . ' ';
             } else {
                 if ($is_public && $values["category"] == "0") {
                     $problems .= gettext("You have to choose a category.") . " ";
                     $hints .= gettext("Choose a category to help the users find your group. ") . " ";
                 }
                 if (empty($problems)) {
                     if ($create_new) {
                         if ($is_public) {
                             $pgroup_id = STEAM_PUBLIC_GROUP;
                         } else {
                             $pgroup_id = STEAM_PRIVATE_GROUP;
                         }
                     } else {
                         $parent = $group->get_steam_group()->get_parent_group();
                         if (is_object($parent)) {
                             $pgroup_id = $parent->get_id();
                         } else {
                             $pgroup_id = -1;
                         }
                         // no koala group. its a steam only group
                     }
                     if ($pgroup_id != -1) {
                         $parentgroup = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $pgroup_id);
                         if (!is_object($parentgroup) || !$parentgroup instanceof \steam_group) {
                             throw new \Exception("Configuration Error: Invalid Public or Private Group Setting. False Group id=" . $pgroup_id, E_CONFIGURATION);
                             exit;
                         }
                         $siblings = $parentgroup->get_subgroups();
                         \steam_factory::load_attributes($GLOBALS["STEAM"]->get_id(), $siblings, array(OBJ_NAME));
                         foreach ($siblings as $sibling) {
                             if (strtolower($sibling->get_name()) == strtolower($values["name"])) {
                                 if ($create_new || $sibling->get_id() != $group->get_steam_group()->get_id()) {
                                     $problems .= gettext("The groupname you've choosen is used for another group already.") . " ";
                                     $hints .= gettext("Please choose another groupname.") . " ";
                                     break;
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if (empty($values["short_dsc"])) {
             $problems .= gettext("The short description is missing.") . " ";
             $hints .= gettext("Sometimes, keywords are sufficient to help people understand what your group is for.") . " ";
         }
         $max_members = -1;
         $sizeproblems = FALSE;
         if (!empty($values["maxsize"]) && trim($values["maxsize"]) != "" && preg_match('/[^-.0-9]/', trim($values["maxsize"]))) {
             $problems .= gettext("Invalid max number of participants.") . " ";
             $hints .= gettext("Please enter a valid number for the max number of participants.") . " " . gettext("Please note that the input of a '0' or to leave the field blank means no limitation.") . " ";
             $sizeproblems = TRUE;
         } else {
             if (!empty($values["maxsize"]) && trim($values["maxsize"]) != "" && trim($values["maxsize"]) < 0) {
                 $problems .= gettext("Invalid max number of participants.") . " ";
                 $hints .= gettext("Please enter a number equal or greater than '0' for the max number of participants.") . " " . gettext("Please note that the input of a '0' or to leave the field blank means no limitation.") . " ";
                 $sizeproblems = TRUE;
             } else {
                 if (isset($values["maxsize"])) {
                     if (trim($values["maxsize"]) === "") {
                         $max_members = 0;
开发者ID:rolwi,项目名称:koala,代码行数:67,代码来源:ManageGroup.class.php


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