Project

General

Profile

« Previous | Next » 

Revision 2068

Added by darkviper almost 11 years ago

  1. admin/users/user_list corrected multibyte handling
  2. Droplet - iEditThisPage: copy/past error fixed (object reference)

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
03 Jan-2014 Build 2068 Manuela v.d.Decken(DarkViper)
15
# admin/users/user_list  corrected multibyte handling
16
# Droplet - iEditThisPage: copy/past error fixed (object reference)
14 17
02 Jan-2014 Build 2067 Dietmar Woellbrink (Luisehahne)
15 18
+ /admin/users/languages/ 20 Language Files added (Tks To jacobi22)
16 19
02 Jan-2014 Build 2066 Dietmar Woellbrink (Luisehahne)
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.4');
54
if(!defined('REVISION')) define('REVISION', '2067');
54
if(!defined('REVISION')) define('REVISION', '2068');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/users/user_list.php
54 54
        $UserStatusActive = 'url('.THEME_URL.'/images/user.png)';
55 55
        $UserStatusInactive = 'url('.THEME_URL.'/images/user_red.png)';
56 56

  
57
        $sUserTitle = ($iUserStatus == 0) ? $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_ACTIVE) : $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_DELETED) ;
57
        $sUserTitle = ($iUserStatus == 0) ? $mLang->MENU_USERS.' '.mb_strtolower($mLang->TEXT_ACTIVE, 'UTF-8')
58
                                          : $mLang->MENU_USERS.' '.mb_strtolower($mLang->TEXT_DELETED, 'UTF-8') ;
58 59

  
59 60
        $oTpl->set_var('TEXT_USERS', $sUserTitle.' '.$mLang->TEXT_SHOW );
60 61
        $oTpl->set_var('STATUS_ICON', ( ($iUserStatus==0) ? $UserStatusActive : $UserStatusInactive) );
......
73 74
        }
74 75

  
75 76
        $sUserList  = $mLang->TEXT_LIST_OPTIONS.' ';
76
        $sUserList .= ($iUserStatus == 1) ? $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_ACTIVE) : $mLang->MENU_USERS.' '.strtolower($mLang->TEXT_DELETED) ;
77
        $sUserList .= ($iUserStatus == 1) ? $mLang->MENU_USERS.' '.mb_strtolower($mLang->TEXT_ACTIVE, 'UTF-8')
78
                                          : $mLang->MENU_USERS.' '.mb_strtolower($mLang->TEXT_DELETED, 'UTF-8') ;
77 79
        // Insert values into the modify/remove menu
78 80
        $oTpl->set_block('main_block', 'list_block', 'list');
79 81
        if($oRes->numRows() > 0) {
......
106 108
        	$oTpl->set_var('DISPLAY_DELETE', 'hide');
107 109
        }
108 110
        $HeaderTitle  = (($iUserStatus == 1) ? $mLang->HEADING_MODIFY_ACTIVE_USER : $mLang->HEADING_MODIFY_DELETE_USER ).' ';
109
        $HeaderTitle .= (($iUserStatus == 1) ? strtolower($mLang->TEXT_ACTIVE) : strtolower($mLang->TEXT_INACTIVE));
111
        $HeaderTitle .= (($iUserStatus == 1) ? mb_strtolower($mLang->TEXT_ACTIVE, 'UTF-8')
112
                                             : mb_strtolower($mLang->TEXT_INACTIVE, 'UTF-8'));
110 113
        // Insert language headings
111 114
        $oTpl->set_var(array(
112 115
        		'HEADING_MODIFY_DELETE_USER' => $HeaderTitle,
......
144 147
        //        	$oTpl->set_var('NAME', 'User waiting for activation');
145 148
        //        	$oTpl->set_var('STATUS', '' );
146 149
                	// Loop through users
147
                    if($nNumRows = $oRes->numRows()) {
150
                    if(($nNumRows = $oRes->numRows())) {
148 151
                    	while($aUser = $oRes->fetchRow(MYSQL_ASSOC)) {
149 152
                    		$oTpl->set_var('CVALUE',$admin->getIDKEY($aUser['user_id']));
150 153
                       		$oTpl->set_var('CSTATUS', '') ;
branches/2.8.x/wb/modules/droplets/example/iEditThisPage.php
2 2
//:Use: [[iEditThisPage?show=7]]. You can format the appearance using CSS-class 'div.iEditThisPage' in your basic-css file
3 3
// @author: Werner von der Decken
4 4

  
5
	global $wb, $database, $HEADING;
5
	global $wb;
6
    $oReg   = WbAdaptor::getInstance();
7
    $oDb    = WbDatabase::getInstance();
8
    $oTrans = Translate::getInstance();
6 9
	$returnvalue = '';
7
	if($wb->is_authenticated() )
8
	{
10
	if ($wb->is_authenticated()) {
9 11
		$is_admin = false;
10 12
		$page_id = PAGE_ID == 0 ? $wb->default_page_id : PAGE_ID;
11 13
		$user_id = $wb->get_user_id();
12
		$sql = 'SELECT `admin_users`, `admin_groups` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.$page_id;
13
		if(($rset = $database->query($sql)) != null)
14
		{
15
			if(($rec = $rset->fetchRow()) != null)
16
			{
14
		$sql = 'SELECT `admin_users`, `admin_groups` '
15
             . 'FROM `'.$oDb->TablePrefix.'pages` '
16
             . 'WHERE `page_id` = '.$page_id;
17
		if (($rset = $oDb->doQuery($sql)) != null) {
18
			if (($rec = $rset->fetchRow(MYSQL_ASSOC)) != null) {
17 19
				$is_admin = ($wb->ami_group_member($rec['admin_groups']) ||
18
				            ($this->is_group_match($user_id, $rec['admin_users'])) );
20
				            ($wb->is_group_match($user_id, $rec['admin_users'])) );
19 21
			}
20 22
		}
21
		if($is_admin)
22
		{
23
			$tpl  = '<a href="'.ADMIN_URL.'/pages/%1$s.php?page_id='.$page_id.'" target="_blank" title="%2$s">';
24
			$tpl .= '<img src="'.THEME_URL.'/images/%3$s_16.png" alt="%2$s" /></a>';
23
		if ($is_admin) {
24
			$tpl  = '<a href="'.$oReg->AcpUrl.'pages/%1$s.php?page_id='.$page_id.'" target="_blank" title="%2$s">'
25
			      . '<img src="'.$oReg->ThemeUrl.'images/%3$s_16.png" alt="%2$s" /></a>';
25 26
			$show = ((!isset($show) || $show == '') ? 1 : (int)$show);
26 27
			$show = ($show > 7 ? 7 : (int)$show);
27 28
			$show = ($show < 2 ? 1 : (int)$show );
28
			if($show & 1)
29
			{
30
				$returnvalue .= sprintf($tpl, 'modify', $HEADING['MODIFY_PAGE'], 'edit');
29
			if ($show & 1) {
30
				$returnvalue .= sprintf($tpl, 'modify', $oTrans->HEADING_MODIFY_PAGE, 'edit');
31 31
			}
32 32
			$sys_perm = $wb->get_session('SYSTEM_PERMISSIONS');
33
			if(@is_array($sys_perm))
34
			{
35
				if(($show & 2) && (array_search('pages_settings', $sys_perm)!==false))
36
				{
37
					$returnvalue .= sprintf($tpl, 'settings', $HEADING['MODIFY_PAGE_SETTINGS'], 'modify');
33
			if (@is_array($sys_perm)) {
34
				if (($show & 2) && (array_search('pages_settings', $sys_perm)!==false)) {
35
					$returnvalue .= sprintf($tpl, 'settings', $oTrans->HEADING_MODIFY_PAGE_SETTINGS, 'modify');
38 36
				}
39
				if(($show & 4) && (array_search('pages_modify', $sys_perm)!==false))
40
				{
41
					$returnvalue .= sprintf($tpl, 'sections', $HEADING['MANAGE_SECTIONS'], 'sections');
37
				if (($show & 4) && (array_search('pages_modify', $sys_perm)!==false)) {
38
					$returnvalue .= sprintf($tpl, 'sections', $oTrans->HEADING_MANAGE_SECTIONS, 'sections');
42 39
				}
43 40
			}
44
			if($returnvalue != '')
45
			{
41
			if ($returnvalue != '') {
46 42
				$returnvalue  = '<div class="iEditThisPage">'.$returnvalue.'</div>';
47 43
			}
48 44
		}

Also available in: Unified diff