routeSQL : Allow the user to change the Actions links (to images, UTF-8 chars...)

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1999 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-03-10 15:03:26 +00:00
parent 1b3e234e22
commit 3ca3ad6e73

View File

@@ -19,6 +19,10 @@ class routeSQL
public $deleteConfirm = true; public $deleteConfirm = true;
/** Push the actions buttons at end of line */ /** Push the actions buttons at end of line */
public $actionsAtEnd = false; public $actionsAtEnd = false;
/** The Text to Delete */
public $textDelete = "";
/** The Text to Edit */
public $textEdit = "";
/** The model file containing the database description */ /** The model file containing the database description */
private $model_file = ""; private $model_file = "";
/** The model class included in the model file */ /** The model class included in the model file */
@@ -49,6 +53,8 @@ class routeSQL
$this->username = $username; $this->username = $username;
$this->password = $password; $this->password = $password;
$this->driver_options = $driver_options; $this->driver_options = $driver_options;
$this->textDelete = dgettext("domframework","Delete");
$this->textEdit = dgettext("domframework","Edit");
} }
/** Connect to the database */ /** Connect to the database */
@@ -137,15 +143,14 @@ class routeSQL
$content .= "<td>"; $content .= "<td>";
$content .= " <a href='".$route->baseURL().$this->url_prefix."/". $content .= " <a href='".$route->baseURL().$this->url_prefix."/".
$line[$this->objectDB->primary]."'>". $line[$this->objectDB->primary]."'>".
dgettext("domframework","Edit")."</a>"; $this->textEdit."</a>";
$content .= " <a href='".$route->baseURL().$this->url_prefix."/". $content .= " <a href='".$route->baseURL().$this->url_prefix."/".
$line[$this->objectDB->primary]."/delete/$token'"; $line[$this->objectDB->primary]."/delete/$token'";
if ($this->deleteConfirm) if ($this->deleteConfirm)
$content .= " onclick=\"return confirm('". $content .= " onclick=\"return confirm('".
dgettext("domframework", dgettext("domframework",
"Are you sure to delete this entry?")."')\""; "Are you sure to delete this entry?")."')\"";
$content .= ">". $content .= ">".$this->textDelete."</a>";
dgettext("domframework","Delete")."</a>";
$content .= "</td>"; $content .= "</td>";
} }
foreach ($line as $col) foreach ($line as $col)
@@ -155,15 +160,14 @@ class routeSQL
$content .= "<td>"; $content .= "<td>";
$content .= " <a href='".$route->baseURL().$this->url_prefix."/". $content .= " <a href='".$route->baseURL().$this->url_prefix."/".
$line[$this->objectDB->primary]."'>". $line[$this->objectDB->primary]."'>".
dgettext("domframework","Edit")."</a>"; $this->textEdit."</a>";
$content .= " <a href='".$route->baseURL().$this->url_prefix."/". $content .= " <a href='".$route->baseURL().$this->url_prefix."/".
$line[$this->objectDB->primary]."/delete/$token'"; $line[$this->objectDB->primary]."/delete/$token'";
if ($this->deleteConfirm) if ($this->deleteConfirm)
$content .= " onclick=\"return confirm('". $content .= " onclick=\"return confirm('".
dgettext("domframework", dgettext("domframework",
"Are you sure to delete this entry?")."')\""; "Are you sure to delete this entry?")."')\"";
$content .= ">". $content .= ">".$this->textDelete."</a>";
dgettext("domframework","Delete")."</a>";
$content .= "</td>"; $content .= "</td>";
} }
$content .= "</tr>\n"; $content .= "</tr>\n";