use an array for warnings in admin panel
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 20 Nov 2016 15:14:09 +0000 (16:14 +0100)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 20 Nov 2016 15:14:09 +0000 (16:14 +0100)
mod/admin.php
view/templates/admin_summary.tpl

index c5ad7de..67b8ed2 100644 (file)
@@ -431,10 +431,10 @@ function admin_page_summary(&$a) {
        // are there MyISAM tables in the DB? If so, trigger a warning message
        $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine`='myisam' LIMIT 1");
        $showwarning = false;
-       $warningtext = "";
+       $warningtext = array();
        if (dbm::is_result($r)) {
                $showwarning = true;
-               $warningtext = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the <tt>convert_innodb.sql</tt> in the <tt>/util</tt> directory of your Friendica installation.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
+               $warningtext[] = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the <tt>convert_innodb.sql</tt> in the <tt>/util</tt> directory of your Friendica installation.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
        }
        $r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
        $accounts = array(
index 34df0db..c8e8af2 100644 (file)
@@ -3,7 +3,9 @@
        <h1>{{$title}} - {{$page}}</h1>
 {{if $showwarning}}
        <div id="admin-warning-message-wrapper">
-               <p id="admin-warning-message" class="warning-message">{{$warningtext}}</p>
+               {{foreach $warningtext as $wt}}
+               <p class="warning-message">{{$wt}}</p>
+               {{/foreach}}
        </div>
 {{/if}}