Ejemplo n.º 1
0
 /**
  * RegistryFieldBase constructor
  *
  * The constructor used by the Registry object to
  * create new fields for that registry.
  * @param string $field_name name of the files of that registry / table
  * @param array $rtype_rdata array with all rdata tags in format $rtype_rdata[name]=value loaded from the xml file.
  * @param sqlConnect $dbc database connexion from the Registry object. Needed if a registry field needs to run a query
  * @access public
  */
 function __construct($field_name = "", $rtype_rdata = 0, $dbc = 0)
 {
     parent::__construct();
     $this->setFieldName($field_name);
     if (!is_resource($dbc)) {
         $dbc = $GLOBALS['conx'];
     }
     //$this->dbc = $dbc;
     if (is_array($rtype_rdata)) {
         $this->setRDatas($rtype_rdata);
     } else {
         $this->setRDatas(array());
     }
     if (strlen($this->fieldtype) == 0) {
         $this->fieldtype = get_class($this);
     }
     /** Curently ordering is not implemented
         *  Not sure its needed.
           $this->exec_order['default'] = 20;
           $this->exec_order['required'] = 30;
           $this->exec_order['hidden'] = 40;
           $this->exec_order['readonly'] = 50;
           $this->exec_order['textline'] = 500;
           $this->exec_order['nothing'] = 50000;
         **/
     if (defined("RADRIA_LOG_RUN_FIELDTYPE")) {
         $this->setLogRun(RADRIA_LOG_RUN_FIELDTYPE);
     }
 }
Ejemplo n.º 2
0
 /**
  * Constructor, create a new instance of an Display
  * @param String $page its the full URL of the page where the parameters need to be sent.
  * @access public
  */
 function __construct($page = "")
 {
     parent::__construct();
     $this->page = $page;
     if (defined("RADRIA_LOG_RUN_DISPLAY")) {
         $this->setLogRun(RADRIA_LOG_RUN_DISPLAY);
     }
 }
Ejemplo n.º 3
0
 /**
  * Constructor, create a new instance of an event controler
  * @param object sqlConnect $dbc
  * @access public
  */
 function __construct($dbc = 0)
 {
     parent::__construct();
     $this->dbc = $dbc;
     if (defined("RADRIA_LOG_RUN_EVENTCONTROLER")) {
         $this->setLogRun(RADRIA_LOG_RUN_EVENTCONTROLER);
     }
     $this->setLog("\n\n Instanciate Event Controler Object " . date("Y/m/d H:i:s"));
     if (!defined("RADRIA_EVENT_SECURE")) {
         define("RADRIA_EVENT_SECURE", true);
     }
     $this->setSecure(RADRIA_EVENT_SECURE);
 }
Ejemplo n.º 4
0
 /**
  *  Destructor, clear the ResultSet and  other related attributes.
  *
  * @param ResultSet $result
  * @access public
  */
 function free($result = 0)
 {
     parent::free();
     if ($result > 0) {
         mysql_free_result($result);
     } elseif (is_resource($this->result)) {
         mysql_free_result($this->result);
     }
     $this->sql_query = "";
     $this->sql_order = "";
     $this->pos = 0;
     $this->max_rows = 0;
     $this->num_rows = 0;
 }
Ejemplo n.º 5
0
 /**
  *    Constructor sqlConnect
  *
  *    If provide with parameters set the login and password
  *
  *  @param string login $login    Username to access the database
  *  @param  string password $password    Password to access the database
  */
 function __construct($login = "", $password = "")
 {
     parent::__construct();
     $this->login = $login;
     $this->password = $password;
 }
Ejemplo n.º 6
0
 /**
  *  Destructor, clear the ResultSet and  other related attributes
  *
  * @param ResultSet $result
  * @access public
  */
 function free($result = 0)
 {
     parent::free();
     if ($result > 0) {
         pg_freeresult($result);
     } elseif ($this->id > 0) {
         pg_freeresult($this->id);
     }
     $this->sql_query = "";
     $this->sql_order = "";
     $this->pos = 0;
     $this->max_rows = 0;
     $this->num_rows = 0;
 }
Ejemplo n.º 7
0
 /**
  * Constructor
  * Constructor, create a new instance of a registry for a table. Load all the registry info in the Registry object.
  * To make it available to apply the registry in the different contexts.
  * @param object sqlConnect $dbc  Database connexion
  * @param String $table name of the table where to apply the registry.
  * @access public
  *
  * Constructor now is going to load the reqistry XML or table
  * for each field get its type (if not defined use default char)
  * create a new instance of the associated field type object and store it into an array
  * indexed by the field name.
  * Built a [rtype]=rdata array and pass it to the constructor
  *
  */
 function __construct($table = '', $dbc = '')
 {
     parent::__construct();
     if (is_resource($table)) {
         $dbc = $table;
         $table = '';
     }
     // temporary hack for backward compatibility. (th4bc)
     if ($dbc == '') {
         $dbc = $GLOBALS['conx'];
     }
     if ($dbc != "") {
         $this->dbc = $dbc;
         $this->project_path = $this->dbc->getProjectDirectory();
     }
     if (!empty($GLOBALS['cfg_local_pasdir'])) {
         $this->radria_core_path = $GLOBALS['cfg_local_pasdir'];
     }
     if (defined("RADRIA_LOG_RUN_FIELDS")) {
         $this->setLogRun(RADRIA_LOG_RUN_FIELDS);
     }
     $this->setLog("\n \n Fields object constructor: " . $table);
     if (strlen(trim($table)) > 0) {
         $table = trim($table);
         $this->table = $table;
         $this->setLog("\n loading from registry: " . $table);
         if (strpos($table, ",") === false) {
             if (file_exists($this->project_path . "/" . $this->tbl_registry . "/" . $this->table . ".reg.xml")) {
                 $this->setLog(" \n loading from xml registry:" . $this->table);
                 $this->registryFromXML($table);
             } else {
                 $this->setLog(" \n loading from Table registry:" . $this->table);
                 $this->registryFromTable($table);
             }
         } else {
             $this->setLog("\n Multiple registries detected");
             $a_tables = explode(",", $table);
             foreach ($a_tables as $reg_table) {
                 $reg_table = trim($reg_table);
                 if (file_exists($this->project_path . "/" . $this->tbl_registry . "/" . $reg_table . ".reg.xml")) {
                     $this->setLog(" \n loading from xml registry:" . $reg_table);
                     $this->registryFromXML($reg_table);
                 } else {
                     $this->registryFromTable($reg_table);
                     $this->setLog(" \n loading from Table registry:" . $reg_table);
                 }
             }
         }
     }
 }