本文整理汇总了PHP中steam_factory::create_docextern方法的典型用法代码示例。如果您正苦于以下问题:PHP steam_factory::create_docextern方法的具体用法?PHP steam_factory::create_docextern怎么用?PHP steam_factory::create_docextern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类steam_factory
的用法示例。
在下文中一共展示了steam_factory::create_docextern方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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_docextern($GLOBALS["STEAM"]->get_id(), strip_tags($this->params["name"]), strip_tags($this->params["url"]), $current_room, "");
$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;
}
示例2: gettext
$hint = gettext("Please insert the URL, starting with 'http://'") . " ";
}
if (empty($values["name"])) {
$problem .= gettext("The name is missing.");
$hint .= gettext("How is the title of the webpage?");
} else {
if (strpos($values["name"], "/")) {
if (!isset($problem)) {
$problem = "";
}
$problem .= gettext("Please don't use the \"/\"-char in the name of the weblink.");
}
}
if (empty($problem)) {
if (!is_object($docextern)) {
$docextern = steam_factory::create_docextern($GLOBALS["STEAM"]->get_id(), $values["name"], $values["url"], $env, $values["desc"]);
} else {
if (empty($values["desc"])) {
$docextern->delete_attribute("OBJ_DESC");
} else {
$docextern->set_attribute("OBJ_DESC", $values["desc"]);
}
$docextern->set_name($values["name"]);
$docextern->set_url($values["url"]);
}
header("Location: " . $values["return_to"]);
exit;
} else {
$portal->set_problem_description($problem, $hint);
$content->setVariable("VALUE_NAME", h($values["name"]));
$content->setVariable("VALUE_URL", h($values["url"]));
示例3: foreach
foreach ($obj->attributes() as $attribute => $value) {
if ($attribute == "tag") {
$delicious_tags[] = "" . $value;
}
}
}
if (!isset($delicious_tags)) {
echo "<script type='text/javascript'>alert('login failed.');</script>";
}
}
}
// action: import links
if (isset($_POST["selected_posts"])) {
foreach ($_POST["selected_posts"] as $post_hash) {
$post = $_POST["delicious"][$post_hash];
$obj = steam_factory::create_docextern($steam, urlencode($post["href"]), $post["href"], $current_room, $post["description"]);
$obj->set_attributes(array("hash" => $post_hash, "others" => $post["others"], "tag" => $post["tag"], "time" => $post["time"]));
}
// close this popup
echo "<script type=\"text/javascript\">opener.location.reload();window.close();</script>";
}
//******************************************************
//** Display Stuff
//******************************************************
//template stuff
$tpl = new Template("./templates/{$language}", "keep");
$tpl->set_file("content", "delicious_import.ihtml");
$tpl->set_block("content", "getposts_title", "DUMMY");
$tpl->set_block("content", "getposts_form", "DUMMY");
$tpl->set_block("content", "getposts_button", "DUMMY");
$tpl->set_block("content", "import_title", "DUMMY");
示例4: blogroll_add_blog
public function blogroll_add_blog($name, $url, $dsc = "")
{
$blogroll = $this->get_blogroll();
$blog = steam_factory::create_docextern($this->steam_connector->get_id(), $name, $url, $blogroll, $dsc);
return $blog;
}
示例5: gettext
$values = $_POST["values"];
// ABFRAGEN
$problems = "";
$hints = "";
if (!$values["name"] || !$values["url"]) {
$problems .= gettext("One of the required fields is missing.");
}
$hints .= gettext("Please provide a name for the unit and an URL for the extern content.");
if (empty($problems)) {
$all_users = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
$staff = $course->steam_group_staff;
$learners = $course->steam_group_learners;
if (!isset($unit)) {
$env = $course->get_workroom();
$url = $values["url"];
$new_unit = steam_factory::create_docextern($GLOBALS["STEAM"]->get_id(), $values["name"], $url, $env, $values["dsc"]);
$new_unit->set_attribute("UNIT_EXTERN_APPEARANCE", $values["appearance"]);
$new_unit->set_attribute("UNIT_EXTERN_URL_DESCRIPTION", $values["url_dsc"]);
$new_unit->set_attributes(array("OBJ_LONG_DESC" => $values["long_dsc"], "UNIT_TYPE" => "units_extern", "OBJ_TYPE" => "docextern_unit_koala", "UNIT_DISPLAY_TYPE" => gettext("Extern Ressource")));
$koala_unit = new koala_object_docextern($new_unit, new units_extern($course->get_steam_object()));
} else {
$new_unit = $unit->get_steam_object();
$koala_unit = $unit;
$attrs = $new_unit->get_attributes(array(OBJ_NAME, OBJ_DESC, 'OBJ_LONG_DESC', OBJ_TYPE, 'UNIT_TYPE', 'UNIT_DISPLAY_TYPE', 'UNIT_EXTERN_APPEARANCE', 'DOC_EXTERN_URL', 'UNIT_EXTERN_URL_DESCRIPTION'));
if ($attrs[OBJ_NAME] !== $values['name']) {
$new_unit->set_name($values['name']);
}
$changes = array();
if ($attrs['OBJ_TYPE'] !== 'docextern_unit_koala') {
$changes['OBJ_TYPE'] = 'docextern_unit_koala';
}
示例6: stripslashes
$result = $inventory[$i];
$result->set_content(stripslashes($_POST["text"]));
$result->set_attribute("DOC_MIME_TYPE", $mimetype);
break;
}
}
if (!$result) {
$result = steam_factory::create_document($steam, $title, stripslashes($_POST["text"]), $mimetype, $current_room, $desc);
}
} else {
$error[] = "error_title";
}
break;
case "link":
if (trim($_POST["title"]) != "" && trim($_POST["url"]) != "") {
$result = steam_factory::create_docextern($steam, $title, $_POST["url"], $current_room, $desc);
} else {
if (trim($_POST["title"]) == "") {
$error[] = "error_title";
}
if (trim($_POST["url"]) == "") {
$error[] = "error_url";
}
}
break;
default:
break;
}
}
//close window on success
if ($result !== false) {
示例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];
$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 {
include "bad_link.php";
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);
}
}
$date = $weblog;
//if(!isset($date))
//throw new \Exception("variable date is not set.");
//if ( $_SERVER[ "REQUEST_METHOD" ] == "POST" && $date->check_access_write( $user ) )
if (false) {
$values = $_POST["values"];
if (!isset($values["delete"])) {
$values["delete"] = false;
}
if ($values["delete"]) {
require_once "Cache/Lite.php";
$cache = new Cache_Lite(array("cacheDir" => PATH_CACHE));
$cache->clean($weblog->get_id());
$cache->clean($date->get_id());
$trashbin = $GLOBALS["STEAM"]->get_current_steam_user();
if (is_object($trashbin)) {
$date->move($trashbin);
} else {
$date->delete();
}
}
header("Location: " . $values["return_to"]);
exit;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//echo "hund";
$values = $_POST["values"];
$problem = "";
$hint = "";
if (isset($values["save"])) {
$values["save"] = true;
} else {
$values["save"] = false;
}
if ($values["save"]) {
if (empty($values["url"])) {
$problem = gettext("The URL is missing.") . " ";
$hint = gettext("Please insert the URL, starting with 'http://'") . " ";
}
if (empty($values["name"])) {
$problem .= gettext("The name is missing.");
$hint .= gettext("How is the title of the webpage?");
} else {
if (strpos($values["name"], "/")) {
if (!isset($problem)) {
$problem = "";
}
$problem .= gettext("Please don't use the \"/\"-char in the name of the blogroll entry.");
}
}
if (empty($problem)) {
$environment = $weblog->get_blogroll();
if (!is_object($environment)) {
throw new \Exception("Environment is not correct.");
}
if (!$environment instanceof \steam_container) {
throw new \Exception("Environment is no container.");
}
if (!$environment->check_access_write($user)) {
throw new \Exception("No write access on this container.", E_USER_RIGHTS);
}
if (empty($problem)) {
$docextern = \steam_factory::create_docextern($GLOBALS["STEAM"]->get_id(), $values["name"], $values["url"], $environment, $values["desc"]);
header("Location: " . $values["return_to"]);
exit;
} else {
//TODO: PROBDESC
//.........这里部分代码省略.........