<input type="text" id="languageItemValue" name="languageItemValue" value="{$languageItemValue}" placeholder="{lang}wcf.acp.language.item.value{/lang}" class="long">
<label><input type="checkbox" name="hasCustomValue" value="1"{if $hasCustomValue == 1} checked{/if}> {lang}wcf.acp.language.item.customValues{/lang}</label>
<label><input type="checkbox" name="hasDisabledCustomValue" value="1"{if $hasDisabledCustomValue == 1} checked{/if}> {lang}wcf.acp.language.item.disabledCustomValues{/lang}</label>
+ <label><input type="checkbox" name="hasRecentlyDisabledCustomValue" value="1"{if $hasRecentlyDisabledCustomValue == 1} checked{/if}> {lang}wcf.acp.language.item.recentlyDisabledCustomValues{/lang}</label>
</dd>
</dl>
{/hascontent}
</header>
+{if $recentlyDisabledCustomValues > 0}
+ <p class="warning">{lang}wcf.acp.language.item.hasRecentlyDisabledCustomValues{/lang}</p>
+{/if}
+
{hascontent}
<div class="paginationTop">
{content}{pages print=true assign=pagesLinks controller='PackageList' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}{/content}
*/
public $hasDisabledCustomValue = 0;
+ /**
+ * search for disabled custom values that have been automatically disabled in the past 7 days
+ * @var boolean
+ */
+ public $hasRecentlyDisabledCustomValue = 0;
+
/**
* available languages
* @var array
if (isset($_REQUEST['languageItemValue'])) $this->languageItemValue = $_REQUEST['languageItemValue'];
if (!empty($_REQUEST['hasCustomValue'])) $this->hasCustomValue = 1;
if (!empty($_REQUEST['hasDisabledCustomValue'])) $this->hasDisabledCustomValue = 1;
+ if (!empty($_REQUEST['hasRecentlyDisabledCustomValue'])) $this->hasRecentlyDisabledCustomValue = 1;
}
/**
if ($this->languageCategoryID) $this->objectList->getConditionBuilder()->add('languageCategoryID = ?', [$this->languageCategoryID]);
if ($this->languageItem) $this->objectList->getConditionBuilder()->add('languageItem LIKE ?', ['%'.$this->languageItem.'%']);
if ($this->languageItemValue) $this->objectList->getConditionBuilder()->add('((languageUseCustomValue = 0 AND languageItemValue LIKE ?) OR languageCustomItemValue LIKE ?)', ['%'.$this->languageItemValue.'%', '%'.$this->languageItemValue.'%']);
- if ($this->hasCustomValue || $this->hasDisabledCustomValue) $this->objectList->getConditionBuilder()->add("languageCustomItemValue IS NOT NULL");
- if ($this->hasDisabledCustomValue) $this->objectList->getConditionBuilder()->add("languageUseCustomValue = ?", [0]);
+ if ($this->hasCustomValue || $this->hasDisabledCustomValue || $this->hasRecentlyDisabledCustomValue) $this->objectList->getConditionBuilder()->add("languageCustomItemValue IS NOT NULL");
+ if ($this->hasDisabledCustomValue || $this->hasRecentlyDisabledCustomValue) $this->objectList->getConditionBuilder()->add("languageUseCustomValue = ?", [0]);
+ if ($this->hasRecentlyDisabledCustomValue) $this->objectList->getConditionBuilder()->add("languageCustomItemDisableTime >= ?", [TIME_NOW - 86400 * 7]);
}
/**
'languageItemValue' => $this->languageItemValue,
'hasCustomValue' => $this->hasCustomValue,
'hasDisabledCustomValue' => $this->hasDisabledCustomValue,
+ 'hasRecentlyDisabledCustomValue' => $this->hasRecentlyDisabledCustomValue,
'availableLanguages' => $this->availableLanguages,
'availableLanguageCategories' => $this->availableLanguageCategories
]);
namespace wcf\acp\page;
use wcf\data\package\PackageList;
use wcf\page\SortablePage;
+use wcf\system\language\LanguageFactory;
use wcf\system\WCF;
/**
parent::assignVariables();
WCF::getTPL()->assign([
+ 'recentlyDisabledCustomValues' => LanguageFactory::getInstance()->countRecentlyDisabledCustomValues(),
'packageID' => $this->packageID
]);
}
* @property-read integer $languageItemOriginIsSystem is `1` if the language item has been delivered by a package, otherwise `0` (for example, if language item has been created for i18n content)
* @property-read integer $languageCategoryID id of the language category the language item belongs to
* @property-read integer|null $packageID id of the package the which delivers the language item or with which the language item is associated
+ * @property-read string $languageItemOldValue previous default value of the language item
+ * @property-read integer $languageCustomItemDisableTime the timestamp at which the custom version has been disabled due to a change to the original value
*/
class LanguageItem extends DatabaseObject {
/**
public function multilingualismEnabled() {
return $this->cache['multilingualismEnabled'];
}
+
+ /**
+ * Returns the number of phrases that have been automatically disabled in the past 7 days.
+ *
+ * @return integer
+ */
+ public function countRecentlyDisabledCustomValues() {
+ $sql = "SELECT COUNT(*) AS count
+ FROM wcf".WCF_N."_language_item
+ WHERE languageCustomItemDisableTime >= ?";
+ $statement = WCF::getDB()->prepareStatement($sql, 1);
+ $statement->execute([TIME_NOW - 86400 * 7]);
+
+ return $statement->fetchColumn();
+ }
}
<item name="wcf.acp.language.add.source.description"><![CDATA[Die ausgewählte Sprache wird als Vorlage benutzt. Alle Sprachvariablen werden in die neue Sprache kopiert.]]></item>
<item name="wcf.acp.language.item.oldValue"><![CDATA[Ursprünglicher Inhalt]]></item>
<item name="wcf.acp.language.item.oldValue.description"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} veränderte Fassung basierte auf dem unten stehenden Stand vom {$item->languageCustomItemDisableTime|date}.]]></item>
+ <item name="wcf.acp.language.item.recentlyDisabledCustomValues"><![CDATA[Kürzlich deaktivierte Inhalte finden (Letzten 7 Tagen)]]></item>
+ <item name="wcf.acp.language.item.hasRecentlyDisabledCustomValues"><![CDATA[{if $recentlyDisabledCustomValues == 1}Eine{else}{#$recentlyDisabledCustomValues}{/if} individuell angepasste {if $recentlyDisabledCustomValues == 1}Sprachvariable wurde{else}Sprachvariablen wurden{/if} vor Kurzem <a href="{link controller='LanguageItemList' hasRecentlyDisabledCustomValue=1}{/link}">automatisch deaktiviert</a>.]]></item>
</category>
<category name="wcf.acp.masterPassword">
<item name="wcf.acp.language.add.source.description"><![CDATA[The selected language will be used as origin, all phrases will be copied into the new language.]]></item>
<item name="wcf.acp.language.item.oldValue"><![CDATA[Original Content]]></item>
<item name="wcf.acp.language.item.oldValue.description"><![CDATA[Your custom value was based on the original content that has changed on {$item->languageCustomItemDisableTime|date}.]]></item>
+ <item name="wcf.acp.language.item.recentlyDisabledCustomValues"><![CDATA[Recently disabled customized values (past 7 days)]]></item>
+ <item name="wcf.acp.language.item.hasRecentlyDisabledCustomValues"><![CDATA[{if $recentlyDisabledCustomValues == 1}One{else}{#$recentlyDisabledCustomValues}{/if} customized {if $recentlyDisabledCustomValues == 1}phrase has been{else}phrases have been{/if} <a href="{link controller='LanguageItemList' hasRecentlyDisabledCustomValue=1}{/link}">automatically disabled</a> recently.]]></item>
</category>
<category name="wcf.acp.masterPassword">