<definitionname>com.woltlab.wcf.clipboardItem</definitionname>
<listclassname>wcf\data\user\UserList</listclassname>
</type>
+
+ <type>
+ <name>com.woltlab.wcf.collapsibleSidebar</name>
+ <definitionname>com.woltlab.wcf.collapsibleContent</definitionname>
+ </type>
</import>
</data>
\ No newline at end of file
<div id="main" class="layoutFluid{if $sidebarOrientation|isset && $sidebar|isset} sidebarOrientation{@$sidebarOrientation|ucfirst} clearfix{/if}">
<div>
{if $sidebar|isset}
- <aside class="sidebar">
+ <aside class="sidebar"{if $sidebarOrientation|isset && $sidebarOrientation == 'right'} data-is-open="{if $sidebarCollapsed}0{else}1{/if}" data-sidebar-name="{$sidebarName}"{/if}>
{@$sidebar}
</aside>
+
+ {if $sidebarOrientation|isset && $sidebarOrientation == 'right'}
+ <script type="text/javascript">
+ //<![CDATA[
+ $(function() {
+ new WCF.Collapsible.Sidebar();
+ });
+ //]]>
+ </script>
+ {/if}
{/if}
<section id="content" class="content clearfix">
<?php
namespace wcf\system\user\collapsible\content;
use wcf\data\object\type\ObjectTypeCache;
+use wcf\system\exception\SystemException;
use wcf\system\user\storage\UserStorageHandler;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
}
}
+ /**
+ * Returns true if given object is collapsed.
+ *
+ * @param string $objectType
+ * @param string $objectID
+ * @return boolean
+ */
+ public function isCollapsed($objectType, $objectID) {
+ $objectTypeID = $this->getObjectTypeID($objectType);
+ if ($objectTypeID === null) {
+ throw new SystemException("Unknown object type '".$objectType."' for definition 'com.woltlab.wcf.collapsibleContent'");
+ }
+
+ return in_array($objectID, $this->getCollapsedContent($objectTypeID));
+ }
+
/**
* Returns the object type id based upon specified object type name. Returns
* null, if object type is unknown.
* Marks content as collapsed.
*
* @param integer $objectTypeID
- * @param integer $objectID
+ * @param string $objectID
*/
public function markAsCollapsed($objectTypeID, $objectID) {
if (WCF::getUser()->userID) {
* Marks content as opened, thus removing the collapsed marking.
*
* @param integer $objectTypeID
- * @param integer $objectID
+ * @param string $objectID
*/
public function markAsOpened($objectTypeID, $objectID) {
if (WCF::getUser()->userID) {