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


PHP steam_factory::create_messageboard方法代码示例

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


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

示例1: initialize

 public function initialize()
 {
     $profile_object = steam_factory::create_object($GLOBALS["STEAM"]->get_id(), "networking profile", CLASS_OBJECT);
     $all_user = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
     $profile_object->set_sanction_all($all_user);
     $guestbook = steam_factory::create_messageboard($GLOBALS["STEAM"]->get_id(), "guestbook", FALSE, "guestbook of " . $this->steam_user->get_attribute("USER_FIRSTNAME") . " " . $this->steam_user->get_attribute("USER_FULLNAME"));
     $guestbook->set_read_access($all_user);
     $guestbook->set_annotate_access($all_user, TRUE);
     $profile_object->set_attribute("LLMS_GUESTBOOK", $guestbook);
     $this->steam_user->set_attribute("LLMS_NETWORKING_PROFILE", $profile_object);
     $this->profile_object = $profile_object;
 }
开发者ID:rolwi,项目名称:koala,代码行数:12,代码来源:lms_networking_profile.class.php

示例2: ajaxResponse

    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $ajaxResponseObject->setStatus("ok");
        $env_room = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
        $forum = \steam_factory::create_messageboard($GLOBALS["STEAM"]->get_id(), $this->params["name"], $env_room);
        $forum->set_attribute("bid:forum_is_editable", 1);
        $jswrapper = new \Widgets\JSWrapper();
        $jswrapper->setJs(<<<END
\t\tcloseDialog();
\t\tlocation.reload();
\t\t
END
);
        $ajaxResponseObject->addWidget($jswrapper);
        return $ajaxResponseObject;
    }
开发者ID:rolwi,项目名称:koala,代码行数:16,代码来源:Create.class.php

示例3: isset

    $title = isset($_POST['title']) ? $_POST["title"] : "";
    $description = isset($_POST['description']) ? $_POST['description'] : "";
}
//Action save
if ($action == "save") {
    $do_login = False;
    if (!$allowed_write) {
        if ($steamUser->get_name() === "guest") {
            $do_login = True;
            $error[] = "error_not_logged_in";
        } else {
            $error[] = "no_access";
        }
    }
    if (count($error) == 0 && ($allowed_write && trim($_POST["title"]) != "")) {
        $messageboard = steam_factory::create_messageboard($steam, rawurlencode($title), $object, norm_post($title));
        if (!empty($messageboard)) {
            $messageboard->set_attribute("bid:forum_subtitle", norm_post(trim($subtitle)));
            $messageboard->set_attribute("bid:description", stripslashes($description));
            //close window on success
            echo "<html><body onload='javascript:if (opener) opener.top.location.reload();window.close();'></body></html";
            $steam->disconnect();
            exit;
        }
    }
}
$steam->disconnect();
//******************************************************
//** Display Stuff
//******************************************************
$t = new Template("./templates/{$language}", "keep");
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:add_forum.php

示例4: frameResponse

 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $portal = \lms_portal::get_instance();
     if (!isset($messageboard) || !is_object($messageboard)) {
         if (empty($this->params[0])) {
             throw new \Exception("Environment not set.");
         }
         if (empty($this->params[1])) {
             throw new \Exception("Group not set.");
         }
         if (!($env = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params[0]))) {
             throw new \Exception("Environment unknown.");
         }
         if (!($grp = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params[1]))) {
             throw new \Exception("Group unknown");
         }
     }
     $accessmergel = FALSE;
     if (isset($messageboard) && is_object($messageboard)) {
         $creator = $messageboard->get_creator();
         if ($messageboard->get_attribute(KOALA_ACCESS) == PERMISSION_UNDEFINED && \lms_steam::get_current_user()->get_id() != $creator->get_id() && !\lms_steam::is_koala_admin(\lms_steam::get_current_user())) {
             $accessmergel = TRUE;
         }
     }
     // TODO: Passt der link?
     $backlink = empty($_POST["values"]["backlink"]) ? $_SERVER["HTTP_REFERER"] : $_POST["values"]["backlink"];
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $values = $_POST["values"];
         if (get_magic_quotes_gpc()) {
             if (!empty($values['name'])) {
                 $values['name'] = stripslashes($values['name']);
             }
             if (!empty($values['dsc'])) {
                 $values['dsc'] = stripslashes($values['dsc']);
             }
         }
         if (empty($values["name"])) {
             $problems = gettext("The name of new message board is missing.");
             $hints = gettext("Please type in a name.");
         }
         if (strpos($values["name"], "/")) {
             if (!isset($problems)) {
                 $problems = "";
             }
             $problems .= gettext("Please don't use the \"/\"-char in the the forum name.");
         }
         if (empty($problems)) {
             $group_members = $grp;
             $group_admins = 0;
             $group_staff = 0;
             // check if group is a course
             $grouptype = (string) $grp->get_attribute("OBJ_TYPE");
             if ($grouptype == "course") {
                 $group_staff = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $grp->get_groupname() . ".staff");
                 $group_admins = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $grp->get_groupname() . ".admins");
                 $group_members = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $grp->get_groupname() . ".learners");
                 $workroom = $group_members->get_workroom();
             } else {
                 $workroom = $grp->get_workroom();
             }
             if (!isset($messageboard) || !is_object($messageboard)) {
                 $new_forum = \steam_factory::create_messageboard($GLOBALS["STEAM"]->get_id(), $values["name"], $env, $values["dsc"]);
                 $_SESSION["confirmation"] = str_replace("%NAME", h($values["name"]), gettext("New forum '%NAME' created."));
             } else {
                 $messageboard->set_attribute(OBJ_NAME, $values["name"]);
                 $messageboard->set_attribute(OBJ_DESC, $values["dsc"]);
                 $portal->set_confirmation(gettext("The changes have been saved."));
                 $new_forum = $messageboard;
             }
             $koala_forum = new \lms_forum($new_forum);
             $access = (int) $values["access"];
             $access_descriptions = \lms_forum::get_access_descriptions($grp);
             if (!$accessmergel) {
                 $koala_forum->set_access($access, $access_descriptions[$access]["members"], $access_descriptions[$access]["steam"], $group_members, $group_staff, $group_admins);
             }
             $GLOBALS["STEAM"]->buffer_flush();
             $cache = get_cache_function(\lms_steam::get_current_user()->get_name(), 600);
             $cache->drop("lms_steam::get_inventory_recursive", $workroom->get_id(), CLASS_MESSAGEBOARD, array("FORUM_LANGUAGE"));
             $cache->drop("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM);
             if (!isset($messageboard) || !is_object($messageboard)) {
                 header("Location: " . $backlink);
                 exit;
             }
         } else {
             $portal->set_problem_description($problems, isset($hints) ? $hints : "");
         }
     }
     $content = \Messageboard::getInstance()->loadTemplate("object_new.template.html");
     if (isset($messageboard) && is_object($messageboard)) {
         $content->setVariable("INFO_TEXT", str_replace("%NAME", h($messageboard->get_name()), gettext("You are going to edit the forum '<b>%NAME</b>'.")));
         $content->setVariable("LABEL_CREATE", gettext("Save changes"));
         $pagetitle = gettext("Preferences");
         if (empty($values)) {
             $values = array();
             $values["name"] = $messageboard->get_name();
             $values["dsc"] = $messageboard->get_attribute(OBJ_DESC);
             $values["access"] = $messageboard->get_attribute(KOALA_ACCESS);
         }
         $breadcrumbheader = gettext("Preferences");
     } else {
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:NewMessageboard.class.php

示例5: h

 if (empty($problems)) {
     $group_members = $grp;
     $group_admins = 0;
     $group_staff = 0;
     // check if group is a course
     $grouptype = (string) $grp->get_attribute("OBJ_TYPE");
     if ($grouptype == "course") {
         $group_staff = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $grp->get_groupname() . ".staff");
         $group_admins = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $grp->get_groupname() . ".admins");
         $group_members = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $grp->get_groupname() . ".learners");
         $workroom = $group_members->get_workroom();
     } else {
         $workroom = $grp->get_workroom();
     }
     if (!isset($messageboard) || !is_object($messageboard)) {
         $new_forum = steam_factory::create_messageboard($GLOBALS["STEAM"]->get_id(), $values["name"], $env, $values["dsc"]);
         $_SESSION["confirmation"] = str_replace("%NAME", h($values["name"]), gettext("New forum '%NAME' created."));
     } else {
         $messageboard->set_attribute(OBJ_NAME, $values["name"]);
         $messageboard->set_attribute(OBJ_DESC, $values["dsc"]);
         $portal->set_confirmation(gettext("The changes have been saved."));
         $new_forum = $messageboard;
     }
     $koala_forum = new lms_forum($new_forum);
     $access = (int) $values["access"];
     $access_descriptions = lms_forum::get_access_descriptions($grp);
     if (!$accessmergel) {
         $koala_forum->set_access($access, $access_descriptions[$access]["members"], $access_descriptions[$access]["steam"], $group_members, $group_staff, $group_admins);
     }
     $GLOBALS["STEAM"]->buffer_flush();
     $cache = get_cache_function(lms_steam::get_current_user()->get_name(), 600);
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:forum_new.php

示例6: createForum

 public function createForum()
 {
     $forum = steam_factory::create_messageboard($GLOBALS["STEAM"]->get_id(), "forum", $this->getRoom());
     $this->forum = $forum;
 }
开发者ID:rolwi,项目名称:koala,代码行数:5,代码来源:PortfolioExtensionLinkModel.php


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