]> git.andy128k.dev Git - ipf.git/commitdiff
do not calculate component list for non-admin pages
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 7 Dec 2014 02:18:16 +0000 (04:18 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 7 Dec 2014 02:20:53 +0000 (04:20 +0200)
ipf/admin/app.php
ipf/admin/templates/admin/base.html
ipf/admin/templates/admin/index.html

index 551980ded0bc1d83cd9c27ef3333c3989f4c4ab4..56c9b44e06253f3325b37897899b47fb0c4a9fc9 100644 (file)
@@ -22,7 +22,7 @@ class IPF_Admin_App extends IPF_Application
         );
     }
 
-    public function templateContext($request)
+    public function appList($request)
     {
         $app_list = array();
         foreach (IPF_Project::getInstance()->appList() as $app) {
@@ -42,13 +42,17 @@ class IPF_Admin_App extends IPF_Application
                 );
             }
         }
+        return $app_list;
+    }
 
+    public function templateContext($request)
+    {
         return array(
             'IPF_VER' => IPF::version(),
             'ADMIN_MEDIA_URL' => IPF::get('static_url') . 'admin/',
             'admin_title' => IPF::get('admin_title'),
             'indexpage_url' => IPF::get('indexpage_url', '/'),
-            'app_list' => $app_list,
+            'app_list' => F::bind(array($this, 'appList'), $request),
         );
     }
 
index 17bc2670a13d224e66f95d616351d2457413b82c..8edd033d463fee565a5e2e5255fb7b6a58b023de 100644 (file)
@@ -37,7 +37,7 @@
         <div class="header"></div>
 
         <ul>
-          {foreach $app_list as $app}
+          {foreach $app_list() as $app}
           <li>
             <h3>{$app.name}</h3>
             <ul>
index 0506781651f2549e4d87161d5bfa144f2fe83de9..add7d14ca32884784ce414a191f87db94e64048c 100644 (file)
@@ -7,7 +7,7 @@
 <div id="content" class="colMS dashboard">
     <h1>{$page_title}</h1>
     <div id="content-main">
-        {foreach $app_list as $app}
+        {foreach $app_list() as $app}
                <div class="module">
         <table summary="">
         <caption>{$app.name|escxml}</caption>