From c27d60107da336249b752ebd52a61e3fb9dbc3a6 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 17 Mar 2015 17:52:08 +0000 Subject: [PATCH] routeSQL : Add support of url-defined var (like zone/XX/entry/YY) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2030 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- routeSQL.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/routeSQL.php b/routeSQL.php index 9cefb74..cf662d2 100644 --- a/routeSQL.php +++ b/routeSQL.php @@ -54,6 +54,11 @@ class routeSQL public $chained = null; /** Chain multiple routeSQL. Wait for the foreign key */ public $chainedForeign = null; + /** Allow one or multiple links by entry in the list + The array must be of the form array ("linkname"=>,"icon"=>) + icon is optional and the linkname is used if it is not provided */ + public $internalLinks = array (); + /** The model file containing the database description */ private $model_file = ""; /** The model class included in the model file */ @@ -487,6 +492,18 @@ class routeSQL dgettext("domframework", "Are you sure to delete this entry?")."')\""; $content .= " class='delete'>".$this->textDelete.""; + foreach ($this->internalLinks as $linkData) + { + if (! isset ($linkData["linkname"])) + throw new Exception ("No linkname defined !", 500); + $content .= " "; + if (isset ($linkData["icon"])) + $content .= $linkData["icon"]; + else + $content .= $linkData["linkname"]; + } $content .= ""; } if ($this->actionsAtEnd === false)