<defaultvalue>1</defaultvalue>
</option>
+ <option name="enable_woltlab_news">
+ <categoryname>module.system</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ </option>
+
<!-- general.page -->
<option name="page_title">
<categoryname>general.page</categoryname>
</script>
<style type="text/css">
- #health ul {
- list-style: disc;
- padding-left: 16px;
+ #news iframe {
+ width: 100%;
}
</style>
-<p class="{@$health}">{lang}wcf.acp.index.health.summary.{@$health}{/lang}</p>
-
-{event name='boxes'}
-
-<div class="tabMenuContainer" data-active="{if $health !== 'success'}health{else}news{/if}" data-store="activeTabMenuItem">
+<div class="tabMenuContainer" data-active="{if ENABLE_WOLTLAB_NEWS}news{else}credits{/if}" data-store="activeTabMenuItem">
<nav class="tabMenu">
<ul>
- {if $health !== 'success'}<li><a href="{@$__wcf->getAnchor('health')}" title="Health">Health</a></li>{/if}
- <li><a href="{@$__wcf->getAnchor('news')}" title="News">News</a></li>
- <li><a href="{@$__wcf->getAnchor('credits')}" title="Credits">{lang}wcf.acp.index.credits{/lang}</a></li>
+ {if ENABLE_WOLTLAB_NEWS}<li><a href="{@$__wcf->getAnchor('news')}">{lang}wcf.acp.index.news{/lang}</a></li>{/if}
+ <li><a href="{@$__wcf->getAnchor('credits')}">{lang}wcf.acp.index.credits{/lang}</a></li>
{event name='tabMenuTabs'}
</ul>
</nav>
- {if $health !== 'success'}
- <div id="health" class="container containerPadding hidden tabMenuContent">
- {foreach from=$healthDetails item='issues' key='healthType'}
- {hascontent}
- <fieldset>
- <legend>{lang}wcf.acp.index.health.detail.{@$healthType}{/lang}</legend>
-
- <ul>
- {content}
- {foreach from=$issues item='issue'}
- <li>{@$issue}</li>
- {/foreach}
- {/content}
- </ul>
- </fieldset>
- {/hascontent}
- {/foreach}
+ {if ENABLE_WOLTLAB_NEWS}
+ <div id="news" class="container containerPadding hidden tabMenuContent">
+ <a class="twitter-timeline" href="https://twitter.com/woltlab" data-chrome="nofooter transparent" data-widget-id="335166618281865217">Tweets by @woltlab</a>
+ {literal}
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ {/literal}
</div>
{/if}
- <div id="news" class="container containerPadding hidden tabMenuContent">
- WoltLab Community Framework is twice as cool now, as the version number is twice as high.
- </div>
-
<div id="credits" class="container containerPadding hidden tabMenuContent">
<fieldset>
<legend>{lang}wcf.acp.index.credits{/lang}</legend>
* @category Community Framework
*/
class IndexPage extends AbstractPage {
- /**
- * health status data
- * @var array
- */
- public $healthDetails = array('error' => array(), 'warning' => array(), 'info' => array());
-
- /**
- * @see wcf\page\IPage::assignVariables()
- */
- public function assignVariables() {
- parent::assignVariables();
-
- $health = 'success';
- if (!empty($this->healthDetails['error'])) $health = 'error';
- else if (!empty($this->healthDetails['warning'])) $health = 'warning';
- else if (!empty($this->healthDetails['info'])) $health = 'info';
-
- WCF::getTPL()->assign(array(
- 'health' => $health,
- 'healthDetails' => $this->healthDetails
- ));
- }
-
- /**
- * Performs various health checks
- */
- public function calculateHealth() {
- try {
- // InnoDB's innodb_flush_log_at_trx_commit=1 causes poor performance, 2 is a better choice
- if (get_class(WCF::getDB()) == 'wcf\system\database\MySQLDatabase') {
- $sql = "SHOW VARIABLES LIKE ?";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array('innodb_flush_log_at_trx_commit'));
- $row = $statement->fetchArray();
- if ($row['Value'] == '1') {
- $this->healthDetails['warning'][] = WCF::getLanguage()->get('wcf.acp.index.health.innodbFlushLog');
- }
- }
-
- // TODO: Fill this list
- $shouldBeWritable = array(WCF_DIR);
- foreach ($shouldBeWritable as $file) {
- if (!is_writable($file)) {
- $this->healthDetails['warning'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.notWritable', array(
- 'file' => $file
- ));
- }
- }
-
- for ($i = 0; $i < 7; $i++) {
- if (file_exists(WCF_DIR.'log/'.date('Y-m-d', TIME_NOW - 86400 * $i).'.txt')) {
- $this->healthDetails['error'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.exception', array(
- 'date' => TIME_NOW - 86400 * $i
- ));
- break;
- }
- }
-
- if (CacheHandler::getInstance()->getCacheSource() instanceof NoCacheSource) {
- $this->healthDetails['warning'][] = WCF::getLanguage()->get('wcf.acp.index.health.noCacheSource');
- }
- else if (get_class(CacheHandler::getInstance()->getCacheSource()) != 'wcf\system\cache\source\\'.ucfirst(CACHE_SOURCE_TYPE).'CacheSource') {
- $this->healthDetails['error'][] = WCF::getLanguage()->getDynamicVariable('wcf.acp.index.health.cacheFallback', array(
- 'shouldBe' => WCF::getLanguage()->get('wcf.acp.option.cache_source_type.'.CACHE_SOURCE_TYPE)
- ));
- }
-
- if (MAIL_SEND_METHOD === 'debug') {
- $this->healthDetails['warning'][] = WCF::getLanguage()->get('wcf.acp.index.health.debugMailSender');
- }
-
- if (IMAGE_ADAPTER_TYPE === 'imagick' && !ImagickImageAdapter::isSupported()) {
- $this->healthDetails['error'][] = WCF::getLanguage()->get('wcf.acp.index.health.imageAdapterFallback');
- }
-
- EventHandler::getInstance()->fireAction($this, 'calculateHealth');
- }
- catch (\Exception $e) {
- $this->healthDetails['error'][] = $e->getMessage();
- }
- }
-
- /**
- * @see wcf\page\IPage::readData()
- */
- public function readData() {
- parent::readData();
-
- $this->calculateHealth();
- }
-
/**
* @see wcf\page\IPage::show()
*/
<item name="wcf.acp.index.credits.productManager"><![CDATA[Projektleitung]]></item>
<item name="wcf.acp.index.credits.trademarks"><![CDATA[„WoltLab®“ und „Burning Board®“ sind eingetragene Gemeinschaftsmarken beim europäischen Harmonisierungsamt für den Binnenmarkt (OHIM) in Alicante, Spanien.]]></item>
<item name="wcf.acp.index.credits.contributor.more"><![CDATA[Weitere]]></item>
+ <item name="wcf.acp.index.credits.news"><![CDATA[Nachrichten]]></item>
</category>
<category name="wcf.acp.language">
<item name="wcf.acp.option.category.general.system.packageServer"><![CDATA[Update-Server]]></item>
<item name="wcf.acp.option.package_server_auth_code"><![CDATA[Authentifizierung-Code]]></item>
<item name="wcf.acp.option.package_server_auth_code.description"><![CDATA[Ihren Authentifizierung-Code finden Sie in Ihrem Kundenkonto auf woltlab.com.]]></item>
+ <item name="wcf.acp.option.enable_woltlab_news"><![CDATA[WoltLab-Nachrichten auf der Startseite der Administrationsoberfläche anzeigen]]></item>
</category>
<category name="wcf.acp.package">
<item name="wcf.acp.index.credits.productManager"><![CDATA[TODO: Projektleitung]]></item>
<item name="wcf.acp.index.credits.trademarks"><![CDATA[TODO: „WoltLab®“ und „Burning Board®“ sind eingetragene Gemeinschaftsmarken beim europäischen Harmonisierungsamt für den Binnenmarkt (OHIM) in Alicante, Spanien.]]></item>
<item name="wcf.acp.index.credits.contributor.more"><![CDATA[TODO: Weitere]]></item>
+ <item name="wcf.acp.index.credits.news"><![CDATA[News]]></item>
</category>
<category name="wcf.acp.language">
<item name="wcf.acp.option.category.general.system.packageServer"><![CDATA[TODO: Update-Server]]></item>
<item name="wcf.acp.option.package_server_auth_code"><![CDATA[TODO: Authentifizierung-Code]]></item>
<item name="wcf.acp.option.package_server_auth_code.description"><![CDATA[TODO: Ihren Authentifizierung-Code finden Sie in Ihrem Kundenkonto auf woltlab.com.]]></item>
+ <item name="wcf.acp.option.enable_woltlab_news"><![CDATA[TODO: WoltLab-Nachrichten auf der Startseite der Administrationsoberfläche anzeigen]]></item>
</category>
<category name="wcf.acp.package">