Removed health tab, added news widget
authorMarcel Werk <burntime@woltlab.com>
Thu, 16 May 2013 23:01:41 +0000 (01:01 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 16 May 2013 23:01:41 +0000 (01:01 +0200)
com.woltlab.wcf/option.xml
wcfsetup/install/files/acp/templates/index.tpl
wcfsetup/install/files/lib/acp/page/IndexPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index fbc5e6ca2fbebdf75cd9b8f6b7ea6af242940d92..e0023f86e95dbee01de5fd91e249f5f64bc50b1c 100644 (file)
                                <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>
index ea67134a0180b626abfdbcd5ac23c799fefa37a5..8a684e69f6ae7172edeffa28c2ef6362d62e8810 100644 (file)
@@ -9,51 +9,30 @@
 </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>
index e03c50324a1fb474ba0ec71889d11b1fabbbded8..b3b4df6d3070ae6520294f83f6ad940c7c5860eb 100755 (executable)
@@ -20,97 +20,6 @@ use wcf\system\WCF;
  * @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()
         */
index d0123555824f6d83f4fe6adf36521e31724b5e1b..24f17dc5ef80cca69d684033d186d59b3a3ff651 100644 (file)
                <item name="wcf.acp.index.credits.productManager"><![CDATA[Projektleitung]]></item>
                <item name="wcf.acp.index.credits.trademarks"><![CDATA[„WoltLab&reg;“ und „Burning Board&reg;“ 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">
index 947eaef8d05556ffcb2ea0890c9743da20ce4c5c..2fc16097fa2e122c59187496296b924fa346dcde 100644 (file)
                <item name="wcf.acp.index.credits.productManager"><![CDATA[TODO: Projektleitung]]></item>
                <item name="wcf.acp.index.credits.trademarks"><![CDATA[TODO: „WoltLab&reg;“ und „Burning Board&reg;“ 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">