Ejemplo n.º 1
0
 /**
  * Pre Process
  */
 function pre_process($data)
 {
     Wygwam_helper::$entry_site_id = isset($this->row['entry_site_id']) ? $this->row['entry_site_id'] : null;
     // convert file tags to URLs
     Wygwam_helper::replace_file_tags($data);
     // convert asset tags to URLs
     Wygwam_helper::replace_asset_tags($data);
     // convert site page tags to URLs
     Wygwam_helper::replace_page_tags($data);
     $this->EE->load->library('typography');
     $tmp_encode_email = $this->EE->typography->encode_email;
     $this->EE->typography->encode_email = FALSE;
     $tmp_convert_curly = $this->EE->typography->convert_curly;
     $this->EE->typography->convert_curly = FALSE;
     $data = $this->EE->typography->parse_type($data, array('text_format' => 'none', 'html_format' => 'all', 'auto_links' => isset($this->row['channel_auto_link_urls']) ? $this->row['channel_auto_link_urls'] : 'n', 'allow_img_url' => isset($this->row['channel_allow_img_urls']) ? $this->row['channel_allow_img_urls'] : 'y'));
     $this->EE->typography->encode_email = $tmp_encode_email;
     $this->EE->typography->convert_curly = $tmp_convert_curly;
     // use normal quotes
     $data = str_replace('"', '"', $data);
     return $data;
 }
Ejemplo n.º 2
0
 /**
  * Display Cell
  */
 function display_cell($data)
 {
     Wygwam_helper::include_field_resources();
     Wygwam_helper::insert_config_js($this->settings);
     // get the cache
     if (!isset($this->EE->session->cache['wygwam'])) {
         $this->EE->session->cache['wygwam'] = array();
     }
     $cache =& $this->EE->session->cache['wygwam'];
     if (!isset($cache['displayed_cols'])) {
         Wygwam_helper::include_theme_js('scripts/matrix2.js');
         $cache['displayed_cols'] = array();
     }
     if (!isset($cache['displayed_cols'][$this->col_id])) {
         $defer = isset($this->settings['defer']) && $this->settings['defer'] == 'y' ? 'true' : 'false';
         Wygwam_helper::insert_js('Wygwam.matrixColConfigs.col_id_' . $this->col_id . ' = ["' . $this->settings['config'] . '", ' . $defer . '];');
         $cache['displayed_cols'][$this->col_id] = TRUE;
     }
     // convert file tags to URLs
     Wygwam_helper::replace_file_tags($data);
     // convert site page tags to URLs
     Wygwam_helper::replace_page_tags($data);
     return '<textarea name="' . $this->cell_name . '" rows="10">' . $data . '</textarea>';
 }