當前位置: 首頁>>代碼示例>>PHP>>正文


PHP steam_factory::create_docextern方法代碼示例

本文整理匯總了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;
    }
開發者ID:rolwi,項目名稱:koala,代碼行數:14,代碼來源:CreateWebLink.class.php

示例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"]));
開發者ID:rolwi,項目名稱:koala,代碼行數:31,代碼來源:docextern_edit.php

示例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");
開發者ID:rolwi,項目名稱:koala,代碼行數:31,代碼來源:delicious_import.php

示例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;
 }
開發者ID:rolwi,項目名稱:koala,代碼行數:6,代碼來源:steam_weblog.class.php

示例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';
         }
開發者ID:rolwi,項目名稱:koala,代碼行數:31,代碼來源:units_extern_new.php

示例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) {
開發者ID:rolwi,項目名稱:koala,代碼行數:31,代碼來源:dialognew.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];
     $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
//.........這裏部分代碼省略.........
開發者ID:rolwi,項目名稱:koala,代碼行數:101,代碼來源:Blogroll.class.php


注:本文中的steam_factory::create_docextern方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。