<?php /* EL PSY CONGROO */    	 	     
require '../../../zb_system/function/c_system_base.php';     		 	  	
require '../../../zb_system/function/c_system_admin.php';     	 				 
$zbp->Load();    							 
$action = 'root';    						  
if (!$zbp->CheckRights($action)) {     			  		
    $zbp->ShowError(6);    	 	 	 	 
    die();     	  			 
}    	   	 		
if (!$zbp->CheckPlugin('qcloud_cos')) {     	 		   
    $zbp->ShowError(48);     	 			  
    die();      	  	 	
}     	 	    
      			 		
$blogtitle = 'qcloud_cos';    		 	 	  
require $blogpath . 'zb_system/admin/admin_header.php';    	   				
require $blogpath . 'zb_system/admin/admin_top.php';    	    	  
     						 
if (isset($_POST['setting']) && $_POST['setting'] != '') {    		 		 	 
    foreach ($_POST as $key => $value) {    			   		
        $zbp->Config('qcloud_cos')->$key = $value;    	   	  	
    }    	  	 		 
    $zbp->SaveConfig('qcloud_cos');    					 	 
    $zbp->ShowHint('good', "保存成功！");    	 	     
}    			 	 		
     		 		 	
?>
    <div id="divMain">
        <div class="divHeader"><?php echo $blogtitle; ?></div>
        <div class="SubMenu">
        </div>
        <form method="post">
            <div id="divMain2">
                <div class="content-box">
                    <div class="content-box-content">
                        <div class="tab-content default-tab" style="border:none;padding:0px;margin:0;" id="tab1">
                            <table style="padding:0px;margin:0px;width:100%;">
                                <tr>
                                    <td><p><b>appid</b></p></td>
                                    <td><p><input id="appid" name="appid" style="width:600px;" type="text"
                                                  value="<?php echo $zbp->Config('qcloud_cos')->appid; ?>"/></p>
                                    </td>
                                </tr>
                                <tr>
                                    <td><p><b>secret id</b></p></td>
                                    <td><p><input id="secretid" name="secretid" style="width:600px;" type="text"
                                                  value="<?php echo $zbp->Config('qcloud_cos')->secretid; ?>"/></p>
                                    </td>
                                </tr>
                                <tr>
                                    <td><p><b>secret key</b></p></td>
                                    <td><p><input id="secretkey" name="secretkey" style="width:600px;" type="text"
                                                  value="<?php echo $zbp->Config('qcloud_cos')->secretkey; ?>"/></p>
                                        以上3项可以在 <a href="https://console.cloud.tencent.com/cam/capi">https://console.cloud.tencent.com/cam/capi</a>
                                        获取
                                    </td>
                                </tr>
                                <tr>
                                    <td><p><b>bucket</b></p></td>
                                    <td><p><input id="bucket" name="bucket" style="width:600px;" type="text"
                                                  value="<?php echo $zbp->Config('qcloud_cos')->bucket; ?>"/></p>
                                    </td>
                                </tr>
                                <tr>
                                    <td><p><b>储存地域</b></p></td>
                                    <td><p><input id="region" name="region" style="width:600px;" type="text"
                                                  value="<?php echo $zbp->Config('qcloud_cos')->region; ?>"/></p>
                                        根据自己情况通过 <a href="https://cloud.tencent.com/document/product/436/6224">https://cloud.tencent.com/document/product/436/6224</a> 获取
                                    </td>
                                </tr>
                                <tr>
                                    <td><p><b>储存路径</b></p></td>
                                    <td><p><input id="savePath" name="savePath" style="width:600px;" type="text"
                                                  value="<?php echo $zbp->Config('qcloud_cos')->savePath; ?>"/></p>
                                        最后要有斜杠：如 /upload/test/
                                    </td>
                                </tr>
                                <tr>
                                    <td><p><b>访问域名</b></p></td>
                                    <td><p><input id="domain" name="domain" style="width:600px;" type="text"
                                                  value="<?php echo $zbp->Config('qcloud_cos')->domain; ?>"/></p>
                                        需要带上http或https，最后的斜杠需要去掉：如 <a href="https://static.zixu.hk">https://static.zixu.hk</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
                <hr/>
                <input type="hidden" name="setting" value="true">
                <p><input type="submit" class="button" value="提交" id="btnPost" onclick=""/></p>
            </div>
        </form>
    </div>

<?php
require $blogpath . 'zb_system/admin/admin_footer.php';    	 		  		
RunTime();     				   
?>