From 1b3e234e22ad805ff12d04be787af09107b379cb Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 10 Mar 2015 14:39:55 +0000 Subject: [PATCH] routeSQL : Actions can be wrote at the start or at the end of line git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1998 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- routeSQL.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/routeSQL.php b/routeSQL.php index f7115f8..cdffd5a 100644 --- a/routeSQL.php +++ b/routeSQL.php @@ -17,6 +17,8 @@ class routeSQL public $displayActions = true; /** Do a confirmation in javascript before deleting entry */ public $deleteConfirm = true; + /** Push the actions buttons at end of line */ + public $actionsAtEnd = false; /** The model file containing the database description */ private $model_file = ""; /** The model class included in the model file */ @@ -111,10 +113,12 @@ class routeSQL dgettext("domframework","Add new entry")."\n"; $content .= "\n"; $content .= " \n"; - if ($this->displayActions) + if ($this->displayActions && $this->actionsAtEnd === false) $content .= " \n"; foreach ($titles as $title) $content .= " \n"; + if ($this->displayActions && $this->actionsAtEnd !== false) + $content .= " \n"; $content .= " \n"; $content .= " \n"; if (count ($datas) === 0) @@ -128,7 +132,7 @@ class routeSQL foreach ($datas as $line) { $content .= " "; - if ($this->displayActions) + if ($this->displayActions && $this->actionsAtEnd === false) { $content .= ""; + } $content .= "\n"; } }
".dgettext("domframework","Actions")."".htmlentities ($title)."".dgettext("domframework","Actions")."
"; $content .= " baseURL().$this->url_prefix."/". + $line[$this->objectDB->primary]."'>". + dgettext("domframework","Edit").""; + $content .= " deleteConfirm) + $content .= " onclick=\"return confirm('". + dgettext("domframework", + "Are you sure to delete this entry?")."')\""; + $content .= ">". + dgettext("domframework","Delete").""; + $content .= "