/[drupal]/contributions/modules/sheetnode/sheetnode.module
ViewVC logotype

Diff of /contributions/modules/sheetnode/sheetnode.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4.2.8, Thu Nov 27 19:37:36 2008 UTC revision 1.4.2.9, Thu Jan 1 14:20:19 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: sheetnode.module,v 1.4.2.7 2008/11/22 07:48:23 kratib Exp $  // $Id: sheetnode.module,v 1.4.2.8 2008/11/27 19:37:36 kratib Exp $
3    
4  function sheetnode_node_info() {  function sheetnode_node_info() {
5    return array(    return array(
# Line 106  function _sheetnode_inject($value, $edit Line 106  function _sheetnode_inject($value, $edit
106  EOS;  EOS;
107  }  }
108    
109    function _sheetnode_sanitize_js($value) {
110      $chars = array(
111        chr(0xE2).chr(0x80).chr(0xA8), // Got this from Google Docs
112      );
113      return str_replace($chars, '', $value);
114    }
115    
116  function sheetnode_insert($node) {  function sheetnode_insert($node) {
117    if ($node->sheetsave) {    if ($node->sheetsave) {
118      _sheetnode_save($node->nid, $node->sheetsave);      _sheetnode_save($node->nid, $node->sheetsave);
# Line 150  function _sheetnode_load($nid) { Line 157  function _sheetnode_load($nid) {
157    
158  function _sheetnode_save($nid, $value) {  function _sheetnode_save($nid, $value) {
159    db_query("DELETE FROM {sheetnode} WHERE nid=%d", $nid);    db_query("DELETE FROM {sheetnode} WHERE nid=%d", $nid);
160    db_query("INSERT INTO {sheetnode} (nid, value) VALUES (%d, '%s')", $nid, serialize($value));    db_query("INSERT INTO {sheetnode} (nid, value) VALUES (%d, '%s')", $nid, serialize(_sheetnode_sanitize_js($value)));
161  }  }
162    
163  // @see http://forums.codecharge.com/posts.php?post_id=75694  // @see http://forums.codecharge.com/posts.php?post_id=75694

Legend:
Removed from v.1.4.2.8  
changed lines
  Added in v.1.4.2.9

  ViewVC Help
Powered by ViewVC 1.1.2