XPressME Integration Kit

Trac

Changeset 598


Ignore:
Timestamp:
May 1, 2010, 12:27:08 PM (14 years ago)
Author:
toemon
Message:

ブロックチェックのブロックリストにブロックオプション編集へのリンクを追加、異常ブロックのみの除去submitボタン追加 Fixes#252

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/extras/xpress_i18n/portuguese-br/xpressme_modules_root/language/pt-br_utf8/admin.php

    r517 r598  
    3939        define("_AM_XP2_USER_META_ERR","Há %d meta-chaves com o prefixo %s."); 
    4040        define("_AM_XP2_USER_META_OK","Meta-dados do usuário funcionando corretamente.");        
     41        define("_AM_XP2_NG_BLOCK_REMOVE","Excluir bloco anormal mesa"); 
     42        define("_AM_XP2_BLOCK_OR","OU"); 
    4143} 
    4244?> 
  • trunk/extras/xpress_i18n/template/xpressme_modules_root/language/english/admin.php

    r517 r598  
    3939        define("_AM_XP2_USER_META_ERR","There is a meta key named %s that the prefix is different in %d piece."); 
    4040        define("_AM_XP2_USER_META_OK","The user meta key is normal.");           
     41        define("_AM_XP2_NG_BLOCK_REMOVE","Remove xoops abnormal block table"); 
     42        define("_AM_XP2_BLOCK_OR","OR"); 
    4143} 
    4244?> 
  • trunk/xpressme_integration_kit/admin/block_check.php

    r232 r598  
    7474switch ( $xoops_block_check->get_op() )  
    7575{ 
     76case "remove_all_block": 
     77        echo $xoops_block_check->remove_all_block(); 
     78        break; 
    7679case "remove_block": 
    7780        echo $xoops_block_check->remove_block(); 
    7881        break; 
    79  
    8082default: 
    8183        if ($xoops_block_check->check_blocks($mydirname)){ 
     
    9092                        echo _AM_XP2_BLOCK_REPAIR_HOWTO."<br />\n";  
    9193                        echo '<form method="POST">'."\n"; 
    92                         echo _AM_XP2_BLOCK_REPAIR_STEP1 .' : '."\n";  
    93                         echo '<input type="submit" name="mid:'.$xoops_block_check->module_id.'" value="' . _AM_XP2_BLOCK_REMOVE . ': '.$xoops_block_check->module_name.'" />'."<br />\n"; 
     94                        echo _AM_XP2_BLOCK_REPAIR_STEP1 .' : <br />'."\n";  
    9495                        echo '&emsp;&emsp;&emsp;&emsp;&nbsp;'; 
    95                         echo _AM_XP2_BLOCK_REMOVE_NOTE; 
     96                        echo '<input type="submit" name="mid:'.$xoops_block_check->module_id.'" value="' . _AM_XP2_NG_BLOCK_REMOVE . ': '.$xoops_block_check->module_name.'" />'."<br />\n"; 
     97                        echo '&emsp;&emsp;&emsp;&nbsp;' . _AM_XP2_BLOCK_OR . '<br />'."\n"; 
     98                        echo '&emsp;&emsp;&emsp;&emsp;&nbsp;'; 
     99                        echo '<input type="submit" name="amid:'.$xoops_block_check->module_id.'" value="' . _AM_XP2_BLOCK_REMOVE . ': '.$xoops_block_check->module_name.'" />'."<br />\n"; 
     100                        echo '<br />'."\n"; 
     101                        echo '&emsp;&emsp;&emsp;&nbsp;' . _AM_XP2_BLOCK_REMOVE_NOTE; 
    96102                        echo "</form>\n"; 
    97103                        echo "<br />\n"; 
  • trunk/xpressme_integration_kit/class/check_blocks_class.php

    r505 r598  
    6868        foreach ( $_POST as $k => $v ) 
    6969        { 
     70                if ( preg_match( "/^amid:/", $k ) ) 
     71                { 
     72                        $op  = 'remove_all_block'; 
     73                        $mid = intval( str_replace("amid:", "", $k) ); 
     74                        break; 
     75                } 
    7076                if ( preg_match( "/^mid:/", $k ) ) 
    7177                { 
     
    106112} 
    107113 
    108 function remove_block() 
     114function remove_all_block() 
    109115{ 
    110116        $text = "<h1>Remove xoops block table</h1>\n"; 
     
    141147        return $text; 
    142148} 
     149function 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} 
    143200 
    144201//-------------------------------------------------------- 
     
    190247{ 
    191248        $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'] ); 
    194254 
    195255        if ( isset($info['file']) && ( $info['file'] != $block_obj->getVar('func_file', 'n') ) ) 
     
    295355        return $url; 
    296356} 
    297  
     357function _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} 
    298370//-------------------------------------------------------- 
    299371// user handler 
  • trunk/xpressme_integration_kit/language/english/admin.php

    r517 r598  
    3939        define("_AM_XP2_USER_META_ERR","There is a meta key named %s that the prefix is different in %d piece."); 
    4040        define("_AM_XP2_USER_META_OK","The user meta key is normal.");           
     41        define("_AM_XP2_NG_BLOCK_REMOVE","Remove xoops abnormal block table"); 
     42        define("_AM_XP2_BLOCK_OR","OR"); 
    4143} 
    4244?> 
  • trunk/xpressme_integration_kit/language/ja_utf8/admin.php

    r517 r598  
    2727        define("_AM_XP2_BLOCK_REPAIR_HOWTO","以下の手順に従ってブロックを修正してください。"); 
    2828        define("_AM_XP2_BLOCK_REPAIR_STEP1","ステップ 1"); 
    29         define("_AM_XP2_BLOCK_REMOVE","ブロックを削除"); 
     29        define("_AM_XP2_BLOCK_REMOVE","ブロックを削除"); 
    3030        define("_AM_XP2_BLOCK_REMOVE_NOTE","注意: モジュールのブロックがデータベースから<b>削除</b>されます。"); 
    3131        define("_AM_XP2_BLOCK_REPAIR_STEP2","ステップ 2"); 
     
    3939        define("_AM_XP2_USER_META_ERR","プレフィックスの異なる %s というメタキーが %d つあります。"); 
    4040        define("_AM_XP2_USER_META_OK","ユーザーメタキーは正常です");  
     41        define("_AM_XP2_NG_BLOCK_REMOVE","NGブロックを削除"); 
     42        define("_AM_XP2_BLOCK_OR","または"); 
    4143} 
    4244?> 
  • trunk/xpressme_integration_kit/language/japanese/admin.php

    r517 r598  
    2727        define("_AM_XP2_BLOCK_REPAIR_HOWTO","°Ê²¼¤Î¼ê½ç¤Ë½¾¤Ã¤Æ¥Ö¥í¥Ã¥¯¤ò½¤Àµ¤·¤Æ¤¯¤À¤µ¤¤¡£"); 
    2828        define("_AM_XP2_BLOCK_REPAIR_STEP1","¥¹¥Æ¥Ã¥× 1"); 
    29         define("_AM_XP2_BLOCK_REMOVE","¥Ö¥í¥Ã¥¯¤òºï½ü"); 
     29        define("_AM_XP2_BLOCK_REMOVE","Á´¥Ö¥í¥Ã¥¯¤òºï½ü"); 
    3030        define("_AM_XP2_BLOCK_REMOVE_NOTE","Ãí°Õ: ¥â¥¸¥å¡¼¥ë¤Î¥Ö¥í¥Ã¥¯¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é<b>ºï½ü</b>¤µ¤ì¤Þ¤¹¡£"); 
    3131        define("_AM_XP2_BLOCK_REPAIR_STEP2","¥¹¥Æ¥Ã¥× 2"); 
     
    3939        define("_AM_XP2_USER_META_ERR","¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Î°Û¤Ê¤ë %s ¤È¤¤¤¦¥á¥¿¥­¡¼¤¬ %d ¤Ä¤¢¤ê¤Þ¤¹¡£"); 
    4040        define("_AM_XP2_USER_META_OK","¥æ¡¼¥¶¡¼¥á¥¿¥­¡¼¤ÏÀµ¾ï¤Ç¤¹");     
     41        define("_AM_XP2_NG_BLOCK_REMOVE","NG¥Ö¥í¥Ã¥¯¤òºï½ü"); 
     42        define("_AM_XP2_BLOCK_OR","¤Þ¤¿¤Ï"); 
    4143} 
    4244?> 
Note: See TracChangeset for help on using the changeset viewer.