Generalize INoticeCondition to IContentCondition
authorMatthias Schmidt <gravatronics@live.com>
Wed, 28 May 2014 19:38:52 +0000 (21:38 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 28 May 2014 19:38:52 +0000 (21:38 +0200)
14 files changed:
com.woltlab.wcf/objectTypeDefinition.xml
wcfsetup/install/files/lib/system/condition/INoticeCondition.class.php [deleted file]
wcfsetup/install/files/lib/system/condition/MultiPageControllerCondition.class.php
wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php
wcfsetup/install/files/lib/system/condition/UserEmailCondition.class.php
wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php
wcfsetup/install/files/lib/system/condition/UserIntegerPropertyCondition.class.php
wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php
wcfsetup/install/files/lib/system/condition/UserOptionsCondition.class.php
wcfsetup/install/files/lib/system/condition/UserRegistrationDateCondition.class.php
wcfsetup/install/files/lib/system/condition/UserRegistrationDateIntervalCondition.class.php
wcfsetup/install/files/lib/system/condition/UserStateCondition.class.php
wcfsetup/install/files/lib/system/condition/UserUsernameCondition.class.php
wcfsetup/install/files/lib/system/notice/NoticeHandler.class.php

index e7793e32688767690483260e21179627fbedcfd1..10a1bd08eb28861e9344985d0ac0783b973735da 100644 (file)
                
                <definition>
                        <name>com.woltlab.wcf.condition.notice</name>
-                       <interfacename><![CDATA[wcf\system\condition\INoticeCondition]]></interfacename>
+                       <interfacename><![CDATA[wcf\system\condition\IContentCondition]]></interfacename>
                </definition>
        </import>
 </data>
diff --git a/wcfsetup/install/files/lib/system/condition/INoticeCondition.class.php b/wcfsetup/install/files/lib/system/condition/INoticeCondition.class.php
deleted file mode 100644 (file)
index 05f90ca..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-namespace wcf\system\condition;
-use wcf\data\condition\Condition;
-
-/**
- * Every implementation for notice conditions needs to implements this interface.
- * 
- * @author     Matthias Schmidt
- * @copyright  2001-2014 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.condition
- * @category   Community Framework
- */
-interface INoticeCondition extends ICondition {
-       /**
-        * Returns true if a notice with the given condition will be shown.
-        * 
-        * All necessary data to check the condition needs to be globally available
-        * like the active user object via WCF::getUser().
-        * 
-        * @param       \wcf\data\condition\Condition   $condition
-        * @return      boolean
-        */
-       public function showNotice(Condition $condition);
-}
index 1abce2aaa908de6930082c155b7963940529c1cf..e0df15ddb6cf5b17a723de4fd2d1a9fac662511e 100644 (file)
@@ -15,7 +15,7 @@ use wcf\system\request\RequestHandler;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class MultiPageControllerCondition extends AbstractMultiSelectCondition implements INoticeCondition {
+class MultiPageControllerCondition extends AbstractMultiSelectCondition implements IContentCondition {
        /**
         * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
         */
@@ -39,9 +39,9 @@ class MultiPageControllerCondition extends AbstractMultiSelectCondition implemen
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                $requestClassName = RequestHandler::getInstance()->getActiveRequest()->getClassName();
                $pageControllers = $condition->pageControllers;
                foreach ($pageControllers as $objectTypeID) {
index da506b8f5a07b2e03d2b7f76d3d29a9e7c86a927..a5b1d5d2ab56ec9626be2d3f5c0c287f88f45762 100644 (file)
@@ -16,7 +16,7 @@ use wcf\system\WCF;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserAvatarCondition extends AbstractSelectCondition implements INoticeCondition, IUserCondition {
+class UserAvatarCondition extends AbstractSelectCondition implements IContentCondition, IUserCondition {
        /**
         * @see wcf\system\condition\AbstractSelectCondition::$fieldName
         */
@@ -96,9 +96,9 @@ class UserAvatarCondition extends AbstractSelectCondition implements INoticeCond
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index 3577271bbf1818d74b965f1c849acaaa64bdbb87..f692041d9242685e9b6c4ab687e3bf3295b82c0b 100644 (file)
@@ -15,7 +15,7 @@ use wcf\system\WCF;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserEmailCondition extends AbstractTextCondition implements INoticeCondition, IUserCondition {
+class UserEmailCondition extends AbstractTextCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractTextCondition::$fieldName
         */
@@ -41,9 +41,9 @@ class UserEmailCondition extends AbstractTextCondition implements INoticeConditi
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index c41b249df283c53741cc890abbc4d2f1242762b7..3e5ad49011dce23c135a4b357ebaddfe31facbbf 100644 (file)
@@ -19,7 +19,7 @@ use wcf\util\ArrayUtil;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserGroupCondition extends AbstractMultipleFieldsCondition implements INoticeCondition, IUserCondition {
+class UserGroupCondition extends AbstractMultipleFieldsCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractMultipleFieldsCondition::$descriptions
         */
@@ -226,9 +226,9 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                return $this->checkUser($condition, WCF::getUser());
        }
 }
index b8540ef9063af825a91092d956a8969b70e14e96..089610d964564f745d9f5db8f138f2e1baefa4e6 100644 (file)
@@ -17,7 +17,7 @@ use wcf\system\WCF;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserIntegerPropertyCondition extends AbstractIntegerCondition implements INoticeCondition, IUserCondition {
+class UserIntegerPropertyCondition extends AbstractIntegerCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractIntegerCondition::$maxValueErrorMessage
         */
@@ -78,9 +78,9 @@ class UserIntegerPropertyCondition extends AbstractIntegerCondition implements I
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index eeeb8c589f0822ca1871fc30e375081638b08bf6..6b3956c80a1f9ea609f373e5365fdbee036a97ba 100644 (file)
@@ -18,7 +18,7 @@ use wcf\util\ArrayUtil;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserLanguageCondition extends AbstractSingleFieldCondition implements INoticeCondition, IUserCondition {
+class UserLanguageCondition extends AbstractSingleFieldCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
         */
@@ -110,9 +110,9 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements INot
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                return $this->checkUser($condition, WCF::getUser());
        }
 }
index f67d4b4d57dc0901a648b606e574d250998f68aa..4f943040ae2eab8b43bb177b0b92831b6ae722dc 100644 (file)
@@ -17,7 +17,7 @@ use wcf\system\WCF;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserOptionsCondition extends AbstractMultipleFieldsCondition implements INoticeCondition, IUserCondition {
+class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IContentCondition, IUserCondition {
        /**
         * user option handler object
         * @var \wcf\system\option\user\UserOptionHandler
@@ -129,9 +129,9 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IN
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index 3d49620c3cb4b589f1806f54e567b81ff16441ad..a4ab90d2e5b196c9b384ae5c46c2df089a88dae9 100644 (file)
@@ -16,7 +16,7 @@ use wcf\system\WCF;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserRegistrationDateCondition extends AbstractSingleFieldCondition implements INoticeCondition, IUserCondition {
+class UserRegistrationDateCondition extends AbstractSingleFieldCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
         */
@@ -151,9 +151,9 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index 670683f1d444c1a699a9089dcbdafc8ec3fdaf51..5b96c682ea1663a84d3b25fc357e57741e28eafa 100644 (file)
@@ -18,7 +18,7 @@ use wcf\system\WCF;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserRegistrationDateIntervalCondition extends AbstractIntegerCondition implements INoticeCondition, IUserCondition {
+class UserRegistrationDateIntervalCondition extends AbstractIntegerCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractMultipleFieldsCondition::$languageItemPrefix
         */
@@ -88,9 +88,9 @@ class UserRegistrationDateIntervalCondition extends AbstractIntegerCondition imp
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index 56d3224777aa7ae6045e7fc48fa9190c7530e20a..d2b4c47a8bbe01d8bd8af77ff73e9af1ce4fc9f2 100644 (file)
@@ -16,7 +16,7 @@ use wcf\system\WCF;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserStateCondition extends AbstractSingleFieldCondition implements INoticeCondition, IUserCondition {
+class UserStateCondition extends AbstractSingleFieldCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractSingleFieldCondition::$label
         */
@@ -193,9 +193,9 @@ HTML;
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index f0fac4306212307402a2b114f4962ada933a5d92..59d3974524811a7f566f94aea171544b747aa9ba 100644 (file)
@@ -16,7 +16,7 @@ use wcf\util\StringUtil;
  * @subpackage system.condition
  * @category   Community Framework
  */
-class UserUsernameCondition extends AbstractTextCondition implements INoticeCondition, IUserCondition {
+class UserUsernameCondition extends AbstractTextCondition implements IContentCondition, IUserCondition {
        /**
         * @see \wcf\system\condition\AbstractTextCondition::$fieldName
         */
@@ -42,9 +42,9 @@ class UserUsernameCondition extends AbstractTextCondition implements INoticeCond
        }
        
        /**
-        * @see \wcf\system\condition\INoticeCondition::showNotice()
+        * @see \wcf\system\condition\IContentCondition::showContent()
         */
-       public function showNotice(Condition $condition) {
+       public function showContent(Condition $condition) {
                if (!WCF::getUser()->userID) return false;
                
                return $this->checkUser($condition, WCF::getUser());
index b9583eee4dd38d5c780ab57e3b2c87d2d5e17af3..91f3400adae3aed4d10cdc5067517f66377c94da 100644 (file)
@@ -38,7 +38,7 @@ class NoticeHandler extends SingletonFactory {
                        $checkFailed = false;
                        $conditions = $notice->getConditions();
                        foreach ($conditions as $condition) {
-                               if (!$condition->getObjectType()->getProcessor()->showNotice($condition)) {
+                               if (!$condition->getObjectType()->getProcessor()->showContent($condition)) {
                                        $checkFailed = true;
                                        break;
                                }