DomCi : update the parameters definitions
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3280 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
83
routeSQL.php
83
routeSQL.php
@@ -92,7 +92,17 @@ class routeSQL
|
||||
/** The Datas are protected in read-only */
|
||||
private $readwriteAllowed = true;
|
||||
|
||||
/** Connect to the database */
|
||||
/** Connect to the database
|
||||
* @param string $model_file The model file containing the database
|
||||
* description
|
||||
* @param string $model_class The model class included in the model file
|
||||
* @param string $url_prefix The prefix to be used in the URL. Should be the
|
||||
* end of $model_file
|
||||
* @param string $dsn The DSN to connect to the database
|
||||
* @param string $username The username to connect to the database
|
||||
* @param string $password The password to connect to the database
|
||||
* @param array|null $driver_options The PDO driver options
|
||||
*/
|
||||
public function __construct ($model_file, $model_class, $url_prefix, $dsn,
|
||||
$username = null, $password = null, $driver_options = null)
|
||||
{
|
||||
@@ -156,9 +166,14 @@ class routeSQL
|
||||
}
|
||||
|
||||
/** Display a paginator
|
||||
$nbentries is the total number of elements
|
||||
num is the number of elements displayed by page
|
||||
page is the page to display */
|
||||
* $nbentries is the total number of elements
|
||||
* num is the number of elements displayed by page
|
||||
* page is the page to display
|
||||
* @param integer $nbentries The number of entries to display
|
||||
* @param integer $page The page number to display
|
||||
* @param integer $num ???
|
||||
* @param string $search The search query
|
||||
*/
|
||||
private function paginatorArea ($nbentries, $page, $num, $search)
|
||||
{
|
||||
// The maximum of links available in the paginator
|
||||
@@ -217,7 +232,12 @@ $content .= "</li>\n";
|
||||
}
|
||||
|
||||
/** Display the actions buttons outside of the table (actually, juste the
|
||||
'Add new entry' button */
|
||||
* 'Add new entry' button
|
||||
* @param integer $nbentries The number of entries
|
||||
* @param integer $page The page number
|
||||
* @param integer $num ???
|
||||
* @param string $search The search query
|
||||
*/
|
||||
private function addNewArea ($nbentries, $page, $num, $search)
|
||||
{
|
||||
$content = "";
|
||||
@@ -232,7 +252,12 @@ $content .= "</li>\n";
|
||||
return $content;
|
||||
}
|
||||
|
||||
/** Display the select list to choose the number of displayed entries */
|
||||
/** Display the select list to choose the number of displayed entries
|
||||
* @param integer $nbentries The number of entries
|
||||
* @param integer $page The page number
|
||||
* @param integer $num ???
|
||||
* @param string $search The search query
|
||||
*/
|
||||
private function numberEntryByDisplayArea ($nbentries, $page, $num, $search)
|
||||
{
|
||||
$route = new route ();
|
||||
@@ -256,7 +281,12 @@ $content .= "</li>\n";
|
||||
return $content;
|
||||
}
|
||||
|
||||
/** Display the search area */
|
||||
/** Display the search area
|
||||
* @param integer $nbentries The number of entries
|
||||
* @param integer $page The page number
|
||||
* @param integer $num ???
|
||||
* @param string $search The search query
|
||||
*/
|
||||
private function searchArea ($nbentries, $page, $num, $search)
|
||||
{
|
||||
$route = new route ();
|
||||
@@ -272,7 +302,12 @@ $content .= "</li>\n";
|
||||
return $content;
|
||||
}
|
||||
|
||||
/** Display the information */
|
||||
/** Display the information
|
||||
* @param integer $nbentries The number of entries
|
||||
* @param integer $page The page number
|
||||
* @param integer $num ???
|
||||
* @param string $search The search query
|
||||
*/
|
||||
private function informationArea ($nbentries, $page, $num, $search)
|
||||
{
|
||||
$content = "";
|
||||
@@ -580,7 +615,7 @@ $content .= "</li>\n";
|
||||
$this->url_prefix = $this->chained->url_prefix."/{chain}/".
|
||||
$this->url_prefix;
|
||||
}
|
||||
/** Add HTML routes */
|
||||
/** Add HTML routes */
|
||||
$route = new route ();
|
||||
$route->debug = $this->debug;;
|
||||
$route->allowSlashes=false;
|
||||
@@ -1757,7 +1792,10 @@ $content .= "</li>\n";
|
||||
}
|
||||
|
||||
/** Authorization : Return TRUE if the user right allow to see the data
|
||||
Return FALSE else */
|
||||
* Return FALSE else
|
||||
* @param array $auth The auth to authenticate
|
||||
* @param integer|null $id The id to examine
|
||||
*/
|
||||
public function accessright ($auth, $id=null)
|
||||
{
|
||||
// echo "accessright=".var_export ($id, TRUE)." for ".
|
||||
@@ -1775,7 +1813,10 @@ $content .= "</li>\n";
|
||||
}
|
||||
|
||||
/** Authorization : Return TRUE if the user right allow to edit the data
|
||||
Return FALSE else */
|
||||
* Return FALSE else
|
||||
* @param array $auth The auth to authenticate
|
||||
* @param integer|null $id The id to examine
|
||||
*/
|
||||
public function editright ($auth, $id=null)
|
||||
{
|
||||
// echo "editright=".var_export ($id, TRUE)." for ".
|
||||
@@ -1792,7 +1833,10 @@ $content .= "</li>\n";
|
||||
}
|
||||
|
||||
/** Authorization : Return TRUE if the $id is in READONLY for the user or
|
||||
FALSE if the user have the RW rights */
|
||||
* FALSE if the user have the RW rights
|
||||
* @param array $auth The auth to authenticate
|
||||
* @param integer|null $id The id to examine
|
||||
*/
|
||||
public function readonly ($auth, $id=null)
|
||||
{
|
||||
// echo "readonly=".var_export ($id, TRUE)." for ".
|
||||
@@ -1809,8 +1853,10 @@ $content .= "</li>\n";
|
||||
}
|
||||
|
||||
/** Return the data of the row if the $id exists in the primary key of the
|
||||
table
|
||||
Return FALSE in the other cases */
|
||||
* table
|
||||
* Return FALSE in the other cases
|
||||
* @param integer $id The id to examine
|
||||
*/
|
||||
public function keyexists ($id)
|
||||
{
|
||||
$data = $this->objectDB->read (array (array ($this->objectDB->primary,
|
||||
@@ -1820,7 +1866,9 @@ $content .= "</li>\n";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/** Display the data in HTML with the view class/method if they are defined */
|
||||
/** Display the data in HTML with the view class/method if they are defined
|
||||
* @param array $data The data to display
|
||||
*/
|
||||
private function rendererhtml ($data)
|
||||
{
|
||||
require_once ("domframework/outputhtml.php");
|
||||
@@ -1849,6 +1897,11 @@ $content .= "</li>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
/** Return the result converted by JSON/XML, defined in REST
|
||||
* @param string $extension The display method
|
||||
* @param array $data The data to return
|
||||
* @param integer $getCode The HTTP code to return (200 OK by default)
|
||||
*/
|
||||
private function renderrest ($extension, $data, $getCode=200)
|
||||
{
|
||||
require_once ("domframework/output$extension.php");
|
||||
|
||||
Reference in New Issue
Block a user