本文整理汇总了PHP中School::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP School::getInstance方法的具体用法?PHP School::getInstance怎么用?PHP School::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类School
的用法示例。
在下文中一共展示了School::getInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
//icons
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
$popupMenu = new \Widgets\PopupMenu();
$items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Bild bearbeiten <img src=\"{$blankIcon}\">", "command" => "EditMessageImage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'last'}", "type" => "popup"))), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"));
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("150px");
$ajaxResponseObject->setStatus("ok");
$ajaxResponseObject->addWidget($popupMenu);
return $ajaxResponseObject;
}
示例2: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
//icons
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
$popupMenu = new \Widgets\PopupMenu();
$items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"));
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("150px");
$ajaxResponseObject->setStatus("ok");
$ajaxResponseObject->addWidget($popupMenu);
return $ajaxResponseObject;
}
示例3: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
//icons
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$trashIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/trash.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
// <img src=\"{$editIcon}\">
$popupMenu = new \Widgets\PopupMenu();
$items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTopic", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Kategorie einfügen <img src=\"{$blankIcon}\">", "command" => "CreateCategory", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'last'}", "type" => "popup"))), array("name" => "SEPARATOR"), array("name" => "Kopieren <img src=\"{$copyIcon}\">", "command" => "PortletCopy", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'{$this->user}'}", "type" => "popup"), array("name" => "Ausschneiden <img src=\"{$cutIcon}\">", "command" => "PortletCut", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'{$this->user}'}", "type" => "popup"), array("name" => "Referenzieren <img src=\"{$referIcon}\">", "command" => "PortletReference", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'{$this->user}'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "SEPARATOR"), array("name" => "Rechte <img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "Explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("150px");
$ajaxResponseObject->setStatus("ok");
$ajaxResponseObject->addWidget($popupMenu);
return $ajaxResponseObject;
}
示例4: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
$count = count($this->selection);
$explorerAssetUrl = \Explorer::getInstance()->getAssetUrl();
if (!in_array($this->id, $this->selection) || in_array($this->id, $this->selection) && $count == 1) {
$object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$env = $object->get_environment();
$inventory = $env->get_inventory();
foreach ($inventory as $key => $element) {
if ($element->get_id() == $this->id) {
$index = $key;
}
}
$popupMenu = new \Widgets\PopupMenu();
if ($object instanceof \steam_trashbin) {
$items = array(array("name" => "Papierkorb leeren", "command" => "EmptyTrashbin", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"));
} else {
if ($env instanceof \steam_trashbin) {
$items = array(array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('EmptyTrashbin', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0, getSelectionAsArray().length); return false;\">{$count} Objekte löschen<img src=\"\"></a>"), array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('Delete', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0, getSelectionAsArray().length); return false;\">{$count} Objekte wiederherstellen<img src=\"\"></a>"));
} else {
$copyIcon = $explorerAssetUrl . "icons/menu/copy.png";
$cutIcon = $explorerAssetUrl . "icons/menu/cut.png";
$referIcon = $explorerAssetUrl . "icons/menu/refer.png";
$trashIcon = $explorerAssetUrl . "icons/menu/trash.png";
$hideIcon = $explorerAssetUrl . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = $explorerAssetUrl . "icons/menu/up.png";
$downIcon = $explorerAssetUrl . "icons/menu/down.png";
$topIcon = $explorerAssetUrl . "icons/menu/top.png";
$bottomIcon = $explorerAssetUrl . "icons/menu/bottom.png";
$renameIcon = $explorerAssetUrl . "icons/menu/rename.png";
$editIcon = $explorerAssetUrl . "icons/menu/edit.png";
$propertiesIcon = $explorerAssetUrl . "icons/menu/properties.png";
$rightsIcon = $explorerAssetUrl . "icons/menu/rights.png";
$blankIcon = $explorerAssetUrl . "icons/menu/blank.png";
$items = array(array("name" => "Kopieren<img src=\"{$copyIcon}\">", "command" => "Copy", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Ausschneiden<img src=\"{$cutIcon}\">", "command" => "Cut", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Referenzieren<img src=\"{$referIcon}\">", "command" => "Reference", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Löschen<img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Darstellung<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("raw" => " <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'transparent'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/transparent.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'red'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/red.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'orange'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/orange.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'yellow'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/yellow.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'green'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/green.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'blue'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/blue.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'purple'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/purple.png\"></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'grey'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$explorerAssetUrl}icons/grey.png\"></a>"))), array("name" => "Umsortieren<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array($index != 0 ? array("name" => "Eins nach oben<img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'up'}") : "", $index < count($inventory) - 1 ? array("name" => "Eins nach unten<img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'down'}") : "", $index != 0 ? array("name" => "Ganz nach oben<img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'top'}") : "", $index < count($inventory) - 1 ? array("name" => "Ganz nach unten<img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'bottom'}") : "")), array("name" => "SEPARATOR"), array("raw" => "<a href=\"#\" onclick=\"event.stopPropagation(); removeAllDirectEditors();if (!jQuery('#{$this->id}_1').hasClass('directEditor')) { jQuery('#{$this->id}_1').addClass('directEditor').html(''); var obj = new Object; obj.id = '{$this->id}'; sendRequest('GetDirectEditor', obj, '{$this->id}_1', 'updater',null,null,'explorer'); } jQuery('.popupmenuwapper').parent().html('');jQuery('.open').removeClass('open'); return false;\">Umbenennen<img src=\"{$renameIcon}\"></a>"), $object instanceof \steam_container && $object->get_attribute("bid:presentation") === "index" ? array("name" => "Listenansicht<img src=\"{$blankIcon}\">", "link" => PATH_URL . "Explorer/Index/" . $this->id . "/?view=list") : "", $object instanceof \steam_document && strstr($object->get_attribute(DOC_MIME_TYPE), "text") ? array("name" => "Bearbeiten<img src=\"{$editIcon}\">", "link" => PATH_URL . "Explorer/EditDocument/" . $this->id . "/") : "", array("name" => "Eigenschaften...<img src=\"{$propertiesIcon}\">", "command" => "Properties", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"), array("name" => "Rechte...<img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
}
}
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("170px");
} else {
$copyIcon = $explorerAssetUrl . "icons/menu/copy.png";
$cutIcon = $explorerAssetUrl . "icons/menu/cut.png";
$referIcon = $explorerAssetUrl . "icons/menu/refer.png";
$trashIcon = $explorerAssetUrl . "icons/menu/trash.png";
$hideIcon = $explorerAssetUrl . "icons/menu/hide.png";
$blankIcon = $explorerAssetUrl . "icons/menu/blank.png";
$popupMenu = new \Widgets\PopupMenu();
$items = array(array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('EmptyTrashbin', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0, getSelectionAsArray().length); return false;\">{$count} Objekte löschen<img src=\"{$trashIcon}\"></a>"), array("raw" => "<a href=\"#\" onclick=\"sendMultiRequest('Delete', getParamsArray({}), getElementIdArray(''), 'updater', null, null, 'explorer', 'Lösche Objekte ...', 0, getSelectionAsArray().length); return false;\">{$count} Objekte wiederherstellen<img src=\"{$trashIcon}\"></a>"));
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("180px");
}
$ajaxResponseObject->setStatus("ok");
$ajaxResponseObject->addWidget($popupMenu);
return $ajaxResponseObject;
}
示例5: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
$path = $this->params["path"];
$forumId = $this->params["forum"];
if (isset($this->params["category"])) {
$categoryId = $this->params["category"];
$isOverview = false;
} else {
$categoryId = $this->id;
$isOverview = true;
}
$object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$objectId = $this->id;
$objectCreatorId = $object->get_creator()->get_id();
$popupMenu = new \Widgets\PopupMenu();
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$trashIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/trash.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
$replyIcon = "";
$deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
$steamUser = \lms_steam::get_current_user();
$steamUserId = $steamUser->get_id();
$forum = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $forumId);
$forumCreatorId = $forum->get_creator()->get_id();
$category = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $categoryId);
$categoryCreatorId = $category->get_creator()->get_id();
$category_allowed_write = $category->check_access_write($steamUser);
$category_allowed_annotate = $category->check_access_annotate($steamUser);
$category_allowed_read = $category->check_access_read($steamUser);
$isForumCreator = false;
$isTopicCreator = false;
//$isReplyEditable= $category->get_attribute("bid:forum:is_editable");
//if(trim($isReplyEditable) == "checked"){
// $isReplyEditable=true;
//} else{
// $isReplyEditable=false;
//}
$canAnnotate = $category_allowed_write || $category_allowed_annotate;
$canRead = $category_allowed_read;
$hasSanction = $category->check_access(SANCTION_SANCTION, $steamUser);
if ($forumCreatorId == $steamUserId) {
$isForumCreator = true;
$isTopicCreator = true;
$canAnnotate = true;
$canRead = true;
} elseif ($categoryCreatorId == $steamUserId) {
$isTopicCreator = true;
$canAnnotate = true;
$canRead = true;
} elseif ($hasSanction) {
$canAnnotate = true;
$canRead = true;
} elseif ($canAnnotate) {
$canRead = true;
}
$isEditable = $forum->get_attribute("bid:forum_is_editable");
//TODO: NEED REPLY_ICON
$items = array();
if ($categoryId == $this->id) {
if (!$isOverview) {
if ($canAnnotate) {
$items[] = array("name" => "Antworten<img src=\"{$replyIcon}\">", "command" => "NewReply", "namespace" => "forum", "params" => "{'id':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
}
}
if ($isTopicCreator) {
$items[] = array("name" => "Bearbeiten<img src=\"{$editIcon}\">", "command" => "EditTopic", "namespace" => "forum", "params" => "{'id':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
$items[] = array("name" => "Löschen<img src=\"{$trashIcon}\">", "command" => "DeleteTopic", "namespace" => "forum", "params" => "{'id':'{$this->id}','forum':'{$forumId}'}");
$items[] = array("name" => "Bild anfügen<img src=\"{$editIcon}\">", "command" => "EditMessageImage", "namespace" => "forum", "params" => "{'messageObjectId':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
}
} else {
if ($canAnnotate) {
$items[] = array("name" => "Antworten<img src=\"{$replyIcon}\">", "command" => "NewReply", "namespace" => "forum", "params" => "{'id':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
}
if ($steamUserId == $objectCreatorId || $isForumCreator) {
if ($isForumCreator || $isEditable) {
$items[] = array("name" => "Bearbeiten<img src=\"{$editIcon}\">", "command" => "EditReply", "namespace" => "forum", "params" => "{'id':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
$items[] = array("name" => "Löschen<img src=\"{$deleteIcon}\">", "command" => "DeleteReply", "namespace" => "forum", "params" => "{'id':'{$this->id}','forum':'{$forumId}'}");
}
$items[] = array("name" => "Bild anfügen<img src=\"{$editIcon}\">", "command" => "EditMessageImage", "namespace" => "forum", "params" => "{'messageObjectId':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
}
}
/*$count = count($this->selection);
if (!in_array($this->id, $this->selection) ||(in_array($this->id, $this->selection) && $count == 1)) {
$object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$env = $object->get_environment();
$inventory = $env->get_inventory();
//.........这里部分代码省略.........
示例6: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
$object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$env = $object->get_environment();
$inventory = $env->get_inventory();
foreach ($inventory as $key => $element) {
if ($element->get_id() == $this->id) {
$index = $key;
}
}
$popupMenu = new \Widgets\PopupMenu();
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$trashIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/trash.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
$items = array(array("name" => "Kopieren<img src=\"{$copyIcon}\">", "command" => "Copy", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Ausschneiden<img src=\"{$cutIcon}\">", "command" => "Cut", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Referenzieren<img src=\"{$referIcon}\">", "command" => "Reference", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Löschen<img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"), array("name" => "Umsortieren<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array($index != 0 ? array("name" => "Eins nach vorne<img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'up'}") : "", $index < count($inventory) - 1 ? array("name" => "Eins nach hinten<img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'down'}") : "", $index != 0 ? array("name" => "Ganz nach vorne<img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'top'}") : "", $index < count($inventory) - 1 ? array("name" => "Ganz nach hinten<img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'bottom'}") : "")), array("name" => "Eigenschaften...<img src=\"{$propertiesIcon}\">", "command" => "Properties", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
//array("name" => "Rechte...<img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
/*$count = count($this->selection);
if (!in_array($this->id, $this->selection) ||(in_array($this->id, $this->selection) && $count == 1)) {
$object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id);
$env = $object->get_environment();
$inventory = $env->get_inventory();
foreach ($inventory as $key => $element) {
if ($element->get_id() == $this->id) {
$index = $key;
}
}
$popupMenu = new \Widgets\PopupMenu();
if ($object instanceof \steam_trashbin) {
$items = array(array("name" => "Papierkorb leeren", "command" => "EmptyTrashbin", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"));
} else if ($env instanceof \steam_trashbin) {
$items = array(array("name" => "Wiederherstellen", "command" => "Restore", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'env':document.getElementById('environment').value}"));
} else {
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$trashIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/trash.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
$items = array(
array("name" => "Kopieren<img src=\"{$copyIcon}\">", "command" => "Copy", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"),
array("name" => "Ausschneiden<img src=\"{$cutIcon}\">", "command" => "Cut", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"),
array("name" => "Referenzieren<img src=\"{$referIcon}\">", "command" => "Reference", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"),
array("name" => "In den Papierkorb legen<img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"),
array("name" => "Darstellung<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array (
//array("name" => "<img src=\"{$hideIcon}\">Verstecken", "command" => "Hide", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}"),
array("raw" => " <a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'transparent'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/transparent.png\"></a>
<a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'red'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/red.png\"></a>
<a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'orange'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/orange.png\"></a>
<a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'yellow'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/yellow.png\"></a>
<a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'green'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/green.png\"></a>
<a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'blue'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/blue.png\"></a>
<a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'purple'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/purple.png\"></a>
<a href=\"#\" onclick=\"sendRequest('ChangeColorLabel', {'id':'{$this->id}', 'color':'grey'}, 'listviewer-overlay', 'updater', null, null, 'explorer'); return false;\"><img src=\"{$this->getExtension()->getAssetUrl()}icons/grey.png\"></a>"),
)),
array("name" => "Lesezeichen<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array (
(!\Bookmarks\Model\Bookmark::isBookmark($this->id)) ? array("name" => "Lesezeichen anlegen<img src=\"{$bookmarkIcon}\">", "command" => "AddBookmark", "namespace" => "bookmarks", "elementId" => "{$this->id}_BookmarkMarkerWrapper", "params" => "{'id':'{$this->id}'}") : "",
(!\Bookmarks\Model\Bookmark::isBookmark($this->id)) ? array("name" => "Schul-Lesezeichen anlegen<img src=\"{$schoolBookmarkIcon}\">", "command" => "AddBookmark", "namespace" => "school", "elementId" => "{$this->id}_SchoolBookmarkMarkerWrapper", "params" => "{'id':'{$this->id}'}") : ""
)),
array("name" => "Umsortieren<img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(
($index != 0) ? array("name" => "Eins nach oben<img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'up'}") : "",
($index < count($inventory)-1) ? array("name" => "Eins nach unten<img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'down'}") : "",
($index != 0) ? array("name" => "Ganz nach oben<img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'top'}") : "",
($index < count($inventory)-1) ? array("name" => "Ganz nach unten<img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "explorer", "params" => "{'id':'{$this->id}', 'direction':'bottom'}") : ""
)),
array("name" => "SEPARATOR"),
array("raw" => "<a href=\"#\" onclick=\"removeAllDirectEditors();if (!jQuery('#{$this->id}_1').hasClass('directEditor')) { jQuery('#{$this->id}_1').addClass('directEditor').html(''); var obj = new Object; obj.id = '{$this->id}'; sendRequest('GetDirectEditor', obj, '{$this->id}_1', 'updater'); }return false;\">Umbenennen<img src=\"{$renameIcon}\"></a>"),
(($object instanceof \steam_document) && (strstr($object->get_attribute(DOC_MIME_TYPE), "text"))) ? array("name" => "Bearbeiten<img src=\"{$editIcon}\">", "link" => PATH_URL . "Explorer/EditDocument/" . $this->id . "/") : "",
array("name" => "Eigenschaften...<img src=\"{$propertiesIcon}\">", "command" => "Properties", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"),
array("name" => "Rechte...<img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
}
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("170px");
} else {
//.........这里部分代码省略.........