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


PHP FrameResponseObject::setProblemDescription方法代码示例

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


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

示例1: execute

    public function execute(\FrameResponseObject $frameResponseObject)
    {
        //CODE FOR ALL COMMANDS OF THIS PAKAGE END
        $user = \lms_steam::get_current_user();
        // Disable caching
        // TODO: Work on cache handling. An enabled cache leads to bugs
        // if used with the wiki.
        \CacheSettings::disable_caching();
        if (!($wiki_container = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id))) {
            include "bad_link.php";
            exit;
        }
        if (!$wiki_container instanceof \steam_container) {
            $wiki_doc = $wiki_container;
            $wiki_container = $wiki_doc->get_environment();
            if ($wiki_doc->get_attribute(DOC_MIME_TYPE) != "text/wiki") {
                include "bad_link.php";
                exit;
            }
        }
        //CODE FOR ALL COMMANDS OF THIS PAKAGE END
        defined("OBJ_ID") or define("OBJ_ID", $wiki_container->get_id());
        $content = \Wiki::getInstance()->loadTemplate("wiki_edit.template.html");
        //$content = new HTML_TEMPLATE_IT();
        //$content->loadTemplateFile( PATH_TEMPLATES . "wiki_edit.template.html" );
        $wiki_entries = $wiki_container->get_inventory(CLASS_DOCUMENT);
        foreach ($wiki_entries as $wiki_entry) {
            if ($wiki_entry->get_attribute(DOC_MIME_TYPE) === "text/wiki") {
                $name = $wiki_entry->get_name();
                $content->setCurrentBlock("BLOCK_WIKI_ENTRY_OPTION");
                $content->setVariable("WIKI_ENTRY_OPTION", "<option value=\"{$name}\">{$name}</option>");
                $content->parse("BLOCK_WIKI_ENTRY_OPTION");
            }
        }
        $problems = "";
        if (!isset($create)) {
            $create = FALSE;
        }
        if ($_SERVER["REQUEST_METHOD"] == "POST") {
            $values = $_POST["values"];
            if (get_magic_quotes_gpc()) {
                if (!empty($values['title'])) {
                    $values['title'] = stripslashes($values['title']);
                }
                if (!empty($values['body'])) {
                    $values['body'] = stripslashes($values['body']);
                }
            }
            if (empty($values["title"])) {
                $problems = gettext("Please enter a subject for your message.");
            }
            if (empty($values["body"])) {
                $problems .= empty($problems) ? gettext("Please enter your message.") : "<br>" . gettext("Please enter your message.");
            }
            if (strpos($values["title"], "/")) {
                if (!isset($problems)) {
                    $problems = "";
                }
                $problems .= gettext("Please don't use the \"/\"-char in the subject of your post.");
            }
            if (empty($problems)) {
                $wiki_content = str_replace("@", "&#64;", $values["body"]);
                if (!empty($values['save'])) {
                    if ($create) {
                        $wiki_doc = \steam_factory::create_document($GLOBALS["STEAM"]->get_id(), $values["title"] . ".wiki", $wiki_content, "text/wiki", $wiki_container, "");
                    } else {
                        // PRUEFEN, OB ALLES OK, DANN NEUE WERTE SPEICHERN
                        $wiki_doc->set_name($values['title'] . ".wiki");
                        $wiki_doc->set_content($wiki_content);
                    }
                    // Clean cache for wiki_entries
                    $cache = get_cache_function($wiki_container->get_id(), 600);
                    $cache->clean($wiki_container->get_id());
                    // clean rsscache
                    $rcache = get_cache_function("rss", 600);
                    $feedlink = PATH_URL . "services/feeds/wiki_public.php?id=" . $wiki_container->get_id();
                    $rcache->drop("lms_rss::get_items", $feedlink);
                    header("Location: " . PATH_URL . "wiki/editentry/" . $wiki_doc->get_id() . "/");
                    exit;
                } else {
                    // PREVIEW
                    $content->setCurrentBlock("BLOCK_PREVIEW");
                    $content->setVariable("LABEL_PREVIEW_EDIT", gettext("Preview the description"));
                    $content->setVariable("PREVIEW_EDIT", get_formatted_output($values["desc"]));
                    $content->parse("BLOCK_PREVIEW");
                    $headline = gettext("Change it?");
                    $content->setVariable("TEXT_DSC", h($values["desc"]));
                    $content->setVariable("TITLE_COMMENT", h($values["title"]));
                }
            } else {
                $frameResponseObject->setProblemDescription($problems);
                //$portal->set_problem_description( $problems );
            }
        }
        if (empty($values)) {
            $wikicontent = "";
            $wikiname = "";
            if (!$create) {
                $wikicontent = $wiki_doc->get_content();
                $wikicontent = str_replace("&#64;", "@", $wikicontent);
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Editentry.class.php

示例2: execute


//.........这里部分代码省略.........
                 $workroom = $group_members->get_workroom();
             } else {
                 $workroom = $grp->get_workroom();
             }
             if (!isset($wiki_container) || !is_object($wiki_container)) {
                 $new_wiki = \steam_factory::create_room($GLOBALS["STEAM"]->get_id(), $values["name"], $env, $values["dsc"]);
                 $new_wiki->set_attribute("OBJ_TYPE", "container_wiki_koala");
                 $_SESSION["confirmation"] = str_replace("%NAME", $values["name"], gettext("New wiki '%NAME' created."));
             } else {
                 $wiki_container->set_attribute(OBJ_NAME, $values["name"]);
                 if ($values["wiki_startpage"] == gettext("Glossary")) {
                     $values["wiki_startpage"] = "glossary";
                 }
                 $wiki_container->set_attribute("OBJ_WIKI_STARTPAGE", $values["wiki_startpage"]);
                 $wiki_container->set_attribute(OBJ_DESC, $values["dsc"]);
                 //$portal->set_confirmation(gettext( "The changes have been saved." ));
                 $new_wiki = $wiki_container;
             }
             $koala_wiki = new \lms_wiki($new_wiki);
             $access = (int) $values["access"];
             $access_descriptions = \lms_wiki::get_access_descriptions($grp);
             if (!$accessmergel) {
                 $koala_wiki->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());
             $cache->drop("lms_steam::get_inventory_recursive", $workroom->get_id(), CLASS_CONTAINER, array("OBJ_TYPE", "WIKI_LANGUAGE"));
             $cache->drop("lms_steam::get_group_communication_objects", $workroom->get_id(), CLASS_MESSAGEBOARD | CLASS_CALENDAR | CLASS_CONTAINER | CLASS_ROOM);
             if (!isset($wiki_container) || !is_object($wiki_container)) {
                 header("Location: " . $backlink);
                 exit;
             }
         } else {
             $frameResponseObject->setProblemDescription($problems);
             $frameResponseObject->setProblemSolution(isset($hints) ? $hints : "");
         }
     }
     $content = \Wiki::getInstance()->loadTemplate("object_new.template.html");
     //$content = new HTML_TEMPLATE_IT( PATH_TEMPLATES );
     //$content->loadTemplateFile( "object_new.template.html" );
     if (isset($wiki_container) && is_object($wiki_container)) {
         $content->setVariable("INFO_TEXT", str_replace("%NAME", h($wiki_container->get_name()), gettext("You are going to edit the wiki '<b>%NAME</b>'.")));
         $content->setVariable("LABEL_CREATE", gettext("Save changes"));
         $pagetitle = gettext("Preferences");
         if (empty($values)) {
             $values = array();
             $values["name"] = $wiki_container->get_name();
             $values["dsc"] = $wiki_container->get_attribute(OBJ_DESC);
             $values["wiki_startpage"] = $wiki_container->get_attribute("OBJ_WIKI_STARTPAGE");
             $values["access"] = $wiki_container->get_attribute(KOALA_ACCESS);
         }
         $breadcrumbheader = gettext("Preferences");
         $content->setVariable("OPTION_WIKI_GLOSSARY", gettext("Glossary"));
         $wiki_entries = $wiki_container->get_inventory(CLASS_DOCUMENT);
         $wiki_entries_sorted = array();
         foreach ($wiki_entries as $wiki_entry) {
             if ($wiki_entry->get_attribute(DOC_MIME_TYPE) === "text/wiki") {
                 $wiki_entries_sorted[] = str_replace(".wiki", "", $wiki_entry->get_name());
             }
         }
         sort($wiki_entries_sorted);
         $startpageFound = false;
         foreach ($wiki_entries_sorted as $wiki_entry) {
             $content->setCurrentBlock("BLOCK_WIKI_STARTPAGE_OPTION");
             $content->setVariable("OPTION_WIKI_STARTPAGE", $wiki_entry);
             if ($values["wiki_startpage"] == $wiki_entry) {
开发者ID:rolwi,项目名称:koala,代码行数:67,代码来源:Editwiki.class.php

示例3: execute

 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //CODE FOR ALL COMMANDS OF THIS PAKAGE END
     $user = \lms_steam::get_current_user();
     // Disable caching
     // TODO: Work on cache handling. An enabled cache leads to bugs
     // if used with the wiki.
     \CacheSettings::disable_caching();
     if (!($wiki_container = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id))) {
         include "bad_link.php";
         exit;
     }
     if (!$wiki_container instanceof \steam_container) {
         $wiki_doc = $wiki_container;
         $wiki_container = $wiki_doc->get_environment();
         if ($wiki_doc->get_attribute(DOC_MIME_TYPE) != "text/wiki") {
             include "bad_link.php";
             exit;
         }
     }
     //CODE FOR ALL COMMANDS OF THIS PAKAGE END
     $version_doc = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params[1]);
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $problems = "";
         try {
             $new_content = $version_doc->get_content();
             $wiki_doc->set_content($new_content);
         } catch (Exception $ex) {
             $problems = $ex->get_message();
         }
         if (empty($problems)) {
             $_SESSION["confirmation"] = str_replace("%VERSION", $version_doc->get_version(), gettext("Version %VERSION recovered."));
             header("Location: " . PATH_URL . "wiki/viewentry/" . $wiki_doc->get_id() . "/");
             exit;
         } else {
             $frameResponseObject->setProblemDescription($problems);
             //$portal->set_problem_description( $problems, $hints );
         }
     }
     $backlink = PATH_URL . "wiki/viewentry/" . $wiki_doc->get_id() . "/";
     $content = \Wiki::getInstance()->loadTemplate("wiki_recover_version.template.html");
     //$content = new HTML_TEMPLATE_IT();
     //$content->loadTemplateFile( PATH_TEMPLATES . "wiki_recover_version.template.html" );
     $content->setVariable("BACK_LINK", $backlink);
     $content->setVariable("INFO_TEXT", gettext("A new version will be created from the one you are recovering. The actual version will not be lost. Is that what you want?"));
     $content->setVariable("LABEL_OK", gettext("Yes, Recover version"));
     $content->setVariable("BACKLINK", "<a href=\"{$backlink}\">" . gettext("back") . "</a>");
     $rootlink = \lms_steam::get_link_to_root($wiki_container);
     WIKI_FULL_HEADLINE ? $headline = array($rootlink[0], $rootlink[1], array("link" => $rootlink[1]["link"] . "communication/", "name" => gettext("Communication")), array("name" => h($wiki_container->get_name()), "link" => PATH_URL . "wiki/" . $wiki_container->get_id() . "/"), array("link" => PATH_URL . "wiki/" . $wiki_doc->get_id() . "/", "name" => str_replace(".wiki", "", h($wiki_doc->get_name()))), array("link" => "", "name" => str_replace("%VERSION", $version_doc->get_version(), gettext("Recover version %VERSION")))) : ($headline = array(array("name" => h($wiki_container->get_name()), "link" => PATH_URL . "wiki/" . $wiki_container->get_id() . "/"), array("link" => PATH_URL . "wiki/" . $wiki_doc->get_id() . "/", "name" => str_replace(".wiki", "", h($wiki_doc->get_name()))), array("link" => "", "name" => str_replace("%VERSION", $version_doc->get_version(), gettext("Recover version %VERSION")))));
     $frameResponseObject->setHeadline($headline);
     $widget = new \Widgets\RawHtml();
     $widget->setHtml($content->get());
     $frameResponseObject->addWidget($widget);
     return $frameResponseObject;
     /*$portal->set_page_main(
     		$headline,
     		$content->get()
     		);
     		$portal->show_html();
     		*/
 }
开发者ID:rolwi,项目名称:koala,代码行数:61,代码来源:Recoverversion.class.php

示例4: execute

 public function execute(\FrameResponseObject $frameResponseObject)
 {
     if (!($env = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_GET["env"]))) {
         throw new \Exception("Environment unknown.");
     }
     $koala_env = \koala_object::get_koala_object($env);
     if (isset($_SERVER["HTTP_REFERER"])) {
         $http_referer = $_SERVER["HTTP_REFERER"];
     } else {
         $http_referer = "";
     }
     $backlink = empty($_POST["values"]["backlink"]) ? $http_referer : $_POST["values"]["backlink"];
     $max_file_size = parse_filesize(ini_get('upload_max_filesize'));
     $max_post_size = parse_filesize(ini_get('post_max_size'));
     if ($max_post_size > 0 && $max_post_size < $max_file_size) {
         $max_file_size = $max_post_size;
     }
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $values = isset($_POST["values"]) ? $_POST["values"] : array();
         $problems = "";
         $hints = "";
         if (empty($_FILES) || !empty($_FILES["material"]["error"]) && $_FILES["material"]["error"] > 0) {
             if (!empty($_FILES) && empty($_FILES["material"]["name"])) {
                 $problems = gettext("No file chosen.") . " ";
                 $hints = gettext("Please choose a local file to upload.") . " ";
             } else {
                 $problems = gettext("Could not upload document.") . " ";
                 $hints = str_replace(array("%SIZE", "%TIME"), array(readable_filesize($max_file_size), (string) ini_get('max_execution_time')), gettext("Maybe your document exceeded the allowed file size (max. %SIZE) or the upload might have taken too long (max. %TIME seconds).")) . " ";
             }
         }
         if (empty($problems)) {
             $content = file_get_contents($_FILES["material"]["tmp_name"]);
             /*
             ob_start();
             readfile( $_FILES["material"]["tmp_name"] );
             $content = ob_get_contents();
             ob_end_clean();
             */
             if (defined("LOG_DEBUGLOG")) {
                 $time1 = microtime(TRUE);
                 \logging::write_log(LOG_DEBUGLOG, "upload" . " \t" . $GLOBALS["STEAM"]->get_login_user_name() . " \t" . $_FILES["material"]["name"] . " \t" . filesize($_FILES["material"]["tmp_name"]) . " Bytes \t... ");
             }
             $filename = str_replace(array("\\", "'"), array("", ""), $_FILES["material"]["name"]);
             $new_material = \steam_factory::create_document($GLOBALS["STEAM"]->get_id(), $filename, $content, $_FILES["material"]["type"], FALSE);
             if (defined("LOG_DEBUGLOG")) {
                 \logging::append_log(LOG_DEBUGLOG, " \t" . round((microtime(TRUE) - $time1) * 1000) . " ms");
             }
             //  Disabled for Testing issues
             // upload($new_material->get_content_id(), $content);
             if (isset($values["dsc"])) {
                 $new_material->set_attribute("OBJ_DESC", $values["dsc"]);
             }
             $new_material->move($env);
             $_SESSION["confirmation"] = str_replace("%DOCUMENT", h($filename), gettext("'%DOCUMENT' has been uploaded."));
             header("Location: " . $backlink);
             exit;
         } else {
             $frameResponseObject->setProblemDescription($problems);
             $frameResponseObject->setProblemSolution($hints);
             //$portal->set_problem_description( $problems, $hints );
         }
     }
     $content = \Wiki::getInstance()->loadTemplate("upload.template.html");
     //$content = new HTML_TEMPLATE_IT( PATH_TEMPLATES );
     //$content->loadTemplateFile( "upload.template.html" );
     $content->setVariable("LABEL_UPLOAD", gettext("Upload"));
     $content->setVariable("LABEL_FILE", gettext("Local file"));
     $content->setVariable("LABEL_DSC", gettext("Description"));
     $content->setVariable("BACKLINK", "<a href=\"{$backlink}\">" . gettext("back") . "</a>");
     $content->setVariable("BACK_LINK", $backlink);
     $content->setVariable("FORM_ACTION", PATH_URL . "wiki/upload/" . (isset($_GET["env"]) ? "?env=" . $_GET["env"] : ""));
     if ($max_file_size > 0) {
         $content->setVariable("MAX_FILE_SIZE_INPUT", "<input type='hidden' name='MAX_FILE_SIZE' value='" . (string) $max_file_size . "'/>");
         $content->setVariable("MAX_FILE_SIZE_INFO", "<br />" . str_replace("%SIZE", readable_filesize($max_file_size), gettext("The maximum allowed file size is %SIZE.")));
     }
     $link_path = $koala_env->get_link_path();
     if (!is_array($link_path)) {
         $link_path = array();
     }
     $link_path[] = array("name" => gettext("Upload document"));
     if (!WIKI_FULL_HEADLINE) {
         $tmp_array = array();
         $elem_last = array_pop($link_path);
         $elem_first = array_pop($link_path);
         $tmp_array[] = $elem_first;
         $tmp_array[] = $elem_last;
         $link_path = $tmp_array;
     }
     //$portal->set_page_main( $link_path, $content->get() );
     //$portal->set_page_main( str_replace( "%ENV", $env->get_name(), gettext( "New upload in '%ENV'" ) ), $content->get() );
     //$portal->set_page_title( gettext( "Upload document" ) );
     //$portal->show_html();
     $frameResponseObject->setHeadline($link_path);
     $widget = new \Widgets\RawHtml();
     $widget->setHtml($content->get());
     $frameResponseObject->addWidget($widget);
     return $frameResponseObject;
 }
开发者ID:rolwi,项目名称:koala,代码行数:98,代码来源:Upload.class.php

示例5: frameResponse


//.........这里部分代码省略.........
             $type = "text/plain";
         }
         if ($_POST["kind"] == 0) {
             $container = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $TCR->get_path() . "/theses");
         } else {
             if ($_POST["kind"] == 1) {
                 $container = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $TCR->get_path() . "/reviews");
             } else {
                 $container = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $TCR->get_path() . "/responses");
             }
         }
         $title = $_POST["title"];
         $desc = $_POST["desc"];
         if (empty($problems)) {
             $new_element = \steam_factory::create_document($GLOBALS["STEAM"]->get_id(), $title, $content, $type, $container, $desc);
             if ($_POST["kind"] == 0) {
                 $new_element->set_attribute("TCR_ROUND", $_POST["round"]);
                 $new_element->set_attribute("TCR_REVIEWS", array());
                 $new_element->set_attribute("TCR_RELEASED", 0);
             } else {
                 if ($_POST["kind"] == 1) {
                     $new_element->set_attribute("TCR_RELEASED", 0);
                     $correspondingThesis = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_POST["elementID"]);
                     $critics_thesis = $correspondingThesis->get_attribute("TCR_REVIEWS");
                     $critics_thesis[$user->get_id()] = $new_element->get_id();
                     $correspondingThesis->set_attribute("TCR_REVIEWS", $critics_thesis);
                 } else {
                     $new_element->set_attribute("TCR_RELEASED", 0);
                     $correspondingReview = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_POST["elementID"]);
                     $correspondingReview->set_attribute("TCR_RESPONSE", $new_element->get_id());
                 }
             }
         } else {
             $frameResponseObject->setProblemDescription($problems);
             $frameResponseObject->setProblemSolution($hints);
         }
     }
     // display actionbar
     $actionbar = new \Widgets\Actionbar();
     $admins = $TCR->get_attribute("TCR_ADMINS");
     if (in_array($user->get_id(), $admins)) {
         $actions = array(array("name" => "Konfiguration", "link" => $TCRExtension->getExtensionUrl() . "configuration/" . $this->id), array("name" => "Private Dokumente", "link" => $TCRExtension->getExtensionUrl() . "privateDocuments/" . $this->id), array("name" => "Übersicht", "link" => $TCRExtension->getExtensionUrl() . "Index/" . $this->id), array("name" => "Alle Dokumente", "link" => $TCRExtension->getExtensionUrl() . "documents/" . $this->id));
     } else {
         $actions = array(array("name" => "Private Dokumente", "link" => $TCRExtension->getExtensionUrl() . "privateDocuments/" . $this->id), array("name" => "Übersicht", "link" => $TCRExtension->getExtensionUrl() . "Index/" . $this->id), array("name" => "Alle Dokumente", "link" => $TCRExtension->getExtensionUrl() . "documents/" . $this->id));
     }
     $actionbar->setActions($actions);
     $frameResponseObject->addWidget($actionbar);
     $group = $TCR->get_attribute("TCR_GROUP");
     if ($group->get_name() == "learners") {
         $parent = $group->get_parent_group();
         $courseOrGroup = "Kurs: " . $parent->get_attribute("OBJ_DESC") . " (" . $parent->get_name() . ")";
         $courseOrGroupUrl = PATH_URL . "semester/" . $parent->get_id();
     } else {
         $courseOrGroup = "Gruppe: " . $group->get_name();
         $courseOrGroupUrl = PATH_URL . "groups/" . $group->get_id();
     }
     $content = $TCRExtension->loadTemplate("tcr_privatedocuments.template.html");
     // display a message if current user is not a user of this tcr
     $members = $TCR->get_attribute("TCR_USERS");
     if (!in_array($user->get_id(), $members)) {
         $content->setCurrentBlock("BLOCK_DOCUMENTS_TABLE");
         $content->setVariable("DISPLAY_TABLE", "none");
         $content->setVariable("NOT_USER", "Sie sind nicht als Teilnehmer dieses Thesen-Kritik-Replik-Verfahrens eingetragen. Wenden Sie sich an einen Administrator.");
         $content->parse("BLOCK_DOCUMENTS_TABLE");
         $rawWidget = new \Widgets\RawHtml();
         $rawWidget->setHtml($content->get());
开发者ID:rolwi,项目名称:koala,代码行数:67,代码来源:PrivateDocuments.class.php

示例6: execute

 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //$portal = \lms_portal::get_instance();
     //$portal->initialize( GUEST_NOT_ALLOWED );
     //$portal->set_page_title( gettext( "Buddy Icon" ) );
     $user = \lms_steam::get_current_user();
     $confirmText = "";
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $problem = "";
         $hint = "";
         if (isset($_POST["action"]) && $_POST["action"] == "deleteicon") {
             // need to set OBJ_ICON to "0" and then to icons module to avoid weird
             // effects in icon handling (server side fix done but not testedyet)
             $old_icon = $user->get_attribute("OBJ_ICON");
             $user->set_acquire_attribute("OBJ_ICON", 0);
             $user->set_attribute("OBJ_ICON", 0);
             // set the default user icon by acquiring OBJ_ICON from icons module
             $user->set_acquire_attribute("OBJ_ICON", $GLOBALS["STEAM"]->get_module("icons"));
             // delete previous user icon object
             if ($old_icon instanceof steam_document) {
                 if ($old_icon->get_path() != "/images/doctypes/user_unknown.jpg" && $old_icon->check_access_write($user)) {
                     $this->clean_iconcache($old_icon);
                     $old_icon->delete();
                 }
             }
             $confirmText = gettext("Your profile icon has been deleted.");
             $this->clean_usericoncache($user);
         } else {
             // upload new icon
             if (count($_FILES) == 0) {
                 $problem = gettext("No image specified.") . " ";
                 $hint = gettext("Please choose an image on your local disk to upload.") . " ";
             }
             if (strpos($_FILES["icon"]["type"], "image") === FALSE) {
                 $problem .= gettext("File is not an image.") . " ";
                 $hint .= gettext("The icon has to be an image file (JPG, GIF or PNG).");
             }
             if ((int) $_FILES["icon"]["size"] > 256000) {
                 $problem .= gettext("File is larger than 250 KByte.");
                 $hint .= gettext("It is only allowed to upload profile icons with file size smaller than 250 KByte.");
             }
             if (empty($problem)) {
                 $user->set_acquire_attribute("OBJ_ICON", 0);
                 $user->delete_value("OBJ_ICON");
                 $old_icon = $user->get_attribute("OBJ_ICON");
                 ob_start();
                 readfile($_FILES["icon"]["tmp_name"]);
                 $content = ob_get_contents();
                 ob_end_clean();
                 $filename = str_replace(array("\\", "'"), array("", ""), $_FILES["icon"]["name"]);
                 if ($old_icon instanceof steam_document && $old_icon->check_access_write($user)) {
                     $new_icon = $old_icon;
                     $new_icon->set_attribute("OBJ_NAME", $filename);
                     $new_icon->set_content($content);
                     $new_icon->set_attribute("DOC_MIME_TYPE", $_FILES["icon"]["type"]);
                 } else {
                     $new_icon = \steam_factory::create_document($GLOBALS["STEAM"]->get_id(), $filename, $content, $_FILES["icon"]["type"], FALSE);
                     $new_icon->set_attribute("OBJ_TYPE", "document_icon_usericon");
                 }
                 $user->set_attribute("OBJ_ICON", $new_icon);
                 $all_user = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "sTeam");
                 $new_icon->set_read_access($all_user);
                 $GLOBALS["STEAM"]->buffer_flush();
                 // clean cache-related data
                 $this->clean_usericoncache($user);
                 $confirmText = gettext("Your profile icon has been changed.");
             } else {
                 $frameResponseObject->setProblemDescription($problem);
             }
         }
     }
     $content = \Profile::getInstance()->loadTemplate("profile_icon.template.html");
     //$content = new \HTML_TEMPLATE_IT();
     //$content->loadTemplateFile( PATH_TEMPLATES . "profile_icon.template.html" );
     //$content->setVariable( "INFO_TEXT", gettext( "Your buddy icon is what we use to represent you when you're in koaLA." ) );
     if (PLATFORM_ID == "bid") {
         $content->setVariable("INFO_TEXT", "Hier können Sie ein Benutzerbild hinterlegen. Dieses wird beispielsweise an Ihren Dokumenten und Forenbeiträgen zusammen mit Ihrem Namen angezeigt.");
     } else {
         $content->setVariable("INFO_TEXT", "Das Benutzerbild wird Sie in " . PLATFORM_NAME . " repräsentieren");
     }
     $content->setVariable("WINDOW_CONFIRM_TEXT", gettext("Are you sure you want to delete your current buddy icon?"));
     $content->setVariable("LABEL_DELETE", gettext("DELETE"));
     $user->delete_value("OBJ_ICON");
     $icon = $user->get_attribute("OBJ_ICON");
     if ($icon instanceof \steam_object) {
         $icon_id = $icon->get_id();
         // if user icon is acquired (= default icon) hide the delete button
         if (is_object($user->get_acquire_attribute("OBJ_ICON"))) {
             $content->setVariable("HIDE_BUTTON", "style='display:none;'");
         }
     } else {
         $icon_id = 0;
         $content->setVariable("HIDE_BUTTON", "style='display:none;'");
     }
     // use it in 140x185 standard thumb size to optimize sharing of icon cache data
     $icon_link = $icon_id == 0 ? PATH_URL . "styles/standard/images/anonymous.jpg" : PATH_URL . "download/image/" . $icon_id . "/140/185";
     $content->setVariable("USER_IMAGE", $icon_link);
     $content->setVariable("LABEL_YOUR_BUDDY_ICON", gettext("This is your buddy icon at the moment."));
     $content->setVariable("LABEL_REPLACE", gettext("Replace with an image"));
     $content->setVariable("LABEL_UPLOAD_INFO", gettext("The uploaded file has to be an image file (JPG, GIF or PNG), should have the dimensions of 140 x 185 pixels and <b>may not be larger than 250 KByte</b>. "));
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Image.class.php

示例7: execute

 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //DEFINITION OF IGNORED USERS AND GROUPS
     $ignoredUser = array(0 => "postman", 1 => "root", 2 => "guest");
     $ignoredGroups = array(0 => "sTeam", 1 => "admin");
     $steam = $GLOBALS["STEAM"];
     $action = isset($_POST["action"]) ? $_POST["action"] : "";
     $searchString = isset($_POST["searchString"]) ? $_POST["searchString"] : "";
     $searchType = isset($_POST["searchType"]) ? $_POST["searchType"] : "searchUser";
     $steamUser = \lms_steam::get_current_user();
     $searchResult = array();
     $min_search_string_count = 4;
     if ($action != "") {
         $searchString = trim($searchString);
         if (strlen($searchString) < $min_search_string_count) {
             //$frameResponseObject->setProblemDescription(gettext("Search string too short"));
             $frameResponseObject->setProblemDescription("Länge der Suchanfrage zu klein! Eine Suchanfrage muss aus mindestens 4 Zeichen bestehen.");
         } else {
             /* prepare search string */
             $modSearchString = $searchString;
             if ($modSearchString[0] != "%") {
                 $modSearchString = "%" . $modSearchString;
             }
             if ($modSearchString[strlen($modSearchString) - 1] != "%") {
                 $modSearchString = $modSearchString . "%";
             }
             $searchModule = $steam->get_module("searching");
             $searchobject = new \searching($searchModule);
             $search = new \search_define();
             if ($searchType == "searchUser") {
                 $search->extendAttr("OBJ_NAME", \search_define::like($modSearchString));
                 $resultItems = $searchobject->search($search, CLASS_USER);
                 foreach ($resultItems as $r) {
                     $id = $r->get_id();
                     $resultItemName[$id] = $r->get_name(1);
                 }
             } elseif ($searchType == "searchGroup") {
                 $search->extendAttr("GROUP_NAME", \search_define::like($modSearchString));
                 $resultItems = $searchobject->search($search, CLASS_GROUP);
                 foreach ($resultItems as $r) {
                     $id = $r->get_id();
                     $resultItemName[$id] = $r->get_groupname(1);
                 }
             } elseif ($searchType == "searchUserFullname") {
                 $cache = get_cache_function($steamUser->get_name(), 60);
                 $resultUser = $cache->call("lms_steam::search_user", $searchString, "name");
                 $resultItems = array();
                 for ($i = 0; $i < count($resultUser); $i++) {
                     $resultItems[$i] = \steam_factory::get_object($steam->get_id(), $resultUser[$i]["OBJ_ID"]);
                 }
                 foreach ($resultItems as $r) {
                     $id = $r->get_id();
                     $resultItemName[$id] = $r->get_name();
                 }
             }
             if ($searchType != "searchUserFullname") {
                 $result = $steam->buffer_flush();
             } else {
                 $result = array();
                 $counter = 0;
                 foreach ($resultItems as $r) {
                     $result[$r->get_name()] = $r->get_id();
                     $counter++;
                 }
             }
             $helper = array();
             foreach ($resultItems as $r) {
                 $id = $r->get_id();
                 if ($r instanceof \steam_user) {
                     $helper[$r->get_name()] = $id;
                 } else {
                     $helper[$r->get_groupname()] = $id;
                 }
                 $resultItemName[$id] = $result[$resultItemName[$id]];
                 $searchResult[] = $resultItemName[$id];
             }
         }
     }
     // sort favourites
     natcasesort($searchResult);
     $content = \Favorite::getInstance()->loadTemplate("fav_search.html");
     //$content->setVariable("TITLE", gettext("Search for favorites"));
     $content->setVariable("TITLE", "Favoritensuche");
     //$content->setVariable("SEARCH",gettext("Search"));
     $content->setVariable("SEARCH", "Suche");
     //$content->setVariable("BUTTON_LABEL", gettext("Search"));
     $content->setVariable("BUTTON_LABEL", "Suchen");
     //$content->setVariable("GROUPS",gettext("Groups"));
     //$content->setVariable("USER_LOGIN",gettext("User (login)"));
     //$content->setVariable("USER_FULLNAME", gettext("User (fullname)"));
     $content->setVariable("GROUPS", "Gruppen");
     $content->setVariable("USER_LOGIN", "Benutzer (Login)");
     $content->setVariable("USER_FULLNAME", "Benutzer (Namen)");
     if ($action != "") {
         //$content->setVariable("SEARCH_RESULTS", gettext("Search results"));
         $loopCount = 0;
         if ($searchType == "searchUser" || $searchType == "searchUserFullname") {
             $category = "user";
         } else {
             $category = "group";
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Search.class.php

示例8: frameResponse

 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $rawHtml = new \Widgets\RawHtml();
     $errorCode = isset($this->params[0]) ? $this->params[0] : 0;
     $errorId = isset($this->params[1]) ? $this->params[1] : 0;
     try {
         switch ($errorCode) {
             case E_AJAX_ERROR:
             case E_JS_ERROR:
                 $frameResponseObject->setTitle("Error");
                 $frameResponseObject->setHeadline("Das hätte nicht passieren sollen.");
                 $frameResponseObject->setProblemDescription("Es ist ein undefinierter Fehler aufgetreten. Das Problem ist protokolliert und es wird bald behoben.");
                 $errorTitle = isset($_COOKIE["title"]) ? $_COOKIE["title"] : "";
                 $errorDescription = isset($_COOKIE["description"]) ? $_COOKIE["description"] : "";
                 $errorLocation = isset($_COOKIE["location"]) ? $_COOKIE["location"] : "";
                 $errorParams = isset($_COOKIE["params"]) ? $_COOKIE["params"] : "";
                 $subject = PLATFORM_NAME . " Error AJAX/JS Handling";
                 mail(ERROR_MAIL_RECEIVER, '=?UTF-8?B?' . base64_encode($subject) . '?=', $errorTitle . "\n" . $errorDescription, null, '-f' . ERROR_MAIL_SENDER);
                 setcookie("title", "", -1);
                 setcookie("description", "", -1);
                 setcookie("location", "", -1);
                 setcookie("params", "", -1);
                 break;
             case E_USER_RIGHTS:
                 $frameResponseObject->setTitle(gettext("No Access"));
                 $rawHtml->setHtml(gettext("No sufficient rights for this object"));
                 $frameResponseObject->setProblemDescription(gettext("You have not the required rights to execute this action. Please consult the owner of the object for further information.") . "<br /><a href=\"" . $_SERVER["HTTP_REFERER"] . "\">" . gettext("back") . "</a>");
                 break;
             case E_USER_NO_NETWORKINGPROFILE:
                 $frameResponseObject->setTitle(gettext("User Profile not initialized"));
                 $rawHtml->setHtml(gettext("User Profile not initialized"));
                 $frameResponseObject->setProblemDescription(gettext("This user never logged in using the koaLA frontend. Therefore the profile is not initilized yet.<br />The profile will be displayed if the user has used the koaLA frontend at least once.") . "<br /><a href=\"" . $_SERVER["HTTP_REFERER"] . "\">" . gettext("back") . "</a>");
                 break;
             case E_CONNECTION:
                 switch (TRUE) {
                     case defined("MAINTAINANCE") && MAINTAINANCE && defined("MAINTAINANCE_MESSAGE") && MAINTAINANCE_MESSAGE && MAINTAINANCE_MESSAGE != "":
                         $frameResponseObject->setTitle(gettext("Maintainance"));
                         $rawHtml->setHtml(gettext("Maintainance"));
                         $frameResponseObject->setProblemDescription(MAINTAINANCE_MESSAGE . "<br /><a href=\"" . PATH_URL . "\">" . gettext("To the start page.") . "</a>");
                         break;
                     case defined("BACKUP_TIME_START") && defined("BACKUP_TIME_END") && BACKUP_TIME_START && BACKUP_TIME_END && BACKUP_TIME_START <= date("G") && date("G") <= BACKUP_TIME_END:
                         $frameResponseObject->setTitle(gettext("Backup"));
                         $rawHtml->setHtml(gettext("Backup"));
                         $frameResponseObject->setProblemDescription(str_replace("%START", BACKUP_TIME_START, str_replace("%END", BACKUP_TIME_END, gettext("The koaLA System is being backuped. The backup process approximately runs from %START to %END each day.") . "<br />" . gettext("Please try again later."))) . "<br /><a href=\"" . PATH_URL . "\">" . gettext("To the start page.") . "</a>");
                         break;
                     default:
                         $frameResponseObject->setTitle(gettext("Unable to process request"));
                         $rawHtml->setHtml(gettext("Unable to process request"));
                         $frameResponseObject->setProblemDescription(gettext("system is not available at the moment. We are working on the problem. Please try again later.") . "</a> " . "<br /><a href=\"" . PATH_URL . "\">" . gettext("To the start page."));
                 }
                 break;
             case E_CONFIGURATION:
                 $frameResponseObject->setTitle(gettext("Error in koala configuration"));
                 $rawHtml->setHtml(gettext("Error in koala configuration"));
                 $frameResponseObject->setProblemDescription(str_replace("%MAIL", "<a href=\"mailto:" . SUPPORT_EMAIL . "?subject=" . PLATFORM_NAME . "%20Configuration%20Error%20" . $errorId . "%20&body=Configuration error: Refer to the " . PLATFORM_NAME . " error log to get more details." . "\">" . gettext("Mail an error description") . "</a>", gettext("There is an error in the koala configuration. %MAIL.")) . "<br /><a href=\"" . PATH_URL . "\">" . gettext("To the start page.") . "</a>");
                 break;
             case E_SOAP_SERVICE_ERROR:
             case E_SOAP_INVALID_PASSWORD:
             case E_SOAP_INVALID_INPUT:
             case E_SOAP_INVALID_RESPONSE_DATA:
                 $frameResponseObject->setTitle(gettext("SOAP Error"));
                 $rawHtml->setHtml(gettext("Communication error"));
                 $frameResponseObject->setProblemDescription(str_replace("%MAIL", "<a href=\"mailto:" . SUPPORT_EMAIL . "?subject=" . PLATFORM_NAME . "%20Configuration%20Error%20" . $errorId . "%20&body=Communication error: Refer to the " . PLATFORM_NAME . " error log to get more details.\r\n" . rawurlencode("\r\nReferer: " . (!empty($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "Direct call") . "\n") . "\"/>" . gettext("Mail an error description") . "</a>", gettext(" An error occured while communicating with the PAUL system. Please help the koaLA support fixing this issue by providing some information e.g. how to produce this error. Please keep in mind that it may be a temporary problem, so try again later.") . "<br />" . "%MAIL") . "<br /><br /><a href=\"" . PATH_URL . "\">" . gettext("To the start page.") . "</a>");
                 break;
             default:
                 if (isset($_SESSION["ERROR_ID"]) && $errorId == $_SESSION["ERROR_ID"]) {
                     if (isset($_SESSION["ERROR_REFERER"]) && !empty($_SESSION["ERROR_REFERER"])) {
                         $referer = $_SESSION["ERROR_REFERER"];
                     } else {
                         if (isset($_SERVER["HTTP_REFERER"]) && !empty($_SERVER["HTTP_REFERER"])) {
                             $referer = $_SERVER["HTTP_REFERER"];
                         } else {
                             $referer = "Direct call";
                         }
                     }
                     $frameResponseObject->setTitle("Error");
                     $frameResponseObject->setHeadline(gettext("An error occured."));
                     $frameResponseObject->setProblemDescription(str_replace("%MAIL", "<a href=\"mailto:" . SUPPORT_EMAIL . "?subject=" . PLATFORM_NAME . "%20Error%20" . $errorId . "&body=" . rawurlencode("\n\nReferer: " . $referer . "\n") . "\">" . gettext("Mail an error description") . "</a>", gettext("An unspecified error occured. Please help fixing this issue by sending a detailed error description: %MAIL.")) . "<br /><a href=\"" . PATH_URL . "\">" . gettext("To the start page.") . "</a>");
                     $error_text = "";
                     if (defined("DEVELOPMENT_MODE") && DEVELOPMENT_MODE) {
                         if (isset($_SESSION["ERROR_REFERER"])) {
                             $error_referer = $_SESSION["ERROR_REFERER"];
                         } else {
                             $error_referer = "";
                         }
                         if (isset($_SESSION["ERROR_TEXT"])) {
                             $error_text = $_SESSION["ERROR_TEXT"];
                         } else {
                             $error_text = "";
                         }
                         $error_text = htmlentities($error_text);
                         $error_text = "<h1 style=\"display:inline\">Entwickler Modus</h1> <a href=\"" . $error_referer . "\">Seite erneut laden</a><br><div style=\"background-color:#ccc;border:1px solid #ddd;overflow-x:auto\"><pre>" . $error_text . "</pre></div>";
                     }
                     $rawHtml->setHtml($error_text);
                 } else {
                     $frameResponseObject->setTitle("Error");
                     $frameResponseObject->setProblemDescription("Probleme bei der Fehlerbehandlung. <br> Mögliche Ursache: Es sind mehrer Fehler aufgetreten. Diese Seite bezieht sich auf ein veraltetes Problem.<br>Daher ist leider keine nähere Fehlerbeschreibung möglich.");
                 }
                 break;
         }
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Report.class.php

示例9: frameResponse

    public function frameResponse(\FrameResponseObject $frameResponseObject)
    {
        $rapidfeedback = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
        $RapidfeedbackExtension = \Rapidfeedback::getInstance();
        $survey = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->params[1]);
        $survey_object = new \Rapidfeedback\Model\Survey($rapidfeedback);
        $xml = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $survey->get_path() . "/survey.xml");
        $survey_object->parseXML($xml);
        $questions = $survey_object->getQuestions();
        $user = $GLOBALS["STEAM"]->get_current_steam_user();
        $RapidfeedbackExtension->addCSS();
        // check if current user is admin
        $staff = $rapidfeedback->get_attribute("RAPIDFEEDBACK_STAFF");
        $admin = 0;
        if ($staff instanceof \steam_group && $staff->is_member($user) || $staff instanceof \steam_user && $staff->get_id() == $user->get_id()) {
            $admin = 1;
        }
        // collect user input if view got submitted (and check for errors)
        $values = array();
        $errors = array();
        if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["submit_survey"])) {
            $questionCounter = 0;
            foreach ($questions as $question) {
                if ($question instanceof \Rapidfeedback\Model\TextQuestion | $question instanceof \Rapidfeedback\Model\TextareaQuestion) {
                    $value = $_POST["question" . $questionCounter];
                    if ($question->getRequired() == 1 && trim($value) == "") {
                        array_push($errors, $questionCounter);
                    } else {
                        if (trim($value) == "") {
                            $values[$questionCounter] = -1;
                        } else {
                            $values[$questionCounter] = trim($value);
                        }
                    }
                } else {
                    if ($question instanceof \Rapidfeedback\Model\SingleChoiceQuestion) {
                        if (!isset($_POST["question" . $questionCounter])) {
                            if ($question->getRequired() == 1) {
                                array_push($errors, $questionCounter);
                            } else {
                                $values[$questionCounter] = -1;
                            }
                        } else {
                            $values[$questionCounter] = $_POST["question" . $questionCounter];
                        }
                    } else {
                        if ($question instanceof \Rapidfeedback\Model\MultipleChoiceQuestion) {
                            $optionsCount = count($question->getOptions());
                            $results = array();
                            for ($count = 0; $count < $optionsCount; $count++) {
                                if (isset($_POST["question" . $questionCounter . "_" . $count])) {
                                    array_push($results, $count);
                                }
                            }
                            if ($question->getRequired() == 1 && empty($results)) {
                                array_push($errors, $questionCounter);
                            } else {
                                $values[$questionCounter] = $results;
                            }
                        } else {
                            if ($question instanceof \Rapidfeedback\Model\MatrixQuestion) {
                                $rowCount = count($question->getRows());
                                $results = array();
                                for ($count = 0; $count < $rowCount; $count++) {
                                    if (isset($_POST["question" . $questionCounter . "_" . $count])) {
                                        array_push($results, $_POST["question" . $questionCounter . "_" . $count]);
                                    }
                                }
                                if ($question->getRequired() == 1 && count($results) < $rowCount) {
                                    array_push($errors, $questionCounter);
                                    $values[$questionCounter] = $results;
                                } else {
                                    $values[$questionCounter] = $results;
                                }
                            }
                        }
                    }
                }
                $questionCounter++;
            }
            // if there are errors show error msg, else save answers
            if (!empty($errors)) {
                $problemdescription = "Erforderliche Fragen nicht beantwortet: ";
                foreach ($errors as $error) {
                    $problemdescription = $problemdescription . ($error + 1) . ", ";
                }
                $problemdescription = substr($problemdescription, 0, strlen($problemdescription) - 2);
                $frameResponseObject->setProblemDescription($problemdescription);
            } else {
                $participants = $survey->get_attribute("RAPIDFEEDBACK_PARTICIPANTS");
                $adminsAllowed = $rapidfeedback->get_attribute("RAPIDFEEDBACK_ADMIN_SURVEY");
                if (!in_array($user->get_id(), $participants) && ($admin == 1 && $adminsAllowed == 1) | $admin == 0) {
                    $resultCount = $survey->get_attribute("RAPIDFEEDBACK_RESULTS");
                    array_push($participants, $user->get_id());
                    $survey->set_attribute("RAPIDFEEDBACK_PARTICIPANTS", $participants);
                    $survey->set_attribute("RAPIDFEEDBACK_RESULTS", $resultCount + 1);
                    $resultContainer = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $survey->get_path() . "/results");
                    $resultObject = \steam_factory::create_document($GLOBALS["STEAM"]->get_id(), "results" . $user->get_id(), "", "text/plain", $resultContainer, "Results of user " . $user->get_id());
                    $questionCounter = 0;
                    foreach ($questions as $question) {
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:View.class.php

示例10: frameResponse

 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     if (isset($this->id)) {
         $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
         if ($object instanceof \steam_exit) {
             $object = $object->get_exit();
             $this->id = $object->get_id();
         }
     } else {
         $currentUser = $GLOBALS["STEAM"]->get_current_steam_user();
         $object = $currentUser->get_workroom();
         $this->id = $object->get_id();
     }
     if (!$object instanceof \steam_object) {
         \ExtensionMaster::getInstance()->send404Error();
         die;
     }
     $objectModel = \AbstractObjectModel::getObjectModel($object);
     if ($object && $object instanceof \steam_container) {
         $count = $object->count_inventory();
         if ($count > 150) {
             die("Es befinden sich {$count} Objekte im diesem Ordner. Das Laden ist nicht möglich.");
         }
         $objects = $object->get_inventory();
     } else {
         $objects = array();
     }
     $objectType = getObjectType($object);
     switch ($objectType) {
         case "document":
             header("location: " . PATH_URL . "explorer/ViewDocument/" . $this->id . "/");
             die;
             break;
         case "forum":
             header("location: " . PATH_URL . "forum/Index/" . $this->id . "/");
             die;
             break;
         case "referenceFolder":
             $exitObject = $object->get_exit();
             header("location: " . PATH_URL . "explorer/Index/" . $exitObject->get_id() . "/");
             die;
             break;
         case "referenceFile":
             $linkObject = $object->get_link_object();
             header("location: " . PATH_URL . "explorer/Index/" . $linkObject->get_id() . "/");
             die;
             break;
         case "user":
             header("location: " . PATH_URL . "user/Index/" . $object->get_name() . "/");
             die;
             break;
         case "group":
             \ExtensionMaster::getInstance()->send404Error();
             die;
             break;
         case "trashbin":
             \ExtensionMaster::getInstance()->send404Error();
             die;
             break;
         case "portal_old":
             $rawHtml = new \Widgets\RawHtml();
             //$rawHtml->setHtml("Dies ist ein \"altes\" Portal und kann nicht mehr angezeigt werden. Bitte umwandeln.");
             $frameResponseObject->addWidget($rawHtml);
             $frameResponseObject->setProblemDescription("Dies ist ein \"altes\" Portal und kann nicht mehr angezeigt werden.");
             $frameResponseObject->setProblemSolution("Bitte umwandeln.");
             return $frameResponseObject;
             break;
         case "gallery":
             header("location: " . PATH_URL . "gallery/Index/" . $this->id . "/");
             die;
             break;
         case "portal":
             header("location: " . PATH_URL . "portal/Index/" . $this->id . "/");
             die;
             break;
         case "portalColumn":
             \ExtensionMaster::getInstance()->send404Error();
             die;
             break;
         case "portalPortlet":
             \ExtensionMaster::getInstance()->send404Error();
             die;
             break;
         case "userHome":
             //ok
             break;
         case "groupWorkroom":
             //ok
             break;
         case "room":
             //ok
             break;
         case "container":
             //ok
             break;
         case "unknown":
             \ExtensionMaster::getInstance()->send404Error();
             die;
             break;
     }
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Index.class.php


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