From 7bb472ea22e025eea73871b76ba00105fee6d208 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Fri, 8 Oct 2004 11:30:10 +0000 Subject: [PATCH] diogenes update --- include/auto.prepend.inc.php | 6 +++--- include/xorg.table-editor.inc.php | 6 +++--- templates/table-editor.tpl | 23 +++++++++++++++-------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/include/auto.prepend.inc.php b/include/auto.prepend.inc.php index b74a4c1..b229565 100644 --- a/include/auto.prepend.inc.php +++ b/include/auto.prepend.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: auto.prepend.inc.php,v 1.24 2004-09-24 14:47:43 x2000habouzit Exp $ + $Id: auto.prepend.inc.php,v 1.25 2004-10-08 11:30:10 x2000habouzit Exp $ ***************************************************************************/ function microtime_float() @@ -72,11 +72,11 @@ function new_admin_page($tpl_name, $popup=false, $tpl_head="") { _new_page(SKINNED, $tpl_name, $tpl_head, AUTH_MDP, $popup, true); } -function new_admin_table_editor($table,$idfield) { +function new_admin_table_editor($table,$idfield,$idedit=false) { global $editor; new_admin_page('table-editor.tpl'); require_once('xorg.table-editor.inc.php'); - $editor = new XOrgAdminTableEditor($table,$idfield); + $editor = new XOrgAdminTableEditor($table,$idfield,$idedit); } ?> diff --git a/include/xorg.table-editor.inc.php b/include/xorg.table-editor.inc.php index ac86bbd..87f03ce 100644 --- a/include/xorg.table-editor.inc.php +++ b/include/xorg.table-editor.inc.php @@ -18,14 +18,14 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: xorg.table-editor.inc.php,v 1.3 2004-08-31 11:16:48 x2000habouzit Exp $ + $Id: xorg.table-editor.inc.php,v 1.4 2004-10-08 11:30:10 x2000habouzit Exp $ ***************************************************************************/ require_once('diogenes.table-editor.inc.php'); class XOrgAdminTableEditor extends DiogenesTableEditor { - function XOrgTableEditor($table,$idfield) { - $this->DiogenesTableEditor($table,$idfield); + function XOrgTableEditor($table,$idfield,$editid=false) { + $this->DiogenesTableEditor($table,$idfield,$editid); } function assign($var_name, $contenu) { diff --git a/templates/table-editor.tpl b/templates/table-editor.tpl index da4ff12..c9a7710 100644 --- a/templates/table-editor.tpl +++ b/templates/table-editor.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: table-editor.tpl,v 1.8 2004-08-31 11:25:39 x2000habouzit Exp $ + $Id: table-editor.tpl,v 1.9 2004-10-08 11:30:11 x2000habouzit Exp $ ***************************************************************************} @@ -28,6 +28,7 @@ {if !$doedit} +{if !$readonly} {literal} {/literal} +{/if}
@@ -59,21 +61,25 @@ - + {if $idsum}{/if} {foreach from=$vars item=myval} {if $myval.sum}{/if} {/foreach} + {if !$hideactions} + {/if} +{if !$readonly} +{/if} {foreach from=$rows item=myrow}{assign var="myarr" value=$myrow[2]} - + {if $idsum}{/if} {foreach from=$vars key=mykey item=myval} {if $myval.sum} {/if} {/foreach} + {if !$hideactions} + {/if} {/foreach} @@ -109,7 +119,6 @@ {foreach from=$vars key=mykey item=myval} - {if $mykey != $idfield} - {/if} {/foreach}
idid{$myval.desc}action
nouvelle entrée create
{$myrow[1]}{$myrow[1]} @@ -89,13 +95,17 @@ + {if !$readonly} edit delete -{foreach from=$myrow[3] item=myaction} + {/if} + {foreach from=$myrow[3] item=myaction} {a lnk=$myaction} -{/foreach} + {/foreach}
{if $id!=''} - modification de l'entrée {else} nouvelle entrée @@ -117,7 +126,6 @@
{$myval.desc} @@ -143,7 +151,6 @@ {/if}
-- 2.1.4