/** * Writes the block data into persistence (destroys previous and insert new) * * @param integer $pageID The page which contains the client space, DB ID * @param integer $clientSpaceID The client space which contains the row, DB ID * @param integer $rowID The row which contains the block, DB ID * @param integer $location The location we want to completly remove the block from * @param boolean $public The precision needed for USERSPACE location * @param array(mixed=>mixed) $data The data indexed by data type (value, file, alt_tag, ...), * @return boolean true on success, false on failure * @access public */ function writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data) { parent::writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data); //delete the old data $this->delFromLocation($pageID, $clientSpaceID, $rowID, $location, $public); $table = $this->_getDataTableName($location, $public); $sql = "\n\t\t\tinsert into\n\t\t\t\t" . $table . "\n\t\t\tset\n\t\t\t\tpage='" . sensitiveIO::sanitizeSQLString($pageID) . "',\n\t\t\t\tclientSpaceID='" . sensitiveIO::sanitizeSQLString($clientSpaceID) . "',\n\t\t\t\trowID='" . sensitiveIO::sanitizeSQLString($rowID) . "',\n\t\t\t\tblockID='" . sensitiveIO::sanitizeSQLString($this->_tagID) . "',\n\t\t\t\ttype='CMS_block_cms_forms',\n\t\t\t\tvalue='" . sensitiveIO::sanitizeSQLString(serialize($data["value"])) . "'\n\t\t"; $q = new CMS_query($sql); if ($q->hasError()) { return false; } else { return true; } }
/** * Writes the block data into persistence (destroys previous and insert new) * * @param integer $pageID The page which contains the client space, DB ID * @param integer $clientSpaceID The client space which contains the row, DB ID * @param integer $rowID The row which contains the block, DB ID * @param integer $location The location we want to completly remove the block from * @param boolean $public The precision needed for USERSPACE location * @param array(mixed=>mixed) $data The data indexed by data type (value, file, alt_tag, ...), * @return boolean true on success, false on failure * @access public */ function writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data) { parent::writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data); //delete the old data $this->delFromLocation($pageID, $clientSpaceID, $rowID, $location, $public); $table = $this->_getDataTableName($location, $public); $sql = "\n\t\t\tinsert into\n\t\t\t\t" . $table . "\n\t\t\tset\n\t\t\t\tpage='" . $pageID . "',\n\t\t\t\tclientSpaceID='" . $clientSpaceID . "',\n\t\t\t\trowID='" . $rowID . "',\n\t\t\t\tblockID='" . $this->_tagID . "',\n\t\t"; if ($data["file"]) { $sql .= "file='" . $data["file"] . "',"; } if ($data["enlargedFile"]) { $sql .= "enlargedFile='" . $data["enlargedFile"] . "',"; } $sql .= "\n\t\t\t\texternalLink = '" . SensitiveIO::sanitizeSQLString($data["externalLink"]) . "',\n\t\t\t\tlabel='" . SensitiveIO::sanitizeSQLString(stripslashes($data["label"])) . "'\n\t\t"; $q = new CMS_query($sql); if ($q->hasError()) { return false; } else { return true; } }
/** * Writes the block data into persistence (destroys previous and insert new) * * @param integer $pageID The page which contains the client space, DB ID * @param integer $clientSpaceID The client space which contains the row, DB ID * @param integer $rowID The row which contains the block, DB ID * @param integer $location The location we want to completly remove the block from * @param boolean $public The precision needed for USERSPACE location * @param array(mixed=>mixed) $data The data indexed by data type (value, file, alt_tag, ...), * @return boolean true on success, false on failure * @access public */ function writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data) { parent::writeToPersistence($pageID, $clientSpaceID, $rowID, $location, $public, $data); //delete the old data $this->delFromLocation($pageID, $clientSpaceID, $rowID, $location, $public); $table = $this->_getDataTableName($location, $public); $sql = "\n\t\t\tinsert into\n\t\t\t\t" . $table . "\n\t\t\tset\n\t\t\t\tpage='" . $pageID . "',\n\t\t\t\tclientSpaceID='" . $clientSpaceID . "',\n\t\t\t\trowID='" . $rowID . "',\n\t\t\t\tblockID='" . $this->_tagID . "',\n\t\t"; if ($data["file"]) { $sql .= "file='" . $data["file"] . "',"; } $sql .= "\n\t\t\t\tname='" . SensitiveIO::sanitizeSQLString(SensitiveIO::sanitizeAsciiString($data["name"])) . "',\n\t\t\t\twidth='" . SensitiveIO::sanitizeSQLString($data["width"]) . "',\n\t\t\t\theight='" . SensitiveIO::sanitizeSQLString($data["height"]) . "',\n\t\t\t\tversion='" . SensitiveIO::sanitizeSQLString($data["version"]) . "',\n\t\t\t\tparams='" . SensitiveIO::sanitizeSQLString($data["params"]) . "',\n\t\t\t\tflashvars='" . SensitiveIO::sanitizeSQLString($data["flashvars"]) . "',\n\t\t\t\tattributes='" . SensitiveIO::sanitizeSQLString($data["attributes"]) . "'\n\t\t"; $q = new CMS_query($sql); if ($q->hasError()) { return false; } else { return true; } }