MidCOM svn: r14719 - in trunk/midcom/midcom.helper.datamanager2:
static/chooser widget
w_i
midcom-commits at lists.midgard-project.org
Fri Feb 1 12:03:36 CET 2008
Author: w_i
Date: Fri Feb 1 12:03:35 2008
New Revision: 14719
URL: http://trac.midgard-project.org/software/changeset/14719
Log:
Made it work better when no javascript enabled
Modified:
trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js
trunk/midcom/midcom.helper.datamanager2/widget/chooser.php
Modified: trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js
==============================================================================
--- trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js (original)
+++ trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js Fri Feb 1 12:03:35 2008
@@ -85,6 +85,8 @@
hideResultsNow();
+ jQuery('.widget_chooser_static_items_table').hide();
+
function selectCurrent()
{
var selected = results_holder.selected();
Modified: trunk/midcom/midcom.helper.datamanager2/widget/chooser.php
==============================================================================
--- trunk/midcom/midcom.helper.datamanager2/widget/chooser.php (original)
+++ trunk/midcom/midcom.helper.datamanager2/widget/chooser.php Fri Feb 1 12:03:35 2008
@@ -1150,7 +1150,7 @@
// debug_print_r('all elements to be added',$elements);
// debug_pop();
- $this->_static_items_html = "<noscript>\n";
+ // $this->_static_items_html = "<noscript>\n";
$this->_static_items_html .= "<table class=\"widget_chooser_static_items_table\">\n<thead><tr>\n";
if ( !empty($this->reflector_key)
@@ -1195,7 +1195,7 @@
foreach ($elements as $key)
{
// debug_add("Processing key {$key}");
- $this->_add_existing_item_as_static($key);
+ // $this->_add_existing_item_as_static($key);
$data = $this->_get_key_data($key);
if ($data)
{
@@ -1214,7 +1214,7 @@
$this->_static_items_html .= "</tbody>\n";
$this->_static_items_html .= "</table>\n";
- $this->_static_items_html .= "</noscript>\n";
+ // $this->_static_items_html .= "</noscript>\n";
//$this->_form->addElement('static', "{$this->_element_id}_initscripts", '', $this->_jscript);
@@ -1239,7 +1239,7 @@
function _add_existing_item_as_static($key)
{
- $object =& $this->_get_key_data($key, false, true);
+ $object = $this->_get_key_data($key, false, true);
$id_field = $this->id_field;
$item_id = @$object->$id_field;
@@ -1255,7 +1255,7 @@
&& !$this->result_headers)
{
$value = @$object->get_label();
- $value = rawurlencode($value);
+ // $value = rawurlencode($value);
//debug_add("adding header item: name=label value={$value}");
$title = $_MIDCOM->i18n->get_string('label', 'midcom');
$this->_static_items_html .= "<td class=\"label\">{$value} </td>\n";
@@ -1266,7 +1266,7 @@
{
$item_name = $header_item['name'];
$value = @$object->$item_name;
- $value = rawurlencode(utf8_decode($value));
+ // $value = rawurlencode(utf8_decode($value));
// debug_add("adding header item: name={$item_name} value={$value}");
//
$this->_static_items_html .= "<td class=\"{$item_name}\">{$value} </td>";
@@ -1380,7 +1380,6 @@
{
// debug_push_class(__CLASS__, __FUNCTION__);
// debug_add("get_key_data for key: {$key}");
-
if ($this->_callback)
{
// debug_add("Using callback to fetch key data");
@@ -1390,7 +1389,7 @@
// debug_pop();
return $this->_callback->resolve_object_name($key);
}
-
+
$results = $this->_callback->get_key_data($key);
if (! $results)
@@ -1400,7 +1399,8 @@
// debug_pop();
- if ($this->_renderer_callback)
+ if ( $this->_renderer_callback
+ || $return_object)
{
return $results;
}
@@ -1453,7 +1453,6 @@
$_MIDCOM->auth->drop_sudo();
// debug_pop();
-
if ($return_object)
{
return $object;
More information about the midcom-commits
mailing list