Completed
Push — master ( ded118...cf7347 )
by Michael
02:48
created

myblocksadmin2.php ➔ list_blockinstances()   F

Complexity

Conditions 28
Paths 3042

Size

Total Lines 216
Code Lines 131

Duplication

Lines 12
Ratio 5.56 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 28
eloc 131
c 1
b 0
f 0
nc 3042
nop 0
dl 12
loc 216
rs 2

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 79 and the first side effect is on line 8.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
// ------------------------------------------------------------------------- //
3
//                     myblocksadmin_for_2.2.php                             //
4
//                - XOOPS block admin for each modules -                     //
5
//                          GIJOE <http://www.peak.ne.jp/>                   //
6
// ------------------------------------------------------------------------- //
7
8
if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
9
10
include_once( '../../../include/cp_header.php' ) ;
11
12
include_once( 'mygrouppermform.php' ) ;
13
include_once( XOOPS_ROOT_PATH.'/class/xoopsblock.php' ) ;
14
include_once "../include/gtickets.php" ;
15
16
$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system' ;
17
18
// language files
19
$language = $xoopsConfig['language'] ;
20
if( ! file_exists( "$xoops_system_path/language/$language/admin/blocksadmin.php") ) $language = 'english' ;
21
22
// to prevent from notice that constants already defined
23
$error_reporting_level = error_reporting( 0 ) ;
24
include_once( "$xoops_system_path/constants.php" ) ;
25
include_once( "$xoops_system_path/language/$language/admin.php" ) ;
26
include_once( "$xoops_system_path/language/$language/admin/blocksadmin.php" ) ;
27
error_reporting( $error_reporting_level ) ;
28
29
$group_defs = file( "$xoops_system_path/language/$language/admin/groups.php" ) ;
30
foreach( $group_defs as $def ) {
31
    if( strstr( $def , '_AM_ACCESSRIGHTS' ) || strstr( $def , '_AM_ACTIVERIGHTS' ) ) eval( $def ) ;
32
}
33
34
// check $xoopsModule
35
if( ! is_object( $xoopsModule ) ) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
36
37
// set target_module if specified by $_GET['dirname']
38
$module_handler =& xoops_gethandler('module');
39
if( ! empty( $_GET['dirname'] ) ) {
40
    $target_module =& $module_handler->getByDirname($_GET['dirname']);
41
}/* else if( ! empty( $_GET['mid'] ) ) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
59% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
42
    $target_module =& $module_handler->get( intval( $_GET['mid'] ) );
43
}*/
44
45 View Code Duplication
if( ! empty( $target_module ) && is_object( $target_module ) ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
46
    // specified by dirname
47
    $target_mid = $target_module->getVar( 'mid' ) ;
48
    $target_mname = $target_module->getVar( 'name' ) . "&nbsp;" . sprintf( "(%2.2f)" , $target_module->getVar('version') / 100.0 ) ;
49
    $query4redirect = '?dirname='.urlencode(strip_tags($_GET['dirname'])) ;
50
} else if( isset( $_GET['mid'] ) && $_GET['mid'] == 0 || $xoopsModule->getVar('dirname') == 'blocksadmin' ) {
51
    $target_mid = 0 ;
52
    $target_mname = '' ;
53
    $query4redirect = '?mid=0' ;
54
} else {
55
    $target_mid = $xoopsModule->getVar( 'mid' ) ;
56
    $target_mname = $xoopsModule->getVar( 'name' ) ;
57
    $query4redirect = '' ;
58
}
59
60
// check access right (needs system_admin of BLOCK)
61
$sysperm_handler =& xoops_gethandler('groupperm');
62 View Code Duplication
if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
63
64
// get blocks owned by the module (Imported from xoopsblock.php then modified)
65
$db =& XoopsDatabaseFactory::getDatabaseConnection();
66
$sql = "SELECT bid,name,show_func,func_file,template FROM ".$db->prefix("newblocks")." WHERE mid='$target_mid'";
67
$result = $db->query($sql);
68
$block_arr = array();
69
while( list( $bid , $bname , $show_func , $func_file , $template ) = $db->fetchRow( $result ) ) {
70
    $block_arr[$bid] = array(
71
        'name' => $bname ,
72
        'show_func' => $show_func ,
73
        'func_file' => $func_file ,
74
        'template' => $template
75
    ) ;
76
}
77
78
// for 2.2
79
function list_blockinstances()
80
{
81
    global $query4redirect , $block_arr , $xoopsGTicket ;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
82
83
    $myts =& MyTextSanitizer::getInstance() ;
84
85
    // cachetime options
86
    $cachetimes = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH);
87
88
    // displaying TH
89
    echo "
90
	<form action='admin.php' name='blockadmin' method='post'>
91
		<table width='95%' class='outer' cellpadding='4' cellspacing='1'>
92
		<tr valign='middle'>
93
			<th>"._AM_TITLE."</th>
94
			<th align='center' nowrap='nowrap'>"._AM_SIDE."</th>
95
			<th align='center'>"._AM_WEIGHT."</th>
96
			<th align='center'>"._AM_VISIBLEIN."</th>
97
			<th align='center'>"._AM_BCACHETIME."</th>
98
			<th align='right'>"._AM_ACTION."</th>
99
		</tr>\n" ;
100
101
    // get block instances
102
    $crit = new Criteria("bid", "(".implode(",",array_keys($block_arr)).")", "IN");
103
    $criteria = new CriteriaCompo($crit);
104
    $criteria->setSort('visible DESC, side ASC, weight');
105
    $instance_handler =& xoops_gethandler('blockinstance');
106
    $instances =& $instance_handler->getObjects($criteria, true, true);
107
108
    //Get modules and pages for visible in
109
    $module_list[_AM_SYSTEMLEVEL]["0-2"] = _AM_ADMINBLOCK;
0 ignored issues
show
Coding Style Comprehensibility introduced by
$module_list was never initialized. Although not strictly required by PHP, it is generally a good practice to add $module_list = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
110
    $module_list[_AM_SYSTEMLEVEL]["0-1"] = _AM_TOPPAGE;
111
    $module_list[_AM_SYSTEMLEVEL]["0-0"] = _AM_ALLPAGES;
112
    $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
113
    $criteria->add(new Criteria('isactive', 1));
114
    $module_handler =& xoops_gethandler('module');
115
    $module_main =& $module_handler->getObjects($criteria, true, true);
116
    if (count($module_main) > 0) {
117
        foreach (array_keys($module_main) as $mid) {
118
            $module_list[$module_main[$mid]->getVar('name')][$mid."-0"] = _AM_ALLMODULEPAGES;
119
            $pages = $module_main[$mid]->getInfo("pages");
120
            if ($pages == false) {
121
                $pages = $module_main[$mid]->getInfo("sub");
122
            }
123
            if (is_array($pages) && $pages != array()) {
124
                foreach ($pages as $id => $pageinfo) {
125
                    $module_list[$module_main[$mid]->getVar('name')][$mid."-".$id] = $pageinfo['name'];
126
                }
127
            }
128
        }
129
    }
130
131
    // blocks displaying loop
132
    $class = 'even' ;
133
    $block_configs = get_block_configs() ;
134
    foreach( array_keys( $instances ) as $i ) {
135
        $sseln = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = "";
136
        $scoln = $scol0 = $scol1 = $scol2 = $scol3 = $scol4 = "#FFFFFF";
137
138
        $weight = $instances[$i]->getVar("weight") ;
139
        $title = $instances[$i]->getVar("title") ;
140
        $bcachetime = $instances[$i]->getVar("bcachetime") ;
141
        $bid = $instances[$i]->getVar("bid") ;
142
        $name = $myts->makeTboxData4Edit( $block_arr[$bid]['name'] ) ;
143
144
        $visiblein = $instances[$i]->getVisibleIn();
145
146
        // visible and side
147
        if ( $instances[$i]->getVar("visible") != 1 ) {
148
            $sseln = " checked='checked'";
149
            $scoln = "#FF0000";
150
        } else switch( $instances[$i]->getVar("side") ) {
151
            default :
0 ignored issues
show
Coding Style introduced by
There must be no space before the colon in a DEFAULT statement

As per the PSR-2 coding standard, there must not be a space in front of the colon in the default statement.

switch ($expr) {
    default : //wrong
        doSomething();
        break;
}

switch ($expr) {
    default: //right
        doSomething();
        break;
}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
152
            case XOOPS_SIDEBLOCK_LEFT :
0 ignored issues
show
Coding Style introduced by
There must be no space before the colon in a CASE statement

As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.

switch ($selector) {
    case "A": //right
        doSomething();
        break;
    case "B" : //wrong
        doSomethingElse();
        break;
}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
153
                $ssel0 = " checked='checked'";
154
                $scol0 = "#00FF00";
155
                break ;
156
            case XOOPS_SIDEBLOCK_RIGHT :
0 ignored issues
show
Coding Style introduced by
There must be no space before the colon in a CASE statement

As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.

switch ($selector) {
    case "A": //right
        doSomething();
        break;
    case "B" : //wrong
        doSomethingElse();
        break;
}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
157
                $ssel1 = " checked='checked'";
158
                $scol1 = "#00FF00";
159
                break ;
160
            case XOOPS_CENTERBLOCK_LEFT :
0 ignored issues
show
Coding Style introduced by
There must be no space before the colon in a CASE statement

As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.

switch ($selector) {
    case "A": //right
        doSomething();
        break;
    case "B" : //wrong
        doSomethingElse();
        break;
}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
161
                $ssel2 = " checked='checked'";
162
                $scol2 = "#00FF00";
163
                break ;
164
            case XOOPS_CENTERBLOCK_RIGHT :
0 ignored issues
show
Coding Style introduced by
There must be no space before the colon in a CASE statement

As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.

switch ($selector) {
    case "A": //right
        doSomething();
        break;
    case "B" : //wrong
        doSomethingElse();
        break;
}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
165
                $ssel4 = " checked='checked'";
166
                $scol4 = "#00FF00";
167
                break ;
168
            case XOOPS_CENTERBLOCK_CENTER :
0 ignored issues
show
Coding Style introduced by
There must be no space before the colon in a CASE statement

As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.

switch ($selector) {
    case "A": //right
        doSomething();
        break;
    case "B" : //wrong
        doSomethingElse();
        break;
}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
169
                $ssel3 = " checked='checked'";
170
                $scol3 = "#00FF00";
171
                break ;
172
        }
173
174
        // bcachetime
175
        $cachetime_options = '' ;
176 View Code Duplication
        foreach( $cachetimes as $cachetime => $cachetime_name ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
177
            if( $bcachetime == $cachetime ) {
178
                $cachetime_options .= "<option value='$cachetime' selected='selected'>$cachetime_name</option>\n" ;
179
            } else {
180
                $cachetime_options .= "<option value='$cachetime'>$cachetime_name</option>\n" ;
181
            }
182
        }
183
184
        $module_options = '' ;
185
        foreach( $module_list as $mname => $module ) {
186
            $module_options .= "<optgroup label='$mname'>\n" ;
187
            foreach( $module as $mkey => $mval ) {
188
                if( in_array( $mkey , $visiblein ) ) {
189
                    $module_options .= "<option value='$mkey' selected='selected'>$mval</option>\n" ;
190
                } else {
191
                    $module_options .= "<option label='$mval' value='$mkey'>$mval</option>\n" ;
192
                }
193
            }
194
            $module_options .= "</optgroup>\n" ;
195
        }
196
197
        // delete link if it is cloned block
198
        $delete_link = "<br /><a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;op=delete&amp;id=$i&amp;selmod=$mid'>"._DELETE."</a>" ;
0 ignored issues
show
Bug introduced by
The variable $mid seems to be defined by a foreach iteration on line 117. Are you sure the iterator is never empty, otherwise this variable is not defined?

It seems like you are relying on a variable being defined by an iteration:

foreach ($a as $b) {
}

// $b is defined here only if $a has elements, for example if $a is array()
// then $b would not be defined here. To avoid that, we recommend to set a
// default value for $b.


// Better
$b = 0; // or whatever default makes sense in your context
foreach ($a as $b) {
}

// $b is now guaranteed to be defined here.
Loading history...
199
200
        // displaying part
201
        echo "
202
		<tr valign='middle'>
203
			<td class='$class'>
204
				$name
205
				<br />
206
				<input type='text' name='title[$i]' value='$title' size='20' />
207
			</td>
208
			<td class='$class' align='center' nowrap='nowrap' width='125px'>
209
				<div style='float:left;background-color:$scol0;'>
210
					<input type='radio' name='side[$i]' value='".XOOPS_SIDEBLOCK_LEFT."' style='background-color:$scol0;' $ssel0 />
211
				</div>
212
				<div style='float:left;'>-</div>
213
				<div style='float:left;background-color:$scol2;'>
214
					<input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_LEFT."' style='background-color:$scol2;' $ssel2 />
215
				</div>
216
				<div style='float:left;background-color:$scol3;'>
217
					<input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_CENTER."' style='background-color:$scol3;' $ssel3 />
218
				</div>
219
				<div style='float:left;background-color:$scol4;'>
220
					<input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_RIGHT."' style='background-color:$scol4;' $ssel4 />
221
				</div>
222
				<div style='float:left;'>-</div>
223
				<div style='float:left;background-color:$scol1;'>
224
					<input type='radio' name='side[$i]' value='".XOOPS_SIDEBLOCK_RIGHT."' style='background-color:$scol1;' $ssel1 />
225
				</div>
226
				<br />
227
				<br />
228
				<div style='float:left;width:40px;'>&nbsp;</div>
229
				<div style='float:left;background-color:$scoln;'>
230
					<input type='radio' name='side[$i]' value='-1' style='background-color:$scoln;' $sseln />
231
				</div>
232
				<div style='float:left;'>"._NONE."</div>
233
			</td>
234
			<td class='$class' align='center'>
235
				<input type='text' name=weight[$i] value='$weight' size='3' maxlength='5' style='text-align:right;' />
236
			</td>
237
			<td class='$class' align='center'>
238
				<select name='bmodule[$i][]' size='5' multiple='multiple'>
239
					$module_options
240
				</select>
241
			</td>
242
			<td class='$class' align='center'>
243
				<select name='bcachetime[$i]' size='1'>
244
					$cachetime_options
245
				</select>
246
			</td>
247
			<td class='$class' align='right'>
248
				<a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;op=edit&amp;id=$i'>"._EDIT."</a>{$delete_link}
249
				<input type='hidden' name='id[$i]' value='$i' />
250
			</td>
251
		</tr>\n" ;
252
253
        $class = ( $class == 'even' ) ? 'odd' : 'even' ;
254
    }
255
256
    // list block classes for add (not instances)
257
    foreach( $block_arr as $bid => $block ) {
258
259
        $description4show = '' ;
260 View Code Duplication
        foreach( $block_configs as $bconf ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
261
            if( $block['show_func'] == $bconf['show_func'] && $block['func_file'] == $bconf['file'] && ( empty( $bconf['template'] ) || $block['template'] == $bconf['template'] ) ) {
262
                if( ! empty( $bconf['description'] ) ) $description4show = $myts->makeTboxData4Show( $bconf['description'] ) ;
263
            }
264
        }
265
266
        echo "
267
		<tr>
268
			<td class='$class' align='left'>
269
				".$myts->makeTboxData4Edit($block['name'])."
270
			</td>
271
			<td class='$class' align='left' colspan='4'>
272
				$description4show
273
			</td>
274
			<td class='$class' align='center'>
275
				<input type='submit' name='addblock[$bid]' value='"._ADD."' />
276
			</td>
277
		</tr>
278
		\n" ;
279
        $class = ( $class == 'even' ) ? 'odd' : 'even' ;
280
    }
281
282
    echo "
283
		<tr>
284
			<td class='foot' align='center' colspan='6'>
285
				<input type='hidden' name='query4redirect' value='$query4redirect' />
286
				<input type='hidden' name='fct' value='blocksadmin' />
287
				<input type='hidden' name='op' value='order2' />
288
				".$xoopsGTicket->getTicketHtml( __LINE__ , 1800 , 'myblocksadmin' )."
289
				<input type='submit' name='submit' value='"._SUBMIT."' />
290
			</td>
291
		</tr>
292
		</table>
293
	</form>\n" ;
294
}
295
296
// for 2.2
297
function list_groups2()
298
{
299
    global $target_mid , $target_mname , $xoopsDB ;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
300
301
    $result = $xoopsDB->query( "SELECT i.instanceid,i.title FROM ".$xoopsDB->prefix("block_instance")." i LEFT JOIN ".$xoopsDB->prefix("newblocks")." b ON i.bid=b.bid WHERE b.mid='$target_mid'" ) ;
302
303
    $item_list = array() ;
304
    while( list( $iid , $title ) = $xoopsDB->fetchRow( $result ) ) {
305
        $item_list[ $iid ] = $title ;
306
    }
307
308
    $form = new MyXoopsGroupPermForm( _MD_AM_ADGS , 1 , 'block_read' , '' ) ;
309 View Code Duplication
    if( $target_mid > 1 ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
310
        $form->addAppendix( 'module_admin' , $target_mid , $target_mname . ' ' . _AM_ACTIVERIGHTS ) ;
311
        $form->addAppendix( 'module_read' , $target_mid , $target_mname .' ' . _AM_ACCESSRIGHTS ) ;
312
    }
313
    foreach( $item_list as $item_id => $item_name) {
314
            $form->addItem( $item_id , $item_name ) ;
315
    }
316
    echo $form->render() ;
317
}
318
319 View Code Duplication
if( ! empty( $_POST['submit'] ) ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
320
    if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
321
        redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
322
    }
323
324
    include( "mygroupperm.php" ) ;
325
    redirect_header( XOOPS_URL."/modules/".$xoopsModule->dirname()."/admin/myblocksadmin.php$query4redirect" , 1 , _MD_AM_DBUPDATED );
326
}
327
328
xoops_cp_header() ;
329
//if( file_exists( './mymenu.php' ) ) include( './mymenu.php' ) ;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
330
include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/admin/functions.php";
331
//lx_adminMenu(3, _AM_LEXIKON_BLOCKS);
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
332
333
//echo "<h3 style='text-align:left;'>$target_mname</h3>\n" ;
334
335
if( ! empty( $block_arr ) ) {
336
    echo "<h4 style='text-align:left;'>"._AM_BADMIN."</h4>\n" ;
337
    list_blockinstances() ;
338
}
339
340
list_groups2() ;
341
xoops_cp_footer() ;
342