]> git.andy128k.dev Git - ipf.git/commitdiff
admin: object tools
authorAndrey Kutejko <andy128k@gmail.com>
Fri, 16 Aug 2013 04:15:21 +0000 (07:15 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Fri, 16 Aug 2013 04:15:21 +0000 (07:15 +0300)
ipf/admin/model.php
ipf/admin/templates/admin/change.html

index d0440d03a302a55e6dae7eaa86a8271be190eb66..62a0a6c0835a69e2499ed7f961f0f5b876c0b594 100644 (file)
@@ -550,6 +550,11 @@ class IPF_Admin_Model
     {
     }
 
+    protected function objectTools($obj)
+    {
+        return array();
+    }
+
     // Views Function
     public function AddItem($request, $lapp, $lmodel)
     {
@@ -596,6 +601,7 @@ class IPF_Admin_Model
             'lmodel'=>$lmodel,
             'admin_title' => IPF::get('admin_title'),
             'indexpage_url'=>IPF::get('indexpage_url','/'),
+            'objecttools' => array(),
         );
         return $this->renderToResponse($this->_getAddTemplate(), $context, $request);
     }
@@ -681,6 +687,8 @@ class IPF_Admin_Model
             $this->setInlines($o);
         }
 
+        $objecttools = $this->objectTools($o);
+
         $context = array(
             'mode'=>'change',
             'page_title'=>$this->titleEdit(),
@@ -695,6 +703,7 @@ class IPF_Admin_Model
             'lmodel'=>$lmodel,
             'admin_title' => IPF::get('admin_title'),
             'indexpage_url'=>IPF::get('indexpage_url','/'),
+            'objecttools' => $objecttools,
         );
         return $this->renderToResponse($this->_getChangeTemplate(), $context, $request);
     }
index 2984d46dec8f31b6bbbd2d63aa40bbe7d421565b..fac373d9edd6c877a3eac2d1764ec0841fb7f430 100644 (file)
 <div id="content" class="colM">
     <h1>{$page_title}</h1>
     <div id="content-main">
-        <ul class="object-tools">{block objecttools}{/block}</ul>
+        <ul class="object-tools">
+          {block objecttools}
+            {foreach $objecttools as $ot_title => $ot_url}
+              <li><a href="{$ot_url}">{$ot_title}</a></li>
+            {/foreach}
+          {/block}
+        </ul>
         <form method="post" {if $form.hasFileField()}enctype="multipart/form-data"{/if}>
         <input type="hidden" name="ipf_referrer" id="id_ipf_referrer" value="" />
         <div>