Example #1
0
 /**
  * Constructor
  * Used while getting all datas from database
  * Useful for duplicate function for example
  *
  * @param integer $id, DB ID of this block
  * @param integer $location The location we want to get the block from
  * @param boolean $public The needed precision for USERSPACE location
  * @access public
  */
 function __construct($id = 0, $location = RESOURCE_LOCATION_USERSPACE, $public = false)
 {
     parent::__construct();
     if (SensitiveIO::isPositiveInteger($id)) {
         //Select table
         $table = $this->_getDataTableName($location, $public);
         $sql = "\n\t\t\t\tselect\n\t\t\t\t\t*\n\t\t\t\tfrom\n\t\t\t\t\t" . $table . "\n\t\t\t\twhere\n\t\t\t\t\tid=" . $id . "\n\t\t\t\t\t";
         $q = new CMS_query($sql);
         if (!$q->hasError()) {
             $data = $q->getArray();
             $this->_dbID = $id;
             $this->_pageID = $data["page"];
             $this->_clientSpaceID = $data["clientSpaceID"];
             $this->_rowID = $data["rowID"];
             $this->_tagID = $data["blockID"];
             //Flash parameters
             $this->_file = $data["file"];
             $this->_width = $data["width"];
             $this->_height = $data["height"];
             $this->_name = $data["name"];
             $this->_version = $data["version"];
             $this->_params = $data["params"];
             $this->_flashvars = $data["flashvars"];
             $this->_flashattributes = $data["attributes"];
         }
     }
 }
Example #2
0
 /**
  * Constructor
  * Used while getting all datas from database
  * Useful for duplicate function for example
  *
  * @param integer $id, DB ID of this block
  * @param integer $location The location we want to get the block from
  * @param boolean $public The needed precision for USERSPACE location
  * @access public
  */
 function __construct($id = 0, $location = RESOURCE_LOCATION_USERSPACE, $public = false)
 {
     parent::__construct();
     if (SensitiveIO::isPositiveInteger($id)) {
         //Select table
         $table = $this->_getDataTableName($location, $public);
         $sql = "\n\t\t\t\tselect\n\t\t\t\t\t*\n\t\t\t\tfrom\n\t\t\t\t\t" . $table . "\n\t\t\t\twhere\n\t\t\t\t\tid=" . $id . "\n\t\t\t\t\t";
         $q = new CMS_query($sql);
         if (!$q->hasError()) {
             $data = $q->getArray();
             $this->_dbID = $id;
             $this->_pageID = $data["page"];
             $this->_clientSpaceID = $data["clientSpaceID"];
             $this->_rowID = $data["rowID"];
             $this->_tagID = $data["blockID"];
             $this->_value = unserialize($data["value"]);
         }
     }
 }
Example #3
0
 /**
  * Constructor
  * Used while getting all datas from database
  * Useful for duplicate function for example
  *
  * @param integer $id, DB ID of this block
  * @param integer $location The location we want to get the block from
  * @param boolean $public The needed precision for USERSPACE location
  * @access public
  */
 function __construct($id = 0, $location = RESOURCE_LOCATION_USERSPACE, $public = false)
 {
     parent::__construct();
     if (SensitiveIO::isPositiveInteger($id)) {
         //Select table
         $table = $this->_getDataTableName($location, $public);
         $sql = "\n\t\t\t\tselect\n\t\t\t\t\t*\n\t\t\t\tfrom\n\t\t\t\t\t" . $table . "\n\t\t\t\twhere\n\t\t\t\t\tid=" . $id . "\n\t\t\t\t\t";
         $q = new CMS_query($sql);
         if (!$q->hasError()) {
             $data = $q->getArray();
             $this->_dbID = $id;
             $this->_pageID = $data["page"];
             $this->_clientSpaceID = $data["clientSpaceID"];
             $this->_rowID = $data["rowID"];
             $this->_tagID = $data["blockID"];
             $this->_label = $data["label"];
             $this->_file = $data["file"];
             $this->_enlargedFile = $data["enlargedFile"];
             $this->_externalLink = $data["externalLink"];
             $this->_resizeable = $data["file"] ? true : false;
         }
     }
 }