Beispiel #1
0
 /**
  * Display Grid Cell
  */
 function grid_display_field($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_grid_cols'])) {
         Wygwam_helper::include_theme_js('scripts/grid.js');
         $cache['displayed_grid_cols'] = array();
     }
     if (!isset($cache['displayed_grid_cols'][$this->settings['col_id']])) {
         $defer = isset($this->settings['defer']) && $this->settings['defer'] == 'y' ? 'true' : 'false';
         Wygwam_helper::insert_js('Wygwam.gridColConfigs.col_id_' . $this->settings['col_id'] . ' = ["' . $this->settings['config'] . '", ' . $defer . '];');
         $cache['displayed_grid_cols'][$this->settings['col_id']] = TRUE;
     }
     // convert file tags to URLs
     Wygwam_helper::replace_file_tags($data);
     // convert asset tags to URLs
     $asset_info = Wygwam_helper::replace_asset_tags($data);
     // convert site page tags to URLs
     Wygwam_helper::replace_page_tags($data);
     if ($this->EE->extensions->active_hook('wygwam_before_display')) {
         $data = $this->EE->extensions->call('wygwam_before_display', $this, $data);
     }
     return '<textarea name="' . $this->field_name . '" rows="10">' . $data . '</textarea>' . $this->_generate_asset_inputs_string($asset_info);
 }
 /**
  * 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>';
 }