Ejemplo n.º 1
0
 /**
  * Inserts a new Kbit front of type KBIT_FRONT in edit mode into the database users
  * @param {int} $UID The UID of the base Kbit
  * @param {frontKbit} $front array of key value pair in FRONT format
  * @param {int} $user User id of the creator
  * @return {frontKbit:KBIT_FRONT}
  */
 private static function add_new_KBIT_FRONT($UID, $front, $user)
 {
     $dbObj = new dbAPI();
     // determines the database name which the {Kbit} should be imported from
     $database_source = dbAPI::get_db_name('user');
     // static table name of specific Kbit front
     $tableName = 'KBIT_FRONT';
     // aquire a new revision number
     $rev_num = Kbit::get_new_Revision_and_disbale_old_ones($UID, $tableName, 'user');
     // database insert query
     $query = "INSERT INTO " . $tableName . " (UID, REVISION, PATH, ENABLED, USER_ID, CREATION_DATE) VALUES (" . $UID . ", 1, '" . $front["PATH"] . "', 1, " . $user . ",'" . date("Y-m-d H:i:s") . "')";
     $dbObj->run_query($database_source, $query);
     return Kbit::get_front_Kbit($UID, $tableName, 'user');
 }