Ignore:
Timestamp:
2012/02/06 11:05:15 (15 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
Location:
branches/version-2_12-dev/data/class/pages/admin/system
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System.php

    r21420 r21441  
    151151 
    152152        // $pagenoが0以上の整数かチェック 
    153         if(SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) { 
     153        if (SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) { 
    154154            $clean_pageno = $pageno; 
    155155        } 
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php

    r21420 r21441  
    6969    function action() { 
    7070 
    71         if(strpos(HTTPS_URL,"https://") !== FALSE){ 
     71        if (strpos(HTTPS_URL,"https://") !== FALSE) { 
    7272            $this->tpl_enable_ssl = TRUE; 
    7373        } 
     
    7878        $this->initParam($objFormParam, $_POST); 
    7979 
    80         if(count($_POST) > 0 ) { 
     80        if (count($_POST) > 0 ) { 
    8181 
    8282            // エラーチェック 
     
    8686 
    8787            //設定ファイルの権限チェック 
    88             if(!is_writable(CONFIG_REALFILE)){ 
     88            if (!is_writable(CONFIG_REALFILE)) { 
    8989                $arrErr['all'] = CONFIG_REALFILE . ' を変更する権限がありません。'; 
    9090            } 
     
    9393            $this->lfCheckAdminArea($this->arrForm, $arrErr); 
    9494 
    95             if(SC_Utils_Ex::isBlank($arrErr) && $this->lfUpdateAdminData($this->arrForm)) { 
     95            if (SC_Utils_Ex::isBlank($arrErr) && $this->lfUpdateAdminData($this->arrForm)) { 
    9696 
    9797                $this->tpl_onload = "window.alert('管理機能の設定を変更しました。URLを変更した場合は、新しいURLにアクセスしてください。');"; 
    98             }else{ 
     98            } else { 
    9999                $this->tpl_onload = "window.alert('設定内容に誤りがあります。設定内容を確認してください。');"; 
    100100                $this->arrErr = array_merge($arrErr, $this->arrErr); 
     
    105105            $admin_dir = str_replace("/","",ADMIN_DIR); 
    106106            $this->arrForm = array("admin_dir"=>$admin_dir,"admin_force_ssl"=>ADMIN_FORCE_SSL,"admin_allow_hosts"=>""); 
    107             if(defined("ADMIN_ALLOW_HOSTS")){ 
     107            if (defined("ADMIN_ALLOW_HOSTS")) { 
    108108                $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS); 
    109109                $this->arrForm["admin_allow_hosts"] = implode("\n",$allow_hosts); 
     
    150150 
    151151        $installData = file(CONFIG_REALFILE, FILE_IGNORE_NEW_LINES); 
    152         foreach($installData as $key=>$line){ 
    153             if(strpos($line,"ADMIN_DIR") !== false and ADMIN_DIR != $admin_dir){ 
     152        foreach ($installData as $key=>$line) { 
     153            if (strpos($line,"ADMIN_DIR") !== false and ADMIN_DIR != $admin_dir) { 
    154154                //既存ディレクトリのチェック 
    155                 if(file_exists(HTML_REALDIR.$admin_dir) and $admin_dir != "admin/"){ 
     155                if (file_exists(HTML_REALDIR.$admin_dir) and $admin_dir != "admin/") { 
    156156                    $arrErr["admin_dir"] .= ROOT_URLPATH.$admin_dir."は既に存在しています。別のディレクトリ名を指定してください。"; 
    157157                } 
    158158                //権限チェック 
    159                 if(!is_writable(HTML_REALDIR . ADMIN_DIR)){ 
     159                if (!is_writable(HTML_REALDIR . ADMIN_DIR)) { 
    160160                    $arrErr["admin_dir"] .= ROOT_URLPATH.ADMIN_DIR."のディレクトリ名を変更する権限がありません。"; 
    161161                } 
     
    168168        $admin_dir = trim($arrForm['admin_dir'])."/"; 
    169169        $admin_force_ssl = 'FALSE'; 
    170         if($arrForm['admin_force_ssl'] == 1){ 
     170        if ($arrForm['admin_force_ssl'] == 1) { 
    171171            $admin_force_ssl = 'TRUE'; 
    172172        } 
    173173        $admin_allow_hosts = explode("\n",$arrForm['admin_allow_hosts']); 
    174         foreach($admin_allow_hosts as $key=>$host){ 
     174        foreach ($admin_allow_hosts as $key=>$host) { 
    175175            $host = trim($host); 
    176             if(strlen($host) >= 8){ 
     176            if (strlen($host) >= 8) { 
    177177                $admin_allow_hosts[$key] = $host; 
    178             }else{ 
     178            } else { 
    179179                unset($admin_allow_hosts[$key]); 
    180180            } 
     
    185185        $installData = file(CONFIG_REALFILE, FILE_IGNORE_NEW_LINES); 
    186186        $diff = 0; 
    187         foreach($installData as $key=>$line){ 
    188             if(strpos($line,"ADMIN_DIR") !== false and ADMIN_DIR != $admin_dir){ 
     187        foreach ($installData as $key=>$line) { 
     188            if (strpos($line,"ADMIN_DIR") !== false and ADMIN_DIR != $admin_dir) { 
    189189                $installData[$key] = 'define("ADMIN_DIR","'.$admin_dir.'");'; 
    190190                //管理機能ディレクトリのリネーム 
     
    196196            } 
    197197 
    198             if(strpos($line,"ADMIN_FORCE_SSL") !== false){ 
     198            if (strpos($line,"ADMIN_FORCE_SSL") !== false) { 
    199199                $installData[$key] = 'define("ADMIN_FORCE_SSL",'.$admin_force_ssl.');'; 
    200200                $diff ++; 
    201201            } 
    202             if(strpos($line,"ADMIN_ALLOW_HOSTS") !== false and ADMIN_ALLOW_HOSTS != $admin_allow_hosts) { 
     202            if (strpos($line,"ADMIN_ALLOW_HOSTS") !== false and ADMIN_ALLOW_HOSTS != $admin_allow_hosts) { 
    203203                $installData[$key] = "define('ADMIN_ALLOW_HOSTS','".$admin_allow_hosts."');"; 
    204204                $diff ++; 
     
    206206        } 
    207207 
    208         if($diff > 0) { 
     208        if ($diff > 0) { 
    209209            $fp = fopen(CONFIG_REALFILE,'wb'); 
    210210            $installData = implode("\n",$installData); 
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Bkup.php

    r21427 r21441  
    8080        $arrForm = array(); 
    8181 
    82         switch($this->getMode()) { 
     82        switch ($this->getMode()) { 
    8383 
    8484        // バックアップを作成する 
     
    8989 
    9090            // データ型に問題がない場合 
    91             if(SC_Utils_Ex::isBlank($arrErrTmp[1])) { 
     91            if (SC_Utils_Ex::isBlank($arrErrTmp[1])) { 
    9292                // データ型以外のエラーチェック 
    9393                $arrErrTmp[2] = $this->lfCheckError($objFormParam->getHashArray(), $this->getMode()); 
     
    115115                if (SC_Utils_Ex::isBlank($arrErrTmp[3])) { 
    116116                    $this->lfUpdBkupData($arrData); 
    117                 }else{ 
     117                } else { 
    118118                    $arrForm = $arrData; 
    119119                    $arrErr = $arrErrTmp[3]; 
     
    234234        $arrVal = array(); 
    235235 
    236         switch($mode) { 
     236        switch ($mode) { 
    237237        case 'bkup': 
    238238            $arrVal[] = $arrForm['bkup_name']; 
     
    325325        // 自動採番をCSV出力 
    326326        $fp = fopen($csv_autoinc_file,'w'); 
    327         if($fp) { 
    328             if($csv_autoinc != ""){ 
     327        if ($fp) { 
     328            if ($csv_autoinc != "") { 
    329329                $success = fwrite($fp, $csv_autoinc); 
    330330                if (!$success) { 
     
    377377        $arrSequences = $objQuery->listSequences(); 
    378378 
    379         foreach($arrSequences as $val){ 
     379        foreach ($arrSequences as $val) { 
    380380            $seq = $objQuery->currVal($val); 
    381381 
     
    456456                $this->restore_msg = "リストア終了しました。"; 
    457457                $this->restore_err = true; 
    458             }else{ 
     458            } else { 
    459459                $objQuery->rollback(); 
    460460                $this->restore_msg = "リストアに失敗しました。"; 
     
    504504            // csvファイルからデータの取得 
    505505            $fp = fopen($file_path, 'r'); 
    506             if($fp === false) { 
     506            if ($fp === false) { 
    507507                SC_Utils_Ex::sfDispException($file_name . ' のファイルオープンに失敗しました。'); 
    508508            } 
     
    536536        $arrCsvData = file($csv); 
    537537 
    538         foreach($arrCsvData as $val){ 
     538        foreach ($arrCsvData as $val) { 
    539539            $arrData = explode(",", trim($val)); 
    540540 
     
    549549        $arrTableList = $objQuery->listTables(); 
    550550 
    551         foreach($arrTableList as $val){ 
     551        foreach ($arrTableList as $val) { 
    552552            // バックアップテーブルは削除しない 
    553553            // XXX mtb_zip も削除不要では? 
     
    567567        $del_file = $bkup_dir.$arrForm['list_name'] . $bkup_ext; 
    568568        // ファイルの削除 
    569         if(is_file($del_file)){ 
     569        if (is_file($del_file)) { 
    570570            $ret = unlink($del_file); 
    571571        } 
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php

    r21376 r21441  
    7373        $this->initForm($objFormParam, $_POST); 
    7474 
    75         switch($this->getMode()) { 
     75        switch ($this->getMode()) { 
    7676        case 'confirm' : 
    7777            $message = $this->lfDoChange($objFormParam); 
     
    119119        $arrTarget = $this->lfGetTargetData($objFormParam); 
    120120        $message = ""; 
    121         if(is_array($arrTarget) && count($arrTarget) == 0) { 
     121        if (is_array($arrTarget) && count($arrTarget) == 0) { 
    122122            $message = "window.alert('変更対象となるデータはありませんでした。');"; 
    123123            return $message; 
    124         } elseif(!is_array($arrTarget) && $arrTarget != "") { 
     124        } elseif (!is_array($arrTarget) && $arrTarget != "") { 
    125125            return $arrTarget; // window.alert が返ってきているはず。 
    126126        } 
    127127 
    128128        // 変更対象の設定変更 
    129         foreach($arrTarget as $item) { 
     129        foreach ($arrTarget as $item) { 
    130130            $index_name = $item['table_name'] . '_' . $item['column_name'] . "_key"; 
    131131            $arrField = array( 'fields' => array($item['column_name'] => array())); 
    132             if($item['indexflag_new'] == '1') { 
     132            if ($item['indexflag_new'] == '1') { 
    133133                $objQuery->createIndex($item['table_name'], $index_name, $arrField); 
    134             }else{ 
     134            } else { 
    135135                $objQuery->dropIndex($item['table_name'], $index_name); 
    136136            } 
     
    150150 
    151151        // 変更されている対象を走査 
    152         for($i = 1; $i <= count($arrIndexFlag); $i++) { 
     152        for ($i = 1; $i <= count($arrIndexFlag); $i++) { 
    153153            //入力値チェック 
    154154            $param = array('indexflag' => $arrIndexFlag[$i], 
     
    163163            $objErr->doFunc(array("カラム名(" . $i . ")", 'column_name', STEXT_LEN), array("GRAPH_CHECK", "EXIST_CHECK", "MAX_LENGTH_CHECK")); 
    164164            $arrErr = $objErr->arrErr; 
    165             if(count($arrErr) != 0) { 
     165            if (count($arrErr) != 0) { 
    166166                // 通常の送信ではエラーにならないはずです。 
    167167                $message = "window.alert('不正なデータがあったため処理を中断しました。');"; 
    168168                return $message; 
    169169            } 
    170             if($param['indexflag'] != $param['indexflag_new']) { 
     170            if ($param['indexflag'] != $param['indexflag_new']) { 
    171171                // 入力値がデータにある対象テーブルかのチェック 
    172172                if ($objQuery->exists('dtb_index_list', 'table_name = ? and column_name = ?', array($param['table_name'], $param['column_name']))) { 
     
    191191 
    192192        $table = ""; 
    193         foreach($arrIndexList as $key => $arrIndex) { 
     193        foreach ($arrIndexList as $key => $arrIndex) { 
    194194            // テーブルに対するインデックス一覧を取得 
    195             if($table !== $arrIndex["table_name"]) { 
     195            if ($table !== $arrIndex["table_name"]) { 
    196196                $table = $arrIndex["table_name"]; 
    197197                $arrIndexes = $objQuery->listTableIndexes($table); 
     
    199199            // インデックスが設定されているかを取得 
    200200            $idx_name = $table . "_" . $arrIndex["column_name"] . "_key"; 
    201             if(array_search($idx_name, $arrIndexes) === false) { 
     201            if (array_search($idx_name, $arrIndexes) === false) { 
    202202                $arrIndexList[$key]['indexflag'] = ''; 
    203203            } else { 
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Input.php

    r21420 r21441  
    7878        $arrForm = array(); 
    7979 
    80         switch($this->getMode()) { 
     80        switch ($this->getMode()) { 
    8181        case 'new': 
    8282            // パラメーターの初期化 
     
    8787            $this->arrForm = $objFormParam->getHashArray(); 
    8888 
    89             if(SC_Utils_Ex::isBlank($arrErr)) { 
     89            if (SC_Utils_Ex::isBlank($arrErr)) { 
    9090 
    9191                $this->insertMemberData($this->arrForm); 
     
    115115            $this->arrForm = $objFormParam->getHashArray(); 
    116116 
    117             if(SC_Utils_Ex::isBlank($arrErr)) { 
     117            if (SC_Utils_Ex::isBlank($arrErr)) { 
    118118 
    119119                $this->updateMemberData($this->arrForm['member_id'], $this->arrForm); 
     
    150150            } 
    151151 
    152             switch($clean_mode_flg) { 
     152            switch ($clean_mode_flg) { 
    153153            case 'edit': 
    154154                $this->tpl_mode      = $clean_mode_flg; 
     
    221221        // ログインID・パスワードの文字数チェック 
    222222        $objErr = new SC_CheckError_Ex(); 
    223         if($mode == 'new') { 
     223        if ($mode == 'new') { 
    224224            $objErr->doFunc(array("パスワード", 'password', ID_MIN_LEN, ID_MAX_LEN), array("NUM_RANGE_CHECK")); 
    225225            $objErr->doFunc(array("ログインID", 'login_id', ID_MIN_LEN, ID_MAX_LEN), array("NUM_RANGE_CHECK")); 
    226         } elseif($mode == 'edit') { 
     226        } elseif ($mode == 'edit') { 
    227227            $objErr->doFunc(array("パスワード", 'password', ID_MIN_LEN, ID_MAX_LEN), array("SPTAB_CHECK" ,"NUM_RANGE_CHECK")); 
    228228            $objErr->doFunc(array("ログインID", 'login_id', ID_MIN_LEN, ID_MAX_LEN), array("SPTAB_CHECK" ,"NUM_RANGE_CHECK")); 
     
    231231        $arrErr = $objErr->arrErr; 
    232232 
    233         switch($mode) { 
     233        switch ($mode) { 
    234234        case 'new':  
    235235            // 管理者名が登録済みでないか 
     
    299299 
    300300        // $pagenoが0以上の整数かチェック 
    301         if(SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) { 
     301        if (SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) { 
    302302            $clean_pageno = $pageno; 
    303303        } 
     
    358358        $sqlVal['work']   = $arrMemberData['work']; 
    359359        $sqlVal['update_date'] = 'CURRENT_TIMESTAMP'; 
    360         if($arrMemberData['password'] != DEFAULT_PASSWORD) { 
     360        if ($arrMemberData['password'] != DEFAULT_PASSWORD) { 
    361361            $salt = SC_Utils_Ex::sfGetRandomString(10); 
    362362            $sqlVal['salt']     = $salt; 
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php

    r21185 r21441  
    7676        $mode = $this->getMode(); 
    7777 
    78         switch($mode) { 
     78        switch ($mode) { 
    7979        case 'install': 
    8080        case 'uninstall': 
     
    8484            $this->arrErr = $objFormParam->checkError(); 
    8585 
    86             if(count($this->arrErr) == 0) { 
     86            if (count($this->arrErr) == 0) { 
    8787                $plugin_id = $objFormParam->getValue('plugin_id'); 
    8888                $plugin_code = $objFormParam->getValue('plugin_code'); 
     
    104104            $this->arrErr = $this->lfCheckErrorUploadFile($plugin_code, $plugin_dir); 
    105105 
    106             if(count($this->arrErr) == 0) { 
     106            if (count($this->arrErr) == 0) { 
    107107                // 一時ディレクトリへアップロード 
    108108                $this->arrErr['plugin_file'] = $objUpFile->makeTempFile('plugin_file', false); 
    109109 
    110                 if($this->arrErr['plugin_file'] == "") { 
     110                if ($this->arrErr['plugin_file'] == "") { 
    111111                    // プラグイン保存ディレクトリへ解凍 
    112112                    $this->arrErr = $this->lfUploadPlugin($objUpFile, $plugin_dir, $plugin_code, $_FILES['plugin_file']['name']); 
    113113 
    114114                    // 完了メッセージアラート設定 
    115                     if(count($this->arrErr) == 0) { 
     115                    if (count($this->arrErr) == 0) { 
    116116                        $this->tpl_onload = "alert('プラグインをアップロードしました。');"; 
    117117                    } 
     
    121121        case 'up': 
    122122            $this->arrErr = $objFormParam->checkError(); 
    123             if(count($this->arrErr) == 0) { 
     123            if (count($this->arrErr) == 0) { 
    124124                $plugin_id = $objFormParam->getValue('plugin_id'); 
    125125                SC_Helper_DB_Ex::sfRankUp("dtb_plugin", "plugin_id", $plugin_id); 
     
    129129        case 'down': 
    130130            $this->arrErr = $objFormParam->checkError(); 
    131             if(count($this->arrErr) == 0) { 
     131            if (count($this->arrErr) == 0) { 
    132132                $plugin_id = $objFormParam->getValue('plugin_id'); 
    133133                SC_Helper_DB_Ex::sfRankDown("dtb_plugin", "plugin_id", $plugin_id); 
     
    189189        // プラグイン重複チェック 
    190190        $plugins = SC_Helper_Plugin_Ex::getAllPlugin(); 
    191         foreach($plugins as $val) { 
    192             if($val['plugin_code'] == $plugin_code) { 
     191        foreach ($plugins as $val) { 
     192            if ($val['plugin_code'] == $plugin_code) { 
    193193                $arrErr['plugin_file'] = "※ 同名のプラグインがすでに登録されています。<br/>"; 
    194194            } 
     
    249249        $arrErr = $objUpFile->checkEXISTS('plugin_file'); 
    250250 
    251         if(count($arrErr) == 0) { 
     251        if (count($arrErr) == 0) { 
    252252            // プラグイン保存ディレクトリ作成 
    253             if(file_exists($plugin_dir)) { 
     253            if (file_exists($plugin_dir)) { 
    254254                $arrErr['plugin_file'] = "※ 同名のディレクトリがすでに存在します。<br/>"; 
    255255            } else { 
     
    257257            } 
    258258 
    259             if(count($arrErr) == 0) { 
     259            if (count($arrErr) == 0) { 
    260260                // 一時ディレクトリからプラグイン保存ディレクトリへ移動 
    261261                $objUpFile->moveTempFile(); 
     
    303303        $plugin_file_path = $this->lfGetPluginFilePath($plugin_code); 
    304304 
    305         if(file_exists($plugin_file_path)) { 
     305        if (file_exists($plugin_file_path)) { 
    306306            require_once $plugin_file_path; 
    307307        } else { 
     
    327327        $arrErr = $this->lfRequirePluginFile($plugin_code); 
    328328 
    329         if(count($arrErr) == 0) { 
     329        if (count($arrErr) == 0) { 
    330330            $plugin = new $plugin_code(); 
    331331            $arrErr = $plugin->$exec_mode($plugin_id); 
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Rank.php

    r21420 r21441  
    6565 
    6666        // $_GET['move'] が想定値かどうかチェック 
    67         switch($_GET['move']) { 
     67        switch ($_GET['move']) { 
    6868            case 'up': 
    6969            case 'down': 
     
    7979            $arrClean['id'] = $_GET['id']; 
    8080 
    81             switch($arrClean['move']) { 
     81            switch ($arrClean['move']) { 
    8282                case 'up': 
    8383                    $this->lfRunkUp($arrClean['id']); 
     
    121121        $maxno = $objQuery->getOne("SELECT max(rank) FROM dtb_member"); 
    122122        // ランクが最大値よりも小さい場合に実行する。 
    123         if($rank < $maxno) { 
     123        if ($rank < $maxno) { 
    124124            // ランクがひとつ上のIDを取得する。 
    125125            $sqlse = "SELECT member_id FROM dtb_member WHERE rank = ?"; 
     
    150150        $minno = $objQuery->getOne("SELECT min(rank) FROM dtb_member"); 
    151151        // ランクが最大値よりも大きい場合に実行する。 
    152         if($rank > $minno) { 
     152        if ($rank > $minno) { 
    153153            // ランクがひとつ下のIDを取得する。 
    154154            $sqlse = "SELECT member_id FROM dtb_member WHERE rank = ?"; 
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_System.php

    r20970 r21441  
    7171 
    7272        $this->initForm($objFormParam, $_GET); 
    73         switch($this->getMode()) { 
     73        switch ($this->getMode()) { 
    7474 
    7575        // PHP INFOを表示 
Note: See TracChangeset for help on using the changeset viewer.