- Timestamp:
- May 1, 2010, 12:27:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/class/check_blocks_class.php
r505 r598 68 68 foreach ( $_POST as $k => $v ) 69 69 { 70 if ( preg_match( "/^amid:/", $k ) ) 71 { 72 $op = 'remove_all_block'; 73 $mid = intval( str_replace("amid:", "", $k) ); 74 break; 75 } 70 76 if ( preg_match( "/^mid:/", $k ) ) 71 77 { … … 106 112 } 107 113 108 function remove_ block()114 function remove_all_block() 109 115 { 110 116 $text = "<h1>Remove xoops block table</h1>\n"; … … 141 147 return $text; 142 148 } 149 function remove_block() 150 { 151 $text = "<h1>Remove xoops block table</h1>\n"; 152 153 $error = false; 154 $block_objs =& $this->_get_block_object_orber_num_bymodule_id( $this->module_id); 155 $module_obj =& $this->_get_module_object_bymodule_id( $this->module_id ); 156 $infos =& $module_obj->getInfo('blocks'); 157 158 foreach ( $infos as $num => $info ) 159 { 160 $block_err = false; 161 if ( !isset( $block_objs[ $num ] ) ){ 162 $block_err = true; 163 } else { 164 $block_obj = $block_objs[ $num ]; 165 if ( isset($info['file']) && ( $info['file'] != $block_obj->getVar('func_file', 'n') ) ) $block_err = true; 166 if ( isset($info['show_func']) && ( $info['show_func'] != $block_obj->getVar('show_func', 'n') ) ) $block_err = true; 167 if ( isset($info['edit_func']) && ( $info['edit_func'] != $block_obj->getVar('edit_func', 'n') ) ) $block_err = true; 168 if ( isset($info['template']) && ( $info['template'] != $block_obj->getVar('template', 'n') ) ) $block_err = true; 169 if ( isset($info['options']) ){ 170 $option_arr_1 = explode( '|', $info['options'] ); 171 $option_arr_2 = explode( '|', $block_obj->getVar('options', 'n') ); 172 173 $excludes_block = array(); 174 175 if (in_array($info['file'],$excludes_block)){ 176 if ( count($option_arr_1) > count($option_arr_2) ) $block_err = true; 177 } else { 178 if ( count($option_arr_1) != count($option_arr_2) ) $block_err = true; 179 } 180 } 181 } 182 if ($block_err){ 183 $ret = $this->_delete_block( $block_obj ); 184 if ( !$ret ) $error = true; 185 } 186 } 187 188 if ( !$error ) { 189 $text .= '<h4 style="color:#0000ff">Success</h4>'."\n"; 190 } else { 191 $text .= '<h4 style="color:#ff0000">Failed</h4>'."\n"; 192 } 193 194 $url = $this->_build_url_module_update( $module_obj->getVar('dirname', 'n') ); 195 $text .= '<a href="'.$url.'">GO to Module Update: '.$module_obj->getVar('name', 's')."</a><br /><br />\n"; 196 // $text .= '<a href="check_blocks.php">Check xoops block table</a><br />'."\n"; 197 198 return $text; 199 } 143 200 144 201 //-------------------------------------------------------- … … 190 247 { 191 248 $this->_error_flag = false; 192 193 $name = htmlspecialchars( $info['name'] ); 249 250 $bid = $block_obj->getVar('bid', 'n'); 251 $edit_url = $this->_build_url_block_edit( $bid ); 252 $name = '<a href="' . $edit_url . '">'. htmlspecialchars( $info['name'] ). '</a>'; 253 // $name = htmlspecialchars( $info['name'] ); 194 254 195 255 if ( isset($info['file']) && ( $info['file'] != $block_obj->getVar('func_file', 'n') ) ) … … 295 355 return $url; 296 356 } 297 357 function _build_url_block_edit( $bid ) 358 { 359 $dir_name = $this->module_dirname; 360 if (file_exists(XOOPS_ROOT_PATH . '/modules/altsys/admin/index.php')){ 361 // $url = XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname=xp_trunk&op=edit&bid='.$bid; 362 $url = XOOPS_URL.'/modules/'.$dir_name.'/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$dir_name.'xp_trunk&op=edit&bid='.$bid; 363 } else if ( $this->_xoops_version == '2.1' ) { 364 $url = XOOPS_URL.'/modules/legacy/admin/index.php?action=BlockEdit&bid='.$bid; 365 } else { 366 $url = XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=mod&bid='.$bid; 367 } 368 return $url; 369 } 298 370 //-------------------------------------------------------- 299 371 // user handler
Note: See TracChangeset
for help on using the changeset viewer.