Project

General

Profile

« Previous | Next » 

Revision 1835

Added by Dietmar almost 12 years ago

! update dragdrop reorder positions of a page tree

View differences:

branches/2.8.x/CHANGELOG
13 13

  
14 14

  
15 15

  
16
10 Dez-2012 Build 1835 Dietmar Woellbrink (Luisehahne)
17
! update dragdrop reorder positions of a page tree
16 18
10 Dez-2012 Build 1834 Dietmar Woellbrink (Luisehahne)
17 19
# fixed redirect checking in class.login.php
18 20
10 Dez-2012 Build 1833 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/skel/themes/htt/pages_sections.htt
41 41
		<td class="header_list_pubdate_start">{TEXT_PUBL_START_DATE}</td>
42 42
		<td class="header_list_pubdate_end">{TEXT_PUBL_END_DATE}</td>
43 43
		<td class="header_list_actions" colspan="3">{TEXT_ACTIONS}</td>
44
		<td class="header_list_section_id">ID</td>
45
		<td {DISPLAY_DEBUG}>{TEXT_PID}</td>
44
		<td title="{TEXT_SECTION}" class="header_list_section_id">ID</td>
45
		<td title="Position" class="header_list_section_id" {DISPLAY_DEBUG}>{TEXT_PID}</td>
46 46
	</tr>
47 47
</thead>
48 48
<tbody>
......
87 87

  
88 88
        <td class="list_section_id">{VAR_SECTION_ID}</td>
89 89

  
90
        <td {DISPLAY_DEBUG}>{POSITION}</td>
90
        <td class="list_section_id" {DISPLAY_DEBUG}>{POSITION}</td>
91 91
    </tr>
92 92
<!-- END section_block -->
93 93
    <tr>
branches/2.8.x/wb/admin/pages/sections.php
32 32
	exit(0);
33 33
}
34 34
/* */
35
$debug = false; // to show position and section_id
35
$debug = true; // to show position
36 36
If(!defined('DEBUG')) { define('DEBUG',$debug);}
37 37
// Create new admin object
38 38
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
......
251 251
						'HEADING_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
252 252
						'TEXT_CHANGE_SETTINGS' => $TEXT['CHANGE_SETTINGS'],
253 253
						'TEXT_ADD_SECTION' => $TEXT['ADD_SECTION'],
254
						'TEXT_SECTION' => $TEXT['SECTION'],
254 255
						'TEXT_ID' => 'ID',
255 256
						'TEXT_TYPE' => $TEXT['TYPE'],
256 257
						'TEXT_BLOCK' => $TEXT['BLOCK'],
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1834');
54
if(!defined('REVISION')) define('REVISION', '1835');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/templates/wb_theme/css/screen.css
17 17
.input_large { width :300px; }
18 18
.input_full { width :100%; }
19 19
/*  */
20
table { border-collapse :collapse; width :100%; table-layout :fixed; }
20
table { border-collapse :collapse; width :100%; table-layout :inherit; }
21 21
table.layout { table-layout :auto; }
22 22
table.header { margin :auto; width :100%; }
23 23
table.header td { min-width :10%; }
branches/2.8.x/wb/modules/jsadmin/jsadmin_backend_include.php
73 73
		if(get_setting('mod_jsadmin_ajax_order_sections', '1')) {
74 74
			$js_scripts[] = 'dragdrop.js';
75 75
			if(SECTION_BLOCKS) {
76
			$js_buttonCell= 5; }
77
      else{ $js_buttonCell= 5; } // This ist the Cell where the Button "Up" is , by Swen Uth
76
    			$js_buttonCell= 5; 
77
            } else { 
78
                $js_buttonCell= 5; 
79
            } // This ist the Cell where the Button "Up" is , by Swen Uth
78 80
		}
79 81
	} elseif($page_type == 'config') {
80 82
		$js_scripts[] = 'tool.js';
branches/2.8.x/wb/modules/jsadmin/move_to.php
63 63
    		$table = TABLE_PREFIX.'pages';
64 64
    	}
65 65
    }
66
	$bModified = ($id_field == 'page_id') ? $bModified : false;
66 67

  
67 68
    $iPageId = intval($_GET['page_id']);
68 69
	// Get current index
69
    $sql = 'SELECT `'.$common_field.'`,`position`,`page_id` FROM `'.$table.'` WHERE `'.$id_field.'` ='.(int)$id; //.' AND page_id='.$iPageId;
70
    $sql = 'SELECT `'.$common_field.'`,`position` FROM `'.$table.'` WHERE `'.$id_field.'` ='.(int)$id; //.' AND page_id='.$iPageId;
70 71
    if($oRes=$database->query($sql)) {
71 72
        if($aPage = $oRes->fetchRow(MYSQL_ASSOC)){
72 73
    		$common_id = intval($aPage[$common_field]);
73 74
    		$old_position = intval($aPage['position']);
74
    		$iPageId = intval($aPage['page_id']);
75 75
        }
76 76
    }
77 77

  
......
90 90
	if($old_position == $position)
91 91
		return;
92 92
*/
93

  
93 94
// all echos with <pre> coded for looking in firebug console
94 95
$sSqlModify =  ($bModified == true) ? ',`modified_when` = '.time().',`modified_by` = '.$admin->get_user_id().' ' : '';
95 96
if($old_position != $position) {
97
}
96 98
	echo $output = ($bDebug == false) ? "\n" : "<pre>$sql</pre>\n";
97 99
	// Build query to update affected rows
98 100
	if($old_position < $position)
......
116 118
EOT;
117 119
	echo $output = ($bDebug == false) ? "\n" : "<pre>$sql</pre>\n";
118 120
	$database->query($sql);
119
}
121
    if(!class_exists('order', false)){ include(WB_PATH.'/framework/class.order.php'); }
122
    $order = new order($table, 'position', $id_field, $common_field);
123
    $order->clean($common_id);    
124
	echo $output = ($bDebug == false) ? "\n" : "<pre>$table,'position','$id_field','$common_field'</pre>\n";
125
	echo $output = ($bDebug == false) ? "\n" : "<pre>$common_id</pre>\n";
126

  
120 127
} else {
121 128
	die("Missing parameters");
122 129
	header("Location: index.php");

Also available in: Unified diff