本文整理汇总了PHP中steam_factory::create_container方法的典型用法代码示例。如果您正苦于以下问题:PHP steam_factory::create_container方法的具体用法?PHP steam_factory::create_container怎么用?PHP steam_factory::create_container使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类steam_factory
的用法示例。
在下文中一共展示了steam_factory::create_container方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processData
public function processData(\IRequestObject $requestObject)
{
//create portlet
$params = $requestObject->getParams();
$name = $params["title"];
$column = $params["parent"];
$version = "3.0";
//check diffrent types of parameter
if (is_string($column)) {
$columnObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $column);
} else {
$columnObject = $column;
}
//default values
$address = "http://api.flickr.com/services/feeds/photoset.gne?set=72157603709124069&nsid=12597119@N03&lang=de-de&format=rss_200";
$address = "http://www.lehrer-online.de/rss-materialien.xml";
$num_items = "5";
$desc_length = "50";
$style = "message";
//Breit
$style = "rss_feed";
//Schmal
$allow_html = "checked";
//create object
$portletObject = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $columnObject);
$portletContent = array("address" => $address, "num_items" => $num_items, "desc_length" => $desc_length, "style" => $style, "allow_html" => $allow_html);
$portletObject->set_attributes(array(OBJ_DESC => $name, OBJ_TYPE => "container_portlet_bid", "bid:portlet" => "rss", "bid:portlet:version" => $version, "bid:portlet:content" => $portletContent));
}
示例2: processData
public function processData(\IRequestObject $requestObject)
{
$params = $requestObject->getParams();
$name = $params["title"];
$column = $params["parent"];
$version = "3.0";
//check diffrent types of parameter
if (is_string($column)) {
$columnObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $column);
} else {
$columnObject = $column;
}
//default values
$descripton = "keine Beschreibung";
$mediaType = "movie";
//$url="http://www.bid-owl.de/download/347240/video.flv"; //test url
$url = "";
//create
$media = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $columnObject);
//$mediaType = "image";
//$mediaType = "audio";
$mediaType = "movie";
$mediaContent = array("headline" => $name, "description" => $descripton, "media_type" => $mediaType, "url" => $url);
$media->set_attributes(array(OBJ_DESC => $name, OBJ_TYPE => "container_portlet_bid", "bid:portlet" => "media", "bid:portlet:version" => $version, "bid:portlet:content" => $mediaContent));
}
示例3: copy_msg
function copy_msg($steam, $source)
{
//create container
$copy = steam_factory::create_container($steam, $source->get_attribute(OBJ_NAME), $steam->get_login_user());
$copy->set_attribute("bid:doctype", "portlet");
$copy->set_attribute("bid:portlet", "msg");
//copy pictures if available
$old_content = $source->get_attribute("bid:portlet:content");
$copy_content = array();
foreach ($old_content as $msg_id) {
$message = steam_factory::get_object($steam, $msg_id);
$new_message = steam_factory::create_copy($steam, $message);
$new_message->move($copy);
array_push($copy_content, $new_message->get_id());
$picture_id = $message->get_attribute("bid:portlet:msg:picture_id");
if ($picture_id != null || $picture_id != "") {
//duplicate picture
$new_picture = steam_factory::create_copy($steam, steam_factory::get_object($steam, $picture_id));
$new_picture->move($copy);
//update portlet content
$new_message->set_attribute("bid:portlet:msg:picture_id", $new_picture->get_id());
}
}
//set correct content
$copy->set_attribute("bid:portlet:content", $copy_content);
return $copy;
}
示例4: processData
public function processData(\IRequestObject $requestObject)
{
$params = $requestObject->getParams();
$name = $params["title"];
$column = $params["parent"];
$version = "1.0";
//check diffrent types of parameter
if (is_string($column)) {
$columnObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $column);
} else {
$columnObject = $column;
}
//get date
$currentYear = date("Y") . "";
$nextYear = date("Y") + 1 . "";
//create
$pollObject = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $columnObject);
$pollTopic = "Beschreibung der Abstimmung";
$startDate = array("day" => "01", "month" => "01", "year" => $currentYear);
$endDate = array("day" => "01", "month" => "01", "year" => $nextYear);
$options = array("Eintrag A", "Eintrag B", "Eintrag C", "Eintrag D", "Eintrag E", "Eintrag F");
$optionsVotecount = array(0, 0, 0, 0, 0, 0);
$pollContent = array("end_date" => $endDate, "options" => $options, "options_votecount" => $optionsVotecount, "poll_topic" => $pollTopic, "start_date" => $startDate);
$pollObject->set_attributes(array(OBJ_DESC => $name, OBJ_TYPE => "container_portlet_bid", "bid:portlet" => "poll", "bid:portlet:version" => $version, "bid:portlet:content" => $pollContent));
}
示例5: create_category
public function create_category($name, $description)
{
if (!($categories = $this->get_object_by_name("categories"))) {
$categories = steam_factory::create_container($GLOBALS["STEAM"]->get_id(), "categories", $this, "all categories for this weblog");
}
$new_category = steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $categories, $description);
return $new_category;
}
示例6: execute
public function execute($request, $response)
{
$myExtension = \Questionary::getInstance();
$name = trim(isset($_POST["name"]) ? $_POST["name"] : "test");
//current room steam object
//if( (int) $object != 0 )
//$current_room = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $object);
//else
$current_room = $GLOBALS["STEAM"]->get_current_steam_user()->get_workroom();
$steamUser = $GLOBALS["STEAM"]->get_current_steam_user();
//get write permission
$access_write = $current_room->check_access_write($steamUser);
$access_read = $current_room->check_access_read($steamUser);
$access_insert = $current_room->check_access_insert($steamUser);
$allowed = $access_write && $access_read && $access_insert ? true : false;
if (!$allowed) {
// ACCESS DENIED?
}
//create questionary if adviced too
if (isset($_POST["mission"]) && $_POST["mission"] == "create" && $name != "" && $allowed) {
//create new questionary
$questionary = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $current_room);
$questions_folder = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), 'questions', $questionary);
$answers_folder = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), 'answers', $questionary);
if (isset($_POST["description"])) {
$description = $_POST["description"];
} else {
$description = "";
}
if ($questionary && $questions_folder && $answers_folder) {
//set standard layout
$layout = "template";
//$templates[1];
//define rights for the attributes
$loginuser_id = $steamUser->get_id();
$rootid = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), "root")->get_id();
$author_rights[$loginuser_id] = $loginuser_id;
$editor_rights[$loginuser_id] = $loginuser_id;
$analyst_rights[$loginuser_id] = $loginuser_id;
$author_rights[$rootid] = $rootid;
$editor_rights[$rootid] = $rootid;
$analyst_rights[$rootid] = $rootid;
//define container as questionary and set all attributes
$attributes = array("bid:doctype" => "questionary", "bid:questionary:fillout" => "1", "bid:questionary:editanswer" => "1", "bid:questionary:editownanswer" => "0", "bid:questionary:number" => "1", "bid:questionary:resultcreator" => "1", "bid:questionary:resultcreationtime" => "1", "bid:questionary:description" => $description, "bid:questionary:edittime" => array(0, 0, 0), "bid:questionary:enabled" => false, "bid:questionary:layout" => $layout, "bid:questionary:author_rights" => $author_rights, "bid:questionary:editor_rights" => $editor_rights, "bid:questionary:analyst_rights" => $analyst_rights);
$result = $questionary->set_attributes($attributes);
header("Location: " . PATH_URL . "questionary/editQuestionary/" . $questionary->get_id());
}
} else {
$myExtension->addCSS();
$content = $myExtension->loadTemplate("questionaryNewQuestionary.template.html");
$content->setCurrentBlock('BLOCK_FORM_NEW_QUESTIONARY');
$content->setVariable("QUESTIONARY_ID", "");
$content->setVariable("BUTTON_MISSION", "create");
$content->setVariable("OBJECT_ID", $current_room->get_id());
$content->parse('BLOCK_FORM_NEW_QUESTIONARY');
return $content->get();
}
}
示例7: create_container
/**
* Creates and returns a new steam_container object.
*
* @param String $name name of the new container
* @param Object $environment steam_container or koala_container in which
* to create the new container
* @param String $description (optional) description of the new container
* @return Object the resulting new steam_container
*/
public static function create_container($name, $environment, $description = "")
{
if ($environment instanceof koala_container) {
$environment = $environment->get_steam_object();
}
if ($environment instanceof koala_container) {
$environment = $environment->get_steam_object();
}
if (!$environment instanceof steam_container) {
throw new Exception("No valid environment provided.", E_PARAMETER);
}
// just create and return a new steam_container (containers need no
// special treatment in koaLA):
return steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $environment, $description);
}
示例8: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
$ajaxResponseObject->setStatus("ok");
$current_room = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$mplme = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), rawurlencode($this->params["title"]), $current_room, $this->params["title"]);
$mplme->set_attribute("OBJ_TYPE", "container_mplme");
$mplme->set_attribute("MPLME_URL", $this->url);
$jswrapper = new \Widgets\JSWrapper();
$jswrapper->setJs(<<<END
\t\tcloseDialog();
\t\tsendRequest("LoadContent", {"id":"{$this->id}"}, "explorerWrapper", "updater", null, null, "explorer");
END
);
$ajaxResponseObject->addWidget($jswrapper);
return $ajaxResponseObject;
}
示例9: processData
public function processData(\IRequestObject $requestObject)
{
$params = $requestObject->getParams();
$name = $params["title"];
$column = $params["parent"];
$version = "3.0";
//check diffrent types of parameter
if (is_string($column)) {
$columnObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $column);
} else {
$columnObject = $column;
}
///old method
$msg = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $columnObject);
$msg->set_attributes(array(OBJ_DESC => $name, OBJ_TYPE => "container_portlet_bid", "bid:portlet:version" => $version, "bid:portlet" => "msg"));
}
示例10: processData
public function processData(\IRequestObject $requestObject)
{
//create headline
$params = $requestObject->getParams();
$name = $params["title"];
$column = $params["parent"];
$version = "3.0";
//check diffrent types of parameter
if (is_string($column)) {
$columnObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $column);
} else {
$columnObject = $column;
}
//create object
$headline = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $name, $columnObject);
$headline_content = array("headline" => $name, "alignment" => "center", "size" => 15);
$headline->set_attributes(array(OBJ_DESC => $name, OBJ_TYPE => "container_portlet_bid", "bid:portlet" => "headline", "bid:portlet:version" => $version, "bid:portlet:content" => $headline_content));
}
示例11: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
$ajaxResponseObject->setStatus("ok");
$env_room = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$worksheetObject = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $this->params["name"], $env_room);
$worksheet = new \Worksheet\Worksheet($worksheetObject->get_id());
$worksheet->setup();
$worksheet->setName($worksheet->getName() . " (Vorlage)");
$jswrapper = new \Widgets\JSWrapper();
$jswrapper->setJs(<<<END
\t\tcloseDialog();
\t\tsendRequest("LoadContent", {"id":"{$this->id}"}, "explorerWrapper", "updater", null, null, "explorer");
\t\t
END
);
$ajaxResponseObject->addWidget($jswrapper);
return $ajaxResponseObject;
}
示例12: createSurvey
public function createSurvey($old = null)
{
if ($old == null) {
$survey_container = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $this->name, $this->rapidfeedback, $this->name);
$results_container = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), "results", $survey_container, "container for results");
} else {
$survey_container = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $old);
$results_container = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $survey_container->get_path() . "/results");
}
$survey_container->set_attribute("RAPIDFEEDBACK_STATE", 0);
$survey_container->set_attribute("RAPIDFEEDBACK_RESULTS", 0);
$survey_container->set_attribute("RAPIDFEEDBACK_PARTICIPANTS", array());
if ($this->starttype == 0) {
$survey_container->set_attribute("RAPIDFEEDBACK_STARTTYPE", 0);
} else {
$begin = $this->begin;
$end = $this->end;
$begin = mktime(0, 0, 0, substr($begin, 3, 2), substr($begin, 0, 2), substr($begin, 6, 4));
$end = mktime(0, 0, 0, substr($end, 3, 2), substr($end, 0, 2), substr($end, 6, 4));
$times = array();
array_push($times, $end);
array_push($times, $begin);
$survey_container->set_attribute("RAPIDFEEDBACK_STARTTYPE", $times);
}
$survey_container->set_attribute("RAPIDFEEDBACK_QUESTIONS", count($this->questions));
$xml = new \SimpleXMLElement("<survey></survey>");
$xml->addChild("name", $this->name);
$xml->addChild("begintext", $this->begintext);
$xml->addChild("endtext", $this->endtext);
foreach ($this->questions as $question) {
$xml_question = $xml->addChild("question");
$question->saveXML($xml_question);
}
if ($old == null) {
$xml_document = \steam_factory::create_document($GLOBALS["STEAM"]->get_id(), "survey.xml", $xml->saveXML(), "text/xml", $survey_container);
} else {
$xml_document = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $survey_container->get_path() . "/survey.xml");
$xml_document->set_content($xml->saveXML());
}
return $survey_container;
}
示例13: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
$ajaxResponseObject->setStatus("ok");
$current_room = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$portal = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $this->params["name"], $current_room);
$portal->set_attribute("OBJ_TYPE", "container_portal_bid");
$columnWidth = array("1" => "900px", "2" => "200px;700px", "3" => "200px;500px;200px");
$columnCount = $this->params["columns"];
$columnWidth = explode(';', $columnWidth[$columnCount]);
$columns = array();
for ($i = 1; $i <= $columnCount; $i++) {
$columns[$i] = \steam_factory::create_container($GLOBALS["STEAM"]->get_id(), '' . $i, $portal, '' . $i);
$columns[$i]->set_attributes(array("OBJ_TYPE" => "container_portalColumn_bid", "bid:portal:column:width" => $columnWidth[$i - 1]));
}
// populate columns with default portlets
switch (count($columns)) {
case 1:
\ExtensionMaster::getInstance()->callCommand("Create", "PortletHeadline", array("parent" => $columns[1], "title" => $this->params["name"], "version" => "3.0"));
\ExtensionMaster::getInstance()->callCommand("Create", "PortletMsg", array("parent" => $columns[1], "title" => "Meldungen", "version" => "3.0"));
break;
case 2:
\ExtensionMaster::getInstance()->callCommand("Create", "PortletTopic", array("parent" => $columns[1], "title" => "Kategorien", "version" => "3.0"));
\ExtensionMaster::getInstance()->callCommand("Create", "PortletHeadline", array("parent" => $columns[2], "title" => $this->params["name"], "version" => "3.0"));
\ExtensionMaster::getInstance()->callCommand("Create", "PortletMsg", array("parent" => $columns[2], "title" => "Meldungen", "version" => "3.0"));
break;
case 3:
\ExtensionMaster::getInstance()->callCommand("Create", "PortletTopic", array("parent" => $columns[1], "title" => "Kategorien", "version" => "3.0"));
\ExtensionMaster::getInstance()->callCommand("Create", "PortletHeadline", array("parent" => $columns[2], "title" => $this->params["name"], "version" => "3.0"));
\ExtensionMaster::getInstance()->callCommand("Create", "PortletMsg", array("parent" => $columns[2], "title" => "Meldungen", "version" => "3.0"));
\ExtensionMaster::getInstance()->callCommand("Create", "PortletAppointment", array("parent" => $columns[3], "title" => "Termine", "version" => "3.0"));
break;
}
$jswrapper = new \Widgets\JSWrapper();
$jswrapper->setJs(<<<END
\t\tcloseDialog();
\t\tsendRequest("LoadContent", {"id":"{$this->id}"}, "explorerWrapper", "updater", null, null, "explorer");
END
);
$ajaxResponseObject->addWidget($jswrapper);
return $ajaxResponseObject;
}
示例14: save
private function save()
{
if ($GLOBALS["STEAM"]->get_login_user_name() != "root") {
$sc = new steam_connector(STEAM_SERVER, STEAM_PORT, STEAM_ROOT_LOGIN, STEAM_ROOT_PW);
} else {
$sc = $GLOBALS["STEAM"];
}
$license_container = steam_factory::get_object_by_name($sc->get_id(), "/home/root/licenses/");
if (!$license_container instanceof steam_container) {
$root_home = steam_factory::get_object_by_name($sc->get_id(), "/home/root/");
$license_container = steam_factory::create_container($sc->get_id(), "licenses", $root_home, "licenses for elearning plattform a stored here");
$license_container->set_attribute("OBJ_HIDDEN", "TRUE");
$license_container->set_attribute("OBJ_TYPE", "usermanagement_licensemanager_data");
}
$license_file = steam_factory::get_object_by_name($sc->get_id(), "/home/root/licenses/licenses.xml");
if (!$license_file instanceof steam_document) {
$license_file = steam_factory::create_document($sc->get_id(), "licenses.xml", $this->license_xml->asXML(), "text/xml");
$license_file->move($license_container);
} else {
$license_file->set_content($this->license_xml->asXML());
}
}
示例15: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
if (!isset($this->params["group_course"])) {
$rawWidget = new \Widgets\RawHtml();
$rawWidget->setHtml("Error: Kurs oder Gruppe auswählen");
$ajaxResponseObject->addWidget($rawWidget);
return $ajaxResponseObject;
}
$user = $GLOBALS["STEAM"]->get_current_steam_user();
if ($this->params["group_course"] == 1) {
// course
if (!isset($this->params["course"])) {
$rawWidget = new \Widgets\RawHtml();
$rawWidget->setHtml("Error: Kurs oder Gruppe auswählen");
$ajaxResponseObject->addWidget($rawWidget);
return $ajaxResponseObject;
}
$course = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["course"]);
$subgroups = $course->get_subgroups();
foreach ($subgroups as $subgroup) {
if ($subgroup->get_name() == "staff") {
$staff = $subgroup->get_members();
$admins = array();
foreach ($staff as $staffMember) {
if ($staffMember instanceof \steam_user) {
array_push($admins, $staffMember->get_id());
}
}
} else {
if ($subgroup->get_name() == "learners") {
$group = $subgroup;
}
}
}
} else {
// group
if (!isset($this->params["group"])) {
$rawWidget = new \Widgets\RawHtml();
$rawWidget->setHtml("Error: Kurs oder Gruppe auswählen");
$ajaxResponseObject->addWidget($rawWidget);
return $ajaxResponseObject;
}
$group = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params["group"]);
$admins = array($user->get_id());
}
if (intval($this->params["rounds"]) == 0) {
$rawWidget = new \Widgets\RawHtml();
$rawWidget->setHtml("Error: Rundenzahl bitte als Integer eingeben.");
$ajaxResponseObject->addWidget($rawWidget);
return $ajaxResponseObject;
}
// create data structure and set access rights
$TCR = \steam_factory::create_room($GLOBALS["STEAM"]->get_id(), $this->params["title"], $group->get_workroom(), $this->params["title"]);
\steam_factory::create_container($GLOBALS["STEAM"]->get_id(), "theses", $TCR, "container for theses");
\steam_factory::create_container($GLOBALS["STEAM"]->get_id(), "reviews", $TCR, "container for reviews");
\steam_factory::create_container($GLOBALS["STEAM"]->get_id(), "responses", $TCR, "container for responses");
$TCR->set_attribute("OBJ_TYPE", "TCR_CONTAINER");
$TCR->set_attribute("TCR_ROUNDS", $this->params["rounds"]);
$TCR->set_attribute("TCR_USERS", array());
$TCR->set_attribute("TCR_ADMINS", $admins);
$TCR->set_attribute("TCR_GROUP", $group);
$TCR->set_sanction_all($group);
$ajaxResponseObject->setStatus("ok");
$jswrapper = new \Widgets\JSWrapper();
$jswrapper->setJs(<<<END
\t\tcloseDialog();
END
);
$ajaxResponseObject->addWidget($jswrapper);
return $ajaxResponseObject;
}