From: Marcel Werk Date: Mon, 18 Apr 2016 09:48:21 +0000 (+0200) Subject: Added filter functions in box list X-Git-Tag: 3.0.0_Beta_1~1859 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db6a640f714f609db965da82a452d953e2c06bed;p=GitHub%2FWoltLab%2FWCF.git Added filter functions in box list --- diff --git a/wcfsetup/install/files/acp/templates/boxList.tpl b/wcfsetup/install/files/acp/templates/boxList.tpl index bd1a000887..11c2ac2ee2 100644 --- a/wcfsetup/install/files/acp/templates/boxList.tpl +++ b/wcfsetup/install/files/acp/templates/boxList.tpl @@ -25,19 +25,91 @@ {hascontent}
- {content}{pages print=true assign=pagesLinks controller="BoxList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}{/content} + {content} + {assign var='linkParameters' value=''} + {if $name}{capture append=linkParameters}&name={@$name|rawurlencode}{/capture}{/if} + {if $title}{capture append=linkParameters}&title={@$title|rawurlencode}{/capture}{/if} + {if $content}{capture append=linkParameters}&content={@$content|rawurlencode}{/capture}{/if} + {if $position}{capture append=linkParameters}&position={@$position}{/capture}{/if} + {if $boxType}{capture append=linkParameters}&boxType={@$boxType|rawurlencode}{/capture}{/if} + + {pages print=true assign=pagesLinks controller="BoxList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$linkParameters"} + {/content}
{/hascontent} +
+
+

{lang}wcf.global.filter{/lang}

+ +
+
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ + {event name='filterFields'} +
+ +
+ + {@SECURITY_TOKEN_INPUT_TAG} +
+
+
+ {if $objects|count}
- - - - + + + + {event name='columnHeads'} diff --git a/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php b/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php index e8fb0c7170..954737dced 100644 --- a/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/BoxListPage.class.php @@ -1,6 +1,9 @@ name = StringUtil::trim($_REQUEST['name']); + if (!empty($_REQUEST['title'])) $this->title = StringUtil::trim($_REQUEST['title']); + if (!empty($_REQUEST['content'])) $this->content = StringUtil::trim($_REQUEST['content']); + if (!empty($_REQUEST['boxType'])) $this->boxType = $_REQUEST['boxType']; + if (!empty($_REQUEST['position'])) $this->position = $_REQUEST['position']; + } + /** * @inheritdoc */ @@ -47,5 +93,40 @@ class BoxListPage extends SortablePage { // hide menu boxes $this->objectList->getConditionBuilder()->add('box.boxType <> ?', array('menu')); + + if (!empty($this->name)) { + $this->objectList->getConditionBuilder()->add('box.name LIKE ?', array('%'.$this->name.'%')); + } + if (!empty($this->title)) { + $this->objectList->getConditionBuilder()->add('box.boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_content WHERE title LIKE ?)', array('%'.$this->title.'%')); + } + if (!empty($this->content)) { + $this->objectList->getConditionBuilder()->add('box.boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_content WHERE content LIKE ?)', array('%'.$this->content.'%')); + } + if (!empty($this->position)) { + $this->objectList->getConditionBuilder()->add('box.position = ?', array($this->position)); + } + if ($this->boxType == 'static') { + $this->objectList->getConditionBuilder()->add('box.boxType IN (?, ?, ?)', array('text', 'html', 'tpl')); + } + else if ($this->boxType == 'system') { + $this->objectList->getConditionBuilder()->add('box.boxType IN (?)', array('system')); + } + } + + /** + * @inheritdoc + */ + public function assignVariables() { + parent::assignVariables(); + + WCF::getTPL()->assign(array( + 'name' => $this->name, + 'title' => $this->title, + 'content' => $this->content, + 'boxType' => $this->boxType, + 'position' => $this->position, + 'availablePositions' => Box::$availablePositions + )); } }
{lang}wcf.global.objectID{/lang}{lang}wcf.global.name{/lang}{lang}wcf.acp.box.boxType{/lang}{lang}wcf.acp.box.position{/lang}{lang}wcf.global.objectID{/lang}{lang}wcf.global.name{/lang}{lang}wcf.acp.box.boxType{/lang}{lang}wcf.acp.box.position{/lang}